From 86057832644058b40d416a52ca74f0d2e010847b Mon Sep 17 00:00:00 2001 From: chenjianxing Date: Fri, 3 Sep 2021 13:24:11 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20cron=E8=A1=A8=E8=BE=BE=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/common/cron/CrontabDay.vue | 21 ++++++------- .../components/common/cron/CrontabHour.vue | 15 +++++----- .../components/common/cron/CrontabMin.vue | 6 ++-- .../components/common/cron/CrontabMouth.vue | 29 +++++++++--------- .../components/common/cron/CrontabSecond.vue | 2 +- .../components/common/cron/CrontabYear.vue | 30 +++++++++---------- 6 files changed, 53 insertions(+), 50 deletions(-) diff --git a/frontend/src/business/components/common/cron/CrontabDay.vue b/frontend/src/business/components/common/cron/CrontabDay.vue index ea7ee8e2dc..0127de7690 100644 --- a/frontend/src/business/components/common/cron/CrontabDay.vue +++ b/frontend/src/business/components/common/cron/CrontabDay.vue @@ -76,17 +76,18 @@ export default { this.$emit('update', 'day', '*', 'day'); this.$emit('update', 'week', '?', 'day'); // this.$emit('update', 'mouth', '*', 'day'); - } else { - if (this.cron.hour === '*') { - this.$emit('update', 'hour', '0', 'day'); - } - if (this.cron.min === '*') { - this.$emit('update', 'min', '0', 'day'); - } - if (this.cron.second === '*') { - this.$emit('update', 'second', '0', 'day'); - } } + // else { + // if (this.cron.hour === '*') { + // this.$emit('update', 'hour', '0', 'day'); + // } + // if (this.cron.min === '*') { + // this.$emit('update', 'min', '0', 'day'); + // } + // if (this.cron.second === '*') { + // this.$emit('update', 'second', '0', 'day'); + // } + // } switch (this.radioValue) { case 2: diff --git a/frontend/src/business/components/common/cron/CrontabHour.vue b/frontend/src/business/components/common/cron/CrontabHour.vue index d67b2d60f9..2395027c31 100644 --- a/frontend/src/business/components/common/cron/CrontabHour.vue +++ b/frontend/src/business/components/common/cron/CrontabHour.vue @@ -54,14 +54,15 @@ export default { if (this.radioValue === 1) { this.$emit('update', 'hour', '*', 'hour'); // this.$emit('update', 'day', '*', 'hour'); - } else { - if (this.cron.min === '*') { - this.$emit('update', 'min', '0', 'hour'); - } - if (this.cron.second === '*') { - this.$emit('update', 'second', '0', 'hour'); - } } + // else { + // if (this.cron.min === '*') { + // this.$emit('update', 'min', '0', 'hour'); + // } + // if (this.cron.second === '*') { + // this.$emit('update', 'second', '0', 'hour'); + // } + // } switch (this.radioValue) { case 2: this.$emit('update', 'hour', this.cycle01 + '-' + this.cycle02); diff --git a/frontend/src/business/components/common/cron/CrontabMin.vue b/frontend/src/business/components/common/cron/CrontabMin.vue index f0cbc7d85e..743d72120f 100644 --- a/frontend/src/business/components/common/cron/CrontabMin.vue +++ b/frontend/src/business/components/common/cron/CrontabMin.vue @@ -52,9 +52,9 @@ export default { methods: { // 单选按钮值变化时 radioChange() { - if (this.radioValue !== 1 && this.cron.second === '*') { - this.$emit('update', 'second', '0', 'min'); - } + // if (this.radioValue !== 1 && this.cron.second === '*') { + // this.$emit('update', 'second', '0', 'min'); + // } switch (this.radioValue) { case 1: this.$emit('update', 'min', '*', 'min'); diff --git a/frontend/src/business/components/common/cron/CrontabMouth.vue b/frontend/src/business/components/common/cron/CrontabMouth.vue index 43def925d5..4b0575ebaf 100644 --- a/frontend/src/business/components/common/cron/CrontabMouth.vue +++ b/frontend/src/business/components/common/cron/CrontabMouth.vue @@ -53,21 +53,22 @@ export default { radioChange() { if (this.radioValue === 1) { this.$emit('update', 'mouth', '*'); - this.$emit('update', 'year', '*'); - } else { - if (this.cron.day === '*') { - this.$emit('update', 'day', '1', 'mouth'); - } - if (this.cron.hour === '*') { - this.$emit('update', 'hour', '0', 'mouth'); - } - if (this.cron.min === '*') { - this.$emit('update', 'min', '0', 'mouth'); - } - if (this.cron.second === '*') { - this.$emit('update', 'second', '0', 'mouth'); - } + // this.$emit('update', 'year', '*'); } + // else { + // if (this.cron.day === '*') { + // this.$emit('update', 'day', '1', 'mouth'); + // } + // if (this.cron.hour === '*') { + // this.$emit('update', 'hour', '0', 'mouth'); + // } + // if (this.cron.min === '*') { + // this.$emit('update', 'min', '0', 'mouth'); + // } + // if (this.cron.second === '*') { + // this.$emit('update', 'second', '0', 'mouth'); + // } + // } switch (this.radioValue) { case 2: this.$emit('update', 'mouth', this.cycle01 + '-' + this.cycle02); diff --git a/frontend/src/business/components/common/cron/CrontabSecond.vue b/frontend/src/business/components/common/cron/CrontabSecond.vue index 4e483fd179..f8221e04ff 100644 --- a/frontend/src/business/components/common/cron/CrontabSecond.vue +++ b/frontend/src/business/components/common/cron/CrontabSecond.vue @@ -54,7 +54,7 @@ switch (this.radioValue) { case 1: this.$emit('update', 'second', '*', 'second'); - this.$emit('update', 'min', '*', 'second'); + // this.$emit('update', 'min', '*', 'second'); break; case 2: this.$emit('update', 'second', this.cycle01 + '-' + this.cycle02); diff --git a/frontend/src/business/components/common/cron/CrontabYear.vue b/frontend/src/business/components/common/cron/CrontabYear.vue index f6775d6de4..628e20016b 100644 --- a/frontend/src/business/components/common/cron/CrontabYear.vue +++ b/frontend/src/business/components/common/cron/CrontabYear.vue @@ -59,21 +59,21 @@ export default { methods: { // 单选按钮值变化时 radioChange() { - if (this.cron.mouth === '*') { - this.$emit('update', 'mouth', '1', 'year'); - } - if (this.cron.day === '*') { - this.$emit('update', 'day', '1', 'year'); - } - if (this.cron.hour === '*') { - this.$emit('update', 'hour', '0', 'year'); - } - if (this.cron.min === '*') { - this.$emit('update', 'min', '0', 'year'); - } - if (this.cron.second === '*') { - this.$emit('update', 'second', '0', 'year'); - } + // if (this.cron.mouth === '*') { + // this.$emit('update', 'mouth', '1', 'year'); + // } + // if (this.cron.day === '*') { + // this.$emit('update', 'day', '1', 'year'); + // } + // if (this.cron.hour === '*') { + // this.$emit('update', 'hour', '0', 'year'); + // } + // if (this.cron.min === '*') { + // this.$emit('update', 'min', '0', 'year'); + // } + // if (this.cron.second === '*') { + // this.$emit('update', 'second', '0', 'year'); + // } switch (this.radioValue) { case 1: this.$emit('update', 'year', '');