现地 设备显示调整

This commit is contained in:
fan 2021-02-20 10:42:25 +08:00
parent 8a2f3b02ac
commit 37d44bf6d2
3 changed files with 39 additions and 24 deletions

View File

@ -59,7 +59,12 @@ export default {
let list = [];
const member = this.$store.state.training.memberData[val];
const station = this.$store.getters['map/getDeviceByCode'](member.deviceCode);
if (station) {
const lineCode = this.$store.getters['map/lineCode'];
if ((lineCode === '02' || lineCode === '05') && station) {
this.showStation = station.code;
const showStationCode = this.stationCentralizedMap[station.code];
this.setCenter(showStationCode);
} else if (station) {
this.showStation = station.code;
const showStationCode = this.stationCentralizedMap[station.code];
nameList.forEach(item => {

View File

@ -518,21 +518,26 @@ export default {
EventBus.$emit('select_DrawType', showMode);
},
setShowStation(stationCode, setCenter) {
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]];
const lineCode = this.$store.getters['map/lineCode'];
if (lineCode === '02' || lineCode === '05') {
!setCenter && this.setCenter(stationCode);
} else {
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, stationCode);
!setCenter && this.setCenter(stationCode);
});
this.$jlmap.updateShowStation(list, stationCode);
!setCenter && this.setCenter(stationCode);
}
},
setOffset(data, num, sum, obj) {
this.$jlmap.switchScreen(data, num, sum, obj);

View File

@ -529,15 +529,20 @@ export default {
},
setShowStation(stationCode) {
const showStation = this.centralizedStationMap[stationCode];
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) {
list = [...list, ...this.$store.state.map.map[item]];
}
});
this.$jlmap.updateShowStation(list, showStation);
this.$jlmap.setCenter(showStation);
const lineCode = this.$store.getters['map/lineCode'];
if (lineCode === '02' || lineCode === '05') {
this.$jlmap.setCenter(showStation);
} else {
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) {
list = [...list, ...this.$store.state.map.map[item]];
}
});
this.$jlmap.updateShowStation(list, showStation);
this.$jlmap.setCenter(showStation);
}
},
setStationList(map) {
this.stationList = [];