refactor: loginlog vxe
parent
7250e23df3
commit
866247959e
@ -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
|
|
||||||
}
|
|
||||||
@ -1,80 +1,47 @@
|
|||||||
import { reactive } from 'vue'
|
import { reactive } from 'vue'
|
||||||
import { DICT_TYPE } from '@/utils/dict'
|
|
||||||
import { useI18n } from '@/hooks/web/useI18n'
|
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 { t } = useI18n() // 国际化
|
||||||
const crudSchemas = reactive<CrudSchema[]>([
|
|
||||||
{
|
// CrudSchema
|
||||||
label: t('common.index'),
|
const crudSchemas = reactive<VxeCrudSchema>({
|
||||||
field: 'id',
|
primaryKey: 'id',
|
||||||
type: 'index',
|
primaryType: 'seq',
|
||||||
form: {
|
action: true,
|
||||||
show: false
|
columns: [
|
||||||
|
{
|
||||||
|
title: '日志类型',
|
||||||
|
field: 'logType',
|
||||||
|
dictType: DICT_TYPE.SYSTEM_LOGIN_TYPE,
|
||||||
|
isSearch: true
|
||||||
},
|
},
|
||||||
detail: {
|
{
|
||||||
show: false
|
title: '用户名称',
|
||||||
}
|
field: 'username',
|
||||||
},
|
isSearch: true
|
||||||
{
|
|
||||||
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
|
|
||||||
},
|
},
|
||||||
search: {
|
{
|
||||||
show: true,
|
title: '登录地址',
|
||||||
component: 'DatePicker',
|
field: 'userIp',
|
||||||
componentProps: {
|
isSearch: true
|
||||||
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)]
|
title: 'userAgent',
|
||||||
}
|
field: 'userAgent'
|
||||||
}
|
},
|
||||||
},
|
{
|
||||||
{
|
title: '登陆结果',
|
||||||
label: t('table.action'),
|
field: 'result',
|
||||||
field: 'action',
|
dictType: DICT_TYPE.SYSTEM_LOGIN_RESULT,
|
||||||
width: '120px',
|
isSearch: true
|
||||||
form: {
|
|
||||||
show: false
|
|
||||||
},
|
},
|
||||||
detail: {
|
{
|
||||||
show: false
|
title: t('common.createTime'),
|
||||||
|
field: 'createTime',
|
||||||
|
formatter: 'formatDate',
|
||||||
|
isForm: false
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
])
|
})
|
||||||
export const { allSchemas } = useCrudSchemas(crudSchemas)
|
export const { allSchemas } = useVxeCrudSchemas(crudSchemas)
|
||||||
|
|||||||
Loading…
Reference in New Issue