From a438064ea632c673aafe360ee54b1f9cbf337f99 Mon Sep 17 00:00:00 2001 From: xingyuv Date: Wed, 22 Mar 2023 16:59:39 +0800 Subject: [PATCH] feat: icon enum --- .../Table/src/components/TableActionIcon.ts | 0 src/enums/appEnum.ts | 20 ++ .../infra/fileConfig/FileConfigModal.vue | 54 ++++++ .../infra/fileConfig/ficleConfig.data.ts | 178 ++++++++++++++++++ src/views/infra/fileConfig/index.vue | 99 +++++++++- src/views/system/area/index.vue | 3 +- src/views/system/dept/index.vue | 7 +- src/views/system/dict/DictData.vue | 7 +- src/views/system/dict/index.vue | 7 +- src/views/system/errorCode/index.vue | 9 +- src/views/system/mail/account/index.vue | 7 +- src/views/system/mail/template/index.vue | 7 +- src/views/system/menu/index.vue | 7 +- src/views/system/notice/index.vue | 7 +- src/views/system/oauth2/client/index.vue | 7 +- src/views/system/oauth2/token/index.vue | 3 +- src/views/system/operatelog/index.vue | 7 +- src/views/system/post/index.vue | 9 +- src/views/system/role/index.vue | 13 +- src/views/system/sensitiveWord/index.vue | 9 +- src/views/system/sms/smsChannel.vue | 7 +- src/views/system/sms/smsTemplate.vue | 13 +- src/views/system/tenant/index.vue | 9 +- src/views/system/tenantPackage/index.vue | 7 +- src/views/system/user/index.vue | 9 +- 25 files changed, 437 insertions(+), 68 deletions(-) create mode 100644 src/components/Table/src/components/TableActionIcon.ts create mode 100644 src/views/infra/fileConfig/FileConfigModal.vue create mode 100644 src/views/infra/fileConfig/ficleConfig.data.ts diff --git a/src/components/Table/src/components/TableActionIcon.ts b/src/components/Table/src/components/TableActionIcon.ts new file mode 100644 index 00000000..e69de29b diff --git a/src/enums/appEnum.ts b/src/enums/appEnum.ts index 2b837ecd..0a0812a7 100644 --- a/src/enums/appEnum.ts +++ b/src/enums/appEnum.ts @@ -50,3 +50,23 @@ export enum RouterTransitionEnum { FADE_BOTTOM = 'fade-bottom', FADE_SCALE = 'fade-scale' } + +export enum IconEnum { + VIEW = 'ant-design:file-search-outlined', + ADD = 'ant-design:plus-outlined', + IMPORT = 'ant-design:vertical-align-top-outlined', + EXPORT = 'ant-design:vertical-align-bottom-outlined', + TEST = 'ant-design:deployment-unit-outlined', + EDIT = 'clarity:note-edit-line', + AUTH = 'ant-design:safety-certificate-outlined', + DATA = 'clarity:note-edit-line', + DELETE = 'ant-design:delete-outlined', + SEARCH = 'ant-design:search-outlined', + RESET = 'ant-design:sync-outlined', + UPLOAD = 'ant-design:cloud-upload-outlined', + DOWNLOAD = 'ant-design:cloud-download-outlined', + PREVIEW = 'ant-design:eye-outlined', + ADD_FOLD = 'ant-design:folder-add-outlined', + LOG = 'ant-design:exception-outlined', + PASSWORD = 'ant-design:key-outlined' +} diff --git a/src/views/infra/fileConfig/FileConfigModal.vue b/src/views/infra/fileConfig/FileConfigModal.vue new file mode 100644 index 00000000..1fda1f7f --- /dev/null +++ b/src/views/infra/fileConfig/FileConfigModal.vue @@ -0,0 +1,54 @@ + + diff --git a/src/views/infra/fileConfig/ficleConfig.data.ts b/src/views/infra/fileConfig/ficleConfig.data.ts new file mode 100644 index 00000000..cc5d26d5 --- /dev/null +++ b/src/views/infra/fileConfig/ficleConfig.data.ts @@ -0,0 +1,178 @@ +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: 'name', + width: 180 + }, + { + title: '存储器', + dataIndex: 'storage', + width: 100, + customRender: ({ text }) => { + return useRender.renderDict(text, DICT_TYPE.INFRA_FILE_STORAGE) + } + }, + { + title: '主配置', + dataIndex: 'master', + width: 180, + customRender: ({ text }) => { + return useRender.renderDict(text, DICT_TYPE.INFRA_BOOLEAN_STRING) + } + }, + { + title: '备注', + dataIndex: 'remark', + width: 180 + }, + { + title: '创建时间', + dataIndex: 'createTime', + width: 180, + customRender: ({ text }) => { + return useRender.renderDate(text) + } + } +] + +export const searchFormSchema: FormSchema[] = [ + { + label: '配置名', + field: 'name', + component: 'Input', + colProps: { span: 8 } + }, + { + label: '存储器', + field: 'storage', + component: 'Select', + componentProps: { + options: getIntDictOptions(DICT_TYPE.INFRA_FILE_STORAGE) + }, + colProps: { span: 8 } + }, + { + label: '创建时间', + field: 'createTime', + component: 'RangePicker', + colProps: { span: 8 } + } +] + +export const formSchema: FormSchema[] = [ + { + label: '编号', + field: 'id', + show: false, + component: 'Input' + }, + { + label: '配置名', + field: 'name', + required: true, + component: 'Input' + }, + { + label: '存储器', + field: 'storage', + component: 'Select', + required: true, + dynamicDisabled: ({ values }) => !!values.id, + componentProps: { + options: getIntDictOptions(DICT_TYPE.INFRA_FILE_STORAGE) + } + }, + { + label: '基础路径', + field: 'config.basePath', + required: true, + ifShow: ({ values }) => values.storage >= 10 && values.storage <= 12, + component: 'Input' + }, + { + label: '主机地址', + field: 'config.host', + required: true, + ifShow: ({ values }) => values.storage >= 11 && values.storage <= 12, + component: 'Input' + }, + { + label: '主机端口', + field: 'config.port', + required: true, + ifShow: ({ values }) => values.storage >= 11 && values.storage <= 12, + component: 'Input' + }, + { + label: '用户名', + field: 'config.username', + required: true, + ifShow: ({ values }) => values.storage >= 11 && values.storage <= 12, + component: 'Input' + }, + { + label: '密码', + field: 'config.password', + required: true, + ifShow: ({ values }) => values.storage >= 11 && values.storage <= 12, + component: 'Input' + }, + { + label: '连接模式', + field: 'config.basePath', + required: true, + ifShow: ({ values }) => values.storage === 11, + component: 'Select', + componentProps: { + options: [ + { lable: '主动模式', key: 'Active', value: 'Active' }, + { lable: '被动模式', key: 'Passive', value: 'Passive' } + ] + } + }, + { + label: '节点地址', + field: 'config.endpoint', + required: true, + ifShow: ({ values }) => values.storage === 20, + component: 'Input' + }, + { + label: '存储 bucket', + field: 'config.bucket', + required: true, + ifShow: ({ values }) => values.storage === 20, + component: 'Input' + }, + { + label: 'accessKey', + field: 'config.accessKey', + ifShow: ({ values }) => values.storage === 20, + component: 'Input' + }, + { + label: 'accessSecret', + field: 'config.accessSecret', + ifShow: ({ values }) => values.storage === 20, + component: 'Input' + }, + { + label: '自定义域名', + field: 'config.domain', + required: true, + component: 'Input' + }, + { + label: '备注', + field: 'remark', + component: 'InputTextArea' + } +] diff --git a/src/views/infra/fileConfig/index.vue b/src/views/infra/fileConfig/index.vue index 3b64cfc4..0a26062f 100644 --- a/src/views/infra/fileConfig/index.vue +++ b/src/views/infra/fileConfig/index.vue @@ -1,3 +1,100 @@ + diff --git a/src/views/system/area/index.vue b/src/views/system/area/index.vue index 519f2583..f6363309 100644 --- a/src/views/system/area/index.vue +++ b/src/views/system/area/index.vue @@ -2,7 +2,7 @@
@@ -11,6 +11,7 @@