diff --git a/src/components/setParamsControl.vue b/src/components/setParamsControl.vue index 14754cc..f4e3b10 100644 --- a/src/components/setParamsControl.vue +++ b/src/components/setParamsControl.vue @@ -54,12 +54,7 @@ export default { var store = this.$store.state; var item = store.equipmentList[store.equipmentIndex - 1] if(item.deviceName == 10 || item.deviceName == 30){ - this.loading = this.$loading({ - lock: true, - text: '加载中', - spinner: 'el-icon-loading', - background: 'rgba(0, 0, 0, 0.7)' - }); + this.dataInit(); } }, @@ -86,6 +81,12 @@ export default { } }, dataInit() { + this.loading = this.$loading({ + lock: true, + text: '加载中', + spinner: 'el-icon-loading', + background: 'rgba(0, 0, 0, 0.7)' + }); var store = this.$store.state; var data = store.equipmentList[store.equipmentIndex - 1].deviceId; this.api.getcontrol_cpermission(data).then((res) => { @@ -338,6 +339,9 @@ export default { if (router.token && router.userid) { return } + if(this.$route.name==this.routerList[0].router){ + return + } this.$router.push({ path: `/${this.routerList[0].router}` }); diff --git a/src/views/page/targetTemperature.vue b/src/views/page/targetTemperature.vue index fe41193..086775d 100644 --- a/src/views/page/targetTemperature.vue +++ b/src/views/page/targetTemperature.vue @@ -205,14 +205,16 @@ export default { loading:null, } }, + watch: { + + '$store.state.equipmentIndex'(newVal, oldVal) { + this.dataInit(); + }, + }, + mounted() { const that = this; - this.loading = this.$loading({ - lock: true, - text: '加载中', - spinner: 'el-icon-loading', - background: 'rgba(0, 0, 0, 0.7)' - }); + setTimeout(() => { that.dataInit(); }, 0); @@ -292,6 +294,12 @@ export default { this.change(code, sendData) }, dataInit() { + this.loading = this.$loading({ + lock: true, + text: '加载中', + spinner: 'el-icon-loading', + background: 'rgba(0, 0, 0, 0.7)' + }); var store = this.$store.state var data = { deviceId: store.equipmentList[store.equipmentIndex - 1].deviceId,