xingyu4j 2 жил өмнө
parent
commit
716266693b

+ 3 - 3
yudao-ui-admin-vue3/src/store/modules/dict.ts

@@ -3,10 +3,10 @@ import { store } from '../index'
 import { DictDataVO } from '@/api/system/dict/types'
 
 export interface DictValueType {
-  value: string | number | boolean
+  value: string
   label: string
-  clorType: string
-  cssClass: string
+  clorType?: string
+  cssClass?: string
 }
 export interface DictTypeType {
   dictType: string

+ 0 - 1
yudao-ui-admin-vue3/src/types/form.d.ts

@@ -1,6 +1,5 @@
 import type { CSSProperties } from 'vue'
 import { ColProps, ComponentProps, ComponentName } from '@/types/components'
-import { FormValueType, FormValueType } from '@/types/form'
 import type { AxiosPromise } from 'axios'
 
 export type FormSetPropsType = {

+ 7 - 5
yudao-ui-admin-vue3/src/utils/dict.ts

@@ -23,8 +23,11 @@ export interface DictDataType {
 export const getDictOptions = (dictType: string) => {
   const dictOptions: DictDataType[] = []
   dictStore.getDictMap.forEach((dict: DictDataType) => {
-    if (dict.dictType + '' === dictType) {
-      dictOptions.push(dict)
+    if (dict.dictType.toString() === dictType) {
+      dictOptions.push({
+        ...dict,
+        value: dict.value
+      })
     }
   })
   return dictOptions
@@ -37,18 +40,17 @@ export const getIntDictOptions = (dictType: string) => {
     if (dict.dictType.toString() === dictType) {
       dictOptions.push({
         ...dict,
-        value: dict.value
+        value: parseInt(dict.value + '')
       })
     }
   })
-  console.log(dictOptions)
   return dictOptions
 }
 
 export const getDictObj = (dictType: string, value: string | number | boolean) => {
   const dictOptions: DictDataType[] = getDictOptions(dictType)
   dictOptions.forEach((dict: DictDataType) => {
-    if (dict.value === value) {
+    if (dict.value === value.toString()) {
       return dict
     }
   })

+ 2 - 8
yudao-ui-admin-vue3/src/views/system/loginlog/loginLog.data.ts

@@ -1,8 +1,6 @@
 import { reactive } from 'vue'
-import { useI18n } from '@/hooks/web/useI18n'
 import { DICT_TYPE } from '@/utils/dict'
 import { VxeCrudSchema, useVxeCrudSchemas } from '@/hooks/web/useVxeCrudSchemas'
-const { t } = useI18n() // 国际化
 
 // CrudSchema
 const crudSchemas = reactive<VxeCrudSchema>({
@@ -16,10 +14,6 @@ const crudSchemas = reactive<VxeCrudSchema>({
       field: 'logType',
       dictType: DICT_TYPE.SYSTEM_LOGIN_TYPE
     },
-    {
-      title: '用户类型',
-      field: 'userType'
-    },
     {
       title: '用户名称',
       field: 'username',
@@ -40,10 +34,10 @@ const crudSchemas = reactive<VxeCrudSchema>({
       dictType: DICT_TYPE.SYSTEM_LOGIN_RESULT
     },
     {
-      title: t('common.createTime'),
+      title: '登录日期',
       field: 'createTime',
       formatter: 'formatDate',
-      isForm: false,
+      isSearch: true,
       search: {
         itemRender: {
           name: 'XDataTimePicker'