diff --git a/yudao-ui-admin-vue3/src/api/system/loginLog/index.ts b/yudao-ui-admin-vue3/src/api/system/loginLog/index.ts index 32c2d9796..4ca31dc3b 100644 --- a/yudao-ui-admin-vue3/src/api/system/loginLog/index.ts +++ b/yudao-ui-admin-vue3/src/api/system/loginLog/index.ts @@ -1,5 +1,17 @@ import request from '@/config/axios' +export interface LoginLogVO { + id: number + logType: number + traceId: number + userType: number + username: string + status: number + userIp: string + userAgent: string + createTime: string +} + // 查询登录日志列表 export const getLoginLogPageApi = (params) => { return request.get({ url: '/system/login-log/page', params }) diff --git a/yudao-ui-admin-vue3/src/api/system/loginLog/types.ts b/yudao-ui-admin-vue3/src/api/system/loginLog/types.ts deleted file mode 100644 index 7454ccf3a..000000000 --- a/yudao-ui-admin-vue3/src/api/system/loginLog/types.ts +++ /dev/null @@ -1,11 +0,0 @@ -export type LoginLogVO = { - id: number - logType: number - traceId: number - userType: number - username: string - status: number - userIp: string - userAgent: string - createTime: string -} diff --git a/yudao-ui-admin-vue3/src/views/system/loginlog/index.vue b/yudao-ui-admin-vue3/src/views/system/loginlog/index.vue index eb65a22d5..f131d0300 100644 --- a/yudao-ui-admin-vue3/src/views/system/loginlog/index.vue +++ b/yudao-ui-admin-vue3/src/views/system/loginlog/index.vue @@ -1,80 +1,66 @@ + - diff --git a/yudao-ui-admin-vue3/src/views/system/loginlog/loginLog.data.ts b/yudao-ui-admin-vue3/src/views/system/loginlog/loginLog.data.ts index 6d97f7b54..a09c54cc3 100644 --- a/yudao-ui-admin-vue3/src/views/system/loginlog/loginLog.data.ts +++ b/yudao-ui-admin-vue3/src/views/system/loginlog/loginLog.data.ts @@ -1,80 +1,47 @@ import { reactive } from 'vue' -import { DICT_TYPE } from '@/utils/dict' import { useI18n } from '@/hooks/web/useI18n' -import { CrudSchema, useCrudSchemas } from '@/hooks/web/useCrudSchemas' +import { DICT_TYPE } from '@/utils/dict' +import { VxeCrudSchema, useVxeCrudSchemas } from '@/hooks/web/useVxeCrudSchemas' const { t } = useI18n() // 国际化 -const crudSchemas = reactive([ - { - label: t('common.index'), - field: 'id', - type: 'index', - form: { - show: false + +// CrudSchema +const crudSchemas = reactive({ + primaryKey: 'id', + primaryType: 'seq', + action: true, + columns: [ + { + title: '日志类型', + field: 'logType', + dictType: DICT_TYPE.SYSTEM_LOGIN_TYPE, + isSearch: true }, - detail: { - show: false - } - }, - { - label: '日志类型', - field: 'logType', - dictType: DICT_TYPE.SYSTEM_LOGIN_TYPE, - search: { - show: true - } - }, - { - label: '用户名称', - field: 'username', - search: { - show: true - } - }, - { - label: '登录地址', - field: 'userIp', - search: { - show: true - } - }, - { - label: 'userAgent', - field: 'userAgent' - }, - { - label: '登陆结果', - field: 'result', - dictType: DICT_TYPE.SYSTEM_LOGIN_RESULT, - search: { - show: true - } - }, - { - label: t('common.createTime'), - field: 'createTime', - form: { - show: false + { + title: '用户名称', + field: 'username', + isSearch: true }, - search: { - show: true, - component: 'DatePicker', - componentProps: { - type: 'daterange', - valueFormat: 'YYYY-MM-DD HH:mm:ss', - defaultTime: [new Date(2000, 1, 1, 0, 0, 0), new Date(2000, 2, 1, 23, 59, 59)] - } - } - }, - { - label: t('table.action'), - field: 'action', - width: '120px', - form: { - show: false + { + title: '登录地址', + field: 'userIp', + isSearch: true }, - detail: { - show: false + { + title: 'userAgent', + field: 'userAgent' + }, + { + title: '登陆结果', + field: 'result', + dictType: DICT_TYPE.SYSTEM_LOGIN_RESULT, + isSearch: true + }, + { + title: t('common.createTime'), + field: 'createTime', + formatter: 'formatDate', + isForm: false } - } -]) -export const { allSchemas } = useCrudSchemas(crudSchemas) + ] +}) +export const { allSchemas } = useVxeCrudSchemas(crudSchemas)