From 3a6059263fb6ceda415e8dc1db5be65cb5734466 Mon Sep 17 00:00:00 2001 From: TsMask <340112800@qq.com> Date: Tue, 21 Nov 2023 19:48:49 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=B0=83=E5=BA=A6=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=E7=8A=B6=E6=80=81=E5=A4=9A=E8=AF=AD=E8=A8=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/i18n/locales/en-US.ts | 4 ---- src/i18n/locales/zh-CN.ts | 4 ---- src/views/monitor/job/index.vue | 27 ++++++++++++++++----------- 3 files changed, 16 insertions(+), 19 deletions(-) diff --git a/src/i18n/locales/en-US.ts b/src/i18n/locales/en-US.ts index 641d0a50..323b811c 100644 --- a/src/i18n/locales/en-US.ts +++ b/src/i18n/locales/en-US.ts @@ -865,10 +865,6 @@ export default { cronExpressionTip1: "Illustrative example: Execute tasks every 20 seconds", cronExpressionNew: "Generating Expressions", status: "Status", - status0: "Disable", - status1: "Opens", - status00: "Pause", - status01: "Active", statusChange: "Are you sure you want the {text} {num} job?", saveLog: "Recording log", tipRowErr: "Errors in the recording of jobs", diff --git a/src/i18n/locales/zh-CN.ts b/src/i18n/locales/zh-CN.ts index 43de513b..ea370570 100644 --- a/src/i18n/locales/zh-CN.ts +++ b/src/i18n/locales/zh-CN.ts @@ -865,10 +865,6 @@ export default { cronExpressionTip1: "示例说明:每20秒执行任务", cronExpressionNew: "生成表达式", status: "状态", - status0: "关闭", - status1: "开启", - status00: "暂停", - status01: "正常", statusChange: "确定要{text} {num} 任务吗?", saveLog: "记录日志", tipRowErr: "任务记录存在错误", diff --git a/src/views/monitor/job/index.vue b/src/views/monitor/job/index.vue index 61424ce0..ad9d65cb 100644 --- a/src/views/monitor/job/index.vue +++ b/src/views/monitor/job/index.vue @@ -377,8 +377,8 @@ function fnModalCron(opt: boolean, cronStr?: string) { function fnRecordStatus(row: Record) { const text = row.status === '1' - ? t('views.monitor.job.status1') - : t('views.monitor.job.status0'); + ? dict.sysJobStatus.find(s => s.value === '1')?.label + : dict.sysJobStatus.find(s => s.value === '0')?.label; Modal.confirm({ title: t('common.tipTitle'), content: t('views.monitor.job.statusChange', { text, num: row.jobName }), @@ -403,7 +403,11 @@ function fnRecordStatus(row: Record) { }); }, onCancel() { - row.status = row.status === '1' ? '0' : '1'; + const value = + row.status === '1' + ? dict.sysJobStatus.find(s => s.value === '0')?.value + : dict.sysJobStatus.find(s => s.value === '1')?.value; + row.status = value || '0'; }, }); } @@ -768,9 +772,13 @@ onMounted(() => { v-if="hasPermissions(['monitor:job:changeStatus'])" v-model:checked="record.status" checked-value="1" - :checked-children="t('views.monitor.job.status01')" + :checked-children=" + dict.sysJobStatus.find(s => s.value === '1')?.label + " un-checked-value="0" - :un-checked-children="t('views.monitor.job.status00')" + :un-checked-children=" + dict.sysJobStatus.find(s => s.value === '0')?.label + " size="small" @change="fnRecordStatus(record)" /> @@ -858,10 +866,7 @@ onMounted(() => { {{ - [ - t('views.monitor.job.status00'), - t('views.monitor.job.status01'), - ][+modalState.from.status] + dict.sysJobStatus.find(s => s.value === modalState.from.status)?.label }} @@ -1086,7 +1091,7 @@ onMounted(() => { - + { - +