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

109 lines
2.1 KiB
TypeScript
Raw Normal View History

2022-11-17 23:45:47 +08:00
import { useI18n } from '@/hooks/web/useI18n'
2022-07-18 19:06:37 +08:00
import { DICT_TYPE } from '@/utils/dict'
2022-11-13 15:38:31 +08:00
import { VxeCrudSchema, useVxeCrudSchemas } from '@/hooks/web/useVxeCrudSchemas'
2022-11-17 23:45:47 +08:00
const { t } = useI18n() // 国际化
2022-11-13 15:38:31 +08:00
const crudSchemas = reactive<VxeCrudSchema>({
primaryKey: 'id',
primaryType: 'seq',
primaryTitle: '日志编号',
2022-11-13 15:38:31 +08:00
action: true,
actionWidth: '80px',
columns: [
{
title: '操作模块',
field: 'module',
isSearch: true
},
{
title: '操作名',
field: 'name'
},
{
title: '操作类型',
field: 'type',
dictType: DICT_TYPE.SYSTEM_OPERATE_TYPE,
2022-11-17 23:09:29 +08:00
dictClass: 'number',
2022-11-13 15:38:31 +08:00
isSearch: true
},
{
title: '请求方法名',
field: 'requestMethod',
isTable: false
2022-11-13 15:38:31 +08:00
},
{
title: '请求地址',
field: 'requestUrl',
isTable: false
2022-11-13 15:38:31 +08:00
},
{
title: '操作人员',
field: 'userNickname',
isSearch: true
},
{
title: '操作明细',
field: 'content',
isTable: false
},
{
title: '用户 IP',
field: 'userIp',
isTable: false
},
{
title: 'userAgent',
field: 'userAgent'
},
{
title: '操作结果',
field: 'resultCode',
table: {
slots: {
default: 'resultCode'
}
2022-11-17 23:45:47 +08:00
}
},
{
title: '操作结果',
field: 'success',
isTable: false,
2022-11-22 22:43:44 +08:00
isDetail: false,
2022-11-17 23:45:47 +08:00
search: {
show: true,
itemRender: {
name: '$select',
props: { placeholder: t('common.selectText') },
options: [
{ label: '成功', value: 'true' },
{ label: '失败', value: 'false' }
]
}
}
2022-07-18 19:06:37 +08:00
},
2022-11-13 15:38:31 +08:00
{
title: '操作日期',
field: 'startTime',
formatter: 'formatDate',
isForm: false,
search: {
2022-11-15 20:12:32 +08:00
show: true,
2022-11-13 15:38:31 +08:00
itemRender: {
name: 'XDataTimePicker'
}
2022-07-18 19:06:37 +08:00
}
},
2022-11-13 15:38:31 +08:00
{
title: '执行时长',
field: 'duration',
table: {
slots: {
default: 'duration'
}
}
2022-07-18 19:06:37 +08:00
}
2022-11-13 15:38:31 +08:00
]
})
export const { allSchemas } = useVxeCrudSchemas(crudSchemas)