parent
fbdb48dc08
commit
f01c445b25
@ -583,3 +583,10 @@ export function enterSimulationByTeacher(group) {
|
||||
method: 'post'
|
||||
});
|
||||
}
|
||||
/** 切换角色后触发消息 */
|
||||
export function getUnreceivedMessages(simulationId, memberId) {
|
||||
return request({
|
||||
url: `/simulation/${simulationId}/${memberId}/unreceivedMessages`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
@ -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) {
|
||||
|
@ -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': // 仿真预加载
|
||||
|
@ -49,7 +49,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {getSimulationMemberList, getAllSimulationUser} from '@/api/simulation';
|
||||
import {getSimulationMemberList, getAllSimulationUser, getUnreceivedMessages} from '@/api/simulation';
|
||||
import {getToken} from '@/utils/auth';
|
||||
import {creatSubscribe, clearSubscribe, getTopic} from '@/utils/stomp';
|
||||
import { defaultCallback, stateCallback, diagramSimCallback } from '@/utils/subscribeCallback';
|
||||
@ -166,6 +166,9 @@ export default {
|
||||
this.$store.dispatch('training/setMapDefaultState');
|
||||
this.isFirst = false;
|
||||
}
|
||||
if (this.$store.state.training.domConfig.trainingDesign) {
|
||||
getUnreceivedMessages(this.$route.query.group, this.$store.state.training.myMemberId);
|
||||
}
|
||||
},
|
||||
'$store.state.socket.memberChangeCount': function () { // 仿真成员变更
|
||||
this.initMemberUserInfo();
|
||||
|
Loading…
Reference in New Issue
Block a user