From e5c38220a29c5cc74bfa47cd7467b4db58bb0705 Mon Sep 17 00:00:00 2001 From: fan Date: Wed, 6 Mar 2024 09:40:47 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=9E=E8=AE=AD=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/store/modules/map.js | 9 +++++++- src/views/newMap/display/index.vue | 1 + .../display/simulationMenu/simulationMenu.vue | 22 ++++++++++--------- .../display/trainingDesign/editOperate.vue | 6 ++--- 4 files changed, 24 insertions(+), 14 deletions(-) diff --git a/src/store/modules/map.js b/src/store/modules/map.js index 5c493eb4a..f02be48b2 100644 --- a/src/store/modules/map.js +++ b/src/store/modules/map.js @@ -263,7 +263,8 @@ const map = { picture:'', // 当前的客户端 domConfig: null, // 仿真配置 initClient: '', // 仿真初始客户端 - linkSwitchMap: {} // 联动道岔数据 + linkSwitchMap: {}, // 联动道岔数据 + simulationCreatorId: '' }, getters: { @@ -1216,6 +1217,9 @@ const map = { }, setLinkSwitchMap: (state, linkSwitchMap) => { state.linkSwitchMap = linkSwitchMap; + }, + setSimulationCreatorId: (state, creatorId) => { + state.simulationCreatorId = creatorId; } }, @@ -1506,6 +1510,9 @@ const map = { }, updateNccDisplayConfig: ({ commit }, displayConfig) => { commit('updateNccDisplayConfig', displayConfig); + }, + setSimulationCreatorId:({ commit }, creatorId) => { + commit('setSimulationCreatorId', creatorId); } } }; diff --git a/src/views/newMap/display/index.vue b/src/views/newMap/display/index.vue index 788181cab..4464c90c8 100644 --- a/src/views/newMap/display/index.vue +++ b/src/views/newMap/display/index.vue @@ -139,6 +139,7 @@ export default { 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('map/setLinkSwitchMap', resp.data.linkSwitchMap || {}); + this.$store.dispatch('map/setSimulationCreatorId', resp.data.creator.id); if (this.simType === 'METRO') { this.$store.dispatch('runPlan/clear'); const respSl = await getByGroupStationList(this.group); diff --git a/src/views/newMap/display/simulationMenu/simulationMenu.vue b/src/views/newMap/display/simulationMenu/simulationMenu.vue index d8f9a5463..1f1704596 100644 --- a/src/views/newMap/display/simulationMenu/simulationMenu.vue +++ b/src/views/newMap/display/simulationMenu/simulationMenu.vue @@ -98,17 +98,19 @@ export default { }, watch: { '$store.state.socket.simulationOver':function(val) { - this.$alert('您所在仿真已被销毁', '提示', { - confirmButtonText: '确定', - showClose: false, - callback: action => { - if (this.$route.query.newOpen) { - window.close(); - } else { - this.back(); + if (this.$store.state.map.simulationCreatorId !== this.$store.state.user.id) { + this.$alert('您所在仿真已被销毁', '提示', { + confirmButtonText: '确定', + showClose: false, + callback: action => { + if (this.$route.query.newOpen) { + window.close(); + } else { + this.back(); + } } - } - }); + }); + } }, '$store.state.socket.simulationRoleList':function(val) { (val || []).forEach(item => { diff --git a/src/views/newMap/display/trainingDesign/editOperate.vue b/src/views/newMap/display/trainingDesign/editOperate.vue index 1730d3ec6..683040b8f 100644 --- a/src/views/newMap/display/trainingDesign/editOperate.vue +++ b/src/views/newMap/display/trainingDesign/editOperate.vue @@ -127,13 +127,13 @@ export default { this.stepDetail = data.data; this.trainingType = data.type; if (!this.stepDetail.operations) { - this.stepDetail.operations = []; + this.$set(this.stepDetail, 'operations', []); } if (!this.stepDetail.simCommands) { - this.stepDetail.simCommands = []; + this.$set(this.stepDetail, 'simCommands', []); } if (!this.stepDetail.tipPosition) { - this.stepDetail.tipPosition = {}; + this.$set(this.stepDetail, 'tipPosition', {}); } }, clearOperation() {