pull/140/head
孙萌 2024-04-11 08:54:13 +08:00
parent da8d754fed
commit 986a261270
2 changed files with 24 additions and 12 deletions

View File

@ -54,12 +54,7 @@ export default {
var store = this.$store.state; var store = this.$store.state;
var item = store.equipmentList[store.equipmentIndex - 1] var item = store.equipmentList[store.equipmentIndex - 1]
if(item.deviceName == 10 || item.deviceName == 30){ 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(); this.dataInit();
} }
}, },
@ -86,6 +81,12 @@ export default {
} }
}, },
dataInit() { 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 store = this.$store.state;
var data = store.equipmentList[store.equipmentIndex - 1].deviceId; var data = store.equipmentList[store.equipmentIndex - 1].deviceId;
this.api.getcontrol_cpermission(data).then((res) => { this.api.getcontrol_cpermission(data).then((res) => {
@ -338,6 +339,9 @@ export default {
if (router.token && router.userid) { if (router.token && router.userid) {
return return
} }
if(this.$route.name==this.routerList[0].router){
return
}
this.$router.push({ path: `/${this.routerList[0].router}` }); this.$router.push({ path: `/${this.routerList[0].router}` });

View File

@ -205,14 +205,16 @@ export default {
loading:null, loading:null,
} }
}, },
watch: {
'$store.state.equipmentIndex'(newVal, oldVal) {
this.dataInit();
},
},
mounted() { mounted() {
const that = this; const that = this;
this.loading = this.$loading({
lock: true,
text: '加载中',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
});
setTimeout(() => { setTimeout(() => {
that.dataInit(); that.dataInit();
}, 0); }, 0);
@ -292,6 +294,12 @@ export default {
this.change(code, sendData) this.change(code, sendData)
}, },
dataInit() { 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 store = this.$store.state
var data = { var data = {
deviceId: store.equipmentList[store.equipmentIndex - 1].deviceId, deviceId: store.equipmentList[store.equipmentIndex - 1].deviceId,