style(sj_map_reduce): 优化任务批次操作按钮栏
This commit is contained in:
parent
34826d7ea4
commit
629204f270
@ -159,26 +159,36 @@ const { columnChecks, columns, data, getData, loading, mobilePagination, searchP
|
||||
title: $t('common.operate'),
|
||||
align: 'center',
|
||||
width: 130,
|
||||
render: row => (
|
||||
<div class="flex-center gap-8px">
|
||||
<NButton type="primary" text ghost size="small" onClick={handleLog}>
|
||||
{$t('common.log')}
|
||||
</NButton>
|
||||
{row.taskBatchStatus === 1 || row.taskBatchStatus === 2 ? (
|
||||
render: row => {
|
||||
const stopBtn = () => {
|
||||
if (row.taskBatchStatus === 1 || row.taskBatchStatus === 2) {
|
||||
return (
|
||||
<>
|
||||
<n-divider vertical />
|
||||
<NPopconfirm onPositiveClick={() => handleStopJob(row.id!)}>
|
||||
{{
|
||||
default: () => $t('common.confirmStop'),
|
||||
trigger: () => (
|
||||
<>
|
||||
<n-divider vertical />
|
||||
<NButton type="error" text ghost size="small">
|
||||
{$t('common.stop')}
|
||||
</NButton>
|
||||
</>
|
||||
)
|
||||
}}
|
||||
</NPopconfirm>
|
||||
) : (
|
||||
''
|
||||
)}
|
||||
{row.taskBatchStatus === 4 || row.taskBatchStatus === 5 || row.taskBatchStatus === 6 ? (
|
||||
</>
|
||||
);
|
||||
}
|
||||
return null;
|
||||
};
|
||||
|
||||
const retryBtn = () => {
|
||||
if (row.taskBatchStatus === 4 || row.taskBatchStatus === 5 || row.taskBatchStatus === 6) {
|
||||
return (
|
||||
<>
|
||||
<n-divider vertical />
|
||||
<NPopconfirm onPositiveClick={() => handleRetryJob(row.id!)}>
|
||||
{{
|
||||
default: () => $t('common.confirmRetry'),
|
||||
@ -189,11 +199,21 @@ const { columnChecks, columns, data, getData, loading, mobilePagination, searchP
|
||||
)
|
||||
}}
|
||||
</NPopconfirm>
|
||||
) : (
|
||||
''
|
||||
)}
|
||||
</>
|
||||
);
|
||||
}
|
||||
return null;
|
||||
};
|
||||
return (
|
||||
<div class="flex-center gap-8px">
|
||||
<NButton type="primary" text ghost size="small" onClick={handleLog}>
|
||||
{$t('common.log')}
|
||||
</NButton>
|
||||
{stopBtn()}
|
||||
{retryBtn()}
|
||||
</div>
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user