1、系统级别错误日志

2、机构加盟工单-环境配置 参数验证调整
This commit is contained in:
1378012178@qq.com 2026-03-10 13:29:29 +08:00
parent 0fa90b83c5
commit 71abc697ac
6 changed files with 779 additions and 3 deletions

View File

@ -0,0 +1,72 @@
import { defHttp } from '/@/utils/http/axios';
import { useMessage } from "/@/hooks/web/useMessage";
const { createConfirm } = useMessage();
enum Api {
list = '/errorrecordlog/errorRecordLog/list',
save='/errorrecordlog/errorRecordLog/add',
edit='/errorrecordlog/errorRecordLog/edit',
deleteOne = '/errorrecordlog/errorRecordLog/delete',
deleteBatch = '/errorrecordlog/errorRecordLog/deleteBatch',
importExcel = '/errorrecordlog/errorRecordLog/importExcel',
exportXls = '/errorrecordlog/errorRecordLog/exportXls',
}
/**
* api
* @param params
*/
export const getExportUrl = Api.exportXls;
/**
* api
*/
export const getImportUrl = Api.importExcel;
/**
*
* @param params
*/
export const list = (params) => defHttp.get({ url: Api.list, params });
/**
*
* @param params
* @param handleSuccess
*/
export const deleteOne = (params,handleSuccess) => {
return defHttp.delete({url: Api.deleteOne, params}, {joinParamsToUrl: true}).then(() => {
handleSuccess();
});
}
/**
*
* @param params
* @param handleSuccess
*/
export const batchDelete = (params, handleSuccess) => {
createConfirm({
iconType: 'warning',
title: '确认删除',
content: '是否删除选中数据',
okText: '确认',
cancelText: '取消',
onOk: () => {
return defHttp.delete({url: Api.deleteBatch, data: params}, {joinParamsToUrl: true}).then(() => {
handleSuccess();
});
}
});
}
/**
*
* @param params
* @param isUpdate
*/
export const saveOrUpdate = (params, isUpdate) => {
let url = isUpdate ? Api.edit : Api.save;
return defHttp.post({ url: url, params }, { isTransformResponse: false });
}

View File

@ -0,0 +1,83 @@
import { BasicColumn } from '/@/components/Table';
import { FormSchema } from '/@/components/Table';
import { rules } from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
import { getWeekMonthQuarterYear } from '/@/utils';
//列表数据
export const columns: BasicColumn[] = [
{
title: '错误发生平台',
align: 'center',
dataIndex: 'orgName',
ellipsis: false,
},
{
title: '错误发生平台编码',
align: 'center',
dataIndex: 'orgCode',
ellipsis: false,
},
{
title: '功能模块',
align: 'center',
dataIndex: 'functionModule',
ellipsis: false,
},
{
title: '具体环节',
align: 'center',
dataIndex: 'functionAction',
ellipsis: false,
},
{
title: '错误简介',
align: 'center',
dataIndex: 'errorBrief',
ellipsis: false,
},
{
title: '错误类型',
align: 'center',
dataIndex: 'errorType',
ellipsis: false,
width:120
},
{
title: '错误级别',
align: 'center',
dataIndex: 'errorLevel',
width:120
},
{
title: '处理状态',
align: 'center',
dataIndex: 'handleStatus',
width:120
},
{
title: '处理人',
align: 'center',
dataIndex: 'handler',
ellipsis: false,
width:120
},
{
title: '处理时间',
align: 'center',
dataIndex: 'handleTime',
},
];
// 高级查询数据
export const superQuerySchema = {
functionModule: { title: '功能模块', order: 0, view: 'text', type: 'string' },
functionAction: { title: '具体环节', order: 1, view: 'text', type: 'string' },
errorBrief: { title: '错误简介', order: 2, view: 'text', type: 'string' },
errorType: { title: '错误类型', order: 6, view: 'text', type: 'string' },
errorLevel: { title: '错误级别', order: 8, view: 'number', type: 'number' },
handleStatus: { title: '处理状态', order: 11, view: 'number', type: 'number' },
handler: { title: '处理人', order: 13, view: 'text', type: 'string' },
handleTime: { title: '处理时间', order: 14, view: 'datetime', type: 'string' },
orgName: { title: '机构名称', order: 20, view: 'text', type: 'string' },
orgCode: { title: '机构编码', order: 21, view: 'text', type: 'string' },
};

View File

@ -0,0 +1,225 @@
<template>
<div class="p-2">
<!--查询区域-->
<div class="jeecg-basic-table-form-container">
<a-form ref="formRef" @keyup.enter.native="searchQuery" :model="queryParam" :label-col="labelCol"
:wrapper-col="wrapperCol">
<a-row :gutter="24">
<a-col :lg="6">
<a-form-item name="orgName">
<template #label><span title="机构名称">机构名称</span></template>
<a-input placeholder="请输入机构名称" v-model:value="queryParam.orgName" allow-clear></a-input>
</a-form-item>
</a-col>
<a-col :lg="6">
<a-form-item name="orgCode">
<template #label><span title="机构编码">机构编码</span></template>
<a-input placeholder="请输入机构编码" v-model:value="queryParam.orgCode" allow-clear></a-input>
</a-form-item>
</a-col>
<a-col :lg="6">
<a-form-item name="functionModule">
<template #label><span title="功能模块">功能模块</span></template>
<JInput v-model:value="queryParam.functionModule" />
</a-form-item>
</a-col>
<a-col :lg="6">
<a-form-item name="functionAction">
<template #label><span title="出错环节">出错环节</span></template>
<JInput v-model:value="queryParam.functionAction" />
</a-form-item>
</a-col>
<a-col :lg="6">
<a-form-item name="businessId">
<template #label><span title="业务数据ID">业务数据</span></template>
<JInput v-model:value="queryParam.businessId" />
</a-form-item>
</a-col>
<a-col :lg="6">
<a-form-item name="errorLevel">
<template #label><span title="错误级别">错误级别</span></template>
<a-input-number placeholder="请输入错误级别" v-model:value="queryParam.errorLevel"></a-input-number>
</a-form-item>
</a-col>
<a-col :lg="6">
<a-form-item name="handleStatus">
<template #label><span title="处理状态">处理状态</span></template>
<a-input-number placeholder="请输入处理状态" v-model:value="queryParam.handleStatus"></a-input-number>
</a-form-item>
</a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<span style="float: left; overflow: hidden" class="table-page-search-submitButtons">
<a-col :lg="6">
<a-button type="primary" preIcon="ant-design:search-outlined" @click="searchQuery">查询</a-button>
<a-button type="primary" preIcon="ant-design:reload-outlined" @click="searchReset"
style="margin-left: 8px">重置</a-button>
</a-col>
</span>
</a-col>
</a-row>
</a-form>
</div>
<!--引用表格-->
<BasicTable @register="registerTable">
<!--插槽:table标题-->
<template #tableTitle>
</template>
<!--操作栏-->
<template #action="{ record }">
<TableAction :actions="getTableAction(record)" />
</template>
<template v-slot:bodyCell="{ column, record, index, text }">
</template>
</BasicTable>
<!-- 表单区域 -->
<ErrorRecordLogModal ref="registerModal" @success="handleSuccess"></ErrorRecordLogModal>
</div>
</template>
<script lang="ts" name="errorrecordlog-errorRecordLog" setup>
import { ref, reactive } from 'vue';
import { BasicTable, useTable, TableAction } from '/@/components/Table';
import { useListPage } from '/@/hooks/system/useListPage';
import { columns, superQuerySchema } from './ErrorRecordLog.data';
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './ErrorRecordLog.api';
import { downloadFile } from '/@/utils/common/renderUtils';
import ErrorRecordLogModal from './components/ErrorRecordLogModal.vue'
import { useUserStore } from '/@/store/modules/user';
import JInput from "/@/components/Form/src/jeecg/components/JInput.vue";
const formRef = ref();
const queryParam = reactive<any>({});
const toggleSearchStatus = ref<boolean>(false);
const registerModal = ref();
const userStore = useUserStore();
//table
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
tableProps: {
title: 'nu_error_record_log',
api: list,
columns,
canResize: false,
useSearchForm: false,
actionColumn: {
width: 120,
fixed: 'right',
},
beforeFetch: async (params) => {
return Object.assign(params, queryParam);
},
},
exportConfig: {
name: "nu_error_record_log",
url: getExportUrl,
params: queryParam,
},
importConfig: {
url: getImportUrl,
success: handleSuccess
},
});
const [registerTable, { reload, collapseAll, updateTableDataRecord, findTableDataRecord, getDataSource }, { rowSelection, selectedRowKeys }] = tableContext;
const labelCol = reactive({
xs: 24,
sm: 4,
xl: 6,
xxl: 4
});
const wrapperCol = reactive({
xs: 24,
sm: 20,
});
/**
* 编辑事件
*/
function handleEdit(record: Recordable) {
registerModal.value.disableSubmit = false;
registerModal.value.edit(record);
}
/**
* 详情
*/
function handleDetail(record: Recordable) {
registerModal.value.disableSubmit = true;
registerModal.value.edit(record);
}
/**
* 成功回调
*/
function handleSuccess() {
(selectedRowKeys.value = []) && reload();
}
/**
* 操作栏
*/
function getTableAction(record) {
return [
{
label: '详情',
onClick: handleDetail.bind(null, record),
},
{
label: '编辑',
onClick: handleEdit.bind(null, record),
auth: 'errorrecordlog:nu_error_record_log:edit'
},
];
}
/**
* 查询
*/
function searchQuery() {
reload();
}
/**
* 重置
*/
function searchReset() {
formRef.value.resetFields();
selectedRowKeys.value = [];
//
reload();
}
</script>
<style lang="less" scoped>
.jeecg-basic-table-form-container {
padding: 0;
.table-page-search-submitButtons {
display: block;
margin-bottom: 24px;
white-space: nowrap;
}
.query-group-cust {
min-width: 100px !important;
}
.query-group-split-cust {
width: 30px;
display: inline-block;
text-align: center
}
.ant-form-item:not(.ant-form-item-with-help) {
margin-bottom: 16px;
height: 32px;
}
:deep(.ant-picker),
:deep(.ant-input-number) {
width: 100%;
}
}
</style>

View File

@ -0,0 +1,274 @@
<template>
<a-spin :spinning="confirmLoading">
<JFormContainer :disabled="false">
<template #detail>
<a-form ref="formRef" class="antd-modal-form" :labelCol="labelCol" :wrapperCol="wrapperCol" name="ErrorRecordLogForm">
<a-row>
<a-col :span="12">
<a-form-item label="机构名称" v-bind="validateInfos.orgName" id="ErrorRecordLogForm-orgName" name="orgName">
<a-input v-model:value="formData.orgName" placeholder="请输入机构名称" allow-clear ></a-input>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="机构编码" v-bind="validateInfos.orgCode" id="ErrorRecordLogForm-orgCode" name="orgCode">
<a-input v-model:value="formData.orgCode" placeholder="请输入机构编码" allow-clear ></a-input>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="功能模块" v-bind="validateInfos.functionModule" id="ErrorRecordLogForm-functionModule" name="functionModule">
<a-input v-model:value="formData.functionModule" placeholder="请输入功能模块" allow-clear ></a-input>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="具体环节" v-bind="validateInfos.functionAction" id="ErrorRecordLogForm-functionAction" name="functionAction">
<a-input v-model:value="formData.functionAction" placeholder="请输入具体环节" allow-clear ></a-input>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="错误简介" v-bind="validateInfos.errorBrief" id="ErrorRecordLogForm-errorBrief" name="errorBrief">
<a-input v-model:value="formData.errorBrief" placeholder="请输入错误简介" allow-clear ></a-input>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="错误详细信息" v-bind="validateInfos.errorDetail" id="ErrorRecordLogForm-errorDetail" name="errorDetail">
<a-textarea v-model:value="formData.errorDetail" :rows="4" placeholder="请输入错误详细信息" />
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="业务数据ID" v-bind="validateInfos.businessId" id="ErrorRecordLogForm-businessId" name="businessId">
<a-input v-model:value="formData.businessId" placeholder="请输入业务数据ID" allow-clear ></a-input>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="业务数据快照" v-bind="validateInfos.businessData" id="ErrorRecordLogForm-businessData" name="businessData">
<a-input v-model:value="formData.businessData" placeholder="请输入业务数据快照" allow-clear ></a-input>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="错误类型" v-bind="validateInfos.errorType" id="ErrorRecordLogForm-errorType" name="errorType">
<a-input v-model:value="formData.errorType" placeholder="请输入错误类型" allow-clear ></a-input>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="错误码" v-bind="validateInfos.errorCode" id="ErrorRecordLogForm-errorCode" name="errorCode">
<a-input v-model:value="formData.errorCode" placeholder="请输入错误码" allow-clear ></a-input>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="错误级别" v-bind="validateInfos.errorLevel" id="ErrorRecordLogForm-errorLevel" name="errorLevel">
<a-input-number v-model:value="formData.errorLevel" placeholder="请输入错误级别" style="width: 100%" />
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="已重试次数" v-bind="validateInfos.retryCount" id="ErrorRecordLogForm-retryCount" name="retryCount">
<a-input-number v-model:value="formData.retryCount" placeholder="请输入已重试次数" style="width: 100%" />
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="最大重试次数" v-bind="validateInfos.maxRetryCount" id="ErrorRecordLogForm-maxRetryCount" name="maxRetryCount">
<a-input-number v-model:value="formData.maxRetryCount" placeholder="请输入最大重试次数" style="width: 100%" />
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="处理状态" v-bind="validateInfos.handleStatus" id="ErrorRecordLogForm-handleStatus" name="handleStatus">
<a-input-number v-model:value="formData.handleStatus" placeholder="请输入处理状态" style="width: 100%" />
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="处理结果/备注" v-bind="validateInfos.handleResult" id="ErrorRecordLogForm-handleResult" name="handleResult">
<a-input v-model:value="formData.handleResult" placeholder="请输入处理结果/备注" allow-clear ></a-input>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="处理人" v-bind="validateInfos.handler" id="ErrorRecordLogForm-handler" name="handler">
<a-input v-model:value="formData.handler" placeholder="请输入处理人" allow-clear ></a-input>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="处理时间" v-bind="validateInfos.handleTime" id="ErrorRecordLogForm-handleTime" name="handleTime">
<a-date-picker placeholder="请选择处理时间" v-model:value="formData.handleTime" showTime value-format="YYYY-MM-DD HH:mm:ss" style="width: 100%" allow-clear />
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="请求URL" v-bind="validateInfos.requestUrl" id="ErrorRecordLogForm-requestUrl" name="requestUrl">
<a-input v-model:value="formData.requestUrl" placeholder="请输入请求URL" allow-clear ></a-input>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="请求方法" v-bind="validateInfos.requestMethod" id="ErrorRecordLogForm-requestMethod" name="requestMethod">
<a-input v-model:value="formData.requestMethod" placeholder="请输入请求方法" allow-clear ></a-input>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="请求参数" v-bind="validateInfos.requestParams" id="ErrorRecordLogForm-requestParams" name="requestParams">
<a-textarea v-model:value="formData.requestParams" :rows="4" placeholder="请输入请求参数" />
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="客户端IP" v-bind="validateInfos.ipAddress" id="ErrorRecordLogForm-ipAddress" name="ipAddress">
<a-input v-model:value="formData.ipAddress" placeholder="请输入客户端IP" allow-clear ></a-input>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="用户代理" v-bind="validateInfos.userAgent" id="ErrorRecordLogForm-userAgent" name="userAgent">
<a-input v-model:value="formData.userAgent" placeholder="请输入用户代理" allow-clear ></a-input>
</a-form-item>
</a-col>
</a-row>
</a-form>
</template>
</JFormContainer>
</a-spin>
</template>
<script lang="ts" setup>
import { ref, reactive, defineExpose, nextTick, defineProps, computed, onMounted } from 'vue';
import { defHttp } from '/@/utils/http/axios';
import { useMessage } from '/@/hooks/web/useMessage';
import { getValueType } from '/@/utils';
import { saveOrUpdate } from '../ErrorRecordLog.api';
import { Form } from 'ant-design-vue';
import JFormContainer from '/@/components/Form/src/container/JFormContainer.vue';
const props = defineProps({
formDisabled: { type: Boolean, default: false },
formData: { type: Object, default: () => ({})},
formBpm: { type: Boolean, default: true }
});
const formRef = ref();
const useForm = Form.useForm;
const emit = defineEmits(['register', 'ok']);
const formData = reactive<Record<string, any>>({
id: '',
functionModule: '',
functionAction: '',
errorBrief: '',
errorDetail: '',
businessId: '',
businessData: '',
errorType: '',
errorCode: '',
errorLevel: undefined,
retryCount: undefined,
maxRetryCount: undefined,
handleStatus: undefined,
handleResult: '',
handler: '',
handleTime: '',
requestUrl: '',
requestMethod: '',
requestParams: '',
ipAddress: '',
userAgent: '',
orgName: '',
orgCode: '',
});
const { createMessage } = useMessage();
const labelCol = ref<any>({ xs: { span: 24 }, sm: { span: 5 } });
const wrapperCol = ref<any>({ xs: { span: 24 }, sm: { span: 16 } });
const confirmLoading = ref<boolean>(false);
//
const validatorRules = reactive({
functionModule: [{ required: true, message: '请输入功能模块!'},],
functionAction: [{ required: true, message: '请输入具体环节!'},],
errorBrief: [{ required: true, message: '请输入错误简介!'},],
});
const { resetFields, validate, validateInfos } = useForm(formData, validatorRules, { immediate: false });
//
const disabled = computed(()=>{
if(props.formBpm === true){
if(props.formData.disabled === false){
return false;
}else{
return true;
}
}
return props.formDisabled;
});
/**
* 新增
*/
function add() {
edit({});
}
/**
* 编辑
*/
function edit(record) {
nextTick(() => {
resetFields();
const tmpData = {};
Object.keys(formData).forEach((key) => {
if(record.hasOwnProperty(key)){
tmpData[key] = record[key]
}
})
//
Object.assign(formData, tmpData);
});
}
/**
* 提交数据
*/
async function submitForm() {
try {
//
await validate();
} catch ({ errorFields }) {
if (errorFields) {
const firstField = errorFields[0];
if (firstField) {
formRef.value.scrollToField(firstField.name, { behavior: 'smooth', block: 'center' });
}
}
return Promise.reject(errorFields);
}
confirmLoading.value = true;
const isUpdate = ref<boolean>(false);
//
let model = formData;
if (model.id) {
isUpdate.value = true;
}
//
for (let data in model) {
//
if (model[data] instanceof Array) {
let valueType = getValueType(formRef.value.getProps, data);
//
if (valueType === 'string') {
model[data] = model[data].join(',');
}
}
}
await saveOrUpdate(model, isUpdate.value)
.then((res) => {
if (res.success) {
createMessage.success(res.message);
emit('ok');
} else {
createMessage.warning(res.message);
}
})
.finally(() => {
confirmLoading.value = false;
});
}
defineExpose({
add,
edit,
submitForm,
});
</script>
<style lang="less" scoped>
.antd-modal-form {
padding: 14px;
}
</style>

View File

@ -0,0 +1,82 @@
<template>
<a-drawer :title="title" :width="'1300'" v-model:visible="visible" :closable="true"
:footer-style="{ textAlign: 'right' }" :bodyStyle="{ padding: '14px' }" @close="handleCancel">
<ErrorRecordLogForm ref="registerForm" @ok="submitCallback" :formDisabled="disableSubmit" :formBpm="false">
</ErrorRecordLogForm>
<template #footer>
<a-button type="primary" style="margin-right: 8px" @click="handleCancel">关闭</a-button>
</template>
</a-drawer>
</template>
<script lang="ts" setup>
import { ref, nextTick, defineExpose } from 'vue';
import ErrorRecordLogForm from './ErrorRecordLogForm.vue'
import JModal from '/@/components/Modal/src/JModal/JModal.vue';
const title = ref<string>('');
const width = ref<number>(800);
const visible = ref<boolean>(false);
const disableSubmit = ref<boolean>(false);
const registerForm = ref();
const emit = defineEmits(['register', 'success']);
/**
* 新增
*/
function add() {
title.value = '新增';
visible.value = true;
nextTick(() => {
registerForm.value.add();
});
}
/**
* 编辑
* @param record
*/
function edit(record) {
title.value = disableSubmit.value ? '详情' : '编辑';
visible.value = true;
nextTick(() => {
registerForm.value.edit(record);
});
}
/**
* 确定按钮点击事件
*/
function handleOk() {
registerForm.value.submitForm();
}
/**
* form保存回调事件
*/
function submitCallback() {
handleCancel();
emit('success');
}
/**
* 取消按钮回调事件
*/
function handleCancel() {
visible.value = false;
}
defineExpose({
add,
edit,
disableSubmit,
});
</script>
<style lang="less">
/**隐藏样式-modal确定按钮 */
.jee-hidden {
display: none !important;
}
</style>
<style lang="less" scoped></style>

View File

@ -218,9 +218,49 @@ const validatorRules = reactive({
dbUsername: [{ required: true, message: '请输入数据库用户名!' },],
dbPassword: [{ required: true, message: '请输入数据库密码!' },],
mediaUrl: [{ required: true, message: '请输入媒体资源地址!' },],
frontPath: [{ required: true, message: '请输入前台路径!' },],
contextPath: [{ required: true, message: '请输入后台路径!' },],
url: [{ required: true, message: '请输入域名' },],
frontPath: [
{
required: true,
message: '请输入前台路径!'
},
{
validator: (rule, value) => {
if (value && value.includes('/')) {
return Promise.reject('请勿使用斜杠(/)');
}
return Promise.resolve();
},
trigger: 'blur'
}
],
contextPath: [
{
required: true,
message: '请输入后台路径!'
},
{
validator: (rule, value) => {
if (value && value.includes('/')) {
return Promise.reject('请勿使用斜杠(/)');
}
return Promise.resolve();
},
trigger: 'blur'
}],
url: [
{
required: true,
message: '请输入域名'
},
{
validator: (rule, value) => {
if (value && !value.endsWith('/')) {
return Promise.reject('需以斜杠(/)结尾');
}
return Promise.resolve();
},
trigger: 'blur'
}],
netUrl: [{ required: true, message: '请输入访问地址' },],
accountNo: [{ required: true, message: '请输入账号' },],
passwordText: [{ required: true, message: '请输入密码' },],