From d60d3b2521ca824f29247b47395405a5e3375343 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=99=E8=90=8C?= <525441437@qq.com> Date: Tue, 2 Apr 2024 15:15:13 +0800 Subject: [PATCH 1/2] 1 --- src/views/page/sensorSet-con.vue | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/views/page/sensorSet-con.vue b/src/views/page/sensorSet-con.vue index e9bd9db..cfac8b0 100644 --- a/src/views/page/sensorSet-con.vue +++ b/src/views/page/sensorSet-con.vue @@ -141,14 +141,13 @@ export default { 'active'(newVal, oldVal) { this.getSensorType() }, + '$store.state.equipmentIndex'(newVal, oldVal) { + + this.dataInit(); + }, }, mounted() { - this.loading = this.$loading({ - lock: true, - text: '加载中', - spinner: 'el-icon-loading', - background: 'rgba(0, 0, 0, 0.7)' - }); + this.dataInit() //input获取焦点后全选 let inputList = document.querySelectorAll('input'); @@ -409,6 +408,12 @@ return num deviceId: store.equipmentList[store.equipmentIndex - 1].deviceId, }; + this.loading = this.$loading({ + lock: true, + text: '加载中', + spinner: 'el-icon-loading', + background: 'rgba(0, 0, 0, 0.7)' + }); this.api.getReadControlSensorChannel(data).then((res) => { this.loading.close() if (res.data.code == 200) { From d30b533128086d97c6de9aeaf1fc3d036592cde5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=99=E8=90=8C?= <525441437@qq.com> Date: Tue, 2 Apr 2024 15:24:31 +0800 Subject: [PATCH 2/2] 1 --- src/views/index.vue | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/views/index.vue b/src/views/index.vue index 3b286ea..01c21f8 100644 --- a/src/views/index.vue +++ b/src/views/index.vue @@ -415,10 +415,18 @@ export default { return } this.$router.push({ path: `/control?change=${item.index}` }) - } else if (item.deviceName == 1 && this.routerNow != 'irrigateSet') { - this.$store.state.equipmentIndex = item.index - this.routerIndex = item.index - this.$router.push({ path: `/irrigateSet?change=${item.index}` }) + } else if (item.deviceName == 1 ) { + if(this.routerNow == 'irrigateSet'){ + this.$store.state.equipmentIndex = item.index + this.routerIndex = item.index + }else{ + this.$store.state.equipmentIndex = item.index + this.routerIndex = item.index + this.$router.push({ path: `/irrigateSet?change=${item.index}` }) + } + + + } else if (item.deviceName == 30) { this.$message('气象站无该页面'); }