From 34f2552cad396ce79a7cf4a50a15ff8bf5d817b6 Mon Sep 17 00:00:00 2001
From: fuzui <73400@163.com>
Date: 星期二, 30 十一月 2021 00:17:12 +0800
Subject: [PATCH] fix: crontab组件互斥bug
---
ruoyi-ui/src/components/Crontab/week.vue | 25 ++----------
ruoyi-ui/src/components/Crontab/index.vue | 7 +++
ruoyi-ui/src/components/Crontab/min.vue | 4 --
ruoyi-ui/src/components/Crontab/year.vue | 15 -------
ruoyi-ui/src/components/Crontab/second.vue | 1
ruoyi-ui/src/components/Crontab/hour.vue | 14 +-----
ruoyi-ui/src/components/Crontab/month.vue | 20 +--------
ruoyi-ui/src/components/Crontab/day.vue | 19 ++-------
8 files changed, 22 insertions(+), 83 deletions(-)
diff --git a/ruoyi-ui/src/components/Crontab/day.vue b/ruoyi-ui/src/components/Crontab/day.vue
index bf9f566..bccd1d7 100644
--- a/ruoyi-ui/src/components/Crontab/day.vue
+++ b/ruoyi-ui/src/components/Crontab/day.vue
@@ -72,23 +72,14 @@
// 鍗曢�夋寜閽�煎彉鍖栨椂
radioChange() {
('day rachange');
- if (this.radioValue === 1) {
- this.$emit('update', 'day', '*', 'day');
- this.$emit('update', 'week', '?', 'day');
- this.$emit('update', 'month', '*', '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');
- }
+ if (this.radioValue !== 2 && this.cron.week !== '?') {
+ this.$emit('update', 'week', '?', 'day')
}
switch (this.radioValue) {
+ case 1:
+ this.$emit('update', 'day', '*');
+ break;
case 2:
this.$emit('update', 'day', '?');
break;
diff --git a/ruoyi-ui/src/components/Crontab/hour.vue b/ruoyi-ui/src/components/Crontab/hour.vue
index 5a1e146..131edc9 100644
--- a/ruoyi-ui/src/components/Crontab/hour.vue
+++ b/ruoyi-ui/src/components/Crontab/hour.vue
@@ -51,18 +51,10 @@
methods: {
// 鍗曢�夋寜閽�煎彉鍖栨椂
radioChange() {
- 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');
- }
- }
switch (this.radioValue) {
+ case 1:
+ this.$emit('update', 'hour', '*')
+ break;
case 2:
this.$emit('update', 'hour', this.cycle01 + '-' + this.cycle02);
break;
diff --git a/ruoyi-ui/src/components/Crontab/index.vue b/ruoyi-ui/src/components/Crontab/index.vue
index 27b4ab3..bd863b1 100644
--- a/ruoyi-ui/src/components/Crontab/index.vue
+++ b/ruoyi-ui/src/components/Crontab/index.vue
@@ -2,7 +2,12 @@
<div>
<el-tabs type="border-card">
<el-tab-pane label="绉�" v-if="shouldHide('second')">
- <CrontabSecond @update="updateCrontabValue" :check="checkNumber" ref="cronsecond" />
+ <CrontabSecond
+ @update="updateCrontabValue"
+ :check="checkNumber"
+ :cron="crontabValueObj"
+ ref="cronsecond"
+ />
</el-tab-pane>
<el-tab-pane label="鍒嗛挓" v-if="shouldHide('min')">
diff --git a/ruoyi-ui/src/components/Crontab/min.vue b/ruoyi-ui/src/components/Crontab/min.vue
index 980c4e7..79e435b 100644
--- a/ruoyi-ui/src/components/Crontab/min.vue
+++ b/ruoyi-ui/src/components/Crontab/min.vue
@@ -52,13 +52,9 @@
methods: {
// 鍗曢�夋寜閽�煎彉鍖栨椂
radioChange() {
- if (this.radioValue !== 1 && this.cron.second === '*') {
- this.$emit('update', 'second', '0', 'min');
- }
switch (this.radioValue) {
case 1:
this.$emit('update', 'min', '*', 'min');
- this.$emit('update', 'hour', '*', 'min');
break;
case 2:
this.$emit('update', 'min', this.cycle01 + '-' + this.cycle02, 'min');
diff --git a/ruoyi-ui/src/components/Crontab/month.vue b/ruoyi-ui/src/components/Crontab/month.vue
index 619d1e7..a7e52e1 100644
--- a/ruoyi-ui/src/components/Crontab/month.vue
+++ b/ruoyi-ui/src/components/Crontab/month.vue
@@ -51,24 +51,10 @@
methods: {
// 鍗曢�夋寜閽�煎彉鍖栨椂
radioChange() {
- if (this.radioValue === 1) {
- this.$emit('update', 'month', '*');
- this.$emit('update', 'year', '*');
- } else {
- if (this.cron.day === '*') {
- this.$emit('update', 'day', '0', 'month');
- }
- if (this.cron.hour === '*') {
- this.$emit('update', 'hour', '0', 'month');
- }
- if (this.cron.min === '*') {
- this.$emit('update', 'min', '0', 'month');
- }
- if (this.cron.second === '*') {
- this.$emit('update', 'second', '0', 'month');
- }
- }
switch (this.radioValue) {
+ case 1:
+ this.$emit('update', 'month', '*');
+ break;
case 2:
this.$emit('update', 'month', this.cycle01 + '-' + this.cycle02);
break;
diff --git a/ruoyi-ui/src/components/Crontab/second.vue b/ruoyi-ui/src/components/Crontab/second.vue
index 0fdf338..40815fb 100644
--- a/ruoyi-ui/src/components/Crontab/second.vue
+++ b/ruoyi-ui/src/components/Crontab/second.vue
@@ -54,7 +54,6 @@
switch (this.radioValue) {
case 1:
this.$emit('update', 'second', '*', 'second');
- this.$emit('update', 'min', '*', 'second');
break;
case 2:
this.$emit('update', 'second', this.cycle01 + '-' + this.cycle02);
diff --git a/ruoyi-ui/src/components/Crontab/week.vue b/ruoyi-ui/src/components/Crontab/week.vue
index 5ad949d..8cc82e2 100644
--- a/ruoyi-ui/src/components/Crontab/week.vue
+++ b/ruoyi-ui/src/components/Crontab/week.vue
@@ -67,27 +67,13 @@
methods: {
// 鍗曢�夋寜閽�煎彉鍖栨椂
radioChange() {
- if (this.radioValue === 1) {
- this.$emit('update', 'week', '*');
- this.$emit('update', 'year', '*');
- } else {
- if (this.cron.month === '*') {
- this.$emit('update', 'month', '0', 'week');
- }
- if (this.cron.day === '*') {
- this.$emit('update', 'day', '0', '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.radioValue !== 2 && this.cron.day !== '?') {
+ this.$emit('update', 'day', '?', 'week');
}
switch (this.radioValue) {
+ case 1:
+ this.$emit('update', 'week', '*');
+ break;
case 2:
this.$emit('update', 'week', '?');
break;
@@ -105,7 +91,6 @@
break;
}
},
- // 鏍规嵁浜掓枼浜嬩欢锛屾洿鏀箁adio鐨勫��
// 鍛ㄦ湡涓や釜鍊煎彉鍖栨椂
cycleChange() {
diff --git a/ruoyi-ui/src/components/Crontab/year.vue b/ruoyi-ui/src/components/Crontab/year.vue
index 800dfa5..16a2b04 100644
--- a/ruoyi-ui/src/components/Crontab/year.vue
+++ b/ruoyi-ui/src/components/Crontab/year.vue
@@ -59,21 +59,6 @@
methods: {
// 鍗曢�夋寜閽�煎彉鍖栨椂
radioChange() {
- if (this.cron.month === '*') {
- this.$emit('update', 'month', '0', 'year');
- }
- if (this.cron.day === '*') {
- this.$emit('update', 'day', '0', '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', '');
--
Gitblit v1.9.3