From 629204f270ce7ba45c2cc9ad85e24df417292a58 Mon Sep 17 00:00:00 2001 From: xlsea Date: Mon, 24 Jun 2024 16:35:11 +0800 Subject: [PATCH] =?UTF-8?q?style(sj=5Fmap=5Freduce):=20=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E6=89=B9=E6=AC=A1=E6=93=8D=E4=BD=9C=E6=8C=89?= =?UTF-8?q?=E9=92=AE=E6=A0=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/job/batch/index.vue | 90 +++++++++++++++++++++-------------- 1 file changed, 55 insertions(+), 35 deletions(-) diff --git a/src/views/job/batch/index.vue b/src/views/job/batch/index.vue index ce9159a..c9c9cab 100644 --- a/src/views/job/batch/index.vue +++ b/src/views/job/batch/index.vue @@ -159,41 +159,61 @@ const { columnChecks, columns, data, getData, loading, mobilePagination, searchP title: $t('common.operate'), align: 'center', width: 130, - render: row => ( -
- - {$t('common.log')} - - {row.taskBatchStatus === 1 || row.taskBatchStatus === 2 ? ( - handleStopJob(row.id!)}> - {{ - default: () => $t('common.confirmStop'), - trigger: () => ( - - {$t('common.stop')} - - ) - }} - - ) : ( - '' - )} - {row.taskBatchStatus === 4 || row.taskBatchStatus === 5 || row.taskBatchStatus === 6 ? ( - handleRetryJob(row.id!)}> - {{ - default: () => $t('common.confirmRetry'), - trigger: () => ( - - {$t('common.retry')} - - ) - }} - - ) : ( - '' - )} -
- ) + render: row => { + const stopBtn = () => { + if (row.taskBatchStatus === 1 || row.taskBatchStatus === 2) { + return ( + <> + + handleStopJob(row.id!)}> + {{ + default: () => $t('common.confirmStop'), + trigger: () => ( + <> + + + {$t('common.stop')} + + + ) + }} + + + ); + } + return null; + }; + + const retryBtn = () => { + if (row.taskBatchStatus === 4 || row.taskBatchStatus === 5 || row.taskBatchStatus === 6) { + return ( + <> + + handleRetryJob(row.id!)}> + {{ + default: () => $t('common.confirmRetry'), + trigger: () => ( + + {$t('common.retry')} + + ) + }} + + + ); + } + return null; + }; + return ( +
+ + {$t('common.log')} + + {stopBtn()} + {retryBtn()} +
+ ); + } } ] });