From f4d9e34b058f89476f9a1cb1fa55bffce3a8a501 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=99=E8=90=8C?= <525441437@qq.com> Date: Tue, 12 Mar 2024 10:57:53 +0800 Subject: [PATCH] 1 --- src/components/setParamsControl.vue | 42 +++++++++++++++-------------- src/views/index.vue | 2 +- 2 files changed, 23 insertions(+), 21 deletions(-) diff --git a/src/components/setParamsControl.vue b/src/components/setParamsControl.vue index 4c38a89..7635802 100644 --- a/src/components/setParamsControl.vue +++ b/src/components/setParamsControl.vue @@ -50,7 +50,11 @@ export default { this.gerRouter(); }, "$store.state.equipmentIndex"(newName, oldName) { - this.dataInit(); + var store = this.$store.state; + var item = store.equipmentList[store.equipmentIndex - 1] + if(item.deviceName == 10 || item.deviceName == 30){ + this.dataInit(); + } }, }, mounted() { @@ -178,21 +182,21 @@ export default { } let targetObject = this.routerList.find(item => item.router === 'electromagneticControl'); if (el.id == 11) { - targetObject.list.push({name: el.nickName, status: -1, router: 'electromagneticControl', index: 1 }); + targetObject.list.push({ name: el.nickName, status: -1, router: 'electromagneticControl', index: 1 }); } else if (el.id == 12) { - targetObject.list.push({name: el.nickName, status: -1, router: 'electromagneticControl', index: 2 }); + targetObject.list.push({ name: el.nickName, status: -1, router: 'electromagneticControl', index: 2 }); } else if (el.id == 13) { - targetObject.list.push({name: el.nickName, status: -1, router: 'electromagneticControl', index: 3 }); + targetObject.list.push({ name: el.nickName, status: -1, router: 'electromagneticControl', index: 3 }); } else if (el.id == 14) { - targetObject.list.push({name: el.nickName, status: -1, router: 'electromagneticControl', index: 4 }); + targetObject.list.push({ name: el.nickName, status: -1, router: 'electromagneticControl', index: 4 }); } else if (el.id == 15) { - targetObject.list.push({name: el.nickName, status: -1, router: 'electromagneticControl', index: 5 }); + targetObject.list.push({ name: el.nickName, status: -1, router: 'electromagneticControl', index: 5 }); } else if (el.id == 16) { - targetObject.list.push({name: el.nickName, status: -1, router: 'electromagneticControl', index: 6 }); + targetObject.list.push({ name: el.nickName, status: -1, router: 'electromagneticControl', index: 6 }); } else if (el.id == 17) { - targetObject.list.push({name: el.nickName, status: -1, router: 'electromagneticControl', index: 7 }); + targetObject.list.push({ name: el.nickName, status: -1, router: 'electromagneticControl', index: 7 }); } else if (el.id == 18) { - targetObject.list.push({name: el.nickName, status: -1, router: 'electromagneticControl', index: 8 }); + targetObject.list.push({ name: el.nickName, status: -1, router: 'electromagneticControl', index: 8 }); } } else if (el.id == 5) { this.routerList.push({ @@ -219,11 +223,11 @@ export default { isRouter: true, }); } else if (el.id == 2) { - this.routerList.push({ id: el.id, sort: el.sort, name: el.nickName, list: [], router: "forceOutput", isRouter: true }); + this.routerList.push({ id: el.id, sort: el.sort, name: el.nickName, list: [], router: "forceOutput", isRouter: true }); } else if (el.id == 4) { - this.routerList.push({ id: el.id, sort: el.sort, name: el.nickName, list: [], router: "intrinsicParameter", isRouter: true }); + this.routerList.push({ id: el.id, sort: el.sort, name: el.nickName, list: [], router: "intrinsicParameter", isRouter: true }); } else if (el.id == 22) { - this.routerList.push({ name: el.nickName, list: [], router: "parameterSet", isRouter: true }); + this.routerList.push({ name: el.nickName, list: [], router: "parameterSet", isRouter: true }); } else if (el.id == 8) { this.routerList.push( { id: el.id, sort: el.sort, name: "加热水泵", list: [], router: "waterPump", isRouter: true }, @@ -313,16 +317,14 @@ export default { // this.routerList.sort((a, b) => a.sort - b.sort); this.routerList.push({ name: '系统参数配置', list: [], router: 'systemSet-con', isRouter: true, },); - console.log(this.routerList); - setTimeout(() => { - var router = this.$route.query - if (router.token && router.userid) { - return - } - this.$router.push({ path: `/${this.routerList[0].router}` }); + + var router = this.$route.query + if (router.token && router.userid) { + return + } + this.$router.push({ path: `/${this.routerList[0].router}` }); - }, 0); }); diff --git a/src/views/index.vue b/src/views/index.vue index 5e7c13f..84138d8 100644 --- a/src/views/index.vue +++ b/src/views/index.vue @@ -358,7 +358,7 @@ export default { } else if (this.routerNow == 'historyData') { this.$store.state.equipmentIndex = item.index this.$router.push({ path: `/historyData?index=${item.index ? item.index : 1}` }) - } else if (item.router == 'formula') { + } else{ this.$store.state.equipmentIndex = item.index this.routerIndex = item.index if (item.deviceName == 10 || item.deviceName == 30) { -- 2.40.1