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: '幫助文檔',