教学系统 课程 现地 切换实训 地图显示代码调整

This commit is contained in:
joylink_cuiweidong 2022-09-13 13:35:14 +08:00
parent 83736869c3
commit 289f02ac0f

View File

@ -139,6 +139,11 @@ export default {
this.$jlmap.updateShowStation(list, userInfo.deviceCode); this.$jlmap.updateShowStation(list, userInfo.deviceCode);
} }
}, },
'$store.state.socket.simulationRoleList':function(list) {
if (list && list.length) {
this.checkRoleChange(list);
}
},
async $route() { async $route() {
loadTrainingInSimulation(this.group, this.$route.query.trainingId).then(resp => { loadTrainingInSimulation(this.group, this.$route.query.trainingId).then(resp => {
this.setTrainingData(resp); this.setTrainingData(resp);
@ -331,6 +336,19 @@ export default {
} }
}); });
window.open(routeData.href, '_blank'); window.open(routeData.href, '_blank');
},
checkRoleChange(list) {
list.forEach(item => {
if (item.messageType === 'PLAY_CHANGE' && item.userId == this.$store.state.user.id && item.type === 'STATION_SUPERVISOR') {
this.$store.dispatch('map/setShowCentralizedStationCode', item.deviceCode);
const mapDevice = this.$store.state.map.mapDevice;
const list = [];
for (const key in mapDevice) {
list.push(mapDevice[key]);
}
this.$jlmap.updateShowStation(list, item.deviceCode);
}
});
} }
} }
}; };