mirror of
https://github.com/jumpserver/lina.git
synced 2025-08-02 07:27:01 +00:00
fix: interval field check
This commit is contained in:
parent
19cd497095
commit
6fb7fe8fa1
@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<el-input v-model="iValue" v-bind="$attrs" v-on="$listeners">
|
||||
<el-input v-bind="$attrs" v-on="$listeners">
|
||||
<template slot="append">{{ iUnit }}</template>
|
||||
</el-input>
|
||||
</template>
|
||||
@ -30,9 +30,6 @@ export default {
|
||||
computed: {
|
||||
iUnit() {
|
||||
return this.displayMapper[this.unit] || this.unit
|
||||
},
|
||||
iValue() {
|
||||
return this.$attrs.value ? this.$attrs.value : this.defaultValue
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -4,7 +4,7 @@ import InputWithUnit from '@/components/Form/FormFields/InputWithUnit.vue'
|
||||
import store from '@/store'
|
||||
|
||||
const validatorInterval = (rule, value, callback) => {
|
||||
if (parseInt(value) < 1) {
|
||||
if (isNaN(parseInt(value, 10)) || parseInt(value) < 1) {
|
||||
return callback(new Error(i18n.t('EnsureThisValueIsGreaterThanOrEqualTo1')))
|
||||
}
|
||||
callback()
|
||||
|
@ -73,13 +73,7 @@ export default {
|
||||
btn.loading = true
|
||||
}
|
||||
})
|
||||
|
||||
if (form.value.interval && typeof form.value.interval === 'number') {
|
||||
form.value.interval = parseInt(form.value.interval, 10)
|
||||
} else {
|
||||
form.value.interval = 24
|
||||
}
|
||||
|
||||
form.value.interval = parseInt(form.value.interval, 10)
|
||||
this.$refs.form.$refs.form.dataForm.submitForm('form', false)
|
||||
},
|
||||
handleSubmitSuccess(res) {
|
||||
|
Loading…
Reference in New Issue
Block a user