西安三站台状态管理显示调整(again)

This commit is contained in:
fan 2021-06-17 18:18:25 +08:00
parent 544ba5af63
commit 320662e6a0

View File

@ -71,17 +71,20 @@ export default {
const point = {};
point.x = e.clientX;
point.y = e.clientY;
const stationList = [];
if (this.$store.state.map.holdStandList.length) {
this.menu = [];
this.$store.state.map.holdStandList.forEach(item => {
const stand = this.$store.getters['map/getDeviceByCode'](item);
const station = this.$store.getters['map/getDeviceByCode'](stand.stationCode);
this.menu.push({
label: station.name,
code: station.code,
handler: this.setCenter
});
if (stationList.indexOf(station.code) === -1) {
stationList.push(station.code);
this.menu.push({
label: station.name,
code: station.code,
handler: this.setCenter
});
}
});
if (this.$refs && this.$refs.popMenu) {
this.$refs.popMenu.resetShowPosition(point);
@ -94,14 +97,18 @@ export default {
point.y = e.clientY;
if (this.$store.state.map.jumpStandList.length) {
this.menu = [];
const stationList = [];
this.$store.state.map.jumpStandList.forEach(item => {
const stand = this.$store.getters['map/getDeviceByCode'](item);
const station = this.$store.getters['map/getDeviceByCode'](stand.stationCode);
this.menu.push({
label: station.name,
code: station.code,
handler: this.setCenter
});
if (stationList.indexOf(station.code) === -1) {
stationList.push(station.code);
this.menu.push({
label: station.name,
code: station.code,
handler: this.setCenter
});
}
});
if (this.$refs && this.$refs.popMenu) {
this.$refs.popMenu.resetShowPosition(point);