From fbb15cde59bdfd5c8cb1037eeace157ecf25f4b1 Mon Sep 17 00:00:00 2001 From: xingyuv Date: Mon, 20 Mar 2023 17:17:39 +0800 Subject: [PATCH] feat: error code init --- src/api/system/errorCode/index.ts | 1 + src/views/system/errorCode/ErrorCodeModel.vue | 58 +++++++++ src/views/system/errorCode/errorCode.data.ts | 114 ++++++++++++++++++ src/views/system/errorCode/index.vue | 96 ++++++++++++++- 4 files changed, 268 insertions(+), 1 deletion(-) create mode 100644 src/views/system/errorCode/ErrorCodeModel.vue create mode 100644 src/views/system/errorCode/errorCode.data.ts diff --git a/src/api/system/errorCode/index.ts b/src/api/system/errorCode/index.ts index 77ea435..582bc91 100644 --- a/src/api/system/errorCode/index.ts +++ b/src/api/system/errorCode/index.ts @@ -42,6 +42,7 @@ export const updateErrorCodeApi = (data: ErrorCodeVO) => { export const deleteErrorCodeApi = (id: number) => { return defHttp.delete({ url: '/system/error-code/delete?id=' + id }) } + // 导出错误码 export const excelErrorCodeApi = (params: ErrorCodePageReqVO) => { return defHttp.download({ url: '/system/error-code/export-excel', params }) diff --git a/src/views/system/errorCode/ErrorCodeModel.vue b/src/views/system/errorCode/ErrorCodeModel.vue new file mode 100644 index 0000000..ab50c50 --- /dev/null +++ b/src/views/system/errorCode/ErrorCodeModel.vue @@ -0,0 +1,58 @@ + + diff --git a/src/views/system/errorCode/errorCode.data.ts b/src/views/system/errorCode/errorCode.data.ts new file mode 100644 index 0000000..41d515e --- /dev/null +++ b/src/views/system/errorCode/errorCode.data.ts @@ -0,0 +1,114 @@ +import { BasicColumn, FormSchema, useRender } from '@/components/Table' +import { DICT_TYPE, getIntDictOptions } from '@/utils/dict' + +export const columns: BasicColumn[] = [ + { + title: '编号', + dataIndex: 'id', + width: 100 + }, + { + title: '类型', + dataIndex: 'type', + width: 80, + customRender: ({ text }) => { + return useRender.renderDict(text, DICT_TYPE.SYSTEM_ERROR_CODE_TYPE) + } + }, + { + title: '应用名', + dataIndex: 'applicationName', + width: 200 + }, + { + title: '错误码编码', + dataIndex: 'code', + width: 120 + }, + { + title: '错误码提示', + dataIndex: 'message', + width: 300 + }, + { + title: '备注', + dataIndex: 'memo', + width: 200 + }, + { + title: '创建时间', + dataIndex: 'createTime', + width: 180, + customRender: ({ text }) => { + return useRender.renderDate(text) + } + } +] + +export const searchFormSchema: FormSchema[] = [ + { + label: '错误码类型', + field: 'type', + component: 'Select', + componentProps: { + options: getIntDictOptions(DICT_TYPE.SYSTEM_ERROR_CODE_TYPE) + }, + colProps: { span: 8 } + }, + { + label: '应用名', + field: 'applicationName', + component: 'Input', + colProps: { span: 8 } + }, + { + label: '错误码编码', + field: 'code', + component: 'Input', + colProps: { span: 8 } + }, + { + label: '错误码提示', + field: 'message', + component: 'Input', + colProps: { span: 8 } + }, + { + label: '创建时间', + field: 'createTime', + component: 'RangePicker', + colProps: { span: 8 } + } +] + +export const formSchema: FormSchema[] = [ + { + label: '编号', + field: 'id', + show: false, + component: 'Input' + }, + { + label: '应用名', + field: 'applicationName', + required: true, + component: 'Input' + }, + { + label: '错误码编码', + field: 'code', + required: true, + component: 'Input' + }, + { + label: '错误码提示', + field: 'message', + required: true, + component: 'Input' + }, + { + label: '备注', + field: 'memo', + component: 'InputTextArea' + } +] diff --git a/src/views/system/errorCode/index.vue b/src/views/system/errorCode/index.vue index 83cefa1..1b34bad 100644 --- a/src/views/system/errorCode/index.vue +++ b/src/views/system/errorCode/index.vue @@ -1,3 +1,97 @@ +