剧本代码调整

This commit is contained in:
joylink_cuiweidong 2020-06-12 16:28:52 +08:00
parent a7ca270be0
commit 29b0937253

View File

@ -683,15 +683,29 @@ export default {
}
},
switchStationMode(val) {
debugger;
if (this.stationList.length > 0) {
if (val == null) {
this.showStation = this.stationList[0].value;
} else {
this.showStation = val;
}
this.$store.dispatch('map/setShowCentralizedStationCode', this.showStation);
this.$store.dispatch('map/setShowCentralizedStationNum');
const nameList = Object.keys(this.$store.state.map.map);
let list = [];
nameList.forEach(item => {
if (this.$store.state.map.map[item] && this.$store.state.map.map[item].constructor === Array) {
if (item === 'trainList') {
this.$store.state.map.map[item].forEach(elem => {
elem && list.push(elem);
});
} else {
list = [...list, ...this.$store.state.map.map[item]];
}
}
});
this.$jlmap.updateShowStation(list, this.showStation);
this.setCenter(this.showStation);
// this.$store.dispatch('map/setShowCentralizedStationCode', this.showStation);
// this.$store.dispatch('map/setShowCentralizedStationNum');
}
},
setStationList(val) {