fix: 定时任务设置保存报错 tapdId: 1006049、1005818(#5373 #5495)

This commit is contained in:
chenjianxing 2021-08-30 15:57:09 +08:00 committed by jianxing
parent 08af2a2822
commit 59b1faec6e
6 changed files with 33 additions and 22 deletions

View File

@ -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');

View File

@ -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');

View File

@ -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');

View File

@ -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;

View File

@ -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) => {

View File

@ -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])) {