fix: 数据源检测时间超出范围后,置为初始值

This commit is contained in:
taojinlong 2022-09-19 17:52:49 +08:00
parent 5765be7af1
commit 66933da1e9

View File

@ -34,7 +34,7 @@
<el-form-item :label="$t('system_parameter_setting.ds_check_time')" > <el-form-item :label="$t('system_parameter_setting.ds_check_time')" >
<el-form :inline="true" :disabled="show"> <el-form :inline="true" :disabled="show">
<el-form-item > <el-form-item >
<el-input v-model="formInline.dsCheckInterval" type="number" min="1" @change="onSimpleCronChange()" /> <el-input size="mini" v-model="formInline.dsCheckInterval" type="number" min="1" @change="onSimpleCronChange()" />
</el-form-item> </el-form-item>
<el-form-item class="form-item"> <el-form-item class="form-item">
@ -276,21 +276,14 @@ export default {
if (this.formInline.dsCheckIntervalType === 'minute') { if (this.formInline.dsCheckIntervalType === 'minute') {
if (this.formInline.dsCheckInterval < 1 || this.formInline.dsCheckInterval > 59) { if (this.formInline.dsCheckInterval < 1 || this.formInline.dsCheckInterval > 59) {
this.$message({ message: this.$t('cron.minute_limit'), type: 'warning', showClose: true }) this.$message({ message: this.$t('cron.minute_limit'), type: 'warning', showClose: true })
this.taskForm.extraData.simple_cron_value = 59 this.formInline.dsCheckInterval = 1
} }
return return
} }
if (this.formInline.dsCheckIntervalType === 'hour') { if (this.formInline.dsCheckIntervalType === 'hour') {
if (this.formInline.dsCheckInterval < 1 || this.formInline.dsCheckInterval > 23) { if (this.formInline.dsCheckInterval < 1 || this.formInline.dsCheckInterval > 23) {
this.$message({ message: this.$t('cron.hour_limit'), type: 'warning', showClose: true }) this.$message({ message: this.$t('cron.hour_limit'), type: 'warning', showClose: true })
this.taskForm.extraData.simple_cron_value = 23 this.formInline.dsCheckInterval = 1
}
return
}
if (this.formInline.dsCheckIntervalType === 'day') {
if (this.formInline.dsCheckInterval < 1 || this.formInline.dsCheckInterval > 31) {
this.$message({ message: this.$t('cron.day_limit'), type: 'warning', showClose: true })
this.taskForm.extraData.simple_cron_value = 31
} }
return return
} }