Commit 7455348a6e578ae6a48e4a11e0fa07a4b58b6182

Authored by xingyu
1 parent 7c0c123b

refactor: dict

Showing 39 changed files with 155 additions and 54 deletions
yudao-ui-admin-vue3/src/hooks/web/useCrudSchemas.ts
1 1 import { reactive } from 'vue'
2 2 import { eachTree, treeMap, filter } from '@/utils/tree'
3   -import { getIntDictOptions } from '@/utils/dict'
  3 +import { getBoolDictOptions, getDictOptions, getIntDictOptions } from '@/utils/dict'
4 4 import { FormSchema } from '@/types/form'
5 5 import { TableColumn } from '@/types/table'
6 6 import { DescriptionsSchema } from '@/types/descriptions'
... ... @@ -12,7 +12,8 @@ export type CrudSchema = Omit<TableColumn, 'children'> & {
12 12 form?: CrudFormParams
13 13 detail?: CrudDescriptionsParams
14 14 children?: CrudSchema[]
15   - dictType?: string
  15 + dictType?: string // 字典类型
  16 + dictData?: 'string' | 'number' | 'boolean' // 字典数据类型 string | number | boolean
16 17 }
17 18  
18 19 type CrudSearchParams = {
... ... @@ -86,7 +87,7 @@ const filterSearchSchema = (crudSchema: CrudSchema[]): FormSchema[] => {
86 87 if (schemaItem.dictType) {
87 88 const allOptions: ComponentOptions = { label: '全部', value: '' }
88 89 options.push(allOptions)
89   - getIntDictOptions(schemaItem.dictType).forEach((dict) => {
  90 + getDictOptions(schemaItem.dictType).forEach((dict) => {
90 91 options.push(dict)
91 92 })
92 93 comonentProps = {
... ... @@ -144,9 +145,19 @@ const filterFormSchema = (crudSchema: CrudSchema[]): FormSchema[] => {
144 145 const options: ComponentOptions[] = []
145 146 let comonentProps = {}
146 147 if (schemaItem.dictType) {
147   - getIntDictOptions(schemaItem.dictType).forEach((dict) => {
148   - options.push(dict)
149   - })
  148 + if (schemaItem.dictData && schemaItem.dictData === 'number') {
  149 + getIntDictOptions(schemaItem.dictType).forEach((dict) => {
  150 + options.push(dict)
  151 + })
  152 + } else if (schemaItem.dictData && schemaItem.dictData === 'boolean') {
  153 + getBoolDictOptions(schemaItem.dictType).forEach((dict) => {
  154 + options.push(dict)
  155 + })
  156 + } else {
  157 + getDictOptions(schemaItem.dictType).forEach((dict) => {
  158 + options.push(dict)
  159 + })
  160 + }
150 161 comonentProps = {
151 162 options: options
152 163 }
... ...
yudao-ui-admin-vue3/src/hooks/web/useVxeCrudSchemas.ts
1 1 import { DescriptionsSchema } from '@/types/descriptions'
2   -import { getIntDictOptions } from '@/utils/dict'
  2 +import { getBoolDictOptions, getDictOptions, getIntDictOptions } from '@/utils/dict'
3 3 import { reactive } from 'vue'
4 4 import {
5 5 FormItemRenderOptions,
... ... @@ -38,6 +38,7 @@ type VxeCrudColumns = Omit<VxeTableColumn, 'children'> & {
38 38 print?: CrudPrintParams // vxe 打印的字段
39 39 children?: VxeCrudColumns[] // 子级
40 40 dictType?: string // 字典类型
  41 + dictData?: 'string' | 'number' | 'boolean' // 字典数据类型 string | number | boolean
41 42 }
42 43  
43 44 type CrudSearchParams = {
... ... @@ -124,7 +125,7 @@ const filterSearchSchema = (crudSchema: VxeCrudSchema): VxeFormItemProps[] => {
124 125 if (schemaItem.dictType) {
125 126 const allOptions = { label: '全部', value: '' }
126 127 options.push(allOptions)
127   - getIntDictOptions(schemaItem.dictType).forEach((dict) => {
  128 + getDictOptions(schemaItem.dictType).forEach((dict) => {
128 129 options.push(dict)
129 130 })
130 131 itemRender.options = options
... ... @@ -229,9 +230,19 @@ const filterFormSchema = (crudSchema: VxeCrudSchema): FormSchema[] => {
229 230 const options: ComponentOptions[] = []
230 231 let comonentProps = {}
231 232 if (schemaItem.dictType) {
232   - getIntDictOptions(schemaItem.dictType).forEach((dict) => {
233   - options.push(dict)
234   - })
  233 + if (schemaItem.dictData && schemaItem.dictData === 'number') {
  234 + getIntDictOptions(schemaItem.dictType).forEach((dict) => {
  235 + options.push(dict)
  236 + })
  237 + } else if (schemaItem.dictData && schemaItem.dictData === 'boolean') {
  238 + getBoolDictOptions(schemaItem.dictType).forEach((dict) => {
  239 + options.push(dict)
  240 + })
  241 + } else {
  242 + getDictOptions(schemaItem.dictType).forEach((dict) => {
  243 + options.push(dict)
  244 + })
  245 + }
235 246 comonentProps = {
236 247 options: options
237 248 }
... ...
yudao-ui-admin-vue3/src/router/index.ts
... ... @@ -12,6 +12,9 @@ import { useUserStoreWithOut } from '@/store/modules/user'
12 12 import { listSimpleDictDataApi } from '@/api/system/dict/dict.data'
13 13 import { isRelogin } from '@/config/axios/service'
14 14 import { getInfoApi } from '@/api/login'
  15 +import { useCache } from '@/hooks/web/useCache'
  16 +
  17 +const { wsCache } = useCache()
15 18  
16 19 const { start, done } = useNProgress()
17 20  
... ... @@ -47,7 +50,8 @@ router.beforeEach(async (to, from, next) => {
47 50 const dictStore = useDictStoreWithOut()
48 51 const userStore = useUserStoreWithOut()
49 52 const permissionStore = usePermissionStoreWithOut()
50   - if (!dictStore.getHasDictData) {
  53 + const dictMap = wsCache.get('dictCache')
  54 + if (!dictMap) {
51 55 const res = await listSimpleDictDataApi()
52 56 dictStore.setDictMap(res)
53 57 }
... ...
yudao-ui-admin-vue3/src/store/modules/dict.ts
1 1 import { defineStore } from 'pinia'
2 2 import { store } from '../index'
3 3 import { DictDataVO } from '@/api/system/dict/types'
  4 +import { useCache } from '@/hooks/web/useCache'
  5 +const { wsCache } = useCache('sessionStorage')
4 6  
5 7 export interface DictValueType {
6   - value: string
  8 + value: any
7 9 label: string
8 10 clorType?: string
9 11 cssClass?: string
... ... @@ -13,19 +15,20 @@ export interface DictTypeType {
13 15 dictValue: DictValueType[]
14 16 }
15 17 export interface DictState {
16   - dictMap: Recordable
  18 + dictMap: Map<string, any>
17 19 }
18 20  
19 21 export const useDictStore = defineStore('dict', {
20 22 state: (): DictState => ({
21   - dictMap: {}
  23 + dictMap: new Map<string, any>()
22 24 }),
23 25 getters: {
24 26 getDictMap(): Recordable {
25   - return this.dictMap
  27 + const dictMap = wsCache.get('dictCache')
  28 + return dictMap ? dictMap : this.dictMap
26 29 },
27 30 getHasDictData(): boolean {
28   - if (this.dictMap.length > 0) {
  31 + if (this.dictMap.size > 0) {
29 32 return true
30 33 } else {
31 34 return false
... ... @@ -35,7 +38,7 @@ export const useDictStore = defineStore(&#39;dict&#39;, {
35 38 actions: {
36 39 setDictMap(dictMap: Recordable) {
37 40 // 设置数据
38   - const dictDataMap = {}
  41 + const dictDataMap = new Map<string, any>()
39 42 dictMap.forEach((dictData: DictDataVO) => {
40 43 // 获得 dictType 层级
41 44 const enumValueObj = dictDataMap[dictData.dictType]
... ... @@ -50,7 +53,8 @@ export const useDictStore = defineStore(&#39;dict&#39;, {
50 53 cssClass: dictData.cssClass
51 54 })
52 55 })
53   - this.dictMap = dictMap
  56 + this.dictMap = dictDataMap
  57 + wsCache.set('dictCache', dictDataMap, { exp: 60 }) // 60 秒 过期
54 58 }
55 59 }
56 60 })
... ...
yudao-ui-admin-vue3/src/utils/dict.ts
... ... @@ -15,36 +15,53 @@ const dictStore = useDictStoreWithOut()
15 15 export interface DictDataType {
16 16 dictType: string
17 17 label: string
18   - value: string | number
  18 + value: string | number | boolean
19 19 colorType: ElementPlusInfoType | '' | 'default' | 'primary'
20 20 cssClass: string
21 21 }
22 22  
23 23 export const getDictOptions = (dictType: string) => {
24   - const dictOptions: DictDataType[] = []
25   - dictStore.getDictMap.forEach((dict: DictDataType) => {
26   - if (dict.dictType + '' === dictType) {
27   - dictOptions.push(dict)
28   - }
29   - })
30   - return dictOptions
  24 + return dictStore.getDictMap[dictType]
31 25 }
32 26  
33   -// TODO @芋艿:暂时提供这个方法,主要考虑 ElSelect。下拉如果可以解,就可以不用这个方法
34 27 export const getIntDictOptions = (dictType: string) => {
35   - const dictOptions: DictDataType[] = []
36   - dictStore.getDictMap.forEach((dict: DictDataType) => {
37   - if (dict.dictType.toString() === dictType) {
38   - dictOptions.push({
39   - ...dict,
40   - value: parseInt(dict.value + '')
41   - })
42   - }
  28 + const dictOption: DictDataType[] = []
  29 + const dictOptions: DictDataType[] = getDictOptions(dictType)
  30 + dictOptions.forEach((dict: DictDataType) => {
  31 + dictOption.push({
  32 + ...dict,
  33 + value: parseInt(dict.value + '')
  34 + })
  35 + })
  36 +
  37 + return dictOption
  38 +}
  39 +
  40 +export const getStrDictOptions = (dictType: string) => {
  41 + const dictOption: DictDataType[] = []
  42 + const dictOptions: DictDataType[] = getDictOptions(dictType)
  43 + dictOptions.forEach((dict: DictDataType) => {
  44 + dictOption.push({
  45 + ...dict,
  46 + value: dict.value + ''
  47 + })
  48 + })
  49 + return dictOption
  50 +}
  51 +
  52 +export const getBoolDictOptions = (dictType: string) => {
  53 + const dictOption: DictDataType[] = []
  54 + const dictOptions: DictDataType[] = getDictOptions(dictType)
  55 + dictOptions.forEach((dict: DictDataType) => {
  56 + dictOption.push({
  57 + ...dict,
  58 + value: dict.value + '' === 'true' ? true : false
  59 + })
43 60 })
44   - return dictOptions
  61 + return dictOption
45 62 }
46 63  
47   -export const getDictObj = (dictType: string, value: string | number | boolean) => {
  64 +export const getDictObj = (dictType: string, value: any) => {
48 65 const dictOptions: DictDataType[] = getDictOptions(dictType)
49 66 dictOptions.forEach((dict: DictDataType) => {
50 67 if (dict.value === value.toString()) {
... ...
yudao-ui-admin-vue3/src/views/bpm/form/form.data.ts
... ... @@ -33,7 +33,8 @@ const crudSchemas = reactive&lt;CrudSchema[]&gt;([
33 33 {
34 34 label: t('common.status'),
35 35 field: 'status',
36   - dictType: DICT_TYPE.COMMON_STATUS
  36 + dictType: DICT_TYPE.COMMON_STATUS,
  37 + dictData: 'number'
37 38 },
38 39 {
39 40 label: '备注',
... ...
yudao-ui-admin-vue3/src/views/bpm/group/group.data.ts
... ... @@ -41,7 +41,8 @@ const crudSchemas = reactive&lt;CrudSchema[]&gt;([
41 41 {
42 42 label: t('common.status'),
43 43 field: 'status',
44   - dictType: DICT_TYPE.COMMON_STATUS
  44 + dictType: DICT_TYPE.COMMON_STATUS,
  45 + dictData: 'number'
45 46 },
46 47 {
47 48 label: '备注',
... ...
yudao-ui-admin-vue3/src/views/bpm/model/model.data.ts
... ... @@ -41,6 +41,7 @@ const crudSchemas = reactive&lt;CrudSchema[]&gt;([
41 41 label: '流程分类',
42 42 field: 'category',
43 43 dictType: DICT_TYPE.BPM_MODEL_CATEGORY,
  44 + dictData: 'number',
44 45 search: {
45 46 show: true
46 47 }
... ...
yudao-ui-admin-vue3/src/views/bpm/processInstance/process.data.ts
... ... @@ -28,6 +28,7 @@ const crudSchemas = reactive&lt;CrudSchema[]&gt;([
28 28 label: '流程分类',
29 29 field: 'category',
30 30 dictType: DICT_TYPE.BPM_MODEL_CATEGORY,
  31 + dictData: 'number',
31 32 search: {
32 33 show: true
33 34 }
... ... @@ -40,6 +41,7 @@ const crudSchemas = reactive&lt;CrudSchema[]&gt;([
40 41 label: t('common.status'),
41 42 field: 'status',
42 43 dictType: DICT_TYPE.BPM_PROCESS_INSTANCE_STATUS,
  44 + dictData: 'number',
43 45 search: {
44 46 show: true
45 47 }
... ... @@ -48,6 +50,7 @@ const crudSchemas = reactive&lt;CrudSchema[]&gt;([
48 50 label: '结果',
49 51 field: 'result',
50 52 dictType: DICT_TYPE.BPM_PROCESS_INSTANCE_RESULT,
  53 + dictData: 'number',
51 54 search: {
52 55 show: true
53 56 }
... ...
yudao-ui-admin-vue3/src/views/bpm/task/done/done.data.ts
... ... @@ -29,7 +29,8 @@ const crudSchemas = reactive&lt;CrudSchema[]&gt;([
29 29 {
30 30 label: '结果',
31 31 field: 'result',
32   - dictType: DICT_TYPE.BPM_PROCESS_INSTANCE_RESULT
  32 + dictType: DICT_TYPE.BPM_PROCESS_INSTANCE_RESULT,
  33 + dictData: 'number'
33 34 },
34 35 {
35 36 label: '审批意见',
... ...
yudao-ui-admin-vue3/src/views/infra/apiAccessLog/apiAccessLog.data.ts
... ... @@ -26,6 +26,7 @@ const crudSchemas = reactive&lt;CrudSchema[]&gt;([
26 26 label: '用户类型',
27 27 field: 'userType',
28 28 dictType: DICT_TYPE.USER_TYPE,
  29 + dictData: 'number',
29 30 search: {
30 31 show: true
31 32 }
... ...
yudao-ui-admin-vue3/src/views/infra/apiErrorLog/apiErrorLog.data.ts
... ... @@ -69,6 +69,7 @@ const crudSchemas = reactive&lt;CrudSchema[]&gt;([
69 69 label: '处理状态',
70 70 field: 'processStatus',
71 71 dictType: DICT_TYPE.INFRA_API_ERROR_LOG_PROCESS_STATUS,
  72 + dictData: 'number',
72 73 search: {
73 74 show: true
74 75 }
... ...
yudao-ui-admin-vue3/src/views/infra/config/config.data.ts
... ... @@ -52,6 +52,7 @@ const crudSchemas = reactive&lt;CrudSchema[]&gt;([
52 52 label: '系统内置',
53 53 field: 'type',
54 54 dictType: DICT_TYPE.INFRA_CONFIG_TYPE,
  55 + dictData: 'number',
55 56 search: {
56 57 show: true
57 58 }
... ...
yudao-ui-admin-vue3/src/views/infra/fileConfig/fileConfig.data.ts
... ... @@ -48,6 +48,7 @@ const crudSchemas = reactive&lt;CrudSchema[]&gt;([
48 48 label: '存储器',
49 49 field: 'storage',
50 50 dictType: DICT_TYPE.INFRA_FILE_STORAGE,
  51 + dictData: 'number',
51 52 search: {
52 53 show: true
53 54 }
... ... @@ -55,7 +56,8 @@ const crudSchemas = reactive&lt;CrudSchema[]&gt;([
55 56 {
56 57 label: '主配置',
57 58 field: 'primary',
58   - dictType: DICT_TYPE.INFRA_BOOLEAN_STRING
  59 + dictType: DICT_TYPE.INFRA_BOOLEAN_STRING,
  60 + dictData: 'number'
59 61 },
60 62 {
61 63 label: t('form.remark'),
... ...
yudao-ui-admin-vue3/src/views/infra/job/job.data.ts
... ... @@ -37,6 +37,7 @@ const crudSchemas = reactive&lt;CrudSchema[]&gt;([
37 37 label: t('common.status'),
38 38 field: 'status',
39 39 dictType: DICT_TYPE.INFRA_JOB_STATUS,
  40 + dictData: 'number',
40 41 form: {
41 42 show: false
42 43 },
... ...
yudao-ui-admin-vue3/src/views/infra/job/jobLog.data.ts
... ... @@ -74,6 +74,7 @@ const crudSchemas = reactive&lt;CrudSchema[]&gt;([
74 74 label: t('common.status'),
75 75 field: 'status',
76 76 dictType: DICT_TYPE.INFRA_JOB_LOG_STATUS,
  77 + dictData: 'number',
77 78 search: {
78 79 show: true
79 80 }
... ...
yudao-ui-admin-vue3/src/views/pay/app/app.data.ts
... ... @@ -45,6 +45,7 @@ const crudSchemas = reactive&lt;CrudSchema[]&gt;([
45 45 label: t('common.status'),
46 46 field: 'status',
47 47 dictType: DICT_TYPE.COMMON_STATUS,
  48 + dictData: 'number',
48 49 search: {
49 50 show: true
50 51 }
... ...
yudao-ui-admin-vue3/src/views/pay/merchant/merchant.data.ts
... ... @@ -51,6 +51,7 @@ const crudSchemas = reactive&lt;CrudSchema[]&gt;([
51 51 label: t('common.status'),
52 52 field: 'status',
53 53 dictType: DICT_TYPE.COMMON_STATUS,
  54 + dictData: 'number',
54 55 search: {
55 56 show: true
56 57 }
... ...
yudao-ui-admin-vue3/src/views/pay/order/order.data.ts
... ... @@ -82,7 +82,8 @@ const crudSchemas = reactive&lt;CrudSchema[]&gt;([
82 82 {
83 83 label: '回调商户状态',
84 84 field: 'notifyStatus',
85   - dictType: DICT_TYPE.PAY_ORDER_NOTIFY_STATUS
  85 + dictType: DICT_TYPE.PAY_ORDER_NOTIFY_STATUS,
  86 + dictData: 'number'
86 87 },
87 88 {
88 89 label: '支付金额',
... ... @@ -109,6 +110,7 @@ const crudSchemas = reactive&lt;CrudSchema[]&gt;([
109 110 label: '支付状态',
110 111 field: 'status',
111 112 dictType: DICT_TYPE.PAY_ORDER_STATUS,
  113 + dictData: 'number',
112 114 search: {
113 115 show: true
114 116 }
... ... @@ -137,6 +139,7 @@ const crudSchemas = reactive&lt;CrudSchema[]&gt;([
137 139 label: '退款状态',
138 140 field: 'refundStatus',
139 141 dictType: DICT_TYPE.PAY_ORDER_REFUND_STATUS,
  142 + dictData: 'number',
140 143 search: {
141 144 show: true
142 145 }
... ...
yudao-ui-admin-vue3/src/views/pay/refund/refund.data.ts
... ... @@ -67,6 +67,7 @@ const crudSchemas = reactive&lt;CrudSchema[]&gt;([
67 67 label: '退款类型',
68 68 field: 'type',
69 69 dictType: DICT_TYPE.PAY_REFUND_ORDER_TYPE,
  70 + dictData: 'number',
70 71 search: {
71 72 show: true
72 73 }
... ... @@ -75,6 +76,7 @@ const crudSchemas = reactive&lt;CrudSchema[]&gt;([
75 76 label: t('common.status'),
76 77 field: 'status',
77 78 dictType: DICT_TYPE.PAY_REFUND_ORDER_STATUS,
  79 + dictData: 'number',
78 80 search: {
79 81 show: true
80 82 }
... ...
yudao-ui-admin-vue3/src/views/system/dict/dict.data.ts
... ... @@ -96,7 +96,8 @@ export const crudSchemas = reactive&lt;CrudSchema[]&gt;([
96 96 {
97 97 label: t('common.status'),
98 98 field: 'status',
99   - dictType: DICT_TYPE.COMMON_STATUS
  99 + dictType: DICT_TYPE.COMMON_STATUS,
  100 + dictData: 'number'
100 101 },
101 102 {
102 103 label: t('form.remark'),
... ...
yudao-ui-admin-vue3/src/views/system/dict/dict.type.ts
... ... @@ -40,7 +40,8 @@ const crudSchemas = reactive&lt;CrudSchema[]&gt;([
40 40 {
41 41 label: t('common.status'),
42 42 field: 'status',
43   - dictType: DICT_TYPE.COMMON_STATUS
  43 + dictType: DICT_TYPE.COMMON_STATUS,
  44 + dictData: 'number'
44 45 },
45 46 {
46 47 label: t('common.createTime'),
... ...
yudao-ui-admin-vue3/src/views/system/errorCode/errorCode.data.ts
... ... @@ -22,6 +22,7 @@ const crudSchemas = reactive&lt;VxeCrudSchema&gt;({
22 22 title: '错误码类型',
23 23 field: 'type',
24 24 dictType: DICT_TYPE.SYSTEM_ERROR_CODE_TYPE,
  25 + dictData: 'number',
25 26 isSearch: true
26 27 },
27 28 {
... ...
yudao-ui-admin-vue3/src/views/system/loginlog/loginLog.data.ts
... ... @@ -12,7 +12,8 @@ const crudSchemas = reactive&lt;VxeCrudSchema&gt;({
12 12 {
13 13 title: '日志类型',
14 14 field: 'logType',
15   - dictType: DICT_TYPE.SYSTEM_LOGIN_TYPE
  15 + dictType: DICT_TYPE.SYSTEM_LOGIN_TYPE,
  16 + dictData: 'number'
16 17 },
17 18 {
18 19 title: '用户名称',
... ... @@ -26,19 +27,26 @@ const crudSchemas = reactive&lt;VxeCrudSchema&gt;({
26 27 },
27 28 {
28 29 title: '浏览器',
29   - field: 'userAgent' // TODO 星语:调宽一点,UA 稍微多展示一点,虽然最终都会缩略
  30 + field: 'userAgent',
  31 + table: {
  32 + width: 100
  33 + }
30 34 },
31 35 {
32 36 title: '登陆结果',
33 37 field: 'result',
34   - dictType: DICT_TYPE.SYSTEM_LOGIN_RESULT
  38 + dictType: DICT_TYPE.SYSTEM_LOGIN_RESULT,
  39 + dictData: 'number'
35 40 },
36 41 {
37   - title: '登录日期', // TODO 星语:有点窄,看看咋调宽一点,避免日期展示不全
  42 + title: '登录日期',
38 43 field: 'createTime',
39 44 formatter: 'formatDate',
40   - isSearch: true,
  45 + table: {
  46 + width: 100
  47 + },
41 48 search: {
  49 + show: true,
42 50 itemRender: {
43 51 name: 'XDataTimePicker'
44 52 }
... ...
yudao-ui-admin-vue3/src/views/system/notice/notice.data.ts
... ... @@ -25,12 +25,14 @@ const crudSchemas = reactive&lt;VxeCrudSchema&gt;({
25 25 {
26 26 title: '公告类型',
27 27 field: 'type',
28   - dictType: DICT_TYPE.SYSTEM_NOTICE_TYPE
  28 + dictType: DICT_TYPE.SYSTEM_NOTICE_TYPE,
  29 + dictData: 'number'
29 30 },
30 31 {
31 32 title: t('common.status'),
32 33 field: 'status',
33 34 dictType: DICT_TYPE.COMMON_STATUS,
  35 + dictData: 'number',
34 36 isSearch: true
35 37 },
36 38 {
... ...
yudao-ui-admin-vue3/src/views/system/oauth2/client/client.data.ts
... ... @@ -45,6 +45,7 @@ const crudSchemas = reactive&lt;VxeCrudSchema&gt;({
45 45 title: t('common.status'),
46 46 field: 'status',
47 47 dictType: DICT_TYPE.COMMON_STATUS,
  48 + dictData: 'number',
48 49 isSearch: true
49 50 },
50 51 {
... ...
yudao-ui-admin-vue3/src/views/system/oauth2/token/token.data.ts
... ... @@ -26,6 +26,7 @@ const crudSchemas = reactive&lt;VxeCrudSchema&gt;({
26 26 title: '用户类型',
27 27 field: 'userType',
28 28 dictType: DICT_TYPE.USER_TYPE,
  29 + dictData: 'number',
29 30 isSearch: true
30 31 },
31 32 {
... ...
yudao-ui-admin-vue3/src/views/system/operatelog/operatelog.data.ts
... ... @@ -21,6 +21,7 @@ const crudSchemas = reactive&lt;VxeCrudSchema&gt;({
21 21 title: '操作类型',
22 22 field: 'type',
23 23 dictType: DICT_TYPE.SYSTEM_OPERATE_TYPE,
  24 + dictData: 'number',
24 25 isSearch: true
25 26 },
26 27 {
... ...
yudao-ui-admin-vue3/src/views/system/post/post.data.ts
... ... @@ -36,6 +36,7 @@ const crudSchemas = reactive&lt;VxeCrudSchema&gt;({
36 36 title: t('common.status'),
37 37 field: 'status',
38 38 dictType: DICT_TYPE.COMMON_STATUS,
  39 + dictData: 'number',
39 40 isSearch: true
40 41 },
41 42 {
... ...
yudao-ui-admin-vue3/src/views/system/role/role.data.ts
... ... @@ -26,7 +26,8 @@ const crudSchemas = reactive&lt;VxeCrudSchema&gt;({
26 26 {
27 27 title: '角色类型',
28 28 field: 'type',
29   - dictType: DICT_TYPE.SYSTEM_ROLE_TYPE
  29 + dictType: DICT_TYPE.SYSTEM_ROLE_TYPE,
  30 + dictData: 'number'
30 31 },
31 32 {
32 33 title: '角色标识',
... ... @@ -41,6 +42,7 @@ const crudSchemas = reactive&lt;VxeCrudSchema&gt;({
41 42 title: t('common.status'),
42 43 field: 'status',
43 44 dictType: DICT_TYPE.COMMON_STATUS,
  45 + dictData: 'number',
44 46 isSearch: true
45 47 },
46 48 {
... ...
yudao-ui-admin-vue3/src/views/system/sensitiveWord/index.vue
... ... @@ -154,6 +154,7 @@ const setDialogTile = (type: string) =&gt; {
154 154  
155 155 // 新增操作
156 156 const handleCreate = () => {
  157 + tags.value = null
157 158 setDialogTile('create')
158 159 }
159 160  
... ... @@ -162,6 +163,7 @@ const handleUpdate = async (rowId: number) =&gt; {
162 163 setDialogTile('update')
163 164 // 设置数据
164 165 const res = await SensitiveWordApi.getSensitiveWordApi(rowId)
  166 + tags.value = res.tags
165 167 unref(formRef)?.setValues(res)
166 168 }
167 169  
... ... @@ -175,6 +177,7 @@ const submitForm = async () =&gt; {
175 177 // 提交请求
176 178 try {
177 179 const data = unref(formRef)?.formModel as SensitiveWordVO
  180 + data.tags = tags.value
178 181 if (actionType.value === 'create') {
179 182 await SensitiveWordApi.createSensitiveWordApi(data)
180 183 ElMessage.success(t('common.createSuccess'))
... ...
yudao-ui-admin-vue3/src/views/system/sensitiveWord/sensitiveWord.data.ts
... ... @@ -39,6 +39,7 @@ const crudSchemas = reactive&lt;CrudSchema[]&gt;([
39 39 label: t('common.status'),
40 40 field: 'status',
41 41 dictType: DICT_TYPE.COMMON_STATUS,
  42 + dictData: 'number',
42 43 search: {
43 44 show: true
44 45 }
... ...
yudao-ui-admin-vue3/src/views/system/sms/smsChannel/sms.channel.data.ts
... ... @@ -34,6 +34,7 @@ const crudSchemas = reactive&lt;VxeCrudSchema&gt;({
34 34 title: t('common.status'),
35 35 field: 'status',
36 36 dictType: DICT_TYPE.COMMON_STATUS,
  37 + dictData: 'number',
37 38 isSearch: true
38 39 },
39 40 {
... ...
yudao-ui-admin-vue3/src/views/system/sms/smsLog/sms.log.data.ts
... ... @@ -23,18 +23,21 @@ const crudSchemas = reactive&lt;VxeCrudSchema&gt;({
23 23 title: '短信渠道',
24 24 field: 'channelId',
25 25 dictType: DICT_TYPE.SYSTEM_SMS_CHANNEL_CODE,
  26 + dictData: 'number',
26 27 isSearch: true
27 28 },
28 29 {
29 30 title: '发送状态',
30 31 field: 'sendStatus',
31 32 dictType: DICT_TYPE.SYSTEM_SMS_SEND_STATUS,
  33 + dictData: 'number',
32 34 isSearch: true
33 35 },
34 36 {
35 37 title: '接收状态',
36 38 field: 'receiveStatus',
37 39 dictType: DICT_TYPE.SYSTEM_SMS_RECEIVE_STATUS,
  40 + dictData: 'number',
38 41 isSearch: true
39 42 },
40 43 {
... ... @@ -46,6 +49,7 @@ const crudSchemas = reactive&lt;VxeCrudSchema&gt;({
46 49 title: '短信类型',
47 50 field: 'templateType',
48 51 dictType: DICT_TYPE.SYSTEM_SMS_TEMPLATE_TYPE,
  52 + dictData: 'number',
49 53 isSearch: true
50 54 },
51 55 {
... ...
yudao-ui-admin-vue3/src/views/system/sms/smsTemplate/index.vue
... ... @@ -156,18 +156,18 @@ const handleCreate = () =&gt; {
156 156  
157 157 // 修改操作
158 158 const handleUpdate = async (rowId: number) => {
  159 + setDialogTile('update')
159 160 // 设置数据
160 161 const res = await SmsTemplateApi.getSmsTemplateApi(rowId)
161 162 unref(formRef)?.setValues(res)
162   - setDialogTile('update')
163 163 }
164 164  
165 165 // 详情操作
166 166 const handleDetail = async (rowId: number) => {
  167 + setDialogTile('detail')
167 168 // 设置数据
168 169 const res = await SmsTemplateApi.getSmsTemplateApi(rowId)
169 170 detailData.value = res
170   - setDialogTile('detail')
171 171 }
172 172  
173 173 // 删除操作
... ...
yudao-ui-admin-vue3/src/views/system/sms/smsTemplate/sms.template.data.ts
... ... @@ -46,6 +46,7 @@ const crudSchemas = reactive&lt;VxeCrudSchema&gt;({
46 46 title: '短信类型',
47 47 field: 'type',
48 48 dictType: DICT_TYPE.SYSTEM_SMS_TEMPLATE_TYPE,
  49 + dictData: 'number',
49 50 table: {
50 51 width: 80
51 52 }
... ... @@ -54,6 +55,7 @@ const crudSchemas = reactive&lt;VxeCrudSchema&gt;({
54 55 title: t('common.status'),
55 56 field: 'status',
56 57 dictType: DICT_TYPE.COMMON_STATUS,
  58 + dictData: 'number',
57 59 table: {
58 60 width: 80
59 61 }
... ...
yudao-ui-admin-vue3/src/views/system/tenant/tenant.data.ts
... ... @@ -106,6 +106,7 @@ const crudSchemas = reactive&lt;CrudSchema[]&gt;([
106 106 label: '租户状态',
107 107 field: 'status',
108 108 dictType: DICT_TYPE.COMMON_STATUS,
  109 + dictData: 'number',
109 110 search: {
110 111 show: true
111 112 }
... ...
yudao-ui-admin-vue3/src/views/system/tenantPackage/tenantPackage.data.ts
... ... @@ -39,6 +39,7 @@ const crudSchemas = reactive&lt;CrudSchema[]&gt;([
39 39 label: t('common.status'),
40 40 field: 'status',
41 41 dictType: DICT_TYPE.COMMON_STATUS,
  42 + dictData: 'number',
42 43 search: {
43 44 show: true
44 45 }
... ...
yudao-ui-admin-vue3/src/views/system/user/user.data.ts
... ... @@ -71,6 +71,7 @@ const crudSchemas = reactive&lt;VxeCrudSchema&gt;({
71 71 title: t('common.status'),
72 72 field: 'status',
73 73 dictType: DICT_TYPE.COMMON_STATUS,
  74 + dictData: 'number',
74 75 isSearch: true
75 76 },
76 77 {
... ...