From 6e477bef89ddf53e2b89d9aeb3338aa2e95910cb Mon Sep 17 00:00:00 2001 From: fan Date: Wed, 6 Dec 2023 17:23:47 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=99=E5=A4=A7=E7=BD=91=E6=96=B0=E6=93=8D?= =?UTF-8?q?=E4=BD=9C=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/jmapNew/map.js | 22 +++---- src/jmapNew/shape/graph/Station/index.js | 21 +++++- .../theme/components/utils/menuOperate.js | 8 +++ .../theme/xian_02/menus/menuStation.vue | 30 ++++++++- .../theme/xian_02/menus/menuStationStand.vue | 65 ++++++++++++++----- .../theme/xian_02/menus/popStationStand.vue | 4 +- 6 files changed, 115 insertions(+), 35 deletions(-) diff --git a/src/jmapNew/map.js b/src/jmapNew/map.js index eefb82d23..68b0b8a75 100644 --- a/src/jmapNew/map.js +++ b/src/jmapNew/map.js @@ -585,18 +585,16 @@ class Jlmap { if (elem.hasOwnProperty('applicantId')) { controlTransferList.push(elem); } - if (!elem.applicantId) { - const oDevice = this.mapDevice[code] || deviceFactory(type, elem, this.showConfig); - const guideLock = this.mapDevice[oDevice.guideLockCode]; - const guideLockStatus = {totalGuideLock: elem.totalGuideLock}; - if (guideLock && this.hookHandle(guideLock, guideLockStatus)) { - this.$painter.update(guideLock); - } - if (elem.dispose) { - this.$painter.delete(oDevice); - } else { - this.$painter.update(oDevice); - } + const oDevice = this.mapDevice[code] || deviceFactory(type, elem, this.showConfig); + const guideLock = this.mapDevice[oDevice.guideLockCode]; + const guideLockStatus = {totalGuideLock: elem.totalGuideLock}; + if (guideLock && this.hookHandle(guideLock, guideLockStatus)) { + this.$painter.update(guideLock); + } + if (elem.dispose) { + this.$painter.delete(oDevice); + } else { + this.$painter.update(oDevice); } store.commit('map/mapStationStateUpdate'); } else if (elem.deviceType === 'STATION_DIRECTION') { diff --git a/src/jmapNew/shape/graph/Station/index.js b/src/jmapNew/shape/graph/Station/index.js index 13a8bfd8a..fdaa931e8 100644 --- a/src/jmapNew/shape/graph/Station/index.js +++ b/src/jmapNew/shape/graph/Station/index.js @@ -954,6 +954,7 @@ export default class Station extends Group { this.substationArrowsControl && this.substationArrowsControl.setColor(this.style.Station.StationControl.lamp.grayColor); this.emergencyArrowsControl && this.emergencyArrowsControl.setColor(this.style.Station.StationControl.lamp.grayColor); this.stationControlCC && this.stationControlCC.setStyle({text:'EL', textFill:this.style.Station.StationControl.text.emergencyControlColor}); + this.stationControlCC && this.stationControlCC.stopAnimation(true); this.veryControl && this.veryControl.setColor(this.style.Station.StationControl.veryControl.defaultColor); this.selfDiscipline && this.selfDiscipline.setColor(this.style.Station.StationControl.selfDiscipline.defaultColor); this.selfDisciplineControl && this.selfDisciplineControl.setColor(this.style.Station.StationControl.selfDisciplineControl.defaultColor); @@ -1047,7 +1048,25 @@ export default class Station extends Group { device && device.instance && device.instance.setCount(countNum); } } - + if (this.style.Station.StationControl.special && model.apply2TheControlMode) { + this.controlTextFlash(model.apply2TheControlMode); + } + } + } + controlTextFlash(apply2TheControlMode) { + if (this.stationControlCC && apply2TheControlMode === 'Local' ) { + let color; + if (apply2TheControlMode === 'Local') { + color = this.style.Station.StationControl.text.stationControlColor; + this.stationControlCC && this.stationControlCC.setStyle({text:'LC', textFill:color}); + } else if (apply2TheControlMode === 'Center') { + color = this.style.Station.StationControl.text.centerControlColor; + this.stationControlCC && this.stationControlCC.setStyle({text:'CC', textFill:color}); + } + this.stationControlCC.animateStyle(true) + .when(500, {textFill: '#000'}) + .when(1000, {textFill: color}) + .when(1500, {textFill: '#000'}).start(); } } handleGuideLock(model) { diff --git a/src/jmapNew/theme/components/utils/menuOperate.js b/src/jmapNew/theme/components/utils/menuOperate.js index df1d45f6f..8c3d0045e 100644 --- a/src/jmapNew/theme/components/utils/menuOperate.js +++ b/src/jmapNew/theme/components/utils/menuOperate.js @@ -388,6 +388,14 @@ export const menuOperate = { // 非常站控 大铁线路 operation: OperationEvent.StationControl.requestVeryControl.menu.operation, cmdType:CMD.ControlConvertMenu.CMD_CM_SPECIAL_STATION_CONTROL + }, + replyStationControl: { + operation: OperationEvent.StationControl.controlResponse.agree.operation, + cmdType: CMD.ControlConvertMenu.CMD_CM_REPLY_STATION_CONTROL + }, + replyCenterControl: { + operation: OperationEvent.StationControl.controlResponse.agree.operation, + cmdType: CMD.ControlConvertMenu.CMD_CM_REPLY_CENTER_CONTROL } }, TrainWindow: { diff --git a/src/jmapNew/theme/xian_02/menus/menuStation.vue b/src/jmapNew/theme/xian_02/menus/menuStation.vue index bb22e1223..10f2eaddf 100644 --- a/src/jmapNew/theme/xian_02/menus/menuStation.vue +++ b/src/jmapNew/theme/xian_02/menus/menuStation.vue @@ -64,10 +64,10 @@ export default { // 暂无功能,先disabled label: '授权', disabled: true, - handler: this.setStationControl, + handler: this.work === 'localWork' ? this.agreeCenterControl : this.agreeStationControl, isDisabled: (station, work) => { if (work === 'localWork') { - return true; + return station.controlMode !== 'Local'; } else { return station.controlMode !== 'Center'; } @@ -469,6 +469,32 @@ export default { } }); }, + agreeStationControl() { + commitOperate(menuOperate.StationControl.replyStationControl, {stationCode: this.selected.code }, 0).then(({valid, operate})=>{ + if (valid) { + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + this.$store.dispatch('menuOperation/pushRequestList', { + device: this.selected, + operation: { code: OperationEvent.Command.commandXian.confirm.operation, name: '授权控制'}, + cmdType: CMD.ControlConvertMenu.CMD_CM_REPLY_STATION_CONTROL, + param: { replyVOList:[{ stationCode: this.selected.code, agree: true}] } + }); + } + }); + }, + agreeCenterControl() { + commitOperate(menuOperate.StationControl.replyCenterControl, {stationCode: this.selected.code }, 0).then(({valid, operate})=>{ + if (valid) { + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + this.$store.dispatch('menuOperation/pushRequestList', { + device: this.selected, + operation: { code: OperationEvent.Command.commandXian.confirm.operation, name: '授权控制'}, + cmdType: CMD.ControlConvertMenu.CMD_CM_REPLY_CENTER_CONTROL, + param: { replyVOList:[{ stationCode: this.selected.code, agree: true}] } + }); + } + }); + }, setEmergencyControl() { // 紧急站控 commitOperate(menuOperate.StationControl.emergencyStationControl, {stationCode:this.selected.code}, 0).then(({valid, operate})=>{ diff --git a/src/jmapNew/theme/xian_02/menus/menuStationStand.vue b/src/jmapNew/theme/xian_02/menus/menuStationStand.vue index 9ca57fa94..6b81ecb9c 100644 --- a/src/jmapNew/theme/xian_02/menus/menuStationStand.vue +++ b/src/jmapNew/theme/xian_02/menus/menuStationStand.vue @@ -50,10 +50,10 @@
跳停
-
设置/取消 所有列车跳停本站
+
设置/取消 所有列车跳停本站
-
所有列车跳停本站
+
所有列车跳停本站
@@ -149,9 +149,12 @@ export default { title: '', standDetainColor: '#FFF', detainStatusColor: '#FFF', + standJumpColor: '#FFF', + jumpStatusColor: '#FFF', bgColor: '#000', fontColor: '#FFF', - detainInterval: '' + detainInterval: '', + jumpInterval: '' }; }, computed: { @@ -203,9 +206,7 @@ export default { this.initStatus(list); }, '$store.state.socket.equipmentStatus': function (val) { - if (this.selected) { - this.detainStatusColor = this.selected.centerHoldTrain || this.selected.stationHoldTrain ? '#FF0' : '#FFF'; - } + this.initDeviceStatus(); } }, methods: { @@ -222,6 +223,7 @@ export default { if (valid) { this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); const requestList = this.$store.state.menuOperation.requestList; + this.initDeviceStatus(); this.initStatus(requestList || []); this.position = position; this.dialogShow = true; @@ -233,21 +235,37 @@ export default { this.$refs.noticeInfo.doShow(); }); }, + initDeviceStatus() { + if (this.selected) { + const device = this.$store.getters['map/getDeviceByCode'](this.selected.code); + this.detainStatusColor = device.centerHoldTrain || device.stationHoldTrain ? '#FF0' : '#FFF'; + this.jumpStatusColor = device.assignSkip || device.allSkip ? '#FF0' : '#FFF'; + } + }, initStatus(requestList) { this.standDetainColor = '#FFF'; this.bgColor = '#000'; this.fontColor = '#FFF'; + this.clearTimer(); + requestList.forEach(item => { + if (item.device && item.device.code === this.selected.code) { + if (item.operation.name === '设置扣车' || item.operation.name === '取消扣车') { + this.standDetain(); + } else if (item.operation.name === '跳停本站' || item.operation.name === '取消跳停') { + this.standJump(); + } + } + }); + }, + clearTimer() { if (this.detainInterval) { clearInterval(this.detainInterval); this.detainInterval = ''; } - requestList.forEach(item => { - if (item.device && item.device.code === this.selected.code) { - if (item.operation.code === OperationEvent.StationStand.setDetainTrain.menu.operation || item.operation.code === OperationEvent.StationStand.cancelDetainTrain.menu.operation) { - this.standDetain(); - } - } - }); + if (this.jumpInterval) { + clearInterval(this.jumpInterval); + this.jumpInterval = ''; + } }, doClose() { const step = { @@ -259,10 +277,7 @@ export default { this.loading = false; this.dialogShow = false; this.$store.dispatch('training/emitTipFresh'); - if (this.detainInterval) { - clearInterval(this.detainInterval); - this.detainInterval = ''; - } + this.clearTimer(); } }); }, @@ -343,7 +358,21 @@ export default { } else { this.standDetainColor = '#000'; } - }, 1000); + }, 500); + } + }, + standJump() { + this.standJumpColor = '#FF0'; + this.bgColor = '#FFF'; + this.fontColor = '#000'; + if (!this.jumpInterval) { + this.jumpInterval = setInterval(() => { + if (this.standJumpColor !== '#FF0') { + this.standJumpColor = '#FF0'; + } else { + this.standJumpColor = '#000'; + } + }, 500); } }, setRuningMode(mode, direction) { diff --git a/src/jmapNew/theme/xian_02/menus/popStationStand.vue b/src/jmapNew/theme/xian_02/menus/popStationStand.vue index c27848541..406b8fec1 100644 --- a/src/jmapNew/theme/xian_02/menus/popStationStand.vue +++ b/src/jmapNew/theme/xian_02/menus/popStationStand.vue @@ -369,7 +369,7 @@ export default { this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$store.dispatch('menuOperation/pushRequestList', { device: this.selected, - operation: { code: OperationEvent.Command.commandXian.confirm.operation, name: '跳停本站请求成功'}, + operation: { code: OperationEvent.Command.commandXian.confirm.operation, name: '跳停本站'}, cmdType: CMD.Stand.CMD_STAND_SET_JUMP_STOP, param: step.param }); @@ -390,7 +390,7 @@ export default { this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$store.dispatch('menuOperation/pushRequestList', { device: this.selected, - operation: { code: OperationEvent.Command.commandXian.confirm.operation, name: '取消跳停请求成功'}, + operation: { code: OperationEvent.Command.commandXian.confirm.operation, name: '取消跳停'}, cmdType: CMD.Stand.CMD_STAND_CANCEL_JUMP_STOP, param: step.param });