From df174615ba1cca3f7afa3d3cbfe28e4a03151558 Mon Sep 17 00:00:00 2001 From: Yuan Date: Tue, 2 Aug 2022 18:12:03 +0800 Subject: [PATCH] =?UTF-8?q?jd1A=E8=B0=83=E6=95=B4=EF=BC=8C=E4=BF=A1?= =?UTF-8?q?=E5=8F=B7=E6=8C=89=E9=92=AE=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/jmapNew/config/skinCode/datie_jd1a.js | 2 +- src/jmapNew/shape/graph/SignalButton/index.js | 23 +- src/jmapNew/shape/graph/Switch/index.js | 3 - .../theme/datie_jd1a/menus/menuButton.vue | 129 +- .../newMapdraft/mapoperate/controlLamp.vue | 1377 +++++++++-------- 5 files changed, 837 insertions(+), 697 deletions(-) diff --git a/src/jmapNew/config/skinCode/datie_jd1a.js b/src/jmapNew/config/skinCode/datie_jd1a.js index 4321b1263..893539850 100644 --- a/src/jmapNew/config/skinCode/datie_jd1a.js +++ b/src/jmapNew/config/skinCode/datie_jd1a.js @@ -259,7 +259,7 @@ class SkinCode extends defaultStyle { this[deviceType.SignalButton] = { shape: 'roundWithDock', fillColor: '#808080', - showName: true + showName: true, } this[deviceType.SwitchFault] = { diff --git a/src/jmapNew/shape/graph/SignalButton/index.js b/src/jmapNew/shape/graph/SignalButton/index.js index 53b096605..ecbf971d4 100644 --- a/src/jmapNew/shape/graph/SignalButton/index.js +++ b/src/jmapNew/shape/graph/SignalButton/index.js @@ -37,6 +37,7 @@ export default class SignalButton extends Group { this.z = 0 this.model = model this.style = style + this.pressed = false // Line this.create() this.setState(model) @@ -291,7 +292,6 @@ export default class SignalButton extends Group { } } } - // let // { value: 'PICK', label: '接车按钮' }, // { value: 'SHUNT_TERMINAL', label: '调车终端按钮' }, if (!store.getters['map/checkDeviceShow'](this._code)) { @@ -308,5 +308,26 @@ export default class SignalButton extends Group { } } } + pressDown(flg, color) { + if (this.pressed === flg) return + if (this.arcShapeDock1) { + if (flg) { + this.arcShape.attr({ shape: { cy: this.arcShape.shape.cy + 2 }, z: this.z + 2, zlevel: this.zlevel }) + if (color) { + this.arcShape + .animateStyle(true) + .when(0, { fill: '#69666E' }) + .when(1000, { fill: color }) + .when(2000, { fill: '#69666E' }) + .start() + } + } else { + this.arcShape.attr({ shape: { cy: this.arcShape.shape.cy - 2 }, z: this.z + 2, zlevel: this.zlevel }) + this.arcShape.stopAnimation(true) + this.recover() + } + this.pressed = flg + } + } getAnchorPoint() {} } diff --git a/src/jmapNew/shape/graph/Switch/index.js b/src/jmapNew/shape/graph/Switch/index.js index 13be80563..36b36e2e1 100644 --- a/src/jmapNew/shape/graph/Switch/index.js +++ b/src/jmapNew/shape/graph/Switch/index.js @@ -487,8 +487,6 @@ export default class Switch extends Group { if (this.model.switchFaultCode) { const switchFault = this.mapDevice[this.model.switchFaultCode]; if (this.style.SwitchFault.lamp.switchState) { - console.log(fault) - console.log(pos) if (pos === 'N') switchFault.instance.setControlColor(this.style.SwitchFault.lamp.controlColor) else if (pos === 'R') switchFault.instance.setControlColor(this.style.SwitchFault.lamp.reverseColor) else if (pos === 'NO') switchFault.instance.setControlColor(this.style.SwitchFault.lamp.switchingColor) @@ -816,7 +814,6 @@ export default class Switch extends Group { } } else { this.setSwitchFault(model); - console.log(model) // model.pos == 'NO' || model.pos == 'EX'; // N-定位 R-反位 NO-无(失表) EX-挤叉 diff --git a/src/jmapNew/theme/datie_jd1a/menus/menuButton.vue b/src/jmapNew/theme/datie_jd1a/menus/menuButton.vue index 66815d55e..c21b7f3fb 100644 --- a/src/jmapNew/theme/datie_jd1a/menus/menuButton.vue +++ b/src/jmapNew/theme/datie_jd1a/menus/menuButton.vue @@ -225,15 +225,15 @@ export default { components: { PasswordBox, DefectiveShunting, - NoticeInfo + NoticeInfo, }, props: { selected: { type: Object, default: () => { return null - } - } + }, + }, }, data() { return { @@ -264,8 +264,9 @@ export default { buttonName: true, signalName: true, switchName: true, - sectionName: true - } + sectionName: true, + }, + pressedSignalButton: null, } }, computed: { @@ -331,7 +332,7 @@ export default { return CMD.Signal.CMD_SIGNAL_ROUTE_GUIDE } return '' - } + }, }, watch: { '$store.state.menuOperation.buttonOperation': function(val, old) { @@ -370,7 +371,7 @@ export default { const station = this.$store.getters['map/getDeviceByCode'](val) this.$store.getters['map/checkStationGuideMaster'](station.code, station.sGuideMasterLock, station.xGuideMasterLock) } - } + }, }, beforeDestroy() { this.routeDataMap = null @@ -385,12 +386,12 @@ export default { over: true, operation: data.operation, cmdType: data.nextCmdType, - param: data.param + param: data.param, } } else { operate = { operationPre: data.operation, - operation: data.operateNext + operation: data.operateNext, } } this.trainingOperation(operate) @@ -477,7 +478,7 @@ export default { operation: this.Station.powerUnLock.button.operation, cmdType: CMD.Station.CMD_STATION_POWER_ON_UNLOCK, code: this.$store.state.map.showCentralizedStationCode, - param: { stationCode: this.$store.state.map.showCentralizedStationCode } + param: { stationCode: this.$store.state.map.showCentralizedStationCode }, } this.$store .dispatch('training/nextNew', operate) @@ -503,7 +504,7 @@ export default { // S引导总锁按钮点击 guideLockLeftButtonDown() { const operate = { - operation: this.Station.stationMasterLock.leftButton.operation + operation: this.Station.stationMasterLock.leftButton.operation, } this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { if (valid) { @@ -519,7 +520,7 @@ export default { // X引导总锁按钮点击 guideLockRightButtonDown() { const operate = { - operation: this.Station.stationMasterLock.rightButton.operation + operation: this.Station.stationMasterLock.rightButton.operation, } this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { if (valid) { @@ -532,17 +533,18 @@ export default { } }) }, - buttonDown(operation, commandTypeList) { + buttonDown(operation, commandTypeList, color) { this.clearOperate() + this.pressedSignalButton.instance.pressDown(true, color) if (operation != this.Command.cancel.clearMbm.operation) { const operate = { - operation: operation + operation: operation, } // 以下 会弹出密码框 (总人解,区故解) 铅封按钮 const operationList = [ this.Signal.humanTrainRoute.button.operation, this.Section.fault.button.operation, - this.Section.defectiveShunting.button.operation + this.Section.defectiveShunting.button.operation, ] this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { if (valid) { @@ -563,7 +565,7 @@ export default { // 清除按钮 const operate = { start: true, - operation: operation + operation: operation, } this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { if (valid) { @@ -595,7 +597,7 @@ export default { // 排列进路 OR 信号重开操作 arrangementRouteOperation(deviceList) { const operate = { - operation: this.Signal.arrangementRoute.button.operation + operation: this.Signal.arrangementRoute.button.operation, } if (!this.routeDataMap) { this.handleRouteDataMap() @@ -672,8 +674,8 @@ export default { operation: this.$store.state.menuOperation.buttonOperation, cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_ROUTE, param: { - signalCode: model._type === 'Signal' ? model.code : model.signalCode - } + signalCode: model._type === 'Signal' ? model.code : model.signalCode, + }, } this.$store .dispatch('training/nextNew', operate) @@ -693,7 +695,7 @@ export default { code: model.code, operation: this.Signal.guide.button.operation, cmdType: CMD.Signal.CMD_SIGNAL_ROUTE_GUIDE, - param: { signalCode: model.signalCode } + param: { signalCode: model.signalCode }, } const signal = this.$store.getters['map/getDeviceByCode'](model.signalCode) // 信号机引导时间15s以内再次点击引导不需要进行密码输入 @@ -711,7 +713,7 @@ export default { code: model.code, operation: this.$store.state.menuOperation.buttonOperation, val: model.code, - cmdType: CMD.Signal.CMD_SIGNAL_HUMAN_RELEASE_ROUTE + cmdType: CMD.Signal.CMD_SIGNAL_HUMAN_RELEASE_ROUTE, } const signal = this.$store.getters['map/getDeviceByCode'](model.signalCode || model.code) if (model._type === 'SignalButton' && model.type === 'PICK') { @@ -733,7 +735,7 @@ export default { code: model.code, operation: this.$store.state.menuOperation.buttonOperation, cmdType: this.cmdType, - param: { switchCode: code } + param: { switchCode: code }, } this.sendCommand(operate) }, @@ -770,7 +772,7 @@ export default { code: model.code, operation: buttonOperation, cmdType: '', - param: {} + param: {}, } if (model._type === 'Signal' && !this.checkHasTrainButton(model)) { if (buttonOperation === this.Signal.lock.button.operation) { @@ -799,7 +801,7 @@ export default { code: model.code, operation: this.guideLockRightFlag ? this.Switch.guideLock.rightButton : this.Switch.guideLock.leftButton, nextCmdType: CMD.Switch.CMD_SWITCH_MASTER_LOCK, - param: { signalCode: model.signalCode } + param: { signalCode: model.signalCode }, } // 信号机引导时间15s以内再次点击引导不需要进行密码输入 if (signal.guideTime) { @@ -817,7 +819,7 @@ export default { code: model.code, operation: this.$store.state.menuOperation.buttonOperation, cmdType: CMD.Section.CMD_SECTION_FAULT_UNLOCK, - param: { sectionCode: model.code } + param: { sectionCode: model.code }, } this.sendCommand(operate) } @@ -826,6 +828,10 @@ export default { selectedChange() { // 按钮按下时 const model = this.selected // 选择设备 + if (this.pressedSignalButton /* && this.pressedSignalButton.code === model.code */) { + this.pressedSignalButton.instance.pressDown(false) + this.pressedSignalButton = null + } if ( (this.$store.state.training.prdType != '01' && this.$store.state.training.prdType != '10') || this.selected._event !== MouseEvent.Left || @@ -840,7 +846,7 @@ export default { this.Switch.locate.button.operation, this.Switch.reverse.button.operation, this.Switch.block.button.operation, - this.Switch.unblock.button.operation + this.Switch.unblock.button.operation, ] const signalButtonOperation = [ 'LOCATE', //总定 @@ -849,7 +855,9 @@ export default { 'UNLOCK', //解锁 'BLOCK', //单封 'UNBLOCK', //解封, - 'SECTION_FAULT_UNLOCK' //区故解 + 'SECTION_FAULT_UNLOCK', //区故解 + 'CANCEL', //总取消 + 'HUMAN_RELEASE_ROUTE', // 总人解 ] if ((this.guideLockLeftFlag || this.guideLockRightFlag) && model._type === 'SignalButton' && model.type === 'GUIDE') { this.handleGuideLock(model) @@ -884,21 +892,30 @@ export default { this.guideLockRightButtonDown() } } else if (model._type === 'SignalButton' && signalButtonOperation.includes(model.type)) { + this.pressedSignalButton = model + const { lamp } = model.instance.style.SwitchFault //总定总反单锁解锁单封解封 if (model.type === 'LOCATE') { - this.buttonDown(this.Switch.locate.button.operation, ['Switch', 'SwitchFault']) + this.buttonDown(this.Switch.locate.button.operation, ['Switch', 'SwitchFault'], lamp.controlColor) } else if (model.type === 'REVERSE') { - this.buttonDown(this.Switch.reverse.button.operation, ['Switch', 'SwitchFault']) + this.buttonDown(this.Switch.reverse.button.operation, ['Switch', 'SwitchFault'], lamp.reverseColor) } else if (model.type === 'MONOLOCK') { - this.buttonDown(this.Switch.lock.button.operation, ['Switch', 'SwitchFault']) + this.buttonDown(this.Switch.lock.button.operation, ['Switch', 'SwitchFault'], lamp.lockColor) } else if (model.type === 'UNLOCK') { - this.buttonDown(this.Switch.unlock.button.operation, ['Switch', 'SwitchFault']) + this.buttonDown(this.Switch.unlock.button.operation, ['Switch', 'SwitchFault'], lamp.controlColor) } else if (model.type === 'BLOCK') { - this.buttonDown(this.Switch.block.button.operation, ['Switch', 'SwitchFault']) + this.buttonDown(this.Switch.block.button.operation, ['Switch', 'SwitchFault'], lamp.blockColor) } else if (model.type === 'UNBLOCK') { - this.buttonDown(this.Switch.unblock.button.operation, ['Switch', 'SwitchFault']) + this.buttonDown(this.Switch.unblock.button.operation, ['Switch', 'SwitchFault'], lamp.controlColor) } else if (model.type === 'SECTION_FAULT_UNLOCK') { - this.buttonDown(this.Section.fault.button.operation, ['Section']) + //区故解 + this.buttonDown(this.Section.fault.button.operation, ['Section'], lamp.faultColor) + } else if (model.type === 'CANCEL') { + //总取消 + this.buttonDown(this.MixinCommand.totalCancel.button.operation, ['Signal', 'SignalButton']) + } else if (model.type === 'HUMAN_RELEASE_ROUTE') { + //总人解 + this.buttonDown(this.Signal.humanTrainRoute.button.operation, ['Signal', 'SignalButton']) } } else if ( (model._type === 'SignalButton' && !this.checkSignalBlock(model.signalCode)) || @@ -930,11 +947,13 @@ export default { this.deviceList && this.deviceList.length && this.$store.dispatch('training/updateMapState', [ - { code: this.deviceList[0].code, _type: this.deviceList[0]._type, hasSelected: 0 } + { code: this.deviceList[0].code, _type: this.deviceList[0]._type, hasSelected: 0 }, ]) this.deviceList = [] Handler.clear() // 清空操作组 this.$store.dispatch('menuOperation/setButtonOperation', null) + // this.pressedSignalButton && this.pressedSignalButton.instance.pressDown(false) + // this.pressedSignalButton = null }, assistOperateOrChange(model) { // mode.type== @@ -946,8 +965,8 @@ export default { param: { labelEnum: model.labelEnum, stationCode: model.stationCode, - pressDown: model.pressDown ? 0 : 1 // 1按下、0弹起 - } + pressDown: model.pressDown ? 0 : 1, // 1按下、0弹起 + }, }, // 改方 CHANGE_DIRECTION: { @@ -956,8 +975,8 @@ export default { param: { labelEnum: model.labelEnum, stationCode: model.stationCode, - pressDown: model.pressDown ? 0 : 1 // 1按下、0弹起 - } + pressDown: model.pressDown ? 0 : 1, // 1按下、0弹起 + }, }, // 接辅助按钮 PICK_ASSIST: { @@ -966,8 +985,8 @@ export default { nextCmdType: CMD.CTC.CTC_ASSIST_PRESS_RECEIVE_ASSIST, param: { labelEnum: model.labelEnum, - stationCode: model.stationCode - } + stationCode: model.stationCode, + }, }, // 发辅助按钮 DEPART_ASSIST: { @@ -975,8 +994,8 @@ export default { nextCmdType: CMD.CTC.CTC_ASSIST_PRESS_DELIVER_ASSIST, param: { labelEnum: model.labelEnum, - stationCode: model.stationCode - } + stationCode: model.stationCode, + }, }, // 事故按钮 ACCIDENT: { @@ -984,9 +1003,9 @@ export default { nextCmdType: CMD.CTC.CTC_ASSIST_PRESS_ACCIDENT, param: { labelEnum: model.labelEnum, - stationCode: model.stationCode - } - } + stationCode: model.stationCode, + }, + }, } const noPasswordModelTypeMap = { // 闭塞按钮 @@ -995,8 +1014,8 @@ export default { nextCmdType: CMD.CTC.CTC_ASSIST_PRESS_BLOCK, param: { labelEnum: model.labelEnum, - stationCode: model.stationCode - } + stationCode: model.stationCode, + }, }, // 复原按钮 RECOVERY: { @@ -1004,9 +1023,9 @@ export default { nextCmdType: CMD.CTC.CTC_ASSIST_PRESS_RESTORE, param: { labelEnum: model.labelEnum, - stationCode: model.stationCode - } - } + stationCode: model.stationCode, + }, + }, } if (noPasswordModelTypeMap[model.type]) { const operate = { @@ -1014,7 +1033,7 @@ export default { operation: noPasswordModelTypeMap[model.type].operation, code: model.code, param: noPasswordModelTypeMap[model.type].param, - cmdType: noPasswordModelTypeMap[model.type].nextCmdType + cmdType: noPasswordModelTypeMap[model.type].nextCmdType, } this.$store .dispatch('training/nextNew', operate) @@ -1033,7 +1052,7 @@ export default { const operate = { operation: modelTypeMap[model.type].operation, code: model.code, - param: modelTypeMap[model.type].param + param: modelTypeMap[model.type].param, } this.$store .dispatch('training/nextNew', operate) @@ -1066,8 +1085,8 @@ export default { // console.error(error); // this.$refs.noticeInfo.doShow(); // }); - } - } + }, + }, }