教学系统 课程 现地 切换实训 地图显示代码调整
This commit is contained in:
parent
83736869c3
commit
289f02ac0f
@ -139,6 +139,11 @@ export default {
|
||||
this.$jlmap.updateShowStation(list, userInfo.deviceCode);
|
||||
}
|
||||
},
|
||||
'$store.state.socket.simulationRoleList':function(list) {
|
||||
if (list && list.length) {
|
||||
this.checkRoleChange(list);
|
||||
}
|
||||
},
|
||||
async $route() {
|
||||
loadTrainingInSimulation(this.group, this.$route.query.trainingId).then(resp => {
|
||||
this.setTrainingData(resp);
|
||||
@ -331,6 +336,19 @@ export default {
|
||||
}
|
||||
});
|
||||
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);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user