diff --git a/frontend/src/business/components/api/automation/schedule/ScheduleMaintain.vue b/frontend/src/business/components/api/automation/schedule/ScheduleMaintain.vue index 4a7b17e7ad..d71d37b315 100644 --- a/frontend/src/business/components/api/automation/schedule/ScheduleMaintain.vue +++ b/frontend/src/business/components/api/automation/schedule/ScheduleMaintain.vue @@ -10,10 +10,10 @@
1
{{ $t('schedule.edit_timer_task') }} - + + prop="cronValue" style="height: 50px"> { return getCurrentUser(); }, + intervalValidate() { + if (this.getIntervalTime() < 1 * 60 * 1000) { + return false; + } + return true; + }, changeMode() { this.runConfig.runWithinResourcePool = false; this.runConfig.resourcePoolId = null; @@ -511,4 +520,8 @@ export default { margin-right: 4px; margin-left: 10px; } +.ms-el-form-item__error >>> .el-form-item__error{ + left: -42px; + padding-top: 0px; +} diff --git a/frontend/src/business/components/api/definition/components/import/ApiSchedule.vue b/frontend/src/business/components/api/definition/components/import/ApiSchedule.vue index b7ff2c75d2..ea00500c69 100644 --- a/frontend/src/business/components/api/definition/components/import/ApiSchedule.vue +++ b/frontend/src/business/components/api/definition/components/import/ApiSchedule.vue @@ -175,7 +175,10 @@ export default { callback(new Error(this.$t('schedule.cron_expression_format_error'))); } else if (!customValidate.pass) { callback(new Error(customValidate.info)); - } else { + }else if(!this.intervalValidate()){ + callback(new Error(this.$t('schedule.cron_expression_interval_error'))); + } + else { callback(); } }; @@ -332,6 +335,12 @@ export default { this.clear(); }); }, + intervalValidate() { + if (this.getIntervalTime() < 1 * 60 * 1000) { + return false; + } + return true; + }, intervalShortValidate() { if (this.getIntervalTime() < 3 * 60 * 1000) { this.$info(this.$t('schedule.cron_expression_interval_short_error')); diff --git a/frontend/src/business/components/api/definition/components/import/ImportScheduleEdit.vue b/frontend/src/business/components/api/definition/components/import/ImportScheduleEdit.vue index 7ebb18d9f2..c895f3679d 100644 --- a/frontend/src/business/components/api/definition/components/import/ImportScheduleEdit.vue +++ b/frontend/src/business/components/api/definition/components/import/ImportScheduleEdit.vue @@ -81,7 +81,10 @@ export default { callback(new Error(this.$t('commons.input_content'))); } else if (!cronValidate(cronValue)) { callback(new Error(this.$t('schedule.cron_expression_format_error'))); - } else if (!customValidate.pass) { + }else if(!this.intervalValidate()){ + callback(new Error(this.$t('schedule.cron_expression_interval_error'))); + } + else if (!customValidate.pass) { callback(new Error(customValidate.info)); } else { callback(); @@ -113,6 +116,12 @@ export default { currentUser: () => { return getCurrentUser(); }, + intervalValidate() { + if (this.getIntervalTime() < 1 * 60 * 1000) { + return false; + } + return true; + }, open(param) { this.$post("/api/definition/getResourceId", param, response => { this.paramSwaggerUrlId = response.data diff --git a/frontend/src/business/components/common/components/MsScheduleEdit.vue b/frontend/src/business/components/common/components/MsScheduleEdit.vue index 54d2682716..666f3fab06 100644 --- a/frontend/src/business/components/common/components/MsScheduleEdit.vue +++ b/frontend/src/business/components/common/components/MsScheduleEdit.vue @@ -9,9 +9,9 @@
1
{{ $t('schedule.edit_timer_task') }} - + + prop="cronValue" style="height: 50px"> { - this.scheduleTask = response.data; - }) - } - },*/ + intervalValidate() { + if (this.getIntervalTime() < 1 * 60 * 1000) { + return false; + } + return true; + }, buildParam() { let param = {}; param.notices = this.tableData; @@ -240,5 +238,8 @@ export default { font-size: 13px; cursor: pointer; } - +.ms-el-form-item__error >>> .el-form-item__error{ + left: 100px; + padding-top: 0px; +} diff --git a/frontend/src/business/components/track/plan/components/ScheduleMaintain.vue b/frontend/src/business/components/track/plan/components/ScheduleMaintain.vue index 0c7ea16ddd..3c2d9aeedd 100644 --- a/frontend/src/business/components/track/plan/components/ScheduleMaintain.vue +++ b/frontend/src/business/components/track/plan/components/ScheduleMaintain.vue @@ -12,9 +12,9 @@
1
{{ $t('schedule.edit_timer_task') }} - + + prop="cronValue" style="height: 50px"> { return getCurrentUser(); }, + intervalValidate() { + if (this.getIntervalTime() < 1 * 60 * 1000) { + return false; + } + return true; + }, scheduleChange() { let flag = this.schedule.enable; let param = {}; @@ -488,4 +497,9 @@ export default { /* display: inline-flex; */ } +.ms-el-form-item__error >>> .el-form-item__error{ + left: -42px; + padding-top: 0px; +} + diff --git a/frontend/src/i18n/en-US.js b/frontend/src/i18n/en-US.js index 583cf3d5c2..17bbceb512 100644 --- a/frontend/src/i18n/en-US.js +++ b/frontend/src/i18n/en-US.js @@ -2535,6 +2535,7 @@ export default { generate_expression: "Generate Expression", cron_expression_format_error: "Cron Expression Format Error", cron_expression_interval_short_error: "Interval time shorter than 3 minutes, please avoid running tests that take too long", + cron_expression_interval_error: "The interval cannot be less than 1 minute", cron: { seconds: "Seconds", minutes: "Minutes", diff --git a/frontend/src/i18n/zh-CN.js b/frontend/src/i18n/zh-CN.js index 353d2c7efa..52eecfd272 100644 --- a/frontend/src/i18n/zh-CN.js +++ b/frontend/src/i18n/zh-CN.js @@ -2539,6 +2539,7 @@ export default { generate_expression: "自动生成", cron_expression_format_error: "Cron 表达式格式错误", cron_expression_interval_short_error: "间隔时间小于 3 分钟, 请避免执行耗时过长的测试", + cron_expression_interval_error: "间隔时间不能小于 1 分钟", cron: { seconds: "秒", minutes: "分钟", diff --git a/frontend/src/i18n/zh-TW.js b/frontend/src/i18n/zh-TW.js index ff9913cdd4..3a479f4e49 100644 --- a/frontend/src/i18n/zh-TW.js +++ b/frontend/src/i18n/zh-TW.js @@ -2538,6 +2538,7 @@ export default { generate_expression: "自动生成", cron_expression_format_error: "Cron 表達式格式錯誤", cron_expression_interval_short_error: "間隔時間小於 3 分鐘, 請避免執行耗時過長的測試", + cron_expression_interval_error: "間隔時間不能小於 1 分鐘", cron: { seconds: "秒", minutes: "分鐘",