From 26a11d77aaec3321cde6a23beb06bc56936e5cba Mon Sep 17 00:00:00 2001 From: syd Date: Sun, 19 Mar 2023 14:40:31 +0800 Subject: [PATCH 01/12] =?UTF-8?q?vue3=20=E9=87=8D=E6=9E=84=EF=BC=9A?= =?UTF-8?q?=E6=95=8F=E6=84=9F=E8=AF=8D=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/system/sensitiveWord/form.vue | 129 +++++++ src/views/system/sensitiveWord/index.vue | 360 ++++++++++-------- .../sensitiveWord/sensitiveWord.data.ts | 74 ---- 3 files changed, 325 insertions(+), 238 deletions(-) create mode 100644 src/views/system/sensitiveWord/form.vue delete mode 100644 src/views/system/sensitiveWord/sensitiveWord.data.ts diff --git a/src/views/system/sensitiveWord/form.vue b/src/views/system/sensitiveWord/form.vue new file mode 100644 index 00000000..a0ed7a21 --- /dev/null +++ b/src/views/system/sensitiveWord/form.vue @@ -0,0 +1,129 @@ + + diff --git a/src/views/system/sensitiveWord/index.vue b/src/views/system/sensitiveWord/index.vue index c3de895d..0eb8287d 100644 --- a/src/views/system/sensitiveWord/index.vue +++ b/src/views/system/sensitiveWord/index.vue @@ -1,191 +1,223 @@ diff --git a/src/views/system/sensitiveWord/sensitiveWord.data.ts b/src/views/system/sensitiveWord/sensitiveWord.data.ts deleted file mode 100644 index d21bb94c..00000000 --- a/src/views/system/sensitiveWord/sensitiveWord.data.ts +++ /dev/null @@ -1,74 +0,0 @@ -import type { VxeCrudSchema } from '@/hooks/web/useVxeCrudSchemas' -const { t } = useI18n() // 国际化 - -// 表单校验 -export const rules = reactive({ - name: [required], - tags: [required] -}) - -// CrudSchema -const crudSchemas = reactive({ - primaryKey: 'id', - primaryType: 'id', - primaryTitle: '敏感词编号', - action: true, - columns: [ - { - title: '敏感词', - field: 'name', - isSearch: true - }, - { - title: '标签', - field: 'tag', - isTable: false, - isForm: false, - isDetail: false, - isSearch: true - }, - { - title: '标签', - field: 'tags', - table: { - slots: { - default: 'tags_default' - } - } - }, - { - title: t('common.status'), - field: 'status', - dictType: DICT_TYPE.COMMON_STATUS, - dictClass: 'number', - isSearch: true - }, - { - title: '描述', - field: 'description', - 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) From 5d062d5877ec0fffd525ab2360870706a9330072 Mon Sep 17 00:00:00 2001 From: Theo Date: Sun, 19 Mar 2023 16:48:27 +0800 Subject: [PATCH 02/12] =?UTF-8?q?=E5=AE=8C=E6=88=90=E5=AD=97=E5=85=B8?= =?UTF-8?q?=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/system/dict/types.ts | 18 +- src/router/modules/remaining.ts | 25 ++ src/views/system/dict/data.form.vue | 182 ++++++++++++ src/views/system/dict/data.vue | 203 +++++++++++++ src/views/system/dict/dict.data.ts | 104 ------- src/views/system/dict/dict.type.ts | 65 ----- src/views/system/dict/form.vue | 122 ++++++++ src/views/system/dict/index.vue | 436 ++++++++++++---------------- 8 files changed, 736 insertions(+), 419 deletions(-) create mode 100644 src/views/system/dict/data.form.vue create mode 100644 src/views/system/dict/data.vue delete mode 100644 src/views/system/dict/dict.data.ts delete mode 100644 src/views/system/dict/dict.type.ts create mode 100644 src/views/system/dict/form.vue diff --git a/src/api/system/dict/types.ts b/src/api/system/dict/types.ts index b630dccb..3421cd23 100644 --- a/src/api/system/dict/types.ts +++ b/src/api/system/dict/types.ts @@ -1,16 +1,18 @@ export type DictTypeVO = { - id: number + id: number | undefined name: string type: string - status: number + status: number | undefined remark: string createTime: Date } export type DictTypePageReqVO = { + pageNo: number + pageSize: number name: string type: string - status: number + status: number | undefined createTime: Date[] } @@ -22,8 +24,8 @@ export type DictTypeExportReqVO = { } export type DictDataVO = { - id: number - sort: number + id: number | undefined + sort: number | undefined label: string value: string dictType: string @@ -31,12 +33,14 @@ export type DictDataVO = { colorType: string cssClass: string remark: string - createTime: Date + createTime: Date | undefined } export type DictDataPageReqVO = { + pageNo: number + pageSize: number label: string dictType: string - status: number + status: number | undefined } export type DictDataExportReqVO = { diff --git a/src/router/modules/remaining.ts b/src/router/modules/remaining.ts index 43375961..d5970267 100644 --- a/src/router/modules/remaining.ts +++ b/src/router/modules/remaining.ts @@ -104,6 +104,31 @@ const remainingRouter: AppRouteRecordRaw[] = [ } ] }, + + { + path: '/dict', + component: Layout, + name: 'dict', + meta: { + hidden: true + }, + children: [ + { + path: 'type/data/:dictType', + component: () => import('@/views/system/dict/data.vue'), + name: 'data', + meta: { + title: '字典数据', + noCache: true, + hidden: true, + canTo: true, + icon: '', + activeMenu: 'system/dict/data' + } + } + ] + }, + { path: '/codegen', component: Layout, diff --git a/src/views/system/dict/data.form.vue b/src/views/system/dict/data.form.vue new file mode 100644 index 00000000..5c85b946 --- /dev/null +++ b/src/views/system/dict/data.form.vue @@ -0,0 +1,182 @@ + + diff --git a/src/views/system/dict/data.vue b/src/views/system/dict/data.vue new file mode 100644 index 00000000..2c1b373a --- /dev/null +++ b/src/views/system/dict/data.vue @@ -0,0 +1,203 @@ + + + diff --git a/src/views/system/dict/dict.data.ts b/src/views/system/dict/dict.data.ts deleted file mode 100644 index cdfe4538..00000000 --- a/src/views/system/dict/dict.data.ts +++ /dev/null @@ -1,104 +0,0 @@ -import type { VxeCrudSchema } from '@/hooks/web/useVxeCrudSchemas' -// 国际化 -const { t } = useI18n() -// 表单校验 -export const dictDataRules = reactive({ - label: [required], - value: [required], - sort: [required] -}) -// crudSchemas -export const crudSchemas = reactive({ - primaryKey: 'id', - primaryType: null, - action: true, - actionWidth: '140px', - searchSpan: 12, - columns: [ - { - title: '字典类型', - field: 'dictType', - isTable: false, - isForm: false - }, - { - title: '数据标签', - field: 'label', - isSearch: true - }, - { - title: '数据键值', - field: 'value' - }, - // { - // title: '标签类型', - // field: 'colorType', - // form: { - // component: 'Select', - // componentProps: { - // options: [ - // { - // label: 'default', - // value: '' - // }, - // { - // label: 'success', - // value: 'success' - // }, - // { - // label: 'info', - // value: 'info' - // }, - // { - // label: 'warning', - // value: 'warning' - // }, - // { - // label: 'danger', - // value: 'danger' - // } - // ] - // } - // }, - // isTable: false - // }, - { - title: '颜色', - field: 'cssClass', - isTable: false, - form: { - component: 'ColorPicker', - componentProps: { - predefine: ['#ffffff', '#409eff', '#67c23a', '#e6a23c', '#f56c6c', '#909399', '#c71585'] - } - } - }, - { - title: '显示排序', - field: 'sort', - isTable: false - }, - { - title: t('common.status'), - field: 'status', - dictType: DICT_TYPE.COMMON_STATUS, - dictClass: 'number' - }, - { - title: t('form.remark'), - field: 'remark', - form: { - component: 'Input', - componentProps: { - type: 'textarea', - rows: 4 - }, - colProps: { - span: 24 - } - }, - isTable: false - } - ] -}) -export const { allSchemas } = useVxeCrudSchemas(crudSchemas) diff --git a/src/views/system/dict/dict.type.ts b/src/views/system/dict/dict.type.ts deleted file mode 100644 index 73b5a021..00000000 --- a/src/views/system/dict/dict.type.ts +++ /dev/null @@ -1,65 +0,0 @@ -import type { VxeCrudSchema } from '@/hooks/web/useVxeCrudSchemas' -const { t } = useI18n() // 国际化 - -// 表单校验 -export const dictTypeRules = reactive({ - name: [required], - type: [required] -}) -// 新增 + 修改 -const crudSchemas = reactive({ - primaryKey: 'id', - primaryType: null, - action: true, - actionWidth: '140px', - searchSpan: 12, - columns: [ - { - title: '字典名称', - field: 'name', - isSearch: true - }, - { - title: '字典类型', - field: 'type', - isSearch: true - }, - { - title: t('common.status'), - field: 'status', - dictType: DICT_TYPE.COMMON_STATUS, - dictClass: 'number', - table: { - width: 70 - } - }, - { - title: t('common.createTime'), - field: 'createTime', - formatter: 'formatDate', - isForm: false, - isTable: false, - search: { - show: true, - itemRender: { - name: 'XDataTimePicker' - } - } - }, - { - title: t('form.remark'), - field: 'remark', - isTable: false, - form: { - componentProps: { - type: 'textarea', - rows: 4 - }, - colProps: { - span: 24 - } - } - } - ] -}) -export const { allSchemas } = useVxeCrudSchemas(crudSchemas) diff --git a/src/views/system/dict/form.vue b/src/views/system/dict/form.vue new file mode 100644 index 00000000..28b42c9d --- /dev/null +++ b/src/views/system/dict/form.vue @@ -0,0 +1,122 @@ + + diff --git a/src/views/system/dict/index.vue b/src/views/system/dict/index.vue index 713fde97..367cc9d4 100644 --- a/src/views/system/dict/index.vue +++ b/src/views/system/dict/index.vue @@ -1,257 +1,207 @@