diff --git a/src/jmapNew/theme/components/utils/menuOperate.js b/src/jmapNew/theme/components/utils/menuOperate.js index ab2ff6ade..970f12e3a 100644 --- a/src/jmapNew/theme/components/utils/menuOperate.js +++ b/src/jmapNew/theme/components/utils/menuOperate.js @@ -926,6 +926,21 @@ export const menuOperate = { equipmentConstructionQuery:{ operation: OperationEvent.RailCommand.equipmentConstructionQuery.menu.operation, cmdType: CMD.RAIL.CMD_RAIL_EQUIPMENT_CONSTRUCTION_INFO_QUERY + }, + // 防洪安全上岗签到表 提交 + floodControlSafetyTableSave:{ + operation: OperationEvent.FloodSafetyRegister.formInput.submit.operation, + cmdType: CMD.RAIL.CMD_RAIL_FLOOD_CONTROL_SAFETY_SUBMIT + }, + // 防洪安全上岗签到表 更新 + floodControlSafetyTableUpdate:{ + operation: OperationEvent.FloodSafetyRegister.formInput.update.operation, + cmdType: CMD.RAIL.CMD_RAIL_FLOOD_CONTROL_SAFETY_UPDATE + }, + // 非正常情况接发列车关键环节控制表 提交 + abnormalTrainTableSave:{ + operation: OperationEvent.AbnormalTrainRegister.formInput.submit.operation, + cmdType: CMD.RAIL.CMD_RAIL_ABNORMAL_TRAIN_SAVE } }, Conversation: { diff --git a/src/jmapNew/transformHandle.js b/src/jmapNew/transformHandle.js index bb6e25b8c..0c087471b 100644 --- a/src/jmapNew/transformHandle.js +++ b/src/jmapNew/transformHandle.js @@ -41,7 +41,7 @@ class TransformHandle { // const scale = parseFloat((20 / this.scaleIndex).toFixed(2)); const scaleRate = this.$painter.$jmap.$options.getScaleRate(); if (scaleRate < 1) { - view.trainB.mouseEvent.arrowText.setStyle({ textFont: (10 / scaleRate).ceil() + 'px consolas' }); + view.trainB.mouseEvent.arrowText.setStyle({ textFont: Math.ceil(10 / scaleRate) + 'px consolas' }); } } diff --git a/src/scripts/cmdPlugin/CommandEnum.js b/src/scripts/cmdPlugin/CommandEnum.js index a237dfac7..39578ec1a 100644 --- a/src/scripts/cmdPlugin/CommandEnum.js +++ b/src/scripts/cmdPlugin/CommandEnum.js @@ -501,7 +501,10 @@ export default { CMD_RAIL_QUERY_REGISTER: {value: 'RAIL_QUERY_REGISTER', label: '查询行车簿册'}, CMD_RAIL_GIVE_TICKET_TO: {value: 'RAIL_GIVE_TICKET_TO', label: '给出票据'}, CMD_RAIL_EQUIPMENT_CONSTRUCTION_INFO_SAVE:{value: 'EQUIPMENT_CONSTRUCTION_INFO_SAVE', label: '填写施工登记簿册'}, - CMD_RAIL_EQUIPMENT_CONSTRUCTION_INFO_QUERY:{value: 'EQUIPMENT_CONSTRUCTION_INFO_QUERY', label: '查询施工登记簿册'} + CMD_RAIL_EQUIPMENT_CONSTRUCTION_INFO_QUERY:{value: 'EQUIPMENT_CONSTRUCTION_INFO_QUERY', label: '查询施工登记簿册'}, + CMD_RAIL_FLOOD_CONTROL_SAFETY_SUBMIT:{value: 'CONTROL_FLOOD_SIGN_SAVE', label: '填写防洪安全上岗签到表'}, + CMD_RAIL_FLOOD_CONTROL_SAFETY_UPDATE:{value: 'CONTROL_FLOOD_SIGN_UPDATE', label: '更新防洪安全上岗签到表'}, + CMD_RAIL_ABNORMAL_TRAIN_SAVE:{value: 'KEY_LINK_CONTROL_INFO_SAVE', label: '填写非正常情况接发列车关键环节控制表'} }, Conversation: { CMD_Conversation_Chat_Text: {value: 'Conversation_Chat_Text', label: '发送文本消息'}, diff --git a/src/scripts/cmdPlugin/newValidateHandler.js b/src/scripts/cmdPlugin/newValidateHandler.js index 460d15065..2e152eeb3 100644 --- a/src/scripts/cmdPlugin/newValidateHandler.js +++ b/src/scripts/cmdPlugin/newValidateHandler.js @@ -22,22 +22,34 @@ class ValidateHandler { valid = false; } return valid; } - checkDeviceCodeConsistent(deviceCode1, deviceCode2) { - const linkDeviceCode1 = store.state.map.linkSwitchMap[deviceCode1]; - console.log(deviceCode1, deviceCode2, linkDeviceCode1, linkDeviceCode1 === deviceCode2); + isNeedCheckLinkSwitch(operation) { + // 道岔单锁/单解 单操到定位/反位 + const needCheckLinkSwitchOperation = [OperationEvent.Switch.lock.menu.operation, OperationEvent.Switch.unlock.menu.operation, + OperationEvent.Switch.locate.menu.operation, OperationEvent.Switch.reverse.menu.operation, OperationEvent.Switch.lock.button.operation, + OperationEvent.Switch.unlock.button.operation, OperationEvent.Switch.locate.button.operation, OperationEvent.Switch.reverse.button.operation, + OperationEvent.Switch.turnout.menu.operation, OperationEvent.Switch.turnout.menuButton.operation, OperationEvent.Switch.lock.menuButton.operation, + OperationEvent.Switch.unlock.menuButton.operation, OperationEvent.Switch.locate.menuButton.operation, OperationEvent.Switch.reverse.menuButton.operation]; + return needCheckLinkSwitchOperation.includes(operation); + } + checkDeviceCodeConsistent(deviceCode1, deviceCode2, operation) { + let linkDeviceCode1 = ''; + if (this.isNeedCheckLinkSwitch(operation)) { + linkDeviceCode1 = store.state.map.linkSwitchMap[deviceCode1]; + } return deviceCode1 === deviceCode2 || linkDeviceCode1 === deviceCode2; } - checkParamConsistent(param1, param2) { + checkParamConsistent(param1, param2, operation) { const linkParam = {}; let linkDataFlag = false; - for (const key in param1) { - linkParam[key] = param1[key]; - if (store.state.map.linkSwitchMap[param1[key]]) { - linkDataFlag = true; - linkParam[key] = store.state.map.linkSwitchMap[param1[key]]; + if (this.isNeedCheckLinkSwitch(operation)) { + for (const key in param1) { + linkParam[key] = param1[key]; + if (store.state.map.linkSwitchMap[param1[key]]) { + linkDataFlag = true; + linkParam[key] = store.state.map.linkSwitchMap[param1[key]]; + } } } - console.log(linkDataFlag, linkParam, param2, objectIsEqual(linkParam, param2)); if (linkDataFlag) { return objectIsEqual(param1, param2) || objectIsEqual(linkParam, param2); } else { @@ -58,7 +70,7 @@ class ValidateHandler { valid = (cmd === stepOperation.operationType) && valid; } if (operate.code || stepOperation.deviceCode) { - valid = this.checkDeviceCodeConsistent(operate.code, stepOperation.deviceCode) && valid; + valid = this.checkDeviceCodeConsistent(operate.code, stepOperation.deviceCode, operate.operation) && valid; } if (stepOperation.subType) { valid = (operate.subType === stepOperation.subType) && valid; @@ -70,29 +82,26 @@ class ValidateHandler { valid = (operate.userOperationType === stepOperation.userOperationType) && valid; } if (stepOperation.val) { - // || operate.val valid = ((operate.val).toString() === stepOperation.val.toString()) && valid; } const opParam = operate.param === undefined ? {} : operate.param; if ((opParam || stepOperation.params) && !opParam.hasOwnProperty('fileBase64Str')) { - valid = this.checkParamConsistent(opParam, stepOperation.params) && valid; + valid = this.checkParamConsistent(opParam, stepOperation.params, operate.operation) && valid; } if (valid && store.state.trainingNew.voiceStepIndex > -1) { !Handler.isLastVoiceStep() && store.dispatch('trainingNew/voiceStepIndexIncrease'); } else if (valid && Handler.isLastOperation()) { - store.dispatch('trainingNew/handleStepRecord', { type:'OVER', stepOperation, operate }); + store.dispatch('trainingNew/handleStepRecord', { type:'OVER', stepOperation }); Handler.nextStep(); } else if (valid) { store.dispatch('trainingNew/operateOrderIncrease'); - store.dispatch('trainingNew/handleStepRecord', { type:'CONTINUE', stepOperation, operate }); + store.dispatch('trainingNew/handleStepRecord', { type:'CONTINUE', stepOperation }); Handler.judgeIsTextSendOperation(); } else { console.log(operate, stepOperation, '----------'); - if (store.state.trainingNew.voiceStepIndex < 0) { - store.dispatch('trainingNew/handleStepRecord', { type:'ERROR', stepOperation, operate }); - } + store.dispatch('trainingNew/handleStepRecord', { type:'ERROR', stepOperation }); console.error('校验失败;'); } return valid; diff --git a/src/store/modules/trainingNew.js b/src/store/modules/trainingNew.js index 96d3a9bfe..210444b43 100644 --- a/src/store/modules/trainingNew.js +++ b/src/store/modules/trainingNew.js @@ -103,7 +103,6 @@ const training = { setVoiceStepList: (state, voiceStepList) => { state.voiceStepIndex = 0; state.voiceStepList = voiceStepList; - console.log(voiceStepList, state.voiceStepIndex); }, voiceStepIndexIncrease: (state) => { state.voiceStepIndex++; @@ -115,7 +114,10 @@ const training = { setExamSwitch: (state, flag) => { state.examSwitch = flag; }, - handleStepRecord: (state, { type, stepOperation, operate }) => { + handleStepRecord: (state, { type, stepOperation }) => { + if (!state.stepRecord.length) { + return; + } const step = state.stepRecord[state.stepRecord.length - 1]; if (!step.clientOperations.length || step.clientOperations[step.clientOperations.length - 1].id !== stepOperation.id) { step.clientOperations.push({ id: stepOperation.id }); @@ -198,19 +200,23 @@ const training = { commit('clearVoiceStepList'); }, handleMatchVoice: ({ commit }, info) => { + const stepOperation = Handler.getTrainingOperation(); if (info && info.content === 'true') { const rightMsg = {errMsg: LangStorage.getLang() === 'en' ? "Correct operation! That's great!" : '操作正确!真棒!', color: 'green'}; commit('setOperateErrMsg', rightMsg); if (Handler.isLastOperation()) { + store.dispatch('trainingNew/handleStepRecord', { type:'OVER', stepOperation }); Handler.nextStep(); commit('clearVoiceStepList'); } else { + store.dispatch('trainingNew/handleStepRecord', { type:'CONTINUE', stepOperation }); commit('clearVoiceStepList'); commit('operateOrderIncrease'); Handler.judgeIsTextSendOperation(); } } else if (info && info.content === 'false') { const errorMsg = {errMsg: LangStorage.getLang() === 'en' ? 'operation mistake!' : '操作错误!', color: 'red'}; + store.dispatch('trainingNew/handleStepRecord', { type:'ERROR', stepOperation }); commit('setOperateErrMsg', errorMsg); Handler.handleVoiceStepList(); } @@ -218,8 +224,8 @@ const training = { setExamSwitch: ({ commit }, flag) => { commit('setExamSwitch', flag); }, - handleStepRecord: ({ commit }, { type, stepOperation, operate }) => { - commit('handleStepRecord', { type, stepOperation, operate }); + handleStepRecord: ({ commit }, { type, stepOperation }) => { + commit('handleStepRecord', { type, stepOperation }); } } }; diff --git a/src/views/newMap/display/exam/examPanel.vue b/src/views/newMap/display/exam/examPanel.vue index 2e50d5c5a..cb3eabae9 100644 --- a/src/views/newMap/display/exam/examPanel.vue +++ b/src/views/newMap/display/exam/examPanel.vue @@ -147,7 +147,9 @@ export default { } this.$store.dispatch('trainingNew/setTrainingDetail', detailResp.data); await loadPublishTraining(this.$route.query.group, training.questionId, {mode: ''}); - await assignUsersPlayRoles([{userId: this.$store.state.user.id, memberId: this.examSceneRuleMap[training.questionId]}], this.$route.query.group); + if (detailResp.data.type === 'SCENE') { + await assignUsersPlayRoles([{userId: this.$store.state.user.id, memberId: this.examSceneRuleMap[training.questionId]}], this.$route.query.group); + } this.$message.success('加载实训成功!'); } catch (e) { this.$message.error('加载实训失败!'); diff --git a/src/views/newMap/display/terminals/abnormalTrain/controlTable.vue b/src/views/newMap/display/terminals/abnormalTrain/controlTable.vue index 115fbdc8e..4c7c083b5 100644 --- a/src/views/newMap/display/terminals/abnormalTrain/controlTable.vue +++ b/src/views/newMap/display/terminals/abnormalTrain/controlTable.vue @@ -158,7 +158,8 @@