mirror of
https://github.com/jumpserver/lina.git
synced 2026-01-15 14:24:39 +00:00
fixed: Fixed NaN issue when setting timing interval
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<el-input v-bind="$attrs" v-on="$listeners">
|
||||
<el-input v-model="iValue" v-bind="$attrs" v-on="$listeners">
|
||||
<template slot="append">{{ iUnit }}</template>
|
||||
</el-input>
|
||||
</template>
|
||||
@@ -15,6 +15,7 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
defaultValue: 24,
|
||||
displayMapper: {
|
||||
'second': this.$t('Second'), // 'sec' is the default value of 'unit
|
||||
'min': this.$t('Minute'), // 'min' is the default value of 'unit
|
||||
@@ -29,6 +30,9 @@ export default {
|
||||
computed: {
|
||||
iUnit() {
|
||||
return this.displayMapper[this.unit] || this.unit
|
||||
},
|
||||
iValue() {
|
||||
return this.$attrs.value ? this.$attrs.value : this.defaultValue
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -73,7 +73,13 @@ export default {
|
||||
btn.loading = true
|
||||
}
|
||||
})
|
||||
form.value.interval = parseInt(form.value.interval, 10)
|
||||
|
||||
if (form.value.interval && typeof form.value.interval === 'number') {
|
||||
form.value.interval = parseInt(form.value.interval, 10)
|
||||
} else {
|
||||
form.value.interval = 24
|
||||
}
|
||||
|
||||
this.$refs.form.$refs.form.dataForm.submitForm('form', false)
|
||||
},
|
||||
handleSubmitSuccess(res) {
|
||||
|
||||
Reference in New Issue
Block a user