From 1555c0ccd59e98d32faa8edc7b630e93b4060d49 Mon Sep 17 00:00:00 2001 From: joylink_cuiweidong <364937672@qq.com> Date: Thu, 8 Dec 2022 17:23:53 +0800 Subject: [PATCH] =?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/chengdu_03/menus/menuSection.vue | 7 ++- .../theme/chengdu_03/menus/menuSignal.vue | 8 ++++ .../theme/chengdu_03/menus/menuSwitch.vue | 1 + .../theme/chengdu_03/menus/menuTrain.vue | 11 +++++ .../theme/foshan_01/menus/menuLimit.vue | 44 +++++++++---------- .../theme/foshan_01/menus/menuSection.vue | 21 +++++---- .../theme/foshan_01/menus/menuSignal.vue | 15 +++++-- .../theme/foshan_01/menus/menuStation.vue | 1 + .../theme/foshan_01/menus/menuSwitch.vue | 4 ++ .../theme/foshan_01/menus/menuTrain.vue | 3 +- 10 files changed, 77 insertions(+), 38 deletions(-) diff --git a/src/jmapNew/theme/chengdu_03/menus/menuSection.vue b/src/jmapNew/theme/chengdu_03/menus/menuSection.vue index 4e11b1c4f..2886fc408 100644 --- a/src/jmapNew/theme/chengdu_03/menus/menuSection.vue +++ b/src/jmapNew/theme/chengdu_03/menus/menuSection.vue @@ -59,12 +59,14 @@ export default { label: '区故解', handler: this.fault, cmdType: CMD.Section.CMD_SECTION_FAULT_UNLOCK, + isDisabled: (sectionDevice, work) => false, isShow: (sectionDevice, work) => work === 'dispatchWork' }, { label: '属性', handler: this.detail, cmdType: CMD.Section.CMD_SECTION_DETAILS, + isDisabled: (sectionDevice, work) => false, isShow: (sectionDevice, work) => work === 'dispatchWork' } ], @@ -113,10 +115,11 @@ export default { mounted() { const isDev = process.env.NODE_ENV === 'development'; if (isDev) { - this.menuNormal.Center.push( { + this.menuNormal.push({ label: '新建计划列车', handler: this.createPlanTrain, - cmdType: CMD.Section.CMD_Train_Init_Plan + cmdType: CMD.Section.CMD_Train_Init_Plan, + isShow: (sectionDevice, work) => work === 'dispatchWork' }); } }, diff --git a/src/jmapNew/theme/chengdu_03/menus/menuSignal.vue b/src/jmapNew/theme/chengdu_03/menus/menuSignal.vue index 1b376cf7b..27896bbc3 100644 --- a/src/jmapNew/theme/chengdu_03/menus/menuSignal.vue +++ b/src/jmapNew/theme/chengdu_03/menus/menuSignal.vue @@ -65,30 +65,35 @@ export default { label: '办理进路', handler: this.arrangementRoute, cmdType: CMD.Signal.CMD_SIGNAL_SET_ROUTE, + isDisabled: (signal, work) => false, isShow: (signalDevice, work) => work === 'dispatchWork' }, { label: '办理引导进路', handler: this.guide, cmdType: CMD.Signal.CMD_SIGNAL_ROUTE_GUIDE, + isDisabled: (signal, work) => false, isShow: (signalDevice, work) => work === 'dispatchWork' }, { label: '取消进路', handler: this.cancelTrainRoute, cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_ROUTE, + isDisabled: (signal, work) => false, isShow: (signalDevice, work) => work === 'dispatchWork' }, { label: '总人解', handler: this.humanTrainRoute, cmdType: CMD.Signal.CMD_SIGNAL_HUMAN_RELEASE_ROUTE, + isDisabled: (signal, work) => false, isShow: (signalDevice, work) => work === 'dispatchWork' }, { label: '信号重开', handler: this.reopenSignal, cmdType: CMD.Signal.CMD_SIGNAL_REOPEN_SIGNAL, + isDisabled: (signal, work) => false, isShow: (signalDevice, work) => work === 'dispatchWork' }, { @@ -109,18 +114,21 @@ export default { label: '进路收人工控', handler: this.humanControl, cmdType: CMD.Signal.CMD_SIGNAL_CLOSE_AUTO_SETTING, + isDisabled: (signal, work) => false, isShow: (signalDevice, work) => work === 'dispatchWork' }, { label: '进路交自动控', handler: this.atsAutoControl, cmdType: CMD.Signal.CMD_SIGNAL_OPEN_AUTO_SETTING, + isDisabled: (signal, work) => false, isShow: (signalDevice, work) => work === 'dispatchWork' }, { label: '进路信息', handler: this.detail, cmdType: CMD.Signal.CMD_SIGNAL_OPEN_AUTO_SETTING, + isDisabled: (signal, work) => false, isShow: (signalDevice, work) => work === 'dispatchWork' } // Local: [ diff --git a/src/jmapNew/theme/chengdu_03/menus/menuSwitch.vue b/src/jmapNew/theme/chengdu_03/menus/menuSwitch.vue index 27925880d..af199b865 100644 --- a/src/jmapNew/theme/chengdu_03/menus/menuSwitch.vue +++ b/src/jmapNew/theme/chengdu_03/menus/menuSwitch.vue @@ -100,6 +100,7 @@ export default { label: '区故解', handler: this.fault, cmdType: CMD.Switch.CMD_SWITCH_FAULT_UNLOCK, + isDisabled: (signal, work) => false, isShow: (switchDevice, work) => work === 'dispatchWork' } // Center: [ diff --git a/src/jmapNew/theme/chengdu_03/menus/menuTrain.vue b/src/jmapNew/theme/chengdu_03/menus/menuTrain.vue index 423673657..f1cbb9119 100644 --- a/src/jmapNew/theme/chengdu_03/menus/menuTrain.vue +++ b/src/jmapNew/theme/chengdu_03/menus/menuTrain.vue @@ -70,57 +70,68 @@ export default { { label: '新建车组号', handler: this.createTrainNo, + isDisabled: (signal, work) => false, isShow: (trainDevice, work) => work === 'dispatchWork' }, { label: '移动车组号', handler: this.moveTrainNo, + isDisabled: (signal, work) => false, isShow: (trainDevice, work) => work === 'dispatchWork' }, { label: '删除车组号', handler: this.deleteTrainNo, + isDisabled: (signal, work) => false, isShow: (trainDevice, work) => work === 'dispatchWork' }, { label: '修改车组号', handler: this.editTrainNo, + isDisabled: (signal, work) => false, isShow: (trainDevice, work) => work === 'dispatchWork' }, { label: '设计划车', handler: this.setPlanTrainId, + isDisabled: (signal, work) => false, isShow: (trainDevice, work) => work === 'dispatchWork' }, { label: '设目的地', handler: this.destinationTrainId, + isDisabled: (signal, work) => false, isShow: (trainDevice, work) => work === 'dispatchWork' }, { label: '设人工车', handler: this.artificialTrainId, + isDisabled: (signal, work) => false, isShow: (trainDevice, work) => work === 'dispatchWork' }, { label: '设特殊人工车', handler: this.undeveloped, + isDisabled: (signal, work) => false, isShow: (trainDevice, work) => work === 'dispatchWork' }, { label: '详细列车信息', handler: this.detailTrainInfo, + isDisabled: (signal, work) => false, isShow: (trainDevice, work) => work === 'dispatchWork' }, { label: '属性', handler: this.undeveloped, + isDisabled: (signal, work) => false, isShow: (trainDevice, work) => work === 'dispatchWork' }, { label: '新建计划列车', handler: this.createPlanTrain, cmdType: CMD.TrainWindow.CMD_Train_Init_Plan, + isDisabled: (signal, work) => false, isShow: (trainDevice, work) => work === 'localWork' } ], diff --git a/src/jmapNew/theme/foshan_01/menus/menuLimit.vue b/src/jmapNew/theme/foshan_01/menus/menuLimit.vue index 21071a34e..1175011c2 100644 --- a/src/jmapNew/theme/foshan_01/menus/menuLimit.vue +++ b/src/jmapNew/theme/foshan_01/menus/menuLimit.vue @@ -32,28 +32,28 @@ export default { return { menu: [{ label: '取消全线临时限速', - handler: this.cancelSpeed, - disabledCallback: '', - auth: { station: true, center: false } - }], - menuNormal: { - local: [ - { - label: '取消全线临时限速', - handler: this.cancelSpeed, - disabledCallback: '', - auth: { station: true, center: false } - } - ], - central: [ - { - label: '取消全线临时限速', - handler: this.cancelSpeed, - disabledCallback: '', - auth: { station: false, center: true } - } - ] - } + handler: this.cancelSpeed + // disabledCallback: '', + // auth: { station: true, center: false } + }] + // menuNormal: { + // local: [ + // { + // label: '取消全线临时限速', + // handler: this.cancelSpeed, + // disabledCallback: '', + // auth: { station: true, center: false } + // } + // ], + // central: [ + // { + // label: '取消全线临时限速', + // handler: this.cancelSpeed, + // disabledCallback: '', + // auth: { station: false, center: true } + // } + // ] + // } }; }, computed: { diff --git a/src/jmapNew/theme/foshan_01/menus/menuSection.vue b/src/jmapNew/theme/foshan_01/menus/menuSection.vue index f51940abf..f2594c469 100644 --- a/src/jmapNew/theme/foshan_01/menus/menuSection.vue +++ b/src/jmapNew/theme/foshan_01/menus/menuSection.vue @@ -75,18 +75,23 @@ export default { { label: '设置临时限速', handler: this.setSpeed, - cmdType: CMD.Section.CMD_SECTION_SET_LIMIT_SPEED - }, - { - label: '全线取消限速', - handler: this.cancelSpeed, - cmdType:CMD.LimitControl.CMD_CANCEL_ALL_LIMIT_SPEED + cmdType: CMD.Section.CMD_SECTION_SET_LIMIT_SPEED, + isDisabled: (sectionDevice, work) => false + }, { label: '全线取消限速', handler: this.cancelSpeed, cmdType:CMD.LimitControl.CMD_CANCEL_ALL_LIMIT_SPEED, - isShow: (signalDevice, work) => work === 'dispatchWork' + isDisabled: (sectionDevice, work) => false + + }, + { + label: '全线取消限速', + handler: this.cancelSpeed, + cmdType:CMD.LimitControl.CMD_CANCEL_ALL_LIMIT_SPEED, + isDisabled: (signal, work) => false, + isShow: (sectionDevice, work) => work === 'dispatchWork' } // Local: [ // // { @@ -151,7 +156,7 @@ export default { label: '新建计划车', handler: this.addPlanTrain, cmdType: CMD.Section.CMD_Train_Init_Plan, - isShow: (signalDevice, work) => work === 'dispatchWork' + isShow: (sectionDevice, work) => work === 'dispatchWork' }); } }, diff --git a/src/jmapNew/theme/foshan_01/menus/menuSignal.vue b/src/jmapNew/theme/foshan_01/menus/menuSignal.vue index e54e0e0f3..757506fb0 100644 --- a/src/jmapNew/theme/foshan_01/menus/menuSignal.vue +++ b/src/jmapNew/theme/foshan_01/menus/menuSignal.vue @@ -66,34 +66,40 @@ export default { { label: '进路选排', handler: this.arrangementRoute, - cmdType:CMD.Signal.CMD_SIGNAL_SET_ROUTE + cmdType:CMD.Signal.CMD_SIGNAL_SET_ROUTE, + isDisabled: (signal, work) => false }, { label: '进路取消', handler: this.cancelTrainRoute, cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_ROUTE, + isDisabled: (signal, work) => false, isShow: (signalDevice, work) => work === 'dispatchWork' }, { label: '信号重开', handler: this.reopenSignal, + isDisabled: (signal, work) => false, cmdType: CMD.Signal.CMD_SIGNAL_REOPEN_SIGNAL }, { label: '进路引导', handler: this.guide, cmdType: CMD.Signal.CMD_SIGNAL_ROUTE_GUIDE, + isDisabled: (signal, work) => false, isShow: (signalDevice, work) => work === 'localWork' }, { label: '进路交人工控', handler: this.humanControl, - cmdType: CMD.Signal.CMD_SIGNAL_CLOSE_AUTO_SETTING + cmdType: CMD.Signal.CMD_SIGNAL_CLOSE_AUTO_SETTING, + isDisabled: (signal, work) => false }, { label: '进路交自动控', handler: this.atsAutoControl, - cmdType: CMD.Signal.CMD_SIGNAL_OPEN_AUTO_SETTING + cmdType: CMD.Signal.CMD_SIGNAL_OPEN_AUTO_SETTING, + isDisabled: (signal, work) => false }, { label: '设置联锁自动进路', @@ -126,7 +132,8 @@ export default { { label: '查询进路状态', handler: this.detail, - cmdType: CMD.Signal.CMD_SIGNAL_DETAIL + cmdType: CMD.Signal.CMD_SIGNAL_DETAIL, + isDisabled: (signal, work) => false } // Local: [ // // { diff --git a/src/jmapNew/theme/foshan_01/menus/menuStation.vue b/src/jmapNew/theme/foshan_01/menus/menuStation.vue index f188d2cc4..e87e9a346 100644 --- a/src/jmapNew/theme/foshan_01/menus/menuStation.vue +++ b/src/jmapNew/theme/foshan_01/menus/menuStation.vue @@ -56,6 +56,7 @@ export default { { label: '上电解锁', handler: this.powerUnLock, + isDisabled: (signal, work) => false, isShow: (signalDevice, work) => work === 'localWork' } ], diff --git a/src/jmapNew/theme/foshan_01/menus/menuSwitch.vue b/src/jmapNew/theme/foshan_01/menus/menuSwitch.vue index 6dae05d0b..5c0699720 100644 --- a/src/jmapNew/theme/foshan_01/menus/menuSwitch.vue +++ b/src/jmapNew/theme/foshan_01/menus/menuSwitch.vue @@ -118,24 +118,28 @@ export default { label: '区段激活', handler: this.active, cmdType: CMD.Switch.CMD_SWITCH_ACTIVE, + isDisabled: (signal, work) => false, isShow: (switchDevice, work) => work === 'localWork' }, { label: '区段切除', handler: this.split, cmdType: CMD.Switch.CMD_SWITCH_CUT_OFF, + isDisabled: (signal, work) => false, isShow: (switchDevice, work) => work === 'localWork' }, { label: '设置临时限速', handler: this.setSpeed, cmdType: CMD.Switch.CMD_SWITCH_SET_LIMIT_SPEED, + isDisabled: (signal, work) => false, isShow: (switchDevice, work) => work === 'localWork' }, { label: '全线取消限速', handler: this.cancelSpeed, cmdType:CMD.LimitControl.CMD_CANCEL_ALL_LIMIT_SPEED, + isDisabled: (signal, work) => false, isShow: (switchDevice, work) => work === 'localWork' } ], diff --git a/src/jmapNew/theme/foshan_01/menus/menuTrain.vue b/src/jmapNew/theme/foshan_01/menus/menuTrain.vue index f19dac29e..5bb9cba52 100644 --- a/src/jmapNew/theme/foshan_01/menus/menuTrain.vue +++ b/src/jmapNew/theme/foshan_01/menus/menuTrain.vue @@ -37,7 +37,6 @@ import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler'; import { DeviceMenu, OperateMode } from '@/scripts/ConstDic'; import CMD from '@/scripts/cmdPlugin/CommandEnum'; import { menuOperate, commitOperate } from '@/jmapNew/theme/components/utils/menuOperate'; -import {judgeStationControl} from '../../components/utils/menuJudge'; export default { name: 'MenuTrain', @@ -227,7 +226,7 @@ export default { // 编辑模式菜单列表 this.menu = []; this.menuNormal.forEach(menuItem => { - menuItem.disabled = !judgeStationControl(this.selected.belongStationCode, this.selected.stationCode, this.work) || menuItem.isDisabled(this.selected, this.work); + menuItem.disabled = menuItem.isDisabled ? menuItem.isDisabled(this.selected) : false; menuItem.show = menuItem.isShow(this.selected, this.work); this.menu.push(menuItem); });