From 59b1faec6ea48926eca9f649853ae9155917f500 Mon Sep 17 00:00:00 2001 From: chenjianxing Date: Mon, 30 Aug 2021 15:57:09 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=AE=9A=E6=97=B6=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E4=BF=9D=E5=AD=98=E6=8A=A5=E9=94=99=20tapdId?= =?UTF-8?q?:=201006049=E3=80=811005818(#5373=20#5495)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/common/cron/CrontabDay.vue | 2 +- .../components/common/cron/CrontabHour.vue | 2 +- .../components/common/cron/CrontabMin.vue | 2 +- .../components/common/cron/CrontabWeek.vue | 38 ++++++++++--------- .../plan/components/ScheduleMaintain.vue | 7 +++- frontend/src/common/js/cron.js | 4 ++ 6 files changed, 33 insertions(+), 22 deletions(-) diff --git a/frontend/src/business/components/common/cron/CrontabDay.vue b/frontend/src/business/components/common/cron/CrontabDay.vue index 11142a0a5c..ea7ee8e2dc 100644 --- a/frontend/src/business/components/common/cron/CrontabDay.vue +++ b/frontend/src/business/components/common/cron/CrontabDay.vue @@ -75,7 +75,7 @@ export default { if (this.radioValue === 1) { this.$emit('update', 'day', '*', 'day'); this.$emit('update', 'week', '?', 'day'); - this.$emit('update', 'mouth', '*', 'day'); + // this.$emit('update', 'mouth', '*', 'day'); } else { if (this.cron.hour === '*') { this.$emit('update', 'hour', '0', 'day'); diff --git a/frontend/src/business/components/common/cron/CrontabHour.vue b/frontend/src/business/components/common/cron/CrontabHour.vue index bbe7918fe9..d67b2d60f9 100644 --- a/frontend/src/business/components/common/cron/CrontabHour.vue +++ b/frontend/src/business/components/common/cron/CrontabHour.vue @@ -53,7 +53,7 @@ export default { radioChange() { if (this.radioValue === 1) { this.$emit('update', 'hour', '*', 'hour'); - this.$emit('update', 'day', '*', 'hour'); + // this.$emit('update', 'day', '*', 'hour'); } else { if (this.cron.min === '*') { this.$emit('update', 'min', '0', 'hour'); diff --git a/frontend/src/business/components/common/cron/CrontabMin.vue b/frontend/src/business/components/common/cron/CrontabMin.vue index 8c8ed1a381..f0cbc7d85e 100644 --- a/frontend/src/business/components/common/cron/CrontabMin.vue +++ b/frontend/src/business/components/common/cron/CrontabMin.vue @@ -58,7 +58,7 @@ export default { switch (this.radioValue) { case 1: this.$emit('update', 'min', '*', 'min'); - this.$emit('update', 'hour', '*', 'min'); + // this.$emit('update', 'hour', '*', 'min'); break; case 2: this.$emit('update', 'min', this.cycle01 + '-' + this.cycle02, 'min'); diff --git a/frontend/src/business/components/common/cron/CrontabWeek.vue b/frontend/src/business/components/common/cron/CrontabWeek.vue index 5b50ff3ef6..72ad1b3aa2 100644 --- a/frontend/src/business/components/common/cron/CrontabWeek.vue +++ b/frontend/src/business/components/common/cron/CrontabWeek.vue @@ -76,31 +76,33 @@ export default { radioChange() { if (this.radioValue === 1) { this.$emit('update', 'week', '*'); - this.$emit('update', 'year', '*'); + this.$emit('update', 'day', '?', 'week'); + // this.$emit('update', 'year', '*'); } else { if (this.radioValue !== 2) { this.$emit('update', 'day', '?', 'week'); } - if (this.cron.mouth === '*') { - this.$emit('update', 'mouth', '1', 'week'); - } - if (this.cron.day === '*') { - this.$emit('update', 'day', '1', 'week'); - } - if (this.cron.hour === '*') { - this.$emit('update', 'hour', '0', 'week'); - } - if (this.cron.min === '*') { - this.$emit('update', 'min', '0', 'week'); - } - if (this.cron.second === '*') { - this.$emit('update', 'second', '0', 'week'); - } + // if (this.cron.mouth === '*') { + // this.$emit('update', 'mouth', '1', 'week'); + // } + // if (this.cron.day === '*') { + // this.$emit('update', 'day', '1', 'week'); + // } + // if (this.cron.hour === '*') { + // this.$emit('update', 'hour', '0', 'week'); + // } + // if (this.cron.min === '*') { + // this.$emit('update', 'min', '0', 'week'); + // } + // if (this.cron.second === '*') { + // this.$emit('update', 'second', '0', 'week'); + // } } switch (this.radioValue) { case 2: - this.$emit('update', 'week', '?'); - break; + // this.$emit('update', 'day', '*'); + this.$emit('update', 'week', '?'); + break; case 3: this.$emit('update', 'week', this.cycle01 + '-' + this.cycle02); break; diff --git a/frontend/src/business/components/track/plan/components/ScheduleMaintain.vue b/frontend/src/business/components/track/plan/components/ScheduleMaintain.vue index 93b595bfe2..482e7fe963 100644 --- a/frontend/src/business/components/track/plan/components/ScheduleMaintain.vue +++ b/frontend/src/business/components/track/plan/components/ScheduleMaintain.vue @@ -310,7 +310,12 @@ export default { this.$refs['from'].validate(); }, showCronDialog() { - this.showCron = true; + let tmp = this.schedule.value; + this.schedule.value = ''; + this.$nextTick(() => { + this.schedule.value = tmp; + this.showCron = true; + }); }, saveCron() { this.$refs['from'].validate((valid) => { diff --git a/frontend/src/common/js/cron.js b/frontend/src/common/js/cron.js index fb1960d093..a97ac2c357 100644 --- a/frontend/src/common/js/cron.js +++ b/frontend/src/common/js/cron.js @@ -50,6 +50,10 @@ export function cronValidate(cronExpression ){ return false; } + if (cronParams[3] === cronParams[5] && cronParams[5] === '?') { + return false; + } + //Check year param if (cronParams.length == 7) { if (!checkYearField(cronParams[6])) {