From deaba534171562a335d532ec0db72d7f48409157 Mon Sep 17 00:00:00 2001 From: fan Date: Thu, 29 Dec 2022 14:25:53 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9B=BD=E8=B5=9B=E7=BA=BF=E8=B7=AF=E8=B0=83?= =?UTF-8?q?=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/jmapNew/theme/factory.js | 8 +- .../theme/race_01/menus/dispatchWorkMenu.vue | 363 ++++++ .../race_01/menus/dispatchWorkMenuBar.vue | 847 ++++++++++++ src/jmapNew/theme/race_01/menus/index.vue | 387 ------ .../theme/race_01/menus/localWorkMenu.vue | 363 ++++++ .../theme/race_01/menus/localWorkMenuBar.vue | 851 ++++++++++++ .../theme/race_01/menus/menuAutoTrunRoute.vue | 125 -- .../theme/race_01/menus/menuAxleReset.vue | 102 -- src/jmapNew/theme/race_01/menus/menuBar.vue | 1135 ----------------- src/jmapNew/theme/race_01/menus/menuLimit.vue | 104 -- src/jmapNew/theme/race_01/menus/menuPower.vue | 1 - .../theme/race_01/menus/menuSection.vue | 135 +- .../theme/race_01/menus/menuSignal.vue | 226 ++-- .../theme/race_01/menus/menuStation.vue | 102 +- .../race_01/menus/menuStationControl.vue | 130 -- .../theme/race_01/menus/menuStationStand.vue | 202 +-- .../race_01/menus/menuStationTurnBack.vue | 32 +- .../theme/race_01/menus/menuSwitch.vue | 212 +-- src/jmapNew/theme/race_01/menus/menuTrain.vue | 224 ++-- .../race_01/menus/passiveDialog/alarm.vue | 2 +- 20 files changed, 2993 insertions(+), 2558 deletions(-) create mode 100644 src/jmapNew/theme/race_01/menus/dispatchWorkMenu.vue create mode 100644 src/jmapNew/theme/race_01/menus/dispatchWorkMenuBar.vue delete mode 100644 src/jmapNew/theme/race_01/menus/index.vue create mode 100644 src/jmapNew/theme/race_01/menus/localWorkMenu.vue create mode 100644 src/jmapNew/theme/race_01/menus/localWorkMenuBar.vue delete mode 100644 src/jmapNew/theme/race_01/menus/menuAutoTrunRoute.vue delete mode 100644 src/jmapNew/theme/race_01/menus/menuAxleReset.vue delete mode 100644 src/jmapNew/theme/race_01/menus/menuBar.vue delete mode 100644 src/jmapNew/theme/race_01/menus/menuLimit.vue delete mode 100644 src/jmapNew/theme/race_01/menus/menuStationControl.vue diff --git a/src/jmapNew/theme/factory.js b/src/jmapNew/theme/factory.js index e4b8dcc31..36904a306 100644 --- a/src/jmapNew/theme/factory.js +++ b/src/jmapNew/theme/factory.js @@ -109,14 +109,10 @@ class Theme { } // 加载行调菜单组件 loadDispatchWorkMenuComponent(code) { - if (['01', '02', '03', '04', '06', '07', '08', '09', '10', '11', '12', '14', '16'].includes(code)) { - return Object.assign({}, require(`./${this._mapMenu[code || this._code]}/menus/dispatchWorkMenu`).default); - } + return Object.assign({}, require(`./${this._mapMenu[code || this._code]}/menus/dispatchWorkMenu`).default); } loadLocalWorkMenuComponent(code) { - if (['01', '02', '03', '04', '06', '07', '08', '09', '10', '11', '12', '14', '16'].includes(code)) { - return Object.assign({}, require(`./${this._mapMenu[code || this._code]}/menus/localWorkMenu`).default); - } + return Object.assign({}, require(`./${this._mapMenu[code || this._code]}/menus/localWorkMenu`).default); } loadCtcWorkMenuComponent(code) { if (code == '16') { diff --git a/src/jmapNew/theme/race_01/menus/dispatchWorkMenu.vue b/src/jmapNew/theme/race_01/menus/dispatchWorkMenu.vue new file mode 100644 index 000000000..2eac28363 --- /dev/null +++ b/src/jmapNew/theme/race_01/menus/dispatchWorkMenu.vue @@ -0,0 +1,363 @@ + + + + + diff --git a/src/jmapNew/theme/race_01/menus/dispatchWorkMenuBar.vue b/src/jmapNew/theme/race_01/menus/dispatchWorkMenuBar.vue new file mode 100644 index 000000000..2baaead3c --- /dev/null +++ b/src/jmapNew/theme/race_01/menus/dispatchWorkMenuBar.vue @@ -0,0 +1,847 @@ + + + + diff --git a/src/jmapNew/theme/race_01/menus/index.vue b/src/jmapNew/theme/race_01/menus/index.vue deleted file mode 100644 index 02c152bba..000000000 --- a/src/jmapNew/theme/race_01/menus/index.vue +++ /dev/null @@ -1,387 +0,0 @@ - - - - - diff --git a/src/jmapNew/theme/race_01/menus/localWorkMenu.vue b/src/jmapNew/theme/race_01/menus/localWorkMenu.vue new file mode 100644 index 000000000..4dedcdbfd --- /dev/null +++ b/src/jmapNew/theme/race_01/menus/localWorkMenu.vue @@ -0,0 +1,363 @@ + + + + + diff --git a/src/jmapNew/theme/race_01/menus/localWorkMenuBar.vue b/src/jmapNew/theme/race_01/menus/localWorkMenuBar.vue new file mode 100644 index 000000000..a88d6f757 --- /dev/null +++ b/src/jmapNew/theme/race_01/menus/localWorkMenuBar.vue @@ -0,0 +1,851 @@ + + + + diff --git a/src/jmapNew/theme/race_01/menus/menuAutoTrunRoute.vue b/src/jmapNew/theme/race_01/menus/menuAutoTrunRoute.vue deleted file mode 100644 index 71fc0b56b..000000000 --- a/src/jmapNew/theme/race_01/menus/menuAutoTrunRoute.vue +++ /dev/null @@ -1,125 +0,0 @@ - - - diff --git a/src/jmapNew/theme/race_01/menus/menuAxleReset.vue b/src/jmapNew/theme/race_01/menus/menuAxleReset.vue deleted file mode 100644 index 13f7a1a0f..000000000 --- a/src/jmapNew/theme/race_01/menus/menuAxleReset.vue +++ /dev/null @@ -1,102 +0,0 @@ - - - diff --git a/src/jmapNew/theme/race_01/menus/menuBar.vue b/src/jmapNew/theme/race_01/menus/menuBar.vue deleted file mode 100644 index c03e37601..000000000 --- a/src/jmapNew/theme/race_01/menus/menuBar.vue +++ /dev/null @@ -1,1135 +0,0 @@ - - - - diff --git a/src/jmapNew/theme/race_01/menus/menuLimit.vue b/src/jmapNew/theme/race_01/menus/menuLimit.vue deleted file mode 100644 index 49e406812..000000000 --- a/src/jmapNew/theme/race_01/menus/menuLimit.vue +++ /dev/null @@ -1,104 +0,0 @@ - - - diff --git a/src/jmapNew/theme/race_01/menus/menuPower.vue b/src/jmapNew/theme/race_01/menus/menuPower.vue index ad6ae3f21..841d507c3 100644 --- a/src/jmapNew/theme/race_01/menus/menuPower.vue +++ b/src/jmapNew/theme/race_01/menus/menuPower.vue @@ -73,7 +73,6 @@ export default { }; }, initMenu() { - // this.menu = MenuContextHandler.covert(this.menuNormal); // 故障模式菜单列表 if (this.operatemode === OperateMode.FAULT) { this.menu = this.menuForce; diff --git a/src/jmapNew/theme/race_01/menus/menuSection.vue b/src/jmapNew/theme/race_01/menus/menuSection.vue index 95b566d86..5df27104e 100644 --- a/src/jmapNew/theme/race_01/menus/menuSection.vue +++ b/src/jmapNew/theme/race_01/menus/menuSection.vue @@ -24,7 +24,7 @@ import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo' import { mapGetters } from 'vuex'; import CMD from '@/scripts/cmdPlugin/CommandEnum'; import { DeviceMenu, OperateMode } from '@/scripts/ConstDic'; -// import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler'; +import { judgeStationControl } from '@/jmapNew/theme/components/utils/menuJudge.js'; import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate'; import LoadSpareTrain from '@/jmapNew/theme/components/menus/dialog/loadSpareTrain'; @@ -47,67 +47,75 @@ export default { default() { return null; } + }, + work: { + type: String, + default() { + return ''; + } } }, data() { return { menu: [], - menuNormal: { - Local: [ - { - label: '区段故障解锁', - handler: this.fault, - cmdType: CMD.Section.CMD_SECTION_FAULT_UNLOCK - }, - { - label: '区段跟踪激活', - handler: this.active, - cmdType: CMD.Section.CMD_SECTION_ACTIVE - }, - { - label: '区段跟踪切除', - handler: this.split, - cmdType: CMD.Section.CMD_SECTION_CUT_OFF - }, - { - label: '区段封锁', - handler: this.lock, - cmdType: CMD.Section.CMD_SECTION_BLOCK - }, - { - label: '区段解封', - handler: this.unlock, - cmdType: CMD.Section.CMD_SECTION_UNBLOCK - } - ], - Center: [ - { - label: '区段跟踪激活', - handler: this.active, - cmdType: CMD.Section.CMD_SECTION_ACTIVE - }, - { - label: '区段跟踪切除', - handler: this.split, - cmdType: CMD.Section.CMD_SECTION_CUT_OFF - }, - { - label: '确认计轴有效', - handler: this.alxeEffective, - cmdType: CMD.Section.CMD_SECTION_COMFIRMATION_AXLE - }, - { - label: '设置临时限速', - handler: this.setSpeed, - cmdType: CMD.Section.CMD_SECTION_SET_LIMIT_SPEED - }, - { - label: '取消临时限速', - handler: this.cancelSpeed, - cmdType: CMD.Section.CMD_SECTION_SET_LIMIT_SPEED - } - ] - }, + menuNormal: [ + { + label: '区段故障解锁', + handler: this.fault, + cmdType: CMD.Section.CMD_SECTION_FAULT_UNLOCK, + isDisabled: (section, work) => false, + isShow: (section, work) => ['01', '02', '03'].includes(section.type) && work == 'localWork' + }, + { + label: '区段跟踪激活', + handler: this.active, + cmdType: CMD.Section.CMD_SECTION_ACTIVE, + isDisabled: (section, work) => false, + isShow: (section, work) => ['01', '02', '03'].includes(section.type) + }, + { + label: '区段跟踪切除', + handler: this.split, + cmdType: CMD.Section.CMD_SECTION_CUT_OFF, + isDisabled: (section, work) => false, + isShow: (section, work) => ['01', '02', '03'].includes(section.type) + }, + { + label: '区段封锁', + handler: this.lock, + cmdType: CMD.Section.CMD_SECTION_BLOCK, + isDisabled: (section, work) => section.blockade === 1, + isShow: (section, work) => ['01', '02', '03'].includes(section.type) && work == 'localWork' + }, + { + label: '区段解封', + handler: this.unlock, + cmdType: CMD.Section.CMD_SECTION_UNBLOCK, + isDisabled: (section, work) => section.blockade !== 1, + isShow: (section, work) => ['01', '02', '03'].includes(section.type) && work == 'localWork' + }, + { + label: '确认计轴有效', + handler: this.alxeEffective, + cmdType: CMD.Section.CMD_SECTION_COMFIRMATION_AXLE, + isDisabled: (section, work) => false, + isShow: (section, work) => ['01', '02', '03'].includes(section.type) && work == 'dispatchWork' + }, + { + label: '设置临时限速', + handler: this.setSpeed, + cmdType: CMD.Section.CMD_SECTION_SET_LIMIT_SPEED, + isDisabled: (section, work) => section.speedUpLimit !== -1, + isShow: (section, work) => ['01', '02', '03'].includes(section.type) && work == 'dispatchWork' + }, + { + label: '取消临时限速', + handler: this.cancelSpeed, + cmdType: CMD.Section.CMD_SECTION_SET_LIMIT_SPEED, + isDisabled: (section, work) => section.speedUpLimit === -1, + isShow: (section, work) => ['01', '02', '03'].includes(section.type) && work == 'dispatchWork' + } + ], menuForce: [ { label: this.$t('menu.menuSection.setFault'), @@ -165,10 +173,12 @@ export default { mounted() { const isDev = process.env.NODE_ENV === 'development'; if (isDev) { - this.menuNormal.Center.push({ + this.menuNormal.push({ label: '新建计划车', handler: this.addPlanTrain, - cmdType: CMD.Section.CMD_Train_Init_Plan + cmdType: CMD.Section.CMD_Train_Init_Plan, + isDisabled: (section, work) => false, + isShow: (section, work) => true }); } }, @@ -182,7 +192,12 @@ export default { initMenu() { // 编辑模式菜单列表 if (this.selected.type != '04') { - // this.menu = MenuContextHandler.covert(this.menuNormal); + this.menu = []; + this.menuNormal.forEach(menuItem => { + menuItem.disabled = !judgeStationControl(this.selected.belongStation, this.selected.stationCode, this.work) || menuItem.isDisabled(this.selected, this.work); + menuItem.show = menuItem.isShow(this.selected, this.work); + this.menu.push(menuItem); + }); } else { this.menu = []; } diff --git a/src/jmapNew/theme/race_01/menus/menuSignal.vue b/src/jmapNew/theme/race_01/menus/menuSignal.vue index ed341eabe..a34bfe348 100644 --- a/src/jmapNew/theme/race_01/menus/menuSignal.vue +++ b/src/jmapNew/theme/race_01/menus/menuSignal.vue @@ -24,9 +24,9 @@ import RouteDetail from '@/jmapNew/theme/components/menus/dialog/routeDetail'; import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo'; import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate'; import CMD from '@/scripts/cmdPlugin/CommandEnum'; -// import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler'; import { mapGetters } from 'vuex'; import { DeviceMenu, OperateMode } from '@/scripts/ConstDic'; +import { judgeStationControl } from '@/jmapNew/theme/components/utils/menuJudge.js'; export default { name: 'SignalMenu', @@ -47,122 +47,117 @@ export default { default() { return null; } + }, + work: { + type: String, + default() { + return ''; + } } }, data() { return { menu: [], - menuNormal: { - Local: [ - { - label: '排列进路', - handler: this.arrangementRoute, - cmdType: CMD.Signal.CMD_SIGNAL_SET_ROUTE - }, - { - label: '取消进路', - handler: this.cancelTrainRoute, - cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_ROUTE - }, - { - label: '信号重开', - handler: this.reopenSignal, - cmdType: CMD.Signal.CMD_SIGNAL_REOPEN_SIGNAL - }, - { - label: '信号机引导办理', - handler: this.guide, - cmdType: CMD.Signal.CMD_SIGNAL_ROUTE_GUIDE - }, - { - label: '人工解锁进路', // 信号机引导取消 - handler: this.humanTrainRoute, - cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_GUIDE - }, - { - label: '信号封锁', - handler: this.lock, - cmdType: CMD.Signal.CMD_SIGNAL_BLOCK - }, - { - label: '信号解封', - handler: this.unlock, - cmdType: CMD.Signal.CMD_SIGNAL_UNBLOCK - }, - { - label: 'Fleet进路办理', - handler: this.singalPassModel, - cmdType: CMD.Signal.CMD_SIGNAL_SET_CI_AUTO - }, - { - label: 'Fleet进路取消', - handler: this.singalCancelPassModel, - cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_CI_AUTO - }, - { - label: '进路自排关', - handler: this.humanControl, - cmdType: CMD.Signal.CMD_SIGNAL_CLOSE_AUTO_SETTING - }, - { - label: '进路自排开', - handler: this.atsAutoControl, - cmdType: CMD.Signal.CMD_SIGNAL_OPEN_AUTO_SETTING - }, - { - label: '查询进路控制状态', - handler: this.detail, - cmdType: CMD.Signal.CMD_SIGNAL_DETAIL - } - ], - Center: [ - { - label: '排列进路', - handler: this.arrangementRoute, - cmdType: CMD.Signal.CMD_SIGNAL_SET_ROUTE - }, - { - label: '取消进路', - handler: this.cancelTrainRoute, - cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_ROUTE - }, - { - label: '人工解锁进路', // 信号机引导取消 - handler: this.humanTrainRoute, - cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_GUIDE - }, - { - label: '信号重开', - handler: this.reopenSignal, - cmdType: CMD.Signal.CMD_SIGNAL_REOPEN_SIGNAL - }, - { - label: '进路自排关', - handler: this.humanControl, - cmdType: CMD.Signal.CMD_SIGNAL_CLOSE_AUTO_SETTING - }, - { - label: '进路自排开', - handler: this.atsAutoControl, - cmdType: CMD.Signal.CMD_SIGNAL_OPEN_AUTO_SETTING - }, - { - label: '设置通过模式', - handler: this.singalPassModel, - cmdType: CMD.Signal.CMD_SIGNAL_SET_CI_AUTO - }, - { - label: '取消通过模式', - handler: this.singalCancelPassModel, - cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_CI_AUTO - }, - { - label: '查询进路控制状态', - handler: this.detail, - cmdType: CMD.Signal.CMD_SIGNAL_DETAIL - } - ] - }, + menuNormal: [ + { + label: '排列进路', + handler: this.arrangementRoute, + cmdType: CMD.Signal.CMD_SIGNAL_SET_ROUTE, + isDisabled: (signal, work) => false, + isShow: (signal, work) => true + }, + { + label: '取消进路', + handler: this.cancelTrainRoute, + cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_ROUTE, + isDisabled: (signal, work) => false, + isShow: (signal, work) => true + }, + { + label: '信号重开', + handler: this.reopenSignal, + cmdType: CMD.Signal.CMD_SIGNAL_REOPEN_SIGNAL, + isDisabled: (signal, work) => false, + isShow: (signal, work) => true + }, + { + label: '信号机引导办理', + handler: this.guide, + cmdType: CMD.Signal.CMD_SIGNAL_ROUTE_GUIDE, + isDisabled: (signal, work) => false, + isShow: (signal, work) => work === 'localWork' + }, + { + label: '人工解锁进路', // 信号机引导取消 + handler: this.humanTrainRoute, + cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_GUIDE, + isDisabled: (signal, work) => false, + isShow: (signal, work) => true + }, + { + label: '信号封锁', + handler: this.lock, + cmdType: CMD.Signal.CMD_SIGNAL_BLOCK, + isDisabled: (signal, work) => signal.blockade === 1, + isShow: (signal, work) => work === 'localWork' + }, + { + label: '信号解封', + handler: this.unlock, + cmdType: CMD.Signal.CMD_SIGNAL_UNBLOCK, + isDisabled: (signal, work) => signal.blockade !== 1, + isShow: (signal, work) => work === 'localWork' + }, + { + label: 'Fleet进路办理', + handler: this.singalPassModel, + cmdType: CMD.Signal.CMD_SIGNAL_SET_CI_AUTO, + isDisabled: (signal, work) => signal.fleetMode === 1, + isShow: (signal, work) => work === 'localWork' + }, + { + label: 'Fleet进路取消', + handler: this.singalCancelPassModel, + cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_CI_AUTO, + isDisabled: (signal, work) => signal.fleetMode === 0, + isShow: (signal, work) => work === 'localWork' + }, + { + label: '进路自排关', + handler: this.humanControl, + cmdType: CMD.Signal.CMD_SIGNAL_CLOSE_AUTO_SETTING, + isDisabled: (signal, work) => false, + isShow: (signal, work) => true + }, + { + label: '进路自排开', + handler: this.atsAutoControl, + cmdType: CMD.Signal.CMD_SIGNAL_OPEN_AUTO_SETTING, + isDisabled: (signal, work) => false, + isShow: (signal, work) => true + }, + { + label: '设置通过模式', + handler: this.singalPassModel, + cmdType: CMD.Signal.CMD_SIGNAL_SET_CI_AUTO, + isDisabled: (signal, work) => signal.fleetMode === 1, + isShow: (signal, work) => work === 'dispatchWork' + }, + { + label: '取消通过模式', + handler: this.singalCancelPassModel, + cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_CI_AUTO, + isDisabled: (signal, work) => signal.fleetMode === 0, + isShow: (signal, work) => work === 'dispatchWork' + }, + { + label: '查询进路控制状态', + handler: this.detail, + cmdType: CMD.Signal.CMD_SIGNAL_DETAIL, + isDisabled: (signal, work) => false, + isShow: (signal, work) => true + } + ], menuForce: [ { label: '设置故障', @@ -214,7 +209,12 @@ export default { }; }, initMenu() { - // this.menu = MenuContextHandler.covert(this.menuNormal); + this.menu = []; + this.menuNormal.forEach(menuItem => { + menuItem.disabled = !judgeStationControl(this.selected.belongStationCode, this.selected.stationCode, this.work) || menuItem.isDisabled(this.selected, this.work); + menuItem.show = menuItem.isShow(this.selected, this.work); + this.menu.push(menuItem); + }); // 故障模式菜单列表 if (this.operatemode === OperateMode.FAULT) { this.menu = this.menuForce; diff --git a/src/jmapNew/theme/race_01/menus/menuStation.vue b/src/jmapNew/theme/race_01/menus/menuStation.vue index f035a07aa..5789df8b2 100644 --- a/src/jmapNew/theme/race_01/menus/menuStation.vue +++ b/src/jmapNew/theme/race_01/menus/menuStation.vue @@ -19,9 +19,10 @@ import CMD from '@/scripts/cmdPlugin/CommandEnum'; import { mapGetters } from 'vuex'; import { OperateMode } from '@/scripts/ConstDic'; import { DeviceMenu } from '@/scripts/ConstDic'; -// import {mouseCancelState} from '@/jmapNew/theme/components/utils/menuItemStatus'; import SetFault from '@/jmapNew/theme/components/menus/dialog/setFault'; import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate'; +import { judgeStationControl } from '@/jmapNew/theme/components/utils/menuJudge.js'; + export default { name: 'StationMenu', components: { @@ -38,52 +39,61 @@ export default { default() { return null; } + }, + work: { + type: String, + default() { + return ''; + } } }, data() { return { menu: [], - menuNormal: { - Local: [ - { - label: '全站设置联锁自动触发', - handler: this.setAutoTrigger, - cmdType: CMD.Station.CMD_STATION_SET_CI_AUTO_TRIGGER - }, - { - label: '全站取消联锁自动触发', - handler: this.cancelAutoTrigger, - cmdType: CMD.Station.CMD_STATION_CANCEL_CI_AUTO_TRIGGER - }, - { - label: '上电解锁', - handler: this.powerUnLock, - cmdType: CMD.Station.CMD_STATION_POWER_ON_UNLOCK - }, - { - label: '执行关键操作测试', - handler: this.execKeyOperationTest, - cmdType: CMD.Station.CMD_STATION_KEY_OPERATION_TEST - } - ], - Center: [ - { - label: '所有进路自排关', - handler: this.humanControlALL, - cmdType: CMD.Station.CMD_STATION_CLOSE_AUTO_SETTING - }, - { - label: '所有进路自排开', - handler: this.atsAutoControlALL, - cmdType: CMD.Station.CMD_STATION_OPEN_AUTO_SETTING - }, - { - label: '执行关键操作测试', - handler: this.execKeyOperationTest, - cmdType: CMD.Station.CMD_STATION_KEY_OPERATION_TEST - } - ] - }, + menuNormal: [ + { + label: '全站设置联锁自动触发', + handler: this.setAutoTrigger, + cmdType: CMD.Station.CMD_STATION_SET_CI_AUTO_TRIGGER, + isDisabled: (station, work) => false, + isShow: (station, work) => work === 'localWork' + }, + { + label: '全站取消联锁自动触发', + handler: this.cancelAutoTrigger, + cmdType: CMD.Station.CMD_STATION_CANCEL_CI_AUTO_TRIGGER, + isDisabled: (station, work) => false, + isShow: (station, work) => work === 'localWork' + }, + { + label: '上电解锁', + handler: this.powerUnLock, + cmdType: CMD.Station.CMD_STATION_POWER_ON_UNLOCK, + isDisabled: (station, work) => false, + isShow: (station, work) => work === 'localWork' + }, + { + label: '所有进路自排关', + handler: this.humanControlALL, + cmdType: CMD.Station.CMD_STATION_CLOSE_AUTO_SETTING, + isDisabled: (station, work) => false, + isShow: (station, work) => work === 'dispatchWork' + }, + { + label: '所有进路自排开', + handler: this.atsAutoControlALL, + cmdType: CMD.Station.CMD_STATION_OPEN_AUTO_SETTING, + isDisabled: (station, work) => false, + isShow: (station, work) => work === 'dispatchWork' + }, + { + label: '执行关键操作测试', + handler: this.execKeyOperationTest, + cmdType: CMD.Station.CMD_STATION_KEY_OPERATION_TEST, + isDisabled: (station, work) => false, + isShow: (station, work) => true + } + ], menuForce: [ { label: '设置ZC故障', @@ -135,13 +145,17 @@ export default { }, initMenu() { if (this.selected.centralized) { - // this.menu = MenuContextHandler.covert(this.menuNormal); + this.menu = []; + this.menuNormal.forEach(menuItem => { + menuItem.show = menuItem.isShow(this.selected, this.work); + menuItem.disabled = !judgeStationControl(this.selected.code, this.selected.stationCode, this.work) || menuItem.isDisabled(this.selected, this.work); + this.menu.push(menuItem); + }); // 故障模式菜单列表 if (this.operatemode === OperateMode.FAULT) { this.menu = this.menuForce; } } - }, doShow(point) { this.clickEvent(); diff --git a/src/jmapNew/theme/race_01/menus/menuStationControl.vue b/src/jmapNew/theme/race_01/menus/menuStationControl.vue deleted file mode 100644 index cce9752f8..000000000 --- a/src/jmapNew/theme/race_01/menus/menuStationControl.vue +++ /dev/null @@ -1,130 +0,0 @@ - - - diff --git a/src/jmapNew/theme/race_01/menus/menuStationStand.vue b/src/jmapNew/theme/race_01/menus/menuStationStand.vue index 6e5236c11..fb6913f21 100644 --- a/src/jmapNew/theme/race_01/menus/menuStationStand.vue +++ b/src/jmapNew/theme/race_01/menus/menuStationStand.vue @@ -26,7 +26,7 @@ import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuO import { mapGetters } from 'vuex'; import { DeviceMenu, OperateMode } from '@/scripts/ConstDic'; import CMD from '@/scripts/cmdPlugin/CommandEnum'; -// import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler'; +import { judgeStationControl } from '@/jmapNew/theme/components/utils/menuJudge.js'; export default { name: 'StationStandMenu', @@ -47,97 +47,117 @@ export default { default() { return null; } + }, + work: { + type: String, + default() { + return ''; + } } }, data() { return { menu: [], - menuNormal: { - Local: [ - { - label: '扣车', - handler: this.setDetainTrain, - cmdType:CMD.Stand.CMD_STAND_SET_HOLD_TRAIN - }, - { - label: '取消扣车', - handler: this.cancelDetainTrain, - cmdType:CMD.Stand.CMD_STAND_CANCEL_HOLD_TRAIN - }, - { - label: '提前发车', - handler: this.earlyDeparture, - cmdType:CMD.Stand.CMD_STAND_EARLY_DEPART - }, - { - label: '查看站台信息', - handler: this.detail, - cmdType:CMD.Stand.CMD_STAND_VIEW_STATUS - } - ], - Center: [ - { - label: '扣车', - handler: this.setDetainTrain, - cmdType:CMD.Stand.CMD_STAND_SET_HOLD_TRAIN - }, - { - label: '取消扣车', - handler: this.cancelDetainTrain, - cmdType:CMD.Stand.CMD_STAND_CANCEL_HOLD_TRAIN - }, - { - label: '批量扣车', - handler: this.setBulkBuckleTrain, - cmdType:CMD.Stand.CMD_STAND_SET_HOLD_TRAIN_ALL - }, - { - label: '批量取消扣车', - handler: this.cancelBulkBuckleTrain, - cmdType:CMD.Stand.CMD_STAND_CANCEL_HOLD_TRAIN_ALL - }, - { - label: '提前发车', - handler: this.earlyDeparture, - cmdType:CMD.Stand.CMD_STAND_EARLY_DEPART - }, - { - label: '设置跳停', - handler: this.setJumpStop, - cmdType:CMD.Stand.CMD_STAND_SET_JUMP_STOP - }, - { - label: '取消跳停', - handler: this.cancelJumpStop, - cmdType:CMD.Stand.CMD_STAND_CANCEL_JUMP_STOP - }, - { - label: '设置停站时间', - handler: this.setStopTime, - cmdType:CMD.Stand.CMD_STAND_SET_PARK_TIME - }, - { - label: '设置运行等级', - handler: this.setRunLevel, - cmdType:CMD.Stand.CMD_STAND_SET_RUN_TIME - }, - { - label: '区间列车数量限制', - handler: this.setDetainTrainAll, - cmdType:CMD.Stand.CMD_STAND_SET_HOLD_TRAIN_AUTO - }, - { - label: '取消区间列车数量限制', - handler: this.cancelDetainTrainAll, - cmdType:CMD.Stand.CMD_STAND_CANCEL_HOLD_TRAIN_AUTO - }, - { - label: '查看站台信息', - handler: this.detail, - cmdType:CMD.Stand.CMD_STAND_VIEW_STATUS - } - ] - }, + menuNormal: [ + { + label: '扣车', + handler: this.setDetainTrain, + cmdType:CMD.Stand.CMD_STAND_SET_HOLD_TRAIN, + isDisabled: (stand, work) => stand.stationHoldTrain === 1, + isShow: (stand, work) => work === 'localWork' + }, + { + label: '取消扣车', + handler: this.cancelDetainTrain, + cmdType:CMD.Stand.CMD_STAND_CANCEL_HOLD_TRAIN, + isDisabled: (stand, work) => stand.stationHoldTrain === 1, + isShow: (stand, work) => work === 'localWork' + }, + { + label: '扣车', + handler: this.setDetainTrain, + cmdType:CMD.Stand.CMD_STAND_SET_HOLD_TRAIN, + isDisabled: (stand, work) => stand.centerHoldTrain === 1, + isShow: (stand, work) => work === 'dispatchWork' + }, + { + label: '取消扣车', + handler: this.cancelDetainTrain, + cmdType:CMD.Stand.CMD_STAND_CANCEL_HOLD_TRAIN, + isDisabled: (stand, work) => stand.centerHoldTrain === 1, + isShow: (stand, work) => work === 'dispatchWork' + }, + { + label: '批量扣车', + handler: this.setBulkBuckleTrain, + cmdType:CMD.Stand.CMD_STAND_SET_HOLD_TRAIN_ALL, + isDisabled: (stand, work) => false, + isShow: (stand, work) => work === 'dispatchWork' + }, + { + label: '批量取消扣车', + handler: this.cancelBulkBuckleTrain, + cmdType:CMD.Stand.CMD_STAND_CANCEL_HOLD_TRAIN_ALL, + isDisabled: (stand, work) => false, + isShow: (stand, work) => work === 'dispatchWork' + }, + { + label: '提前发车', + handler: this.earlyDeparture, + cmdType:CMD.Stand.CMD_STAND_EARLY_DEPART, + isDisabled: (stand, work) => stand.trainParking !== 1, + isShow: (stand, work) => false + }, + { + label: '设置跳停', + handler: this.setJumpStop, + cmdType:CMD.Stand.CMD_STAND_SET_JUMP_STOP, + isDisabled: (stand, work) => stand.allSkip !== 0, + isShow: (stand, work) => work === 'dispatchWork' + }, + { + label: '取消跳停', + handler: this.cancelJumpStop, + cmdType:CMD.Stand.CMD_STAND_CANCEL_JUMP_STOP, + isDisabled: (stand, work) => stand.allSkip !== 1, + isShow: (stand, work) => work === 'dispatchWork' + }, + { + label: '设置停站时间', + handler: this.setStopTime, + cmdType:CMD.Stand.CMD_STAND_SET_PARK_TIME, + isDisabled: (stand, work) => false, + isShow: (stand, work) => work === 'dispatchWork' + }, + { + label: '设置运行等级', + handler: this.setRunLevel, + cmdType:CMD.Stand.CMD_STAND_SET_RUN_TIME, + isDisabled: (stand, work) => false, + isShow: (stand, work) => work === 'dispatchWork' + }, + { + label: '区间列车数量限制', + handler: this.setDetainTrainAll, + cmdType:CMD.Stand.CMD_STAND_SET_HOLD_TRAIN_AUTO, + isDisabled: (stand, work) => false, + isShow: (stand, work) => work === 'dispatchWork' + }, + { + label: '取消区间列车数量限制', + handler: this.cancelDetainTrainAll, + cmdType:CMD.Stand.CMD_STAND_CANCEL_HOLD_TRAIN_AUTO, + isDisabled: (stand, work) => false, + isShow: (stand, work) => work === 'dispatchWork' + }, + { + label: '查看站台信息', + handler: this.detail, + cmdType: CMD.Stand.CMD_STAND_VIEW_STATUS, + isDisabled: (stand, work) => false, + isShow: (stand, work) => true + } + ], menuForce: [ { label: '设置故障', @@ -189,8 +209,12 @@ export default { }, initMenu() { // 编辑模式菜单列表 - // this.menu = MenuContextHandler.covert(this.menuNormal); - + this.menu = []; + this.menuNormal.forEach(menuItem => { + menuItem.disabled = !judgeStationControl(this.selected.stationCode, this.selected.deviceStationCode, this.work) || menuItem.isDisabled(this.selected, this.work); + menuItem.show = menuItem.isShow(this.selected, this.work); + this.menu.push(menuItem); + }); // 故障模式菜单列表 if (this.operatemode === OperateMode.FAULT) { this.menu = this.menuForce; diff --git a/src/jmapNew/theme/race_01/menus/menuStationTurnBack.vue b/src/jmapNew/theme/race_01/menus/menuStationTurnBack.vue index e3e3bd18a..87c8973b3 100644 --- a/src/jmapNew/theme/race_01/menus/menuStationTurnBack.vue +++ b/src/jmapNew/theme/race_01/menus/menuStationTurnBack.vue @@ -26,27 +26,24 @@ export default { default() { return null; } + }, + work: { + type: String, + default() { + return ''; + } } }, data() { return { menu: [], - menuNormal: { - Local: [ - { - label: '设置折返策略', - handler: this.setBackStrategy, - cmdType: CMD.Station.CMD_STATION_SET_TURN_BACK_STRATEGY - } - ], - Center: [ - { - label: '设置折返策略', - handler: this.setBackStrategy, - cmdType: CMD.Station.CMD_STATION_SET_TURN_BACK_STRATEGY - } - ] - }, + menuNormal: [ + { + label: '设置折返策略', + handler: this.setBackStrategy, + cmdType: CMD.Station.CMD_STATION_SET_TURN_BACK_STRATEGY + } + ], menuForce: [ ] }; @@ -78,8 +75,7 @@ export default { }, initMenu() { // 编辑模式菜单列表 - // this.menu = MenuContextHandler.covert(this.menuNormal); - + this.menu = this.menuNormal; // 故障模式菜单列表 if (this.operatemode === OperateMode.FAULT) { this.menu = this.menuForce; diff --git a/src/jmapNew/theme/race_01/menus/menuSwitch.vue b/src/jmapNew/theme/race_01/menus/menuSwitch.vue index 594690840..31a54044a 100644 --- a/src/jmapNew/theme/race_01/menus/menuSwitch.vue +++ b/src/jmapNew/theme/race_01/menus/menuSwitch.vue @@ -21,7 +21,7 @@ import AlxeEffective from './dialog/alxeEffective'; import SwitchHookLock from '@/jmapNew/theme/components/menus/dialog/switchHookLock'; import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo'; import { mapGetters } from 'vuex'; - +import { judgeStationControl } from '@/jmapNew/theme/components/utils/menuJudge.js'; import CMD from '@/scripts/cmdPlugin/CommandEnum'; import { DeviceMenu, OperateMode } from '@/scripts/ConstDic'; import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate'; @@ -44,111 +44,114 @@ export default { default() { return null; } + }, + work: { + type: String, + default() { + return ''; + } } }, data() { return { menu: [], - menuNormal: { - Local: [ - { - label: '定操', - handler: this.locate, - cmdType: CMD.Switch.CMD_SWITCH_NORMAL_POSITION - }, - { - label: '反操', - handler: this.reverse, - cmdType: CMD.Switch.CMD_SWITCH_REVERSE_POSITION - }, - { - label: '道岔单锁', - handler: this.lock, - cmdType: CMD.Switch.CMD_SWITCH_SINGLE_LOCK - }, - { - label: '道岔单解', - handler: this.unlock, - cmdType: CMD.Switch.CMD_SWITCH_SINGLE_UNLOCK - }, - { - label: '道岔封锁', - handler: this.block, - cmdType: CMD.Switch.CMD_SWITCH_BLOCK - }, - { - label: '道岔解封', - handler: this.unblock, - cmdType: CMD.Switch.CMD_SWITCH_UNBLOCK - }, - { - label: '设置临时限速', - handler: this.setSpeed, - cmdType: CMD.Switch.CMD_SWITCH_SET_LIMIT_SPEED - }, - { - label: '取消临时限速', - handler: this.cancelSpeed, - cmdType: CMD.Switch.CMD_SWITCH_CANCEL_LIMIT_SPEED - } - ], - Center: [ - { - label: '定操', - handler: this.locate, - cmdType: CMD.Switch.CMD_SWITCH_NORMAL_POSITION - }, - { - label: '反操', - handler: this.reverse, - cmdType: CMD.Switch.CMD_SWITCH_REVERSE_POSITION - }, - // { - // label: '道岔单锁', - // handler: this.lock, - // cmdType: CMD.Switch.CMD_SWITCH_SINGLE_LOCK - // }, - { - type: 'separator' - }, - { - label: '区段激活', - handler: this.active, - cmdType: CMD.Switch.CMD_SWITCH_ACTIVE - }, - { - label: '区段切除', - handler: this.split, - cmdType: CMD.Switch.CMD_SWITCH_CUT_OFF - }, - { - type: 'separator' - }, - { - label: '确认计轴有效', - handler: this.alxeEffective, - cmdType: CMD.Switch.CMD_SWITCH_COMFIRMATION_AXLE - }, - { - label: '设置临时限速', - handler: this.setSpeed, - cmdType: CMD.Switch.CMD_SWITCH_SET_LIMIT_SPEED - }, - { - label: '取消临时限速', - handler: this.cancelSpeed, - cmdType:CMD.Switch.CMD_SWITCH_CANCEL_LIMIT_SPEED - }, - { - type: 'separator' - }, - { - label: '查看公里标', - handler: this.undeveloped, - cmdType: CMD.Switch.CMD_SWITCH_SET_LIMIT_SPEED - } - ] - }, + menuNormal: [ + { + label: '定操', + handler: this.locate, + cmdType: CMD.Switch.CMD_SWITCH_NORMAL_POSITION, + isDisabled: (switchDevice, work) => switchDevice.normalPosition === 1, + isShow: (switchDevice, work) => true + }, + { + label: '反操', + handler: this.reverse, + cmdType: CMD.Switch.CMD_SWITCH_REVERSE_POSITION, + isDisabled: (switchDevice, work) => switchDevice.reversePosition === 1, + isShow: (switchDevice, work) => true + }, + { + label: '道岔单锁', + handler: this.lock, + cmdType: CMD.Switch.CMD_SWITCH_SINGLE_LOCK, + isDisabled: (switchDevice, work) => switchDevice.singleLock === 1, + isShow: (switchDevice, work) => work === 'localWork' + }, + { + label: '道岔单解', + handler: this.unlock, + cmdType: CMD.Switch.CMD_SWITCH_SINGLE_UNLOCK, + isDisabled: (switchDevice, work) => switchDevice.singleLock !== 1, + isShow: (switchDevice, work) => work === 'localWork' + }, + { + label: '道岔封锁', + handler: this.block, + cmdType: CMD.Switch.CMD_SWITCH_BLOCK, + isDisabled: (switchDevice, work) => switchDevice.blockade === 1, + isShow: (switchDevice, work) => work === 'localWork' + }, + { + label: '道岔解封', + handler: this.unblock, + cmdType: CMD.Switch.CMD_SWITCH_UNBLOCK, + isDisabled: (switchDevice, work) => switchDevice.blockade !== 1, + isShow: (switchDevice, work) => work === 'localWork' + }, + { + type: 'separator', + isShow: (switchDevice, work) => work === 'dispatchWork' + }, + { + label: '区段激活', + handler: this.active, + cmdType: CMD.Switch.CMD_SWITCH_ACTIVE, + isDisabled: (switchDevice, work) => false, + isShow: (switchDevice, work) => work === 'dispatchWork' + }, + { + label: '区段切除', + handler: this.split, + cmdType: CMD.Switch.CMD_SWITCH_CUT_OFF, + isDisabled: (switchDevice, work) => false, + isShow: (switchDevice, work) => work === 'dispatchWork' + }, + { + type: 'separator', + isShow: (switchDevice, work) => work === 'dispatchWork' + }, + { + label: '确认计轴有效', + handler: this.alxeEffective, + cmdType: CMD.Switch.CMD_SWITCH_COMFIRMATION_AXLE, + isDisabled: (switchDevice, work) => false, + isShow: (switchDevice, work) => work === 'dispatchWork' + }, + { + label: '设置临时限速', + handler: this.setSpeed, + cmdType: CMD.Switch.CMD_SWITCH_SET_LIMIT_SPEED, + isDisabled: (switchDevice, work) => false, + isShow: (switchDevice, work) => work === 'dispatchWork' + }, + { + label: '取消临时限速', + handler: this.cancelSpeed, + cmdType:CMD.Switch.CMD_SWITCH_CANCEL_LIMIT_SPEED, + isDisabled: (switchDevice, work) => false, + isShow: (switchDevice, work) => work === 'dispatchWork' + }, + { + type: 'separator' + }, + { + label: '查看公里标', + handler: this.undeveloped, + cmdType: CMD.Switch.CMD_SWITCH_SET_LIMIT_SPEED, + isDisabled: (switchDevice, work) => false, + isShow: (switchDevice, work) => true + } + ], menuForce: [ { label: '设置故障', @@ -201,7 +204,12 @@ export default { }, initMenu() { // 编辑模式菜单列表 - // this.menu = MenuContextHandler.covert(this.menuNormal); + this.menu = []; + this.menuNormal.forEach(menuItem => { + menuItem.disabled = !judgeStationControl(this.selected.belongStationCode, this.selected.stationCode, this.work) || menuItem.isDisabled(this.selected, this.work); + menuItem.show = menuItem.isShow(this.selected, this.work); + this.menu.push(menuItem); + }); // 故障模式菜单列表 if (this.operatemode === OperateMode.FAULT) { // if (!this.$store.state.scriptRecord.bgSet) { diff --git a/src/jmapNew/theme/race_01/menus/menuTrain.vue b/src/jmapNew/theme/race_01/menus/menuTrain.vue index d2841f5bb..d63dfaeb4 100644 --- a/src/jmapNew/theme/race_01/menus/menuTrain.vue +++ b/src/jmapNew/theme/race_01/menus/menuTrain.vue @@ -32,7 +32,6 @@ import SetTrainOperation from '@/jmapNew/theme/components/menus/dialog/setTrainO import { mapGetters } from 'vuex'; import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler'; import { DeviceMenu, OperateMode } from '@/scripts/ConstDic'; -// import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler'; import CMD from '@/scripts/cmdPlugin/CommandEnum'; import { menuOperate, commitOperate, commitTrainSend } from '@/jmapNew/theme/components/utils/menuOperate'; @@ -63,145 +62,83 @@ export default { data() { return { menu: [], - menuNormal: { - Local: [ - // { - // label: '设置车组号', - // handler: this.addTrainId, - // cmdType: CMD.TrainWindow.CMD_Train_Init_Plan - // }, - // { - // label: '删除车组号', - // handler: this.delTrainId, - // cmdType: CMD.TrainWindow.CMD_Train_Init_Plan - // }, - // { - // label: '移动车组号', - // handler: this.moveTrainId, - // cmdType: CMD.TrainWindow.CMD_Train_Init_Plan - // }, - // { - // label: '新建计划车', - // handler: this.addPlanTrain, - // cmdType: CMD.TrainWindow.CMD_Train_Init_Plan - // }, - // { - // type: 'separator' - // }, - // { - // label: '设置计划车', - // handler: this.setPlanTrain, - // cmdType: CMD.TrainWindow.CMD_Train_Init_Plan - // }, - // { - // label: '设置头码车', - // handler: this.setHeadTrain, - // cmdType: CMD.TrainWindow.CMD_Train_Init_Plan - // }, - // { - // label: '设置人工车', - // handler: this.setWorkTrain, - // cmdType: CMD.TrainWindow.CMD_Train_Init_Plan - // }, - // { - // label: '设乘务组号', - // handler: this.undeveloped, - // cmdType: CMD.TrainWindow.CMD_Train_Init_Plan - // }, - // { - // type: 'separator' - // }, - // { - // label: '标记ATP切除', - // handler: this.setTrainATPdel, - // cmdType: CMD.TrainWindow.CMD_Train_Init_Plan - // }, - // { - // label: '标记ATP恢复', - // handler: this.setTrainATPRec, - // cmdType: CMD.TrainWindow.CMD_Train_Init_Plan - // }, - // { - // type: 'separator' - // }, - // { - // label: '旅行冲突列车', - // handler: this.undeveloped, - // cmdType: CMD.TrainWindow.CMD_Train_Init_Plan - // }, - // { - // label: '列车信息', - // handler: this.undeveloped, - // cmdType: CMD.TrainWindow.CMD_Train_Init_Plan - // } - ], - Center: [ - { - label: '设置车组号', - handler: this.addTrainId, - cmdType: CMD.TrainWindow.CMD_Train_Init_Plan - }, - { - label: '删除车组号', - handler: this.delTrainId, - cmdType: CMD.TrainWindow.CMD_Train_Init_Plan - }, - { - label: '移动车组号', - handler: this.moveTrainId, - cmdType: CMD.TrainWindow.CMD_Train_Init_Plan - }, - { - type: 'separator' - }, - { - label: '设置计划车', - handler: this.setPlanTrain, - cmdType: CMD.TrainWindow.CMD_TRAIN_SET_PLAN - }, - { - label: '设置头码车', - handler: this.setHeadTrain, - cmdType: CMD.TrainWindow.CMD_TRAIN_SET_HEAD - }, - { - label: '设置人工车', - handler: this.setWorkTrain, - cmdType: CMD.TrainWindow.CMD_TRAIN_SET_MANUAL - }, - { - label: '设乘务组号', - handler: this.undeveloped, - cmdType: CMD.TrainWindow.CMD_Train_Init_Plan - }, - { - type: 'separator' - }, - { - label: '标记ATP切除', - handler: this.setTrainATPdel, - cmdType: CMD.TrainWindow.CMD_Train_Init_Plan - }, - { - label: '标记ATP恢复', - handler: this.setTrainATPRec, - cmdType: CMD.TrainWindow.CMD_Train_Init_Plan - }, - { - type: 'separator' - }, - { - label: '旅行冲突列车', - handler: this.undeveloped, - cmdType: CMD.TrainWindow.CMD_Train_Init_Plan - }, - { - label: '列车信息', - handler: this.undeveloped, - cmdType: CMD.TrainWindow.CMD_Train_Init_Plan - } - ] - }, + menuNormal: [ + { + label: '设置车组号', + handler: this.addTrainId, + cmdType: CMD.TrainWindow.CMD_Train_Init_Plan, + isShow: (train, work) => work === 'dispatchWork' + }, + { + label: '删除车组号', + handler: this.delTrainId, + cmdType: CMD.TrainWindow.CMD_Train_Init_Plan, + isShow: (train, work) => work === 'dispatchWork' + }, + { + label: '移动车组号', + handler: this.moveTrainId, + cmdType: CMD.TrainWindow.CMD_Train_Init_Plan, + isShow: (train, work) => work === 'dispatchWork' + }, + { + type: 'separator' + }, + { + label: '设置计划车', + handler: this.setPlanTrain, + cmdType: CMD.TrainWindow.CMD_TRAIN_SET_PLAN, + isShow: (train, work) => work === 'dispatchWork' + }, + { + label: '设置头码车', + handler: this.setHeadTrain, + cmdType: CMD.TrainWindow.CMD_TRAIN_SET_HEAD, + isShow: (train, work) => work === 'dispatchWork' + }, + { + label: '设置人工车', + handler: this.setWorkTrain, + cmdType: CMD.TrainWindow.CMD_TRAIN_SET_MANUAL, + isShow: (train, work) => work === 'dispatchWork' + }, + { + label: '设乘务组号', + handler: this.undeveloped, + cmdType: CMD.TrainWindow.CMD_Train_Init_Plan, + isShow: (train, work) => work === 'dispatchWork' + }, + { + type: 'separator' + }, + { + label: '标记ATP切除', + handler: this.setTrainATPdel, + cmdType: CMD.TrainWindow.CMD_Train_Init_Plan, + isShow: (train, work) => work === 'dispatchWork' + }, + { + label: '标记ATP恢复', + handler: this.setTrainATPRec, + cmdType: CMD.TrainWindow.CMD_Train_Init_Plan, + isShow: (train, work) => work === 'dispatchWork' + }, + { + type: 'separator' + }, + { + label: '旅行冲突列车', + handler: this.undeveloped, + cmdType: CMD.TrainWindow.CMD_Train_Init_Plan, + isShow: (train, work) => work === 'dispatchWork' + }, + { + label: '列车信息', + handler: this.undeveloped, + cmdType: CMD.TrainWindow.CMD_Train_Init_Plan, + isShow: (train, work) => work === 'dispatchWork' + } + ], menuForce: [ { label: '设置故障', @@ -319,7 +256,12 @@ export default { }, initMenu() { // 编辑模式菜单列表 - // this.menu = MenuContextHandler.covert(this.menuNormal); + this.menu = []; + this.menuNormal.forEach(menuItem => { + menuItem.disabled = menuItem.isDisabled ? menuItem.isDisabled(this.selected) : false; + menuItem.show = menuItem.isShow ? menuItem.isShow(this.selected, this.work) : true; + this.menu.push(menuItem); + }); // 故障模式菜单列表 if (this.operatemode === OperateMode.FAULT) { if (!this.$store.state.scriptRecord.bgSet) { diff --git a/src/jmapNew/theme/race_01/menus/passiveDialog/alarm.vue b/src/jmapNew/theme/race_01/menus/passiveDialog/alarm.vue index 5a28b8d87..0541958bf 100644 --- a/src/jmapNew/theme/race_01/menus/passiveDialog/alarm.vue +++ b/src/jmapNew/theme/race_01/menus/passiveDialog/alarm.vue @@ -2,7 +2,7 @@