diff --git a/src/jmapNew/shape/Switch/index.js b/src/jmapNew/shape/Switch/index.js index 8f3b60099..6ed243a1a 100644 --- a/src/jmapNew/shape/Switch/index.js +++ b/src/jmapNew/shape/Switch/index.js @@ -558,15 +558,29 @@ export default class Switch extends Group { return this.name.getBoundingRect(); } - getShapeTipPoint() { - const text = this.name.getNameText(); - if (text) { - const rect = text.getBoundingRect(); + getShapeTipPoint(opts) { + let rect; + let text; + + switch (opts.subDeviceType) { + case 'enabled': + rect = this.enabledName.getBoundingRect(); + break; + default: + text = this.name.getNameText(); + if (text) { + rect = text.getBoundingRect(); + } + break; + } + + if (rect) { return { x: rect.x + rect.width / 2, y: rect.y }; } + return null; } diff --git a/src/jmapNew/theme/components/utils/menuOperate.js b/src/jmapNew/theme/components/utils/menuOperate.js index 7256d9ef0..b64ae8c53 100644 --- a/src/jmapNew/theme/components/utils/menuOperate.js +++ b/src/jmapNew/theme/components/utils/menuOperate.js @@ -481,6 +481,11 @@ export function commitOperate(operate, paramList, over, val) { step.over = true; step.cmdType = operate.cmdType; } + if (over == 4) { + const codeList = Object.values(paramList); + step.code = codeList[0]; + } + return new Promise(function(resolve, reject) { store.dispatch('training/nextNew', step).then(({ valid }) => { if (valid) { diff --git a/src/jmapNew/theme/xian_02/menus/menuCancel.vue b/src/jmapNew/theme/xian_02/menus/menuCancel.vue index 5099dc1ec..5a5cf5f38 100644 --- a/src/jmapNew/theme/xian_02/menus/menuCancel.vue +++ b/src/jmapNew/theme/xian_02/menus/menuCancel.vue @@ -229,7 +229,6 @@ export default { operate = { send: true, operation: eachCmd.operation.code, - cmdType: eachCmd.cmdType, param: eachCmd.param // 请求栈中参数配置 }; const deviceStatus = {code: eachCmd.device.code, _type: eachCmd.device._type, isCiConfirm: 0}; diff --git a/src/jmapNew/theme/xian_02/menus/menuRequest.vue b/src/jmapNew/theme/xian_02/menus/menuRequest.vue index 4b1d6c641..aff5f367f 100644 --- a/src/jmapNew/theme/xian_02/menus/menuRequest.vue +++ b/src/jmapNew/theme/xian_02/menus/menuRequest.vue @@ -131,11 +131,16 @@ export default { const eachCmd = requestList[0]; let operate = ''; if (eachCmd.ciConfirm) { - operate = { - code: eachCmd.device.code, - operation: eachCmd.operation.code, - param: eachCmd.param // 请求栈中参数配置 - }; + operate = eachCmd.nextStepNotEnd + ? { + operation: eachCmd.operation.code, + param: eachCmd.param // 请求栈中参数配置 + } + : { + code: eachCmd.device.code, + operation: eachCmd.operation.code, + param: eachCmd.param // 请求栈中参数配置 + }; const deviceStatus = {code: eachCmd.device.code, _type: eachCmd.device._type, isCiConfirm: 1}; if (eachCmd.device._type === deviceType.Signal) { deviceStatus.isRequestLock = 0; diff --git a/src/jmapNew/theme/xian_02/menus/menuSignal.vue b/src/jmapNew/theme/xian_02/menus/menuSignal.vue index f4b2ae064..8b853545a 100644 --- a/src/jmapNew/theme/xian_02/menus/menuSignal.vue +++ b/src/jmapNew/theme/xian_02/menus/menuSignal.vue @@ -415,8 +415,8 @@ export default { this.$store.dispatch('menuOperation/pushRequestList', { device: this.selected, operation: { code: OperationEvent.Command.commandXian.confirm.operation, name: '终端信号解封'}, - ciConfirm: true, - param: {signalCode: this.selected.code} + param: {signalCode: this.selected.code}, + cmdType: CMD.Signal.CMD_SIGNAL_UNBLOCK }); this.$store.dispatch('training/updateMapState', [{code: this.selected.code, _type: 'Signal', isRequestLock: 1}]); } else { diff --git a/src/jmapNew/theme/xian_02/menus/menuSwitch.vue b/src/jmapNew/theme/xian_02/menus/menuSwitch.vue index 697be9848..8d9587e64 100644 --- a/src/jmapNew/theme/xian_02/menus/menuSwitch.vue +++ b/src/jmapNew/theme/xian_02/menus/menuSwitch.vue @@ -294,7 +294,7 @@ export default { this.$store.dispatch('menuOperation/pushRequestList', { device: this.selected, operation: { code: OperationEvent.Command.commandXian.confirm.operation, name: '道岔解锁'}, - // cmdType: CMD.Switch.CMD_SWITCH_SINGLE_UNLOCK, + nextStepNotEnd: true, ciConfirm: true, param: operate.param }); @@ -326,12 +326,23 @@ export default { // }); // }, enabledConfirm() { - this.$store.dispatch('menuOperation/pushRequestList', { - device: this.selected, - operation: { code: OperationEvent.Switch.unlock.menu.operation, name: '道岔解锁'}, - cmdType: CMD.Switch.CMD_SWITCH_SINGLE_UNLOCK, - param: { - switchCode: this.selected.code + const step = { + code: this.selected.code, + operation: OperationEvent.Switch.unlock.menu.operation, + subType: 'enabled', + params: {switchCode:this.selected.code} + }; + + this.$store.dispatch('training/nextNew', step).then(({ valid }) => { + if (valid) { + this.$store.dispatch('menuOperation/pushRequestList', { + device: this.selected, + operation: { code: OperationEvent.Command.commandXian.confirm.operation, name: '道岔解锁'}, + cmdType: CMD.Switch.CMD_SWITCH_SINGLE_UNLOCK, + param: { + switchCode: this.selected.code + } + }); } }); }, diff --git a/src/jmapNew/theme/xian_02/operationConfig.js b/src/jmapNew/theme/xian_02/operationConfig.js index d505e5cbc..d776794cc 100644 --- a/src/jmapNew/theme/xian_02/operationConfig.js +++ b/src/jmapNew/theme/xian_02/operationConfig.js @@ -306,9 +306,9 @@ export default { trainingType: 'Switch', productTypes: ['01', '02'], stepVOList: [ - { deviceType: '02', orderNum: 1, operateCode: '104', tip: '鼠标右键菜单选择【道岔单解】' }, + { deviceType: '02', orderNum: 1, operateCode: '104', tip: '鼠标右键菜单选择【道岔单解】', codeType:'SWITCH' }, { deviceType: '02', orderNum: 2, operateCode: '009', tip: '鼠标左键点击【发送请求】按钮' }, - { deviceType: '02', orderNum: 3, operateCode: '104', tip: '鼠标右键点击【E】选择使能' }, + { deviceType: '02', orderNum: 3, operateCode: '104', tip: '鼠标右键点击【E】选择使能', codeType:'SWITCH', subType:'enabled' }, { deviceType: '02', orderNum: 4, operateCode: '009', tip: '鼠标左键点击【发送请求】按钮' } ] }, @@ -377,7 +377,7 @@ export default { operateType: 'Signal_Block', skinCode: '09', trainingName: '信号封锁({5})', - trainingRemark: '信号封锁', + trainingRemark: '信号封锁功能', trainingType: 'Signal', productTypes: ['01', '02'], stepVOList: [ @@ -396,9 +396,7 @@ export default { productTypes: ['01', '02'], stepVOList: [ { deviceType: '04', orderNum: 1, operateCode: '307', tip: '鼠标右键菜单选择【信号解封】' }, - { deviceType: '04', orderNum: 2, operateCode: '009', tip: '鼠标左键点击【发送请求】按钮' }, - { deviceType: '04', orderNum: 3, operateCode: '307', tip: '鼠标右键点击【E】选择使能' }, - { deviceType: '04', orderNum: 4, operateCode: '009', tip: '鼠标左键点击【发送请求】按钮' } + { deviceType: '04', orderNum: 2, operateCode: '009', tip: '鼠标左键点击【发送请求】按钮' } ] }, { @@ -432,7 +430,7 @@ export default { { maxDuration: 15, minDuration: 8, - operateType: 'CMD_TRAIN_HOLD', + operateType: 'Train_Hold', skinCode: '09', trainingName: '列车扣车({5})', trainingRemark: '列车扣车功能', @@ -446,7 +444,7 @@ export default { { maxDuration: 15, minDuration: 8, - operateType: 'CMD_TRAIN_CANCEL_HOLD', + operateType: 'Train_Cancel_Hold', skinCode: '09', trainingName: '列车放行({5})', trainingRemark: '列车放行功能', diff --git a/src/scripts/cmdPlugin/ValidateHandler.js b/src/scripts/cmdPlugin/ValidateHandler.js index 87706d888..0f5a816c5 100644 --- a/src/scripts/cmdPlugin/ValidateHandler.js +++ b/src/scripts/cmdPlugin/ValidateHandler.js @@ -30,6 +30,7 @@ class ValidateHandler { judge (operate) { const steps = Handler.getSteps(); const order = Handler.getOrder(); + let valid = false; if (operate.over && steps.length == 1) { // 右键菜单直接发送校验 if (operate && steps[0] &&