From f01c445b25358e7945343e7771067bf112434962 Mon Sep 17 00:00:00 2001 From: fan Date: Wed, 27 Sep 2023 15:46:10 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E5=AE=9E=E8=AE=AD=E9=97=AE=E9=A2=98?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (cherry picked from commit 0598da9a2d42a63e9238b8c85251508844e914cc) --- src/api/simulation.js | 7 +++++ .../menuDialog/stationControlConvert.vue | 31 +++++++++++++++++++ src/utils/subscribeCallback.js | 2 +- src/views/newMap/display/terminals/index.vue | 5 ++- 4 files changed, 43 insertions(+), 2 deletions(-) diff --git a/src/api/simulation.js b/src/api/simulation.js index 52387fe15..dbe149486 100644 --- a/src/api/simulation.js +++ b/src/api/simulation.js @@ -583,3 +583,10 @@ export function enterSimulationByTeacher(group) { method: 'post' }); } +/** 切换角色后触发消息 */ +export function getUnreceivedMessages(simulationId, memberId) { + return request({ + url: `/simulation/${simulationId}/${memberId}/unreceivedMessages`, + method: 'get' + }); +} diff --git a/src/jmapNew/theme/xian_01/menus/menuDialog/stationControlConvert.vue b/src/jmapNew/theme/xian_01/menus/menuDialog/stationControlConvert.vue index 833f8c6b6..c58ecdb49 100644 --- a/src/jmapNew/theme/xian_01/menus/menuDialog/stationControlConvert.vue +++ b/src/jmapNew/theme/xian_01/menus/menuDialog/stationControlConvert.vue @@ -163,6 +163,37 @@ export default { this.updateTableValue(controlTransfer); }); }, + '$store.state.socket.controlTransfer': function(val) { + if (this.$store.state.training.domConfig.trainingDesign) { + if (val[0].application === 'LOCAL') { + this.doShow({operation: OperationEvent.StationControl.requestStationControl.mbar.operation}); + } else if (val[0].application === 'CENTER') { + this.doShow({operation: OperationEvent.StationControl.requestCentralControl.mbar.operation}); + } else if (val[0].application === 'FORCE_LOCAL') { + this.doShow({operation: OperationEvent.StationControl.forcedStationControl.mbar.operation}); + } + val.forEach(item => { + let controlMode = ''; + if (item.application === 'LOCAL' || item.application === 'FORCE_LOCAL') { + controlMode = 'Local'; + } else if (item.application === 'CENTER') { + controlMode = 'Center'; + } + // this.updateTableValue( { code: item.stationCode, controlMode: controlMode }); + this.tableData.forEach((row, index) => { + if (row.code == item.stationCode) { + row.result = this.$t('menu.menuDialog.controlModeTransfersuccees'); + row.control = this.controlProps[controlMode]; + this.removeSelection(item.stationCode); + row.disabled = true; + row.check = false; + this.disabledClose = false; + this.disabledSure = false; + } + }); + }); + } + }, // 深度数据状态 tableData: { handler(val, oldVal) { diff --git a/src/utils/subscribeCallback.js b/src/utils/subscribeCallback.js index 93f02247b..677d1f867 100644 --- a/src/utils/subscribeCallback.js +++ b/src/utils/subscribeCallback.js @@ -210,7 +210,7 @@ function handle(data) { case 'Simulation_Training_Audio_MATCH_RESULT': store.dispatch('trainingNew/handleMatchVoice', msg); break; - case 'Simulation_Control_Transfer_Result': + case 'Simulation_Control_Mode_Apply_Result': store.dispatch('socket/setControlTransfer', msg); break; case 'Simulation_Training_Prepare_Start': // 仿真预加载 diff --git a/src/views/newMap/display/terminals/index.vue b/src/views/newMap/display/terminals/index.vue index a8c8e9f2d..b4ee973ab 100644 --- a/src/views/newMap/display/terminals/index.vue +++ b/src/views/newMap/display/terminals/index.vue @@ -49,7 +49,7 @@