feat: 优化 system

This commit is contained in:
xingyu4j
2025-06-24 17:35:43 +08:00
parent 9821f134fc
commit 34730ab1a0
22 changed files with 483 additions and 275 deletions

View File

@@ -1,6 +1,12 @@
import type { VbenFormSchema } from '#/adapter/form';
import type { VxeTableGridOptions } from '#/adapter/vxe-table';
import type { DescriptionItemSchema } from '#/components/description';
import { h } from 'vue';
import { formatDateTime } from '@vben/utils';
import { DictTag } from '#/components/dict-tag';
import { DICT_TYPE, getRangePickerDefaultProps } from '#/utils';
/** 列表的搜索表单 */
@@ -84,3 +90,50 @@ export function useGridColumns(): VxeTableGridOptions['columns'] {
},
];
}
/** 详情页的字段 */
export function useDetailSchema(): DescriptionItemSchema[] {
return [
{
field: 'id',
label: '日志编号',
},
{
field: 'logType',
label: '操作类型',
content: (data) => {
return h(DictTag, {
type: DICT_TYPE.SYSTEM_LOGIN_TYPE,
value: data?.logType,
});
},
},
{
field: 'username',
label: '用户名称',
},
{
field: 'userIp',
label: '登录地址',
},
{
field: 'userAgent',
label: '浏览器',
},
{
field: 'result',
label: '登录结果',
content: (data) => {
return h(DictTag, {
type: DICT_TYPE.SYSTEM_LOGIN_RESULT,
value: data?.result,
});
},
},
{
field: 'createTime',
label: '登录日期',
content: (data) => formatDateTime(data?.createTime || '') as string,
},
];
}