This commit is contained in:
ival 2019-08-12 11:01:13 +08:00
commit 914b5d4e0e
2 changed files with 55 additions and 53 deletions

View File

@ -75,6 +75,8 @@ export default {
},
initMenu() {
this.menuNormal = [];
let resultCode = this.$route.path.indexOf("/display");
if(resultCode === -1){
this.stationList.forEach(station => {
if (station.code === station.concentrateStationCode) {
let node = {
@ -102,7 +104,7 @@ export default {
this.menuNormal.push(node);
}
});
}
if (this.isScreen) {
this.menu = [...this.menuScreen];
}

View File

@ -76,41 +76,41 @@ export default {
};
},
initMenu() {
// this.menuNormal = [];
// this.stationList.forEach(station => {
// if (station.code === station.concentrateStationCode) {
// let node = {
// label: station.name,
// children: []
// }
this.menuNormal = [];
this.stationList.forEach(station => {
if (station.code === station.concentrateStationCode) {
let node = {
label: station.name,
children: []
}
// this.stationList.forEach(elem => {
// if (elem.visible) {
// let next = elem;
// while (next.code != next.concentrateStationCode || !next.concentrateStationCode) {
// next = this.$store.getters['map/getDeviceByCode'](next.concentrateStationCode);
// }
this.stationList.forEach(elem => {
if (elem.visible) {
let next = elem;
while (next.code != next.concentrateStationCode || !next.concentrateStationCode) {
next = this.$store.getters['map/getDeviceByCode'](next.concentrateStationCode);
}
// if (station.code == next.code) {
// node.children.push({
// code: elem.code,
// label: elem.name,
// handler: this.mapLocation,
// });
// }
// }
// })
if (station.code == next.code) {
node.children.push({
code: elem.code,
label: elem.name,
handler: this.mapLocation,
});
}
}
})
// this.menuNormal.push(node);
// }
// });
this.menuNormal.push(node);
}
});
if (this.isScreen) {
this.menu = [...this.menuScreen];
}
// else {
// this.menu = [...this.menuNormal];
// }
else {
this.menu = [...this.menuNormal];
}
},
doShow(point) {
this.clickEvent();