From c4ee6b035043e92e943cb52020c2a84d4ffcde59 Mon Sep 17 00:00:00 2001 From: fan Date: Thu, 1 Dec 2022 16:58:12 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=BF=E7=9C=9F=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../theme/fuzhou_01/menus/menuSection.vue | 16 +-- .../theme/fuzhou_01/menus/menuSignal.vue | 24 ++--- .../theme/fuzhou_01/menus/menuStation.vue | 49 ++++------ .../fuzhou_01/menus/menuStationStand.vue | 54 ++++++++--- .../theme/fuzhou_01/menus/menuSwitch.vue | 97 ++++++++++++++++--- 5 files changed, 162 insertions(+), 78 deletions(-) diff --git a/src/jmapNew/theme/fuzhou_01/menus/menuSection.vue b/src/jmapNew/theme/fuzhou_01/menus/menuSection.vue index 7b7cdc9f2..f68847800 100644 --- a/src/jmapNew/theme/fuzhou_01/menus/menuSection.vue +++ b/src/jmapNew/theme/fuzhou_01/menus/menuSection.vue @@ -63,7 +63,7 @@ export default { cmdType: CMD.Section.CMD_SECTION_FAULT_UNLOCK, isDisabled: (section, work) => { if (work === 'localWork') { - return this.$store.state.training.roleDeviceCode === section.stationCode; + return this.$store.state.training.roleDeviceCode !== section.stationCode; } else { return false; } @@ -76,7 +76,7 @@ export default { cmdType: CMD.Section.CMD_SECTION_CUT_OFF, isDisabled: (section, work) => { if (work === 'localWork') { - return this.$store.state.training.roleDeviceCode === section.stationCode && section.cutOff === 1; + return this.$store.state.training.roleDeviceCode !== section.stationCode || section.cutOff === 1; } else { return section.cutOff === 1; } @@ -89,7 +89,7 @@ export default { cmdType: CMD.Section.CMD_SECTION_ACTIVE, isDisabled: (section, work) => { if (work === 'localWork') { - return this.$store.state.training.roleDeviceCode === section.stationCode && section.cutOff !== 1; + return this.$store.state.training.roleDeviceCode !== section.stationCode || section.cutOff !== 1; } else { return section.cutOff !== 1; } @@ -102,7 +102,7 @@ export default { cmdType: CMD.Section.CMD_SECTION_AXIS_PRE_RESET, isDisabled: (section, work) => { if (work === 'localWork') { - return this.$store.state.training.roleDeviceCode === section.stationCode; + return this.$store.state.training.roleDeviceCode !== section.stationCode; } else { return false; } @@ -116,7 +116,7 @@ export default { // isDisabled: section => section.blockade === 1, isDisabled: (section, work) => { if (work === 'localWork') { - return this.$store.state.training.roleDeviceCode === section.stationCode && section.blockade === 1; + return this.$store.state.training.roleDeviceCode !== section.stationCode || section.blockade === 1; } else { return section.blockade === 1; } @@ -129,7 +129,7 @@ export default { cmdType: CMD.Section.CMD_SECTION_UNBLOCK, isDisabled: (section, work) => { if (work === 'localWork') { - return this.$store.state.training.roleDeviceCode === section.stationCode && section.blockade !== 1; + return this.$store.state.training.roleDeviceCode !== section.stationCode || section.blockade !== 1; } else { return section.blockade !== 1; } @@ -142,7 +142,7 @@ export default { cmdType: CMD.Section.CMD_SECTION_SET_LIMIT_SPEED, isDisabled: (section, work) => { if (work === 'localWork') { - return this.$store.state.training.roleDeviceCode === section.stationCode && section.speedUpLimit !== -1; + return this.$store.state.training.roleDeviceCode !== section.stationCode || section.speedUpLimit !== -1; } else { return section.speedUpLimit !== -1; } @@ -155,7 +155,7 @@ export default { cmdType: CMD.Section.CMD_SECTION_CANCEL_LIMIT_SPEED, isDisabled: (section, work) => { if (work === 'localWork') { - return this.$store.state.training.roleDeviceCode === section.stationCode && section.speedUpLimit === -1; + return this.$store.state.training.roleDeviceCode !== section.stationCode || section.speedUpLimit === -1; } else { return section.speedUpLimit === -1; } diff --git a/src/jmapNew/theme/fuzhou_01/menus/menuSignal.vue b/src/jmapNew/theme/fuzhou_01/menus/menuSignal.vue index da1cbcdd0..72f1ae316 100644 --- a/src/jmapNew/theme/fuzhou_01/menus/menuSignal.vue +++ b/src/jmapNew/theme/fuzhou_01/menus/menuSignal.vue @@ -67,7 +67,7 @@ export default { cmdType: CMD.Signal.CMD_SIGNAL_SET_ROUTE, isDisabled: (signal, work) => { if (work === 'localWork') { - return this.$store.state.training.roleDeviceCode === signal.stationCode; + return this.$store.state.training.roleDeviceCode !== signal.stationCode; } else { return false; } @@ -79,7 +79,7 @@ export default { cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_ROUTE, isDisabled: (signal, work) => { if (work === 'localWork') { - return this.$store.state.training.roleDeviceCode === signal.stationCode; + return this.$store.state.training.roleDeviceCode !== signal.stationCode; } else { return false; } @@ -91,7 +91,7 @@ export default { cmdType: CMD.Signal.CMD_SIGNAL_BLOCK, isDisabled: (signal, work) => { if (work === 'localWork') { - return this.$store.state.training.roleDeviceCode === signal.stationCode && signal.blockade === 1; + return this.$store.state.training.roleDeviceCode !== signal.stationCode || signal.blockade === 1; } else { return signal.blockade === 1; } @@ -103,7 +103,7 @@ export default { cmdType: CMD.Signal.CMD_SIGNAL_UNBLOCK, isDisabled: (signal, work) => { if (work === 'localWork') { - return this.$store.state.training.roleDeviceCode === signal.stationCode && signal.blockade !== 1; + return this.$store.state.training.roleDeviceCode !== signal.stationCode || signal.blockade !== 1; } else { return signal.blockade !== 1; } @@ -115,7 +115,7 @@ export default { cmdType: CMD.Signal.CMD_SIGNAL_REOPEN_SIGNAL, isDisabled: (signal, work) => { if (work === 'localWork') { - return this.$store.state.training.roleDeviceCode === signal.stationCode; + return this.$store.state.training.roleDeviceCode !== signal.stationCode; } else { return false; } @@ -127,7 +127,7 @@ export default { cmdType: CMD.Signal.CMD_SIGNAL_CLOSE_SIGNAL, isDisabled: (signal, work) => { if (work === 'localWork') { - return this.$store.state.training.roleDeviceCode === signal.stationCode; + return this.$store.state.training.roleDeviceCode !== signal.stationCode; } else { return false; } @@ -137,7 +137,7 @@ export default { label: '进路引导', handler: this.guide, cmdType: CMD.Signal.CMD_SIGNAL_ROUTE_GUIDE, - isDisabled: (signal, work) => this.$store.state.training.roleDeviceCode === signal.stationCode, + isDisabled: (signal, work) => this.$store.state.training.roleDeviceCode !== signal.stationCode, isShow: (signal, work) => work === 'localWork' }, { @@ -150,28 +150,28 @@ export default { label: this.$t('menu.menuSignal.setInterlockAutoRoute'), handler: this.setAutoInterlock, cmdType: CMD.Signal.CMD_SIGNAL_SET_CI_AUTO, - isDisabled: (signal, work) => this.$store.state.training.roleDeviceCode === signal.stationCode && signal.fleetMode === 1, + isDisabled: (signal, work) => this.$store.state.training.roleDeviceCode !== signal.stationCode || signal.fleetMode === 1, isShow: (signal, work) => work === 'localWork' }, { label: this.$t('menu.menuSignal.cancelInterlockAutoRoute'), handler: this.cancelAutoInterlock, cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_CI_AUTO, - isDisabled: (signal, work) => this.$store.state.training.roleDeviceCode === signal.stationCode && signal.fleetMode === 0, + isDisabled: (signal, work) => this.$store.state.training.roleDeviceCode !== signal.stationCode || signal.fleetMode === 0, isShow: (signal, work) => work === 'localWork' }, { label: this.$t('menu.menuSignal.setInterlockAutoTrigger'), handler: this.setAutoTrigger, cmdType: CMD.Signal.CMD_SIGNAL_SET_CI_AUTO_TRIGGER, - isDisabled: (signal, work) => this.$store.state.training.roleDeviceCode === signal.stationCode && signal.ciControl === 1, + isDisabled: (signal, work) => this.$store.state.training.roleDeviceCode !== signal.stationCode || signal.ciControl === 1, isShow: (signal, work) => work === 'localWork' }, { label: this.$t('menu.menuSignal.cancelInterlockAutoTrigger'), handler: this.cancelAutoTrigger, cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_CI_AUTO_TRIGGER, - isDisabled: (signal, work) => this.$store.state.training.roleDeviceCode === signal.stationCode && signal.ciControl !== 1, + isDisabled: (signal, work) => this.$store.state.training.roleDeviceCode !== signal.stationCode || signal.ciControl !== 1, isShow: (signal, work) => work === 'localWork' }, { @@ -191,7 +191,7 @@ export default { handler: this.detail, isDisabled: (signal, work) => { if (work === 'localWork') { - return this.$store.state.training.roleDeviceCode === signal.stationCode; + return this.$store.state.training.roleDeviceCode !== signal.stationCode; } else { return false; } diff --git a/src/jmapNew/theme/fuzhou_01/menus/menuStation.vue b/src/jmapNew/theme/fuzhou_01/menus/menuStation.vue index f1cbfe347..cb89b0f32 100644 --- a/src/jmapNew/theme/fuzhou_01/menus/menuStation.vue +++ b/src/jmapNew/theme/fuzhou_01/menus/menuStation.vue @@ -53,12 +53,28 @@ export default { label: this.$t('menu.menuStation.fullSiteSetInterlockAutoTrigger'), handler: this.setAutoTrigger, cmdType: CMD.Station.CMD_STATION_SET_CI_AUTO_TRIGGER, + isDisabled: (station, work) => { + if (this.$store.state.training.roleDeviceCode === station.code) { + return false; + } else { + const myStation = this.$store.getters['map/getDeviceByCode'](this.$store.state.training.roleDeviceCode); + return !(myStation.centralized && myStation.chargeStationCodeList.includes(station.code)); + } + }, isShow: (station, work) => work === 'localWork' }, { label: this.$t('menu.menuStation.fullSiteCancelInterlockAutoTrigger'), handler: this.cancelAutoTrigger, cmdType: CMD.Station.CMD_STATION_CANCEL_CI_AUTO_TRIGGER, + isDisabled: (station, work) => { + if (this.$store.state.training.roleDeviceCode === station.code) { + return false; + } else { + const myStation = this.$store.getters['map/getDeviceByCode'](this.$store.state.training.roleDeviceCode); + return !(myStation.centralized && myStation.chargeStationCodeList.includes(station.code)); + } + }, isShow: (station, work) => work === 'localWork' }, { @@ -80,37 +96,6 @@ export default { isShow: (station, work) => work === 'dispatchWork' } ], - menuNormal1: { - Local: [ - { - label: this.$t('menu.menuStation.fullSiteSetInterlockAutoTrigger'), - handler: this.setAutoTrigger, - cmdType: CMD.Station.CMD_STATION_SET_CI_AUTO_TRIGGER - }, - { - label: this.$t('menu.menuStation.fullSiteCancelInterlockAutoTrigger'), - handler: this.cancelAutoTrigger, - cmdType: CMD.Station.CMD_STATION_CANCEL_CI_AUTO_TRIGGER - } - ], - Center: [ - { - label: '全站进路交人工控', - handler: this.humanControlALL, - cmdType: CMD.Station.CMD_STATION_CLOSE_AUTO_SETTING - }, - { - label: '全站进路ATS自排', - handler: this.atsAutoControlALL, - cmdType: CMD.Station.CMD_STATION_OPEN_AUTO_SETTING - }, - { - label: this.$t('menu.menuStation.execKeyOperationTest'), - handler: this.execKeyOperationTest, - cmdType: CMD.Station.CMD_STATION_KEY_OPERATION_TEST - } - ] - }, menuForce: [ { label: this.$t('menu.menuStation.setStoppage'), @@ -157,7 +142,7 @@ export default { initMenu() { this.menu = []; this.menuNormal.forEach(menuItem => { - menuItem.disabled = menuItem.isDisabled ? menuItem.isDisabled(this.selected) : false; + menuItem.disabled = menuItem.isDisabled ? menuItem.isDisabled(this.selected, this.work) : false; menuItem.show = menuItem.isShow ? menuItem.isShow(this.selected, this.work) : true; this.menu.push(menuItem); }); diff --git a/src/jmapNew/theme/fuzhou_01/menus/menuStationStand.vue b/src/jmapNew/theme/fuzhou_01/menus/menuStationStand.vue index 8d5f2fa18..7084c4f80 100644 --- a/src/jmapNew/theme/fuzhou_01/menus/menuStationStand.vue +++ b/src/jmapNew/theme/fuzhou_01/menus/menuStationStand.vue @@ -66,64 +66,83 @@ export default { handler: this.setDetainTrain, cmdType:CMD.Stand.CMD_STAND_SET_HOLD_TRAIN, isDisabled: stand => stand.centerHoldTrain === 1, - isShow: (station, work) => work === 'dispatchWork' + isShow: (stand, work) => work === 'dispatchWork' }, { label: this.$t('menu.menuStationStand.cancelDetainTrain'), handler: this.cancelDetainTrain, cmdType:CMD.Stand.CMD_STAND_CANCEL_HOLD_TRAIN, isDisabled: stand => stand.centerHoldTrain !== 1, - isShow: (station, work) => work === 'dispatchWork' + isShow: (stand, work) => work === 'dispatchWork' }, { label: this.$t('menu.menuStationStand.setDetainTrain'), handler: this.setDetainTrain, cmdType:CMD.Stand.CMD_STAND_SET_HOLD_TRAIN, - isDisabled: stand => stand.stationHoldTrain === 1, - isShow: (station, work) => work === 'localWork' + isDisabled: (stand, work) => this.$store.state.training.roleDeviceCode !== stand.deviceStationCode || stand.stationHoldTrain === 1, + isShow: (stand, work) => work === 'localWork' }, { label: this.$t('menu.menuStationStand.cancelDetainTrain'), handler: this.cancelDetainTrain, cmdType:CMD.Stand.CMD_STAND_CANCEL_HOLD_TRAIN, - isDisabled: stand => stand.stationHoldTrain !== 1, - isShow: (station, work) => work === 'localWork' + isDisabled: (stand, work) => this.$store.state.training.roleDeviceCode !== stand.deviceStationCode || stand.stationHoldTrain !== 1, + isShow: (stand, work) => work === 'localWork' }, { label: this.$t('menu.menuStationStand.cancelDetainTrainForce'), handler: this.cancelDetainTrainForce, - cmdType:CMD.Stand.CMD_STAND_FORCE_CANCEL_HOLD_TRAIN + cmdType:CMD.Stand.CMD_STAND_FORCE_CANCEL_HOLD_TRAIN, + isDisabled: (stand, work) => { + if (work === 'localWork') { + return this.$store.state.training.roleDeviceCode !== stand.deviceStationCode; + } else { + return false; + } + } }, { label: this.$t('menu.menuStationStand.jumpStop'), handler: this.setJumpStop, cmdType:CMD.Stand.CMD_STAND_SET_JUMP_STOP, - isDisabled: stand => stand.allSkip === 1 + isDisabled: (stand, work) => { + if (work === 'localWork') { + return this.$store.state.training.roleDeviceCode !== stand.deviceStationCode || stand.allSkip === 1; + } else { + return false; + } + } }, { label: this.$t('menu.menuStationStand.cancelJumpStop'), handler: this.cancelJumpStop, cmdType:CMD.Stand.CMD_STAND_CANCEL_JUMP_STOP, - isDisabled: stand => stand.allSkip !== 1 && stand.assignSkip !== 1 + isDisabled: (stand, work) => { + if (work === 'localWork') { + return this.$store.state.training.roleDeviceCode !== stand.deviceStationCode || (stand.allSkip !== 1 && stand.assignSkip !== 1); + } else { + return false; + } + } }, { label: this.$t('menu.menuStationStand.setStopTime'), handler: this.setStopTime, cmdType:CMD.Stand.CMD_STAND_SET_PARK_TIME, - isShow: (station, work) => work === 'dispatchWork' + isShow: (stand, work) => work === 'dispatchWork' }, { label: this.$t('menu.menuStationStand.setRunLevel'), handler: this.setRunLevel, cmdType:CMD.Stand.CMD_STAND_SET_RUN_TIME, - isShow: (station, work) => work === 'dispatchWork' + isShow: (stand, work) => work === 'dispatchWork' }, { label: this.$t('menu.menuStationStand.setEarlyDeparture'), handler: this.earlyDeparture, cmdType:CMD.Stand.CMD_STAND_EARLY_DEPART, isDisabled: stand => stand.trainParking !== 1, - isShow: (station, work) => work === 'dispatchWork' + isShow: (stand, work) => work === 'dispatchWork' }, { label: this.$t('menu.menuStationStand.setBackStrategy'), @@ -134,7 +153,14 @@ export default { { label: this.$t('menu.menuStationStand.getStationStandStatus'), handler: this.detail, - cmdType:CMD.Stand.CMD_STAND_VIEW_STATUS + cmdType:CMD.Stand.CMD_STAND_VIEW_STATUS, + isDisabled: (stand, work) => { + if (work === 'localWork') { + return this.$store.state.training.roleDeviceCode !== stand.deviceStationCode; + } else { + return false; + } + } } ], menuForce: [ @@ -189,7 +215,7 @@ export default { // 编辑模式菜单列表 this.menu = []; this.menuNormal.forEach(menuItem => { - menuItem.disabled = menuItem.isDisabled ? menuItem.isDisabled(this.selected) : false; + menuItem.disabled = menuItem.isDisabled ? menuItem.isDisabled(this.selected, this.work) : false; menuItem.show = menuItem.isShow ? menuItem.isShow(this.selected, this.work) : true; this.menu.push(menuItem); }); diff --git a/src/jmapNew/theme/fuzhou_01/menus/menuSwitch.vue b/src/jmapNew/theme/fuzhou_01/menus/menuSwitch.vue index 7fa056dd1..e6593110a 100644 --- a/src/jmapNew/theme/fuzhou_01/menus/menuSwitch.vue +++ b/src/jmapNew/theme/fuzhou_01/menus/menuSwitch.vue @@ -57,60 +57,133 @@ export default { label: '道岔单锁', handler: this.lock, cmdType: CMD.Switch.CMD_SWITCH_SINGLE_LOCK, - isDisabled: switchDevice => switchDevice.singleLock === 1 + isDisabled: (switchDevice, work) => { + if (work === 'localWork') { + return this.$store.state.training.roleDeviceCode !== switchDevice.stationCode || switchDevice.singleLock === 1; + } else { + return false; + } + } }, { label: '道岔单解', handler: this.unlock, cmdType: CMD.Switch.CMD_SWITCH_SINGLE_UNLOCK, - isDisabled: switchDevice => switchDevice.singleLock !== 1 + isDisabled: (switchDevice, work) => { + if (work === 'localWork') { + return this.$store.state.training.roleDeviceCode !== switchDevice.stationCode || switchDevice.singleLock !== 1; + } else { + return false; + } + } }, { label: '道岔封锁', handler: this.block, cmdType: CMD.Switch.CMD_SWITCH_BLOCK, - isDisabled: switchDevice => switchDevice.blockade === 1 + isDisabled: (switchDevice, work) => { + if (work === 'localWork') { + return this.$store.state.training.roleDeviceCode !== switchDevice.stationCode || switchDevice.blockade === 1; + } else { + return false; + } + } }, { label: '道岔解封', handler: this.unblock, cmdType: CMD.Switch.CMD_SWITCH_UNBLOCK, - isDisabled: switchDevice => switchDevice.blockade !== 1 + isDisabled: (switchDevice, work) => { + if (work === 'localWork') { + return this.$store.state.training.roleDeviceCode !== switchDevice.stationCode || switchDevice.blockade !== 1; + } else { + return false; + } + } }, { label: '道岔转动', handler: this.switchTurnout, - cmdType: CMD.Switch.CMD_SWITCH_TURN + cmdType: CMD.Switch.CMD_SWITCH_TURN, + isDisabled: (switchDevice, work) => { + if (work === 'localWork') { + return this.$store.state.training.roleDeviceCode !== switchDevice.stationCode; + } else { + return false; + } + } }, { label: '故障解锁', handler: this.fault, - cmdType: CMD.Switch.CMD_SWITCH_FAULT_UNLOCK + cmdType: CMD.Switch.CMD_SWITCH_FAULT_UNLOCK, + isDisabled: (switchDevice, work) => { + if (work === 'localWork') { + return this.$store.state.training.roleDeviceCode !== switchDevice.stationCode; + } else { + return false; + } + } }, { label: '计轴预复位', handler: this.axlePreReset, - cmdType: CMD.Switch.CMD_SWITCH_AXLE_PRE_RESET + cmdType: CMD.Switch.CMD_SWITCH_AXLE_PRE_RESET, + isDisabled: (switchDevice, work) => { + if (work === 'localWork') { + return this.$store.state.training.roleDeviceCode !== switchDevice.stationCode; + } else { + return false; + } + } }, { label: this.$t('menu.menuSwitch.sectionResection'), handler: this.split, - cmdType: CMD.Switch.CMD_SWITCH_CUT_OFF + cmdType: CMD.Switch.CMD_SWITCH_CUT_OFF, + isDisabled: (switchDevice, work) => { + if (work === 'localWork') { + return this.$store.state.training.roleDeviceCode !== switchDevice.stationCode; + } else { + return false; + } + } }, { label: this.$t('menu.menuSwitch.sectionActive'), handler: this.active, - cmdType: CMD.Switch.CMD_SWITCH_ACTIVE + cmdType: CMD.Switch.CMD_SWITCH_ACTIVE, + isDisabled: (switchDevice, work) => { + if (work === 'localWork') { + return this.$store.state.training.roleDeviceCode !== switchDevice.stationCode; + } else { + return false; + } + } }, { label: '设置限速', handler: this.setSpeed, - cmdType: CMD.Switch.CMD_SWITCH_SET_LIMIT_SPEED + cmdType: CMD.Switch.CMD_SWITCH_SET_LIMIT_SPEED, + isDisabled: (switchDevice, work) => { + if (work === 'localWork') { + return this.$store.state.training.roleDeviceCode !== switchDevice.stationCode; + } else { + return false; + } + } }, { label: '取消限速', handler: this.cancelSpeed, - cmdType: CMD.Switch.CMD_SWITCH_CANCEL_LIMIT_SPEED + cmdType: CMD.Switch.CMD_SWITCH_CANCEL_LIMIT_SPEED, + isDisabled: (switchDevice, work) => { + if (work === 'localWork') { + return this.$store.state.training.roleDeviceCode !== switchDevice.stationCode; + } else { + return false; + } + } } ], menuForce: [ @@ -154,7 +227,7 @@ export default { // 编辑模式菜单列表 this.menu = []; this.menuNormal.forEach(menuItem => { - menuItem.disabled = menuItem.isDisabled ? menuItem.isDisabled(this.selected) : false; + menuItem.disabled = menuItem.isDisabled ? menuItem.isDisabled(this.selected, this.work) : false; menuItem.show = menuItem.isShow ? menuItem.isShow(this.selected, this.work) : true; this.menu.push(menuItem); });