fix: 调度任务页面排版

This commit is contained in:
TsMask
2024-01-10 15:21:36 +08:00
parent c174af7d8f
commit 3d8b2d35d7
2 changed files with 23 additions and 12 deletions

View File

@@ -109,39 +109,45 @@ let tableColumns: ColumnsType = [
title: t('views.monitor.job.jobName'), title: t('views.monitor.job.jobName'),
dataIndex: 'jobName', dataIndex: 'jobName',
align: 'left', align: 'left',
width: 200,
}, },
{ {
title: t('views.monitor.job.jobGroup'), title: t('views.monitor.job.jobGroup'),
dataIndex: 'jobGroup', dataIndex: 'jobGroup',
key: 'jobGroup', key: 'jobGroup',
align: 'center', align: 'center',
width: 100,
}, },
{ {
title: t('views.monitor.job.invokeTarget'), title: t('views.monitor.job.invokeTarget'),
dataIndex: 'invokeTarget', dataIndex: 'invokeTarget',
align: 'left', align: 'left',
width: 100,
}, },
{ {
title: t('views.monitor.job.cronExpression'), title: t('views.monitor.job.cronExpression'),
dataIndex: 'cronExpression', dataIndex: 'cronExpression',
align: 'left', align: 'left',
width: 100,
}, },
{ {
title: t('views.monitor.job.status'), title: t('views.monitor.job.status'),
dataIndex: 'status', dataIndex: 'status',
key: 'status', key: 'status',
align: 'center', align: 'center',
width: 100,
}, },
{ {
title: t('views.monitor.job.saveLog'), title: t('views.monitor.job.saveLog'),
dataIndex: 'saveLog', dataIndex: 'saveLog',
key: 'saveLog', key: 'saveLog',
align: 'center', align: 'center',
width: 100,
}, },
{ {
title: t('common.operate'), title: t('common.operate'),
key: 'jobId', key: 'jobId',
align: 'center', align: 'left',
}, },
]; ];
@@ -756,7 +762,7 @@ onMounted(() => {
:size="tableState.size" :size="tableState.size"
:row-class-name="fnTableStriped" :row-class-name="fnTableStriped"
:pagination="tablePagination" :pagination="tablePagination"
:scroll="{ x: true }" :scroll="{ x: tableColumns.length * 120 }"
:row-selection="{ :row-selection="{
type: 'checkbox', type: 'checkbox',
selectedRowKeys: tableState.selectedRowKeys, selectedRowKeys: tableState.selectedRowKeys,
@@ -769,16 +775,15 @@ onMounted(() => {
</template> </template>
<template v-if="column.key === 'status'"> <template v-if="column.key === 'status'">
<a-switch <a-switch
v-if="hasPermissions(['monitor:job:changeStatus'])" v-if="
dict.sysJobStatus.length > 0 &&
hasPermissions(['monitor:job:changeStatus'])
"
v-model:checked="record.status" v-model:checked="record.status"
checked-value="1" checked-value="1"
:checked-children=" :checked-children="dict.sysJobStatus[0].label"
dict.sysJobStatus.find(s => s.value === '1')?.label
"
un-checked-value="0" un-checked-value="0"
:un-checked-children=" :un-checked-children="dict.sysJobStatus[1].label"
dict.sysJobStatus.find(s => s.value === '0')?.label
"
size="small" size="small"
@change="fnRecordStatus(record)" @change="fnRecordStatus(record)"
/> />

View File

@@ -127,28 +127,33 @@ let tableColumns: ColumnsType = [
title: t('views.monitor.jobLog.jobName'), title: t('views.monitor.jobLog.jobName'),
dataIndex: 'jobName', dataIndex: 'jobName',
align: 'left', align: 'left',
width: 200,
}, },
{ {
title: t('views.monitor.jobLog.jobGroup'), title: t('views.monitor.jobLog.jobGroup'),
dataIndex: 'jobGroup', dataIndex: 'jobGroup',
key: 'jobGroup', key: 'jobGroup',
align: 'center', align: 'center',
width: 100,
}, },
{ {
title: t('views.monitor.jobLog.invokeTarget'), title: t('views.monitor.jobLog.invokeTarget'),
dataIndex: 'invokeTarget', dataIndex: 'invokeTarget',
align: 'left', align: 'left',
width: 100,
}, },
{ {
title: t('views.monitor.jobLog.status'), title: t('views.monitor.jobLog.status'),
dataIndex: 'status', dataIndex: 'status',
key: 'status', key: 'status',
align: 'center', align: 'center',
width: 100,
}, },
{ {
title: t('views.monitor.jobLog.createTime'), title: t('views.monitor.jobLog.createTime'),
dataIndex: 'createTime', dataIndex: 'createTime',
align: 'center', align: 'center',
width: 150,
customRender(opt) { customRender(opt) {
if (+opt.value <= 0) return ''; if (+opt.value <= 0) return '';
return parseDateToStr(+opt.value); return parseDateToStr(+opt.value);
@@ -158,7 +163,8 @@ let tableColumns: ColumnsType = [
title: t('views.monitor.jobLog.costTime'), title: t('views.monitor.jobLog.costTime'),
dataIndex: 'costTime', dataIndex: 'costTime',
key: 'costTime', key: 'costTime',
align: 'center', align: 'right',
width: 100,
customRender(opt) { customRender(opt) {
return `${opt.value} ms`; return `${opt.value} ms`;
}, },
@@ -166,7 +172,7 @@ let tableColumns: ColumnsType = [
{ {
title: t('common.operate'), title: t('common.operate'),
key: 'jobLogId', key: 'jobLogId',
align: 'center', align: 'left',
}, },
]; ];
@@ -592,7 +598,7 @@ onMounted(() => {
:data-source="tableState.data" :data-source="tableState.data"
:size="tableState.size" :size="tableState.size"
:row-class-name="fnTableStriped" :row-class-name="fnTableStriped"
:scroll="{ x: true }" :scroll="{ x: tableColumns.length * 120 }"
:pagination="tablePagination" :pagination="tablePagination"
:row-selection="{ :row-selection="{
type: 'checkbox', type: 'checkbox',