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