This commit is contained in:
joylink_cuiweidong 2021-01-13 17:02:31 +08:00
commit ac6f3673d4

View File

@ -352,7 +352,7 @@ export default {
let resp = {data: {}};
resp = await this.getUserRole();
if (resp && resp.code == 200) {
this.setSimulationPrdType();
this.setSimulationPrdType(resp.data.deviceCode);
}
loadMapDataById(this.mapId, 'simulation');
} else {
@ -362,6 +362,7 @@ export default {
// prdTyperole
setSimulationPrdType(deviceCode) {
// Dispatcher STATION_SUPERVISOR Audience Driver MAINTAINER
this.showStation = '';
switch (this.userRole) {
case 'DISPATCHER':
this.$store.dispatch('training/setPrdType', '02');
@ -375,6 +376,7 @@ export default {
this.$store.dispatch('training/setPrdType', '01');
this.$store.dispatch('training/setRoles', 'STATION_SUPERVISOR');
this.$refs.menuSchema.chiShowStation = deviceCode;
this.showStation = deviceCode;
this.mapViewLoadedOver && this.switchStationMode(deviceCode);
this.jl3dmaintainershow = false;
this.drivingShow = false;
@ -521,10 +523,11 @@ export default {
}
},
switchStationMode(stationCode) {
this.showStation = stationCode;
this.showStation = this.centralizedStationMap[stationCode];
this.setShowStation(this.showStation);
},
setShowStation(stationCode) {
const showStation = this.centralizedStationMap[stationCode];
const nameList = Object.keys(this.$store.state.map.map);
let list = [];
nameList.forEach(item => {
@ -532,8 +535,8 @@ export default {
list = [...list, ...this.$store.state.map.map[item]];
}
});
this.$jlmap.updateShowStation(list, stationCode);
this.$jlmap.setCenter(stationCode);
this.$jlmap.updateShowStation(list, showStation);
this.$jlmap.setCenter(showStation);
},
setStationList(map) {
this.stationList = [];
@ -546,7 +549,7 @@ export default {
});
}
});
if (this.stationList.length) {
if (this.stationList.length && !this.showStation) {
this.showStation = this.stationList[0].value;
}
},