From 9cc51b9e56d484813caab5dd656a8d564c68bb97 Mon Sep 17 00:00:00 2001 From: limin-fit2 Date: Wed, 16 Feb 2022 13:44:25 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E5=AE=9A=E6=97=B6=E4=BB=BB=E5=8A=A1):=20?= =?UTF-8?q?=E5=AE=9A=E6=97=B6=E4=BB=BB=E5=8A=A1=E9=A1=B5=E9=9D=A2=E5=BC=80?= =?UTF-8?q?=E5=85=B3=E7=8A=B6=E6=80=81=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=ID1010211 【ID1010211】【定时任务】github#10422,优化定时任务保存按钮】https://www.tapd.cn/55049933/bugtrace/bugs/view?bug_id=1155049933001010211 --- .../metersphere/service/ScheduleService.java | 2 +- .../automation/schedule/ScheduleMaintain.vue | 39 ++++++++++++------- .../plan/components/ScheduleMaintain.vue | 37 +++++++++++------- frontend/src/i18n/en-US.js | 3 ++ frontend/src/i18n/zh-CN.js | 3 ++ frontend/src/i18n/zh-TW.js | 3 ++ 6 files changed, 59 insertions(+), 28 deletions(-) diff --git a/backend/src/main/java/io/metersphere/service/ScheduleService.java b/backend/src/main/java/io/metersphere/service/ScheduleService.java index 7006172a75..4e0e42819a 100644 --- a/backend/src/main/java/io/metersphere/service/ScheduleService.java +++ b/backend/src/main/java/io/metersphere/service/ScheduleService.java @@ -164,7 +164,7 @@ public class ScheduleService { public Schedule buildApiTestSchedule(ScheduleRequest request) { Schedule schedule = new Schedule(); schedule.setResourceId(request.getResourceId()); - schedule.setEnable(true); + schedule.setEnable(request.getEnable()); schedule.setValue(request.getValue().trim()); schedule.setKey(request.getResourceId()); schedule.setUserId(SessionUtils.getUser().getId()); diff --git a/frontend/src/business/components/api/automation/schedule/ScheduleMaintain.vue b/frontend/src/business/components/api/automation/schedule/ScheduleMaintain.vue index b07d7be391..71796ec8b8 100644 --- a/frontend/src/business/components/api/automation/schedule/ScheduleMaintain.vue +++ b/frontend/src/business/components/api/automation/schedule/ScheduleMaintain.vue @@ -6,22 +6,29 @@
- - - + + + - + + + + + {{ $t('commons.save') }} - - + + + + + + @@ -116,6 +123,7 @@ export default { dialogVisible: false, schedule: { value: "", + enable: true }, scheduleTaskType: "", testId: String, @@ -211,13 +219,16 @@ export default { this.activeName = 'first'; }, findSchedule() { - var scheduleResourceID = this.testId; - var taskType = this.scheduleTaskType; + let scheduleResourceID = this.testId; + let taskType = this.scheduleTaskType; this.result = this.$get("/schedule/findOne/" + scheduleResourceID + "/" + taskType, response => { if (response.data != null) { this.schedule = response.data; } else { - this.schedule = {}; + this.schedule = { + value: '', + enable: true + }; } }); }, @@ -240,7 +251,7 @@ export default { if (valid) { this.intervalShortValidate(); let formCronValue = this.form.cronValue; - this.schedule.enable = true; + // this.schedule.enable = true; this.schedule.value = formCronValue; this.saveSchedule(); this.dialogVisible = false; diff --git a/frontend/src/business/components/track/plan/components/ScheduleMaintain.vue b/frontend/src/business/components/track/plan/components/ScheduleMaintain.vue index ef390aae96..dd88000b21 100644 --- a/frontend/src/business/components/track/plan/components/ScheduleMaintain.vue +++ b/frontend/src/business/components/track/plan/components/ScheduleMaintain.vue @@ -13,21 +13,28 @@
{{ $t('schedule.edit_timer_task') }} - - + + - + + + + + {{ $t('commons.save') }} - - + + + + + + @@ -192,6 +199,7 @@ export default { dialogVisible: false, schedule: { value: "", + enable: true, }, scheduleTaskType: "", testId: String, @@ -290,8 +298,8 @@ export default { this.getResourcePools(); }, findSchedule() { - var scheduleResourceID = this.testId; - var taskType = this.scheduleTaskType; + let scheduleResourceID = this.testId; + let taskType = this.scheduleTaskType; this.result = this.$get("/schedule/findOne/" + scheduleResourceID + "/" + taskType, response => { if (response.data != null) { this.schedule = response.data; @@ -299,7 +307,10 @@ export default { this.runConfig = JSON.parse(response.data.config); } } else { - this.schedule = {}; + this.schedule = { + value: '', + enable: true + }; } }); }, @@ -322,7 +333,7 @@ export default { if (valid) { this.intervalShortValidate(); let formCronValue = this.form.cronValue; - this.schedule.enable = true; + // this.schedule.enable = true; this.schedule.value = formCronValue; this.saveSchedule(); this.dialogVisible = false; diff --git a/frontend/src/i18n/en-US.js b/frontend/src/i18n/en-US.js index 9215ca1b5d..bef163122b 100644 --- a/frontend/src/i18n/en-US.js +++ b/frontend/src/i18n/en-US.js @@ -33,6 +33,9 @@ export default { cut_back_new_version: 'Switch back to new version', comment: 'Comment', close_schedule: 'Close Schedule', + open_schedule: 'Start Schedule', + schedule_switch: 'Schedule Switch', + schedule_cron_title: 'Schedule Time Expression', review_complete: 'Review Completed', examples: 'examples', help_documentation: 'Help', diff --git a/frontend/src/i18n/zh-CN.js b/frontend/src/i18n/zh-CN.js index ae20335960..06cbc64086 100644 --- a/frontend/src/i18n/zh-CN.js +++ b/frontend/src/i18n/zh-CN.js @@ -33,6 +33,9 @@ export default { cut_back_new_version: '切回新版', comment: '评论', close_schedule: '关闭定时任务', + open_schedule: '开启定时任务', + schedule_switch: '定时任务开关', + schedule_cron_title: '定时任务时间表达式', review_complete: '评审完成', examples: '示例', help_documentation: '帮助文档', diff --git a/frontend/src/i18n/zh-TW.js b/frontend/src/i18n/zh-TW.js index 941a6c2b8e..3ff4802a82 100644 --- a/frontend/src/i18n/zh-TW.js +++ b/frontend/src/i18n/zh-TW.js @@ -33,6 +33,9 @@ export default { cut_back_new_version: '切回新版', comment: '評論', close_schedule: '關閉定時任務', + open_schedule: '開啟定時任務', + schedule_switch: '定時任務開關', + schedule_cron_title: '定時任務時間運算式', review_complete: '評審完成', examples: '示例', help_documentation: '幫助文檔',