实训调整

This commit is contained in:
fan 2024-03-06 09:40:47 +08:00
parent ce1be2d1c8
commit e5c38220a2
4 changed files with 24 additions and 14 deletions

View File

@ -263,7 +263,8 @@ const map = {
picture:'', // 当前的客户端 picture:'', // 当前的客户端
domConfig: null, // 仿真配置 domConfig: null, // 仿真配置
initClient: '', // 仿真初始客户端 initClient: '', // 仿真初始客户端
linkSwitchMap: {} // 联动道岔数据 linkSwitchMap: {}, // 联动道岔数据
simulationCreatorId: ''
}, },
getters: { getters: {
@ -1216,6 +1217,9 @@ const map = {
}, },
setLinkSwitchMap: (state, linkSwitchMap) => { setLinkSwitchMap: (state, linkSwitchMap) => {
state.linkSwitchMap = linkSwitchMap; state.linkSwitchMap = linkSwitchMap;
},
setSimulationCreatorId: (state, creatorId) => {
state.simulationCreatorId = creatorId;
} }
}, },
@ -1506,6 +1510,9 @@ const map = {
}, },
updateNccDisplayConfig: ({ commit }, displayConfig) => { updateNccDisplayConfig: ({ commit }, displayConfig) => {
commit('updateNccDisplayConfig', displayConfig); commit('updateNccDisplayConfig', displayConfig);
},
setSimulationCreatorId:({ commit }, creatorId) => {
commit('setSimulationCreatorId', creatorId);
} }
} }
}; };

View File

@ -139,6 +139,7 @@ export default {
this.$store.dispatch('runPlan/setRunPlanInfo', resp.data.runPlan); this.$store.dispatch('runPlan/setRunPlanInfo', resp.data.runPlan);
this.$store.dispatch('training/setDomConfig', resp.data.paramVO && resp.data.paramVO.domConfig ? resp.data.paramVO.domConfig : {}); this.$store.dispatch('training/setDomConfig', resp.data.paramVO && resp.data.paramVO.domConfig ? resp.data.paramVO.domConfig : {});
this.$store.dispatch('map/setLinkSwitchMap', resp.data.linkSwitchMap || {}); this.$store.dispatch('map/setLinkSwitchMap', resp.data.linkSwitchMap || {});
this.$store.dispatch('map/setSimulationCreatorId', resp.data.creator.id);
if (this.simType === 'METRO') { if (this.simType === 'METRO') {
this.$store.dispatch('runPlan/clear'); this.$store.dispatch('runPlan/clear');
const respSl = await getByGroupStationList(this.group); const respSl = await getByGroupStationList(this.group);

View File

@ -98,6 +98,7 @@ export default {
}, },
watch: { watch: {
'$store.state.socket.simulationOver':function(val) { '$store.state.socket.simulationOver':function(val) {
if (this.$store.state.map.simulationCreatorId !== this.$store.state.user.id) {
this.$alert('您所在仿真已被销毁', '提示', { this.$alert('您所在仿真已被销毁', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
showClose: false, showClose: false,
@ -109,6 +110,7 @@ export default {
} }
} }
}); });
}
}, },
'$store.state.socket.simulationRoleList':function(val) { '$store.state.socket.simulationRoleList':function(val) {
(val || []).forEach(item => { (val || []).forEach(item => {

View File

@ -127,13 +127,13 @@ export default {
this.stepDetail = data.data; this.stepDetail = data.data;
this.trainingType = data.type; this.trainingType = data.type;
if (!this.stepDetail.operations) { if (!this.stepDetail.operations) {
this.stepDetail.operations = []; this.$set(this.stepDetail, 'operations', []);
} }
if (!this.stepDetail.simCommands) { if (!this.stepDetail.simCommands) {
this.stepDetail.simCommands = []; this.$set(this.stepDetail, 'simCommands', []);
} }
if (!this.stepDetail.tipPosition) { if (!this.stepDetail.tipPosition) {
this.stepDetail.tipPosition = {}; this.$set(this.stepDetail, 'tipPosition', {});
} }
}, },
clearOperation() { clearOperation() {