diff --git a/src/components/Form/FormFields/InputWithUnit.vue b/src/components/Form/FormFields/InputWithUnit.vue index fc8c205cf..bcd4568a2 100644 --- a/src/components/Form/FormFields/InputWithUnit.vue +++ b/src/components/Form/FormFields/InputWithUnit.vue @@ -1,5 +1,5 @@ @@ -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 } } } diff --git a/src/views/assets/Cloud/Account/components/TimingPanel.vue b/src/views/assets/Cloud/Account/components/TimingPanel.vue index a89b2af24..3d15c4196 100644 --- a/src/views/assets/Cloud/Account/components/TimingPanel.vue +++ b/src/views/assets/Cloud/Account/components/TimingPanel.vue @@ -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) {