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 @@ + + + + + + + + + + + + + + + + + + + {{ dict.label }} + + + + + + + + + + + + + + + + + + + + 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 @@ + + + + + + + + + + + + {{ dict.label }} + + + + + + + + + + + + + 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 @@ - - - - - - 字典分类 - - - - - - + + + + + + + + + + + + + + + + + 搜索 + 重置 + + 新增 + + + 导出 + + + + + + + + + + + + + {{ scope.row.type }} + + - - - - - + + + + - - - - - - - - 字典数据 - - - - - 请从左侧选择 - - - - - - - - - - - - - - - - - - - - - - {{ dictTypeValue }} - - - - - + + - - - - - - - - + + + + 修改 + 删除 + + + + + + + + +