Files
ipms-sjy/yudao-ui-admin-vue3/src/views/system/loginlog/loginLog.data.ts

50 lines
1.2 KiB
TypeScript
Raw Normal View History

2022-07-18 19:06:37 +08:00
import { reactive } from 'vue'
2022-11-13 14:49:59 +08:00
import { DICT_TYPE } from '@/utils/dict'
import { VxeCrudSchema, useVxeCrudSchemas } from '@/hooks/web/useVxeCrudSchemas'
// CrudSchema
const crudSchemas = reactive<VxeCrudSchema>({
primaryKey: 'id',
primaryType: 'seq',
action: true,
2022-11-13 15:38:31 +08:00
actionWidth: '80px',
2022-11-13 14:49:59 +08:00
columns: [
{
title: '日志类型',
field: 'logType',
2022-11-13 15:13:38 +08:00
dictType: DICT_TYPE.SYSTEM_LOGIN_TYPE
},
2022-11-13 14:49:59 +08:00
{
title: '用户名称',
field: 'username',
isSearch: true
2022-07-18 19:06:37 +08:00
},
2022-11-13 14:49:59 +08:00
{
title: '登录地址',
field: 'userIp',
isSearch: true
},
{
2022-11-13 15:13:38 +08:00
title: '浏览器',
2022-11-16 09:56:57 +08:00
field: 'userAgent' // TODO 星语调宽一点UA 稍微多展示一点,虽然最终都会缩略
2022-11-13 14:49:59 +08:00
},
{
title: '登陆结果',
field: 'result',
2022-11-13 15:13:38 +08:00
dictType: DICT_TYPE.SYSTEM_LOGIN_RESULT
2022-07-18 19:06:37 +08:00
},
2022-11-13 14:49:59 +08:00
{
2022-11-16 09:56:57 +08:00
title: '登录日期', // TODO 星语:有点窄,看看咋调宽一点,避免日期展示不全
2022-11-13 14:49:59 +08:00
field: 'createTime',
formatter: 'formatDate',
2022-11-15 09:17:26 +08:00
isSearch: true,
2022-11-13 15:13:38 +08:00
search: {
itemRender: {
name: 'XDataTimePicker'
}
}
2022-07-18 19:06:37 +08:00
}
2022-11-13 14:49:59 +08:00
]
})
export const { allSchemas } = useVxeCrudSchemas(crudSchemas)