diff --git a/src/views/profile/DeviceTimingConfig/DeviceTimingConfig.vue b/src/views/profile/DeviceTimingConfig/DeviceTimingConfig.vue index d2dc9e34..dac59433 100644 --- a/src/views/profile/DeviceTimingConfig/DeviceTimingConfig.vue +++ b/src/views/profile/DeviceTimingConfig/DeviceTimingConfig.vue @@ -247,6 +247,9 @@ export default { deviceKey() { this.getList(); }, + list() { + this.monthTradingTableHeight = this.list.length >= 5 ? '290px' : '' + } }, created() { this.getDicts("timer_mod").then((response) => { @@ -327,14 +330,15 @@ export default { "{m}-{d}-{h}-{i}" ); let list = this.list.map((v, idx) => { - return v.num === this.form.num + let result = v.num === this.form.num ? Object.assign(v, this.form, { num: ++idx }) : Object.assign(v, { num: ++idx }); + return JSON.parse(JSON.stringify(result)); }); if (!this.updateIndex) { this.form.num = list.length + 1; - list = list.concat([this.form]); + list = list.concat([JSON.parse(JSON.stringify(this.form))]); } this.list = [...list] this.open = false; @@ -378,7 +382,6 @@ export default { getDeviceTimingConfig(this.deviceKey) .then((response) => { this.list = response.data; - this.monthTradingTableHeight = this.list.length >= 5 ? '290px' : 'auto' this.loading = false; }) .catch((e) => {