reactor:【infra 基础设施】job/logger 进一步统一代码风格

This commit is contained in:
YunaiV
2025-09-09 18:44:42 +08:00
parent b3a65f2492
commit 08b4176fb3
4 changed files with 48 additions and 67 deletions

View File

@@ -71,26 +71,32 @@ export function useGridColumns(): VxeTableGridOptions['columns'] {
{
field: 'id',
title: '日志编号',
minWidth: 80,
},
{
field: 'jobId',
title: '任务编号',
minWidth: 80,
},
{
field: 'handlerName',
title: '处理器的名字',
minWidth: 180,
},
{
field: 'handlerParam',
title: '处理器的参数',
minWidth: 140,
},
{
field: 'executeIndex',
title: '第几次执行',
minWidth: 100,
},
{
field: 'beginTime',
title: '执行时间',
minWidth: 280,
formatter: ({ row }) => {
return `${formatDateTime(row.beginTime)} ~ ${formatDateTime(row.endTime)}`;
},
@@ -98,11 +104,15 @@ export function useGridColumns(): VxeTableGridOptions['columns'] {
{
field: 'duration',
title: '执行时长',
formatter: ({ cellValue }) => `${cellValue} 毫秒`,
minWidth: 120,
formatter: ({ row }) => {
return `${row.duration} 毫秒`;
},
},
{
field: 'status',
title: '任务状态',
minWidth: 100,
cellRender: {
name: 'CellDict',
props: { type: DICT_TYPE.INFRA_JOB_LOG_STATUS },

View File

@@ -32,12 +32,9 @@ function handleDetail(row: InfraJobLogApi.JobLog) {
detailModalApi.setData({ id: row.id }).open();
}
// 获取表单schema并设置默认jobId
const formSchema = useGridFormSchema();
const [Grid, gridApi] = useVbenVxeGrid({
formOptions: {
schema: formSchema,
schema: useGridFormSchema(),
},
gridOptions: {
columns: useGridColumns(),
@@ -57,6 +54,7 @@ const [Grid, gridApi] = useVbenVxeGrid({
},
rowConfig: {
keyField: 'id',
isHover: true,
},
toolbarConfig: {
refresh: true,