From 76096647fb5486339dd8a19033b367ae72102996 Mon Sep 17 00:00:00 2001 From: joylink_cuiweidong <364937672@qq.com> Date: Thu, 8 Dec 2022 09:57:56 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/jmapNew/theme/factory.js | 4 +- src/jmapNew/theme/foshan_01/menus/index.vue | 380 ------ src/jmapNew/theme/foshan_01/menus/menuBar.vue | 1203 ----------------- 3 files changed, 2 insertions(+), 1585 deletions(-) delete mode 100644 src/jmapNew/theme/foshan_01/menus/index.vue delete mode 100644 src/jmapNew/theme/foshan_01/menus/menuBar.vue diff --git a/src/jmapNew/theme/factory.js b/src/jmapNew/theme/factory.js index 55e495f4a..af9782405 100644 --- a/src/jmapNew/theme/factory.js +++ b/src/jmapNew/theme/factory.js @@ -109,12 +109,12 @@ class Theme { } // 加载行调菜单组件 loadDispatchWorkMenuComponent(code) { - if (['02', '10', '11', '16', '08'].includes(code)) { + if (['01', '02', '04', '10', '11', '16', '08'].includes(code)) { return Object.assign({}, require(`./${this._mapMenu[code || this._code]}/menus/dispatchWorkMenu`).default); } } loadLocalWorkMenuComponent(code) { - if (['02', '10', '11', '16', '08'].includes(code)) { + if (['01', '02', '04', '10', '11', '16', '08'].includes(code)) { return Object.assign({}, require(`./${this._mapMenu[code || this._code]}/menus/localWorkMenu`).default); } } diff --git a/src/jmapNew/theme/foshan_01/menus/index.vue b/src/jmapNew/theme/foshan_01/menus/index.vue deleted file mode 100644 index f60470bfe..000000000 --- a/src/jmapNew/theme/foshan_01/menus/index.vue +++ /dev/null @@ -1,380 +0,0 @@ - - - - - diff --git a/src/jmapNew/theme/foshan_01/menus/menuBar.vue b/src/jmapNew/theme/foshan_01/menus/menuBar.vue deleted file mode 100644 index 16b5f8db6..000000000 --- a/src/jmapNew/theme/foshan_01/menus/menuBar.vue +++ /dev/null @@ -1,1203 +0,0 @@ - - - - From 05e77984549ea54124af67e393f8375ef673b7ac Mon Sep 17 00:00:00 2001 From: dong <58670809@qq.com> Date: Thu, 8 Dec 2022 10:33:32 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../theme/xian_01/menus/menuSection.vue | 35 ++----- .../theme/xian_01/menus/menuSignal.vue | 96 +++++-------------- .../theme/xian_01/menus/menuStation.vue | 56 +++++------ .../theme/xian_01/menus/menuStationStand.vue | 28 ++---- .../theme/xian_01/menus/menuSwitch.vue | 66 ++++--------- 5 files changed, 86 insertions(+), 195 deletions(-) diff --git a/src/jmapNew/theme/xian_01/menus/menuSection.vue b/src/jmapNew/theme/xian_01/menus/menuSection.vue index 39d44c9f0..0045090a7 100644 --- a/src/jmapNew/theme/xian_01/menus/menuSection.vue +++ b/src/jmapNew/theme/xian_01/menus/menuSection.vue @@ -25,6 +25,7 @@ import { DeviceMenu, OperateMode } from '@/scripts/ConstDic'; import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate'; import LoadSpareTrain from '@/jmapNew/theme/components/menus/dialog/loadSpareTrain'; // import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler'; +import { judgeStationControl } from '@/jmapNew/theme/components/utils/menuJudge.js'; export default { name: 'SectionMenu', @@ -61,11 +62,10 @@ export default { handler: this.lock, cmdType: CMD.Section.CMD_SECTION_BLOCK, isDisabled: (section, work) => { - const device = this.$store.getters['map/getDeviceByCode'](section.stationCode); if (work === 'localWork') { - return this.$store.state.training.roleDeviceCode !== section.stationCode || section.blockade === 1 || device.controlMode !== 'Local'; + return section.blockade === 1; } else { - return section.blockade === 1 || device.controlMode !== 'Center'; + return section.blockade === 1; } }, isShow: (section, work) => ['01', '02', '03'].includes(section.type) @@ -75,11 +75,10 @@ export default { handler: this.unlock, cmdType: CMD.Section.CMD_SECTION_UNBLOCK, isDisabled: (section, work) => { - const device = this.$store.getters['map/getDeviceByCode'](section.stationCode); if (work === 'localWork') { - return this.$store.state.training.roleDeviceCode !== section.stationCode || section.blockade !== 1 || device.controlMode !== 'Local'; + return section.blockade !== 1; } else { - return section.blockade !== 1 || device.controlMode !== 'Center'; + return section.blockade !== 1; } }, isShow: (section, work) => ['01', '02', '03'].includes(section.type) @@ -89,12 +88,7 @@ export default { handler: this.fault, cmdType: CMD.Section.CMD_SECTION_FAULT_UNLOCK, isDisabled: (section, work) => { - const device = this.$store.getters['map/getDeviceByCode'](section.stationCode); - if (work === 'localWork') { - return device.controlMode !== 'Local'; - } else { - return device.controlMode !== 'Center'; - } + return false; }, isShow: (section, work) => ['01', '02', '03'].includes(section.type) }, @@ -103,12 +97,7 @@ export default { handler: this.setSpeed, cmdType: CMD.Section.CMD_SECTION_SET_LIMIT_SPEED, isDisabled: (section, work) => { - const device = this.$store.getters['map/getDeviceByCode'](section.stationCode); - if (work === 'localWork') { - return device.controlMode !== 'Local'; - } else { - return device.controlMode !== 'Center'; - } + return false; }, isShow: (section, work) => section.type === '02' }, @@ -117,12 +106,7 @@ export default { handler: this.cancelSpeed, cmdType: CMD.Section.CMD_SECTION_CANCEL_LIMIT_SPEED, isDisabled: (section, work) => { - const device = this.$store.getters['map/getDeviceByCode'](section.stationCode); - if (work === 'localWork') { - return device.controlMode !== 'Local'; - } else { - return device.controlMode !== 'Center'; - } + return false; }, isShow: (section, work) => section.type === '02' }, @@ -212,7 +196,8 @@ export default { // this.menu = MenuContextHandler.covert(this.menuNormal); this.menu = []; this.menuNormal.forEach(menuItem => { - menuItem.disabled = menuItem.isDisabled ? menuItem.isDisabled(this.selected, this.work) : false; + const status = judgeStationControl(this.selected.belongStation, this.selected.stationCode, this.work); + menuItem.disabled = menuItem.isDisabled ? menuItem.isDisabled(this.selected, this.work) || !status : false; menuItem.show = menuItem.isShow ? menuItem.isShow(this.selected, this.work) : true; this.menu.push(menuItem); }); diff --git a/src/jmapNew/theme/xian_01/menus/menuSignal.vue b/src/jmapNew/theme/xian_01/menus/menuSignal.vue index e25931bee..22e3a996f 100644 --- a/src/jmapNew/theme/xian_01/menus/menuSignal.vue +++ b/src/jmapNew/theme/xian_01/menus/menuSignal.vue @@ -29,6 +29,7 @@ import { mapGetters } from 'vuex'; import { DeviceMenu, OperateMode } from '@/scripts/ConstDic'; import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate'; import ConflictRoute from './dialog/conflictRoute'; +import { judgeStationControl } from '@/jmapNew/theme/components/utils/menuJudge.js'; export default { name: 'SignalMenu', @@ -67,12 +68,7 @@ export default { handler: this.arrangementRoute, cmdType: CMD.Signal.CMD_SIGNAL_SET_ROUTE, isDisabled: (signal, work) => { - const device = this.$store.getters['map/getDeviceByCode'](signal.stationCode); - if (work === 'localWork') { - return false; - } else { - return device.controlMode !== 'Center'; - } + return false; } }, { @@ -80,12 +76,7 @@ export default { handler: this.cancelTrainRoute, cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_ROUTE, isDisabled: (signal, work) => { - const device = this.$store.getters['map/getDeviceByCode'](signal.stationCode); - if (work === 'localWork') { - return false; - } else { - return device.controlMode !== 'Center'; - } + return false; } }, { @@ -93,11 +84,10 @@ export default { handler: this.lock, cmdType: CMD.Signal.CMD_SIGNAL_BLOCK, isDisabled: (signal, work) => { - const device = this.$store.getters['map/getDeviceByCode'](signal.stationCode); if (work === 'localWork') { - return this.$store.state.training.roleDeviceCode !== signal.stationCode || signal.blockade === 1; + return signal.blockade === 1; } else { - return signal.blockade === 1 || device.controlMode !== 'Center'; + return signal.blockade === 1; } } }, @@ -106,11 +96,10 @@ export default { handler: this.unlock, cmdType: CMD.Signal.CMD_SIGNAL_UNBLOCK, isDisabled: (signal, work) => { - const device = this.$store.getters['map/getDeviceByCode'](signal.stationCode); if (work === 'localWork') { - return this.$store.state.training.roleDeviceCode !== signal.stationCode || signal.blockade !== 1; + return signal.blockade !== 1; } else { - return signal.blockade !== 1 || device.controlMode !== 'Center'; + return signal.blockade !== 1; } } }, @@ -119,12 +108,7 @@ export default { handler: this.signalClose, cmdType: CMD.Signal.CMD_SIGNAL_CLOSE_SIGNAL, isDisabled: (signal, work) => { - const device = this.$store.getters['map/getDeviceByCode'](signal.stationCode); - if (work === 'localWork') { - return false; - } else { - return device.controlMode !== 'Center'; - } + return false; } }, { @@ -132,12 +116,7 @@ export default { handler: this.reopenSignal, cmdType: CMD.Signal.CMD_SIGNAL_REOPEN_SIGNAL, isDisabled: (signal, work) => { - const device = this.$store.getters['map/getDeviceByCode'](signal.stationCode); - if (work === 'localWork') { - return false; - } else { - return device.controlMode !== 'Center'; - } + return false; } }, { @@ -145,12 +124,7 @@ export default { handler: this.guide, cmdType: CMD.Signal.CMD_SIGNAL_ROUTE_GUIDE, isDisabled: (signal, work) => { - const device = this.$store.getters['map/getDeviceByCode'](signal.stationCode); - if (work === 'localWork') { - return false; - } else { - return device.controlMode !== 'Center'; - } + return false; } }, { @@ -158,69 +132,55 @@ export default { handler: this.setAutoInterlock, cmdType: CMD.Signal.CMD_SIGNAL_SET_CI_AUTO, isDisabled: (signal, work) => { - const device = this.$store.getters['map/getDeviceByCode'](signal.stationCode); if (work === 'localWork') { - return this.$store.state.training.roleDeviceCode !== signal.stationCode || signal.fleetMode !== 0; + return signal.fleetMode !== 0; } else { - return signal.fleetMode !== 0 || device.controlMode !== 'Center'; + return signal.fleetMode !== 0; } - }, - isShow: (signal, work) => work === 'localWork' + } }, { label: '取消联锁自动进路', handler: this.cancelAutoInterlock, cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_CI_AUTO, isDisabled: (signal, work) => { - console.log('🚀 ~ file: menuSignal.vue:182 ~ data ~ signal', signal); - const device = this.$store.getters['map/getDeviceByCode'](signal.stationCode); if (work === 'localWork') { - return this.$store.state.training.roleDeviceCode !== signal.stationCode || signal.fleetMode !== 1; + return signal.fleetMode !== 1; } else { - return signal.fleetMode !== 1 || device.controlMode !== 'Center'; + return signal.fleetMode !== 1; } - }, - isShow: (signal, work) => work === 'localWork' + } }, { label: '设置联锁自动触发', handler: this.setAutoTrigger, cmdType: CMD.Signal.CMD_SIGNAL_SET_CI_AUTO_TRIGGER, isDisabled: (signal, work) => { - const device = this.$store.getters['map/getDeviceByCode'](signal.stationCode); if (work === 'localWork') { - return this.$store.state.training.roleDeviceCode !== signal.stationCode || signal.ciControl === 1 || !signal.canSetCi; + return signal.ciControl === 1 && !signal.canSetCi; } else { - return signal.ciControl === 1 || !signal.canSetCi || device.controlMode !== 'Center'; + return signal.ciControl === 1 && !signal.canSetCi; } - }, - isShow: (signal, work) => work === 'localWork' + } }, { label: '取消联锁自动触发', handler: this.cancelAutoTrigger, cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_CI_AUTO_TRIGGER, isDisabled: (signal, work) => { - const device = this.$store.getters['map/getDeviceByCode'](signal.stationCode); if (work === 'localWork') { - return this.$store.state.training.roleDeviceCode !== signal.stationCode || signal.ciControl !== 1; + return signal.ciControl !== 1; } else { - return signal.ciControl !== 1 || device.controlMode !== 'Center'; + return signal.ciControl !== 1; } - }, - isShow: (signal, work) => work === 'localWork' + } }, { label: '进路交人工控', handler: this.humanControl, cmdType: CMD.Signal.CMD_SIGNAL_CLOSE_AUTO_SETTING, isDisabled: (signal, work) => { - const device = this.$store.getters['map/getDeviceByCode'](signal.stationCode); - if (work === 'localWork') { - return false; - } else { - return device.controlMode !== 'Center'; - } + return false; } }, { @@ -228,12 +188,7 @@ export default { handler: this.atsAutoControl, cmdType: CMD.Signal.CMD_SIGNAL_OPEN_AUTO_SETTING, isDisabled: (signal, work) => { - const device = this.$store.getters['map/getDeviceByCode'](signal.stationCode); - if (work === 'localWork') { - return false; - } else { - return device.controlMode !== 'Center'; - } + return false; } }, { @@ -305,7 +260,8 @@ export default { // this.menu = MenuContextHandler.covert(this.menuNormal); this.menu = []; this.menuNormal.forEach(menuItem => { - menuItem.disabled = menuItem.isDisabled ? menuItem.isDisabled(this.selected, this.work) : false; + const status = judgeStationControl(this.selected.belongStationCode, this.selected.stationCode, this.work); + menuItem.disabled = menuItem.isDisabled ? menuItem.isDisabled(this.selected, this.work) || !status : false; menuItem.show = menuItem.isShow ? menuItem.isShow(this.selected, this.work) : true; this.menu.push(menuItem); }); diff --git a/src/jmapNew/theme/xian_01/menus/menuStation.vue b/src/jmapNew/theme/xian_01/menus/menuStation.vue index 75d32537d..913110a2d 100644 --- a/src/jmapNew/theme/xian_01/menus/menuStation.vue +++ b/src/jmapNew/theme/xian_01/menus/menuStation.vue @@ -22,6 +22,7 @@ import SetFault from '@/jmapNew/theme/components/menus/dialog/setFault'; // import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler'; import CMD from '@/scripts/cmdPlugin/CommandEnum'; import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate'; +import { judgeStationControl } from '@/jmapNew/theme/components/utils/menuJudge.js'; export default { name: 'StationMenu', @@ -100,8 +101,7 @@ export default { } else { return station.controlMode !== 'Center'; } - }, - isShow: (station, work) => work === 'localWork' + } }, { label: '所有进路交人工控', @@ -113,40 +113,31 @@ export default { } else { return station.controlMode !== 'Center'; } - }, - isShow: (station, work) => work === 'localWork' - }, + } + } // { // label: '执行关键操作测试', // handler: this.execKeyOperationTest, // cmdType: CMD.Station.CMD_STATION_KEY_OPERATION_TEST, // } - { - label: '所有进路交人工控', - handler: this.humanControlALL, - cmdType: CMD.Station.CMD_STATION_CLOSE_AUTO_SETTING, - isDisabled: (station, work) => { - if (work === 'localWork') { - return station.controlMode !== 'Local'; - } else { - return station.controlMode !== 'Center'; - } - }, - isShow: (station, work) => work === 'dispatchWork' - }, - { - label: '所有进路交ATS自动控', - handler: this.atsAutoControlALL, - cmdType: CMD.Station.CMD_STATION_OPEN_AUTO_SETTING, - isDisabled: (station, work) => { - if (work === 'localWork') { - return station.controlMode !== 'Local'; - } else { - return station.controlMode !== 'Center'; - } - }, - isShow: (station, work) => work === 'dispatchWork' - } + // { + // label: '所有进路交人工控', + // handler: this.humanControlALL, + // cmdType: CMD.Station.CMD_STATION_CLOSE_AUTO_SETTING, + // isDisabled: (station, work) => { + // return false; + // }, + // isShow: (station, work) => work === 'dispatchWork' + // }, + // { + // label: '所有进路交ATS自动控', + // handler: this.atsAutoControlALL, + // cmdType: CMD.Station.CMD_STATION_OPEN_AUTO_SETTING, + // isDisabled: (station, work) => { + // return false; + // }, + // isShow: (station, work) => work === 'dispatchWork' + // } // { // label: '执行关键操作测试', // handler: this.execKeyOperationTest, @@ -201,7 +192,8 @@ export default { // this.menu = MenuContextHandler.covert(this.menuNormal); this.menu = []; this.menuNormal.forEach(menuItem => { - menuItem.show = menuItem.isShow ? menuItem.isShow(this.selected, this.work) : true; + const status = judgeStationControl(this.selected.code, this.selected.stationCode, this.work); + menuItem.show = menuItem.isShow ? menuItem.isShow(this.selected, this.work) || !status : true; menuItem.disabled = menuItem.isDisabled ? menuItem.isDisabled(this.selected, this.work) : false; this.menu.push(menuItem); }); diff --git a/src/jmapNew/theme/xian_01/menus/menuStationStand.vue b/src/jmapNew/theme/xian_01/menus/menuStationStand.vue index 2f49cf076..ce2c60c35 100644 --- a/src/jmapNew/theme/xian_01/menus/menuStationStand.vue +++ b/src/jmapNew/theme/xian_01/menus/menuStationStand.vue @@ -29,6 +29,7 @@ import { DeviceMenu, OperateMode } from '@/scripts/ConstDic'; import CMD from '@/scripts/cmdPlugin/CommandEnum'; // import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler'; import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate'; +import { judgeStationControl } from '@/jmapNew/theme/components/utils/menuJudge.js'; export default { name: 'StationStandMenu', @@ -67,9 +68,8 @@ export default { handler: this.setDetainTrain, cmdType:CMD.Stand.CMD_STAND_SET_HOLD_TRAIN, isDisabled: (stand, work) => { - const device = this.$store.getters['map/getDeviceByCode'](stand.stationCode); if (work === 'localWork') { - return this.$store.state.training.roleDeviceCode !== stand.deviceStationCode || stand.stationHoldTrain !== 0 || device.controlMode !== 'Local'; + return stand.stationHoldTrain !== 0; } else { return stand.centerHoldTrain !== 0; } @@ -80,9 +80,8 @@ export default { handler: this.cancelDetainTrain, cmdType:CMD.Stand.CMD_STAND_CANCEL_HOLD_TRAIN, isDisabled: (stand, work) => { - const device = this.$store.getters['map/getDeviceByCode'](stand.stationCode); if (work === 'localWork') { - return this.$store.state.training.roleDeviceCode !== stand.deviceStationCode || stand.stationHoldTrain !== 1 || device.controlMode !== 'Local'; + return stand.stationHoldTrain !== 1; } else { return stand.centerHoldTrain !== 1; } @@ -93,12 +92,7 @@ export default { handler: this.cancelDetainTrainForce, cmdType:CMD.Stand.CMD_STAND_FORCE_CANCEL_HOLD_TRAIN, isDisabled: (stand, work) => { - const device = this.$store.getters['map/getDeviceByCode'](stand.stationCode); - if (work === 'localWork') { - return this.$store.state.training.roleDeviceCode !== stand.deviceStationCode || device.controlMode !== 'Local'; - } else { - return false; - } + return false; }, isShow: (section, work) => work === 'dispatchWork' }, @@ -107,12 +101,7 @@ export default { handler: this.detail, cmdType:CMD.Stand.CMD_STAND_VIEW_STATUS, isDisabled: (stand, work) => { - const device = this.$store.getters['map/getDeviceByCode'](stand.stationCode); - if (work === 'localWork') { - return this.$store.state.training.roleDeviceCode !== stand.deviceStationCode || device.controlMode !== 'Local'; - } else { - return false; - } + return false; } }, { @@ -127,7 +116,7 @@ export default { cmdType: CMD.Stand.CMD_STAND_SET_JUMP_STOP, isDisabled: (stand, work) => { if (work === 'localWork') { - return this.$store.state.training.roleDeviceCode !== stand.deviceStationCode; + return false; } else { return stand.allSkip !== 0; } @@ -140,7 +129,7 @@ export default { cmdType: CMD.Stand.CMD_STAND_CANCEL_JUMP_STOP, isDisabled: (stand, work) => { if (work === 'localWork') { - return this.$store.state.training.roleDeviceCode !== stand.deviceStationCode; + return false; } else { return stand.allSkip !== 1 && stand.assignSkip !== 1; } @@ -213,7 +202,8 @@ export default { // this.menu = MenuContextHandler.covert(this.menuNormal); this.menu = []; this.menuNormal.forEach(menuItem => { - menuItem.disabled = menuItem.isDisabled ? menuItem.isDisabled(this.selected, this.work) : false; + const status = judgeStationControl(this.selected.stationCode, this.selected.deviceStationCode, this.work); + menuItem.disabled = menuItem.isDisabled ? menuItem.isDisabled(this.selected, this.work) || !status : false; menuItem.show = menuItem.isShow ? menuItem.isShow(this.selected, this.work) : true; this.menu.push(menuItem); }); diff --git a/src/jmapNew/theme/xian_01/menus/menuSwitch.vue b/src/jmapNew/theme/xian_01/menus/menuSwitch.vue index 1296476ab..ae8aec279 100644 --- a/src/jmapNew/theme/xian_01/menus/menuSwitch.vue +++ b/src/jmapNew/theme/xian_01/menus/menuSwitch.vue @@ -22,6 +22,7 @@ import CMD from '@/scripts/cmdPlugin/CommandEnum'; import { mapGetters } from 'vuex'; import { DeviceMenu, OperateMode } from '@/scripts/ConstDic'; import { menuOperate, commitOperate } from '@/jmapNew/theme/components/utils/menuOperate'; +import { judgeStationControl } from '@/jmapNew/theme/components/utils/menuJudge.js'; export default { name: 'SwitchMenu', @@ -57,11 +58,10 @@ export default { handler: this.lock, cmdType:CMD.Switch.CMD_SWITCH_SINGLE_LOCK, isDisabled: (switchDevice, work) => { - const device = this.$store.getters['map/getDeviceByCode'](switchDevice.stationCode); if (work === 'localWork') { - return this.$store.state.training.roleDeviceCode !== switchDevice.stationCode || switchDevice.singleLock === 1 || device.controlMode !== 'Local'; + return switchDevice.singleLock === 1; } else { - return switchDevice.singleLock === 1 || device.controlMode !== 'Center'; + return switchDevice.singleLock === 1; } } }, @@ -70,11 +70,10 @@ export default { handler: this.unlock, cmdType:CMD.Switch.CMD_SWITCH_SINGLE_UNLOCK, isDisabled: (switchDevice, work) => { - const device = this.$store.getters['map/getDeviceByCode'](switchDevice.stationCode); if (work === 'localWork') { - return this.$store.state.training.roleDeviceCode !== switchDevice.stationCode || switchDevice.singleLock !== 1 || device.controlMode !== 'Local'; + return switchDevice.singleLock !== 1; } else { - return switchDevice.singleLock !== 1 || device.controlMode !== 'Center'; + return switchDevice.singleLock !== 1; } } }, @@ -83,11 +82,10 @@ export default { handler: this.block, cmdType:CMD.Switch.CMD_SWITCH_BLOCK, isDisabled: (switchDevice, work) => { - const device = this.$store.getters['map/getDeviceByCode'](switchDevice.stationCode); if (work === 'localWork') { - return this.$store.state.training.roleDeviceCode !== switchDevice.stationCode || switchDevice.blockade === 1 || device.controlMode !== 'Local'; + return switchDevice.blockade === 1; } else { - return switchDevice.blockade === 1 || device.controlMode !== 'Center'; + return switchDevice.blockade === 1; } } }, @@ -96,11 +94,10 @@ export default { handler: this.unblock, cmdType:CMD.Switch.CMD_SWITCH_UNBLOCK, isDisabled: (switchDevice, work) => { - const device = this.$store.getters['map/getDeviceByCode'](switchDevice.stationCode); if (work === 'localWork') { - return this.$store.state.training.roleDeviceCode !== switchDevice.stationCode || switchDevice.blockade !== 1 || device.controlMode !== 'Local'; + return switchDevice.blockade !== 1; } else { - return switchDevice.blockade !== 1 || device.controlMode !== 'Center'; + return switchDevice.blockade !== 1; } } }, @@ -109,12 +106,7 @@ export default { handler: this.switchTurnout, cmdType:CMD.Switch.CMD_SWITCH_TURN, isDisabled: (switchDevice, work) => { - const device = this.$store.getters['map/getDeviceByCode'](switchDevice.stationCode); - if (work === 'localWork') { - return this.$store.state.training.roleDeviceCode !== switchDevice.stationCode || device.controlMode !== 'Local'; - } else { - return device.controlMode !== 'Center'; - } + return false; } }, { @@ -122,12 +114,7 @@ export default { handler: this.fault, cmdType:CMD.Switch.CMD_SWITCH_FAULT_UNLOCK, isDisabled: (switchDevice, work) => { - const device = this.$store.getters['map/getDeviceByCode'](switchDevice.stationCode); - if (work === 'localWork') { - return this.$store.state.training.roleDeviceCode !== switchDevice.stationCode || device.controlMode !== 'Local'; - } else { - return device.controlMode !== 'Center'; - } + return false; } }, // { @@ -140,12 +127,7 @@ export default { handler: this.split, cmdType:CMD.Switch.CMD_SWITCH_CUT_OFF, isDisabled: (switchDevice, work) => { - const device = this.$store.getters['map/getDeviceByCode'](switchDevice.stationCode); - if (work === 'localWork') { - return this.$store.state.training.roleDeviceCode !== switchDevice.stationCode || device.controlMode !== 'Local'; - } else { - return false; - } + return false; } }, { @@ -153,12 +135,7 @@ export default { handler: this.active, cmdType:CMD.Switch.CMD_SWITCH_ACTIVE, isDisabled: (switchDevice, work) => { - const device = this.$store.getters['map/getDeviceByCode'](switchDevice.stationCode); - if (work === 'localWork') { - return this.$store.state.training.roleDeviceCode !== switchDevice.stationCode || device.controlMode !== 'Local'; - } else { - return false; - } + return false; } }, { @@ -166,12 +143,7 @@ export default { handler: this.setSpeed, cmdType:CMD.Switch.CMD_SWITCH_SET_LIMIT_SPEED, isDisabled: (switchDevice, work) => { - const device = this.$store.getters['map/getDeviceByCode'](switchDevice.stationCode); - if (work === 'localWork') { - return this.$store.state.training.roleDeviceCode !== switchDevice.stationCode || device.controlMode !== 'Local'; - } else { - return device.controlMode !== 'Center'; - } + return false; } }, { @@ -179,12 +151,7 @@ export default { handler: this.cancelSpeed, cmdType:CMD.Switch.CMD_SWITCH_CANCEL_LIMIT_SPEED, isDisabled: (switchDevice, work) => { - const device = this.$store.getters['map/getDeviceByCode'](switchDevice.stationCode); - if (work === 'localWork') { - return this.$store.state.training.roleDeviceCode !== switchDevice.stationCode || device.controlMode !== 'Local'; - } else { - return device.controlMode !== 'Center'; - } + return false; } } ], @@ -235,7 +202,8 @@ export default { // this.menu = MenuContextHandler.covert(this.menuNormal); this.menu = []; this.menuNormal.forEach(menuItem => { - menuItem.disabled = menuItem.isDisabled ? menuItem.isDisabled(this.selected, this.work) : false; + const status = judgeStationControl(this.selected.belongStationCode, this.selected.stationCode, this.work); + menuItem.disabled = menuItem.isDisabled ? menuItem.isDisabled(this.selected, this.work) || !status : false; menuItem.show = menuItem.isShow ? menuItem.isShow(this.selected, this.work) : true; this.menu.push(menuItem); }); From 6e986d51bbd5f67998532adea20dc4ed565609d1 Mon Sep 17 00:00:00 2001 From: joylink_cuiweidong <364937672@qq.com> Date: Thu, 8 Dec 2022 11:14:32 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/system/companyManage/index.vue | 14 ++++++++++---- src/views/system/projectManage/add.vue | 8 -------- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/src/views/system/companyManage/index.vue b/src/views/system/companyManage/index.vue index 2a5aebd46..9c539357b 100644 --- a/src/views/system/companyManage/index.vue +++ b/src/views/system/companyManage/index.vue @@ -8,9 +8,9 @@