fix: Job create cannot be saved without setting interval

This commit is contained in:
wangruidong
2024-11-07 17:56:54 +08:00
committed by Bryan
parent 671fa65930
commit 9edb64837d

View File

@@ -4,10 +4,12 @@ import InputWithUnit from '@/components/Form/FormFields/InputWithUnit.vue'
import store from '@/store' import store from '@/store'
const validatorInterval = (rule, value, callback) => { const validatorInterval = (rule, value, callback) => {
if (isNaN(parseInt(value, 10)) || parseInt(value) < 1) { // value只能是 null 或者 >=1
return callback(new Error(i18n.t('EnsureThisValueIsGreaterThanOrEqualTo1'))) if (value === null || (!isNaN(value) && Number(value) >= 1)) {
}
callback() callback()
} else {
callback(new Error(i18n.t('EnsureThisValueIsGreaterThanOrEqualTo1')))
}
} }
export const crontab = { export const crontab = {