From ee9474fdb4e8d38c3cb32a1a1287e6298eb4a909 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Wed, 8 Mar 2023 08:15:49 +0800 Subject: [PATCH] =?UTF-8?q?vue3=20=E9=87=8D=E6=9E=84=EF=BC=9A=E4=BD=BF?= =?UTF-8?q?=E7=94=A8=20el=20=E5=8E=9F=E7=94=9F=E5=AE=9E=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/infra/config/index.ts | 2 +- src/types/auto-components.d.ts | 10 +- src/types/auto-imports.d.ts | 1 - src/views/infra/config/config.data.ts | 90 ---------- src/views/infra/config/index.vue | 249 +++++++++++--------------- src/views/infra/config/index2.vue | 162 +++++++++++++++++ 6 files changed, 274 insertions(+), 240 deletions(-) delete mode 100644 src/views/infra/config/config.data.ts create mode 100644 src/views/infra/config/index2.vue diff --git a/src/api/infra/config/index.ts b/src/api/infra/config/index.ts index 5a9bee1b..84ded9aa 100644 --- a/src/api/infra/config/index.ts +++ b/src/api/infra/config/index.ts @@ -27,7 +27,7 @@ export interface ConfigExportReqVO { } // 查询参数列表 -export const getConfigPageApi = (params: ConfigPageReqVO) => { +export const getConfigPage = (params: ConfigPageReqVO) => { return request.get({ url: '/infra/config/page', params }) } diff --git a/src/types/auto-components.d.ts b/src/types/auto-components.d.ts index fa82a4aa..96eed08d 100644 --- a/src/types/auto-components.d.ts +++ b/src/types/auto-components.d.ts @@ -23,8 +23,8 @@ declare module '@vue/runtime-core' { DictTag: typeof import('./../components/DictTag/src/DictTag.vue')['default'] Echart: typeof import('./../components/Echart/src/Echart.vue')['default'] Editor: typeof import('./../components/Editor/src/Editor.vue')['default'] - ElAvatar: typeof import('element-plus/es')['ElAvatar'] ElAutoResizer: typeof import('element-plus/es')['ElAutoResizer'] + ElAvatar: typeof import('element-plus/es')['ElAvatar'] ElBadge: typeof import('element-plus/es')['ElBadge'] ElButton: typeof import('element-plus/es')['ElButton'] ElButtonGroup: typeof import('element-plus/es')['ElButtonGroup'] @@ -35,6 +35,7 @@ declare module '@vue/runtime-core' { ElCollapseItem: typeof import('element-plus/es')['ElCollapseItem'] ElCollapseTransition: typeof import('element-plus/es')['ElCollapseTransition'] ElConfigProvider: typeof import('element-plus/es')['ElConfigProvider'] + ElDatePicker: typeof import('element-plus/es')['ElDatePicker'] ElDescriptions: typeof import('element-plus/es')['ElDescriptions'] ElDescriptionsItem: typeof import('element-plus/es')['ElDescriptionsItem'] ElDialog: typeof import('element-plus/es')['ElDialog'] @@ -56,10 +57,14 @@ declare module '@vue/runtime-core' { ElImage: typeof import('element-plus/es')['ElImage'] ElImageViewer: typeof import('element-plus/es')['ElImageViewer'] ElInput: typeof import('element-plus/es')['ElInput'] + ElInputNumber: typeof import('element-plus/es')['ElInputNumber'] ElLink: typeof import('element-plus/es')['ElLink'] ElOption: typeof import('element-plus/es')['ElOption'] ElPagination: typeof import('element-plus/es')['ElPagination'] ElPopover: typeof import('element-plus/es')['ElPopover'] + ElRadio: typeof import('element-plus/es')['ElRadio'] + ElRadioButton: typeof import('element-plus/es')['ElRadioButton'] + ElRadioGroup: typeof import('element-plus/es')['ElRadioGroup'] ElRow: typeof import('element-plus/es')['ElRow'] ElScrollbar: typeof import('element-plus/es')['ElScrollbar'] ElSelect: typeof import('element-plus/es')['ElSelect'] @@ -74,6 +79,9 @@ declare module '@vue/runtime-core' { ElTimeline: typeof import('element-plus/es')['ElTimeline'] ElTimelineItem: typeof import('element-plus/es')['ElTimelineItem'] ElTooltip: typeof import('element-plus/es')['ElTooltip'] + ElTransfer: typeof import('element-plus/es')['ElTransfer'] + ElTree: typeof import('element-plus/es')['ElTree'] + ElTreeSelect: typeof import('element-plus/es')['ElTreeSelect'] ElUpload: typeof import('element-plus/es')['ElUpload'] Error: typeof import('./../components/Error/src/Error.vue')['default'] FlowCondition: typeof import('./../components/bpmnProcessDesigner/package/penal/flow-condition/FlowCondition.vue')['default'] diff --git a/src/types/auto-imports.d.ts b/src/types/auto-imports.d.ts index a05a5b48..7c9f5ff1 100644 --- a/src/types/auto-imports.d.ts +++ b/src/types/auto-imports.d.ts @@ -6,7 +6,6 @@ export {} declare global { const DICT_TYPE: typeof import('@/utils/dict')['DICT_TYPE'] const EffectScope: typeof import('vue')['EffectScope'] - const ElButton: typeof import('element-plus/es')['ElButton'] const computed: typeof import('vue')['computed'] const createApp: typeof import('vue')['createApp'] const customRef: typeof import('vue')['customRef'] diff --git a/src/views/infra/config/config.data.ts b/src/views/infra/config/config.data.ts deleted file mode 100644 index 41acfa15..00000000 --- a/src/views/infra/config/config.data.ts +++ /dev/null @@ -1,90 +0,0 @@ -import type { VxeCrudSchema } from '@/hooks/web/useVxeCrudSchemas' -const { t } = useI18n() // 国际化 - -// 表单校验 -export const rules = reactive({ - category: [required], - name: [required], - key: [required], - value: [required] -}) - -// CrudSchema -const crudSchemas = reactive({ - primaryKey: 'id', - primaryType: null, - action: true, - columns: [ - { - title: '参数分类', - field: 'category' - }, - { - title: '参数名称', - field: 'name', - isSearch: true - }, - { - title: '参数键名', - field: 'key', - isSearch: true - }, - { - title: '参数键值', - field: 'value' - }, - { - title: '系统内置', - field: 'type', - dictType: DICT_TYPE.INFRA_CONFIG_TYPE, - dictClass: 'number', - isSearch: true - }, - { - title: '是否可见', - field: 'visible', - table: { - slots: { - default: 'visible_default' - } - }, - form: { - component: 'RadioButton', - componentProps: { - options: [ - { label: '是', value: true }, - { label: '否', value: false } - ] - } - } - }, - { - title: t('form.remark'), - field: 'remark', - isTable: false, - form: { - component: 'Input', - componentProps: { - type: 'textarea', - rows: 4 - }, - colProps: { - span: 24 - } - } - }, - { - title: t('common.createTime'), - field: 'createTime', - formatter: 'formatDate', - isForm: false, - search: { - show: true, - itemRender: { - name: 'XDataTimePicker' - } - } - } - ] -}) -export const { allSchemas } = useVxeCrudSchemas(crudSchemas) diff --git a/src/views/infra/config/index.vue b/src/views/infra/config/index.vue index 73f0f8ad..14dd5ff7 100644 --- a/src/views/infra/config/index.vue +++ b/src/views/infra/config/index.vue @@ -1,162 +1,117 @@ diff --git a/src/views/infra/config/index2.vue b/src/views/infra/config/index2.vue new file mode 100644 index 00000000..ce52436f --- /dev/null +++ b/src/views/infra/config/index2.vue @@ -0,0 +1,162 @@ + +