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,34 +75,36 @@ export default {
},
initMenu() {
this.menuNormal = [];
this.stationList.forEach(station => {
if (station.code === station.concentrateStationCode) {
let node = {
label: station.name,
children: []
}
let resultCode = this.$route.path.indexOf("/display");
if(resultCode === -1){
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,
});
}
}
})
this.menuNormal.push(node);
}
});
if (station.code == next.code) {
node.children.push({
code: elem.code,
label: elem.name,
handler: this.mapLocation,
});
}
}
})
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();