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