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