diff --git a/src/jmapNew/theme/foshan_01/menus/menuSignal.vue b/src/jmapNew/theme/foshan_01/menus/menuSignal.vue index e9a79f9c8..b8b315b2b 100644 --- a/src/jmapNew/theme/foshan_01/menus/menuSignal.vue +++ b/src/jmapNew/theme/foshan_01/menus/menuSignal.vue @@ -51,120 +51,107 @@ 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.singalPassModel, - // cmdType: CMD.Signal.CMD_SIGNAL_SET_CI_AUTO - // }, - // { - // label: '取消自动进路', - // 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.setAutoInterlock, - cmdType: CMD.Signal.CMD_SIGNAL_SET_CI_AUTO - }, - { - label: '取消联锁自动进路', - handler: this.cancelAutoInterlock, - cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_CI_AUTO - }, - { - label: '设置联锁自动触发', - handler: this.setAutoTrigger, - cmdType: CMD.Signal.CMD_SIGNAL_SET_CI_AUTO_TRIGGER - }, - { - label: '取消联锁自动触发', - handler: this.cancelAutoTrigger, - cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_CI_AUTO_TRIGGER - }, - { - 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.reopenSignal, - cmdType: CMD.Signal.CMD_SIGNAL_REOPEN_SIGNAL - }, - { - type: 'separator' - }, - { - 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 - } - ] - }, + menuNormal: [ + { + label: '进路选排', + handler: this.arrangementRoute, + cmdType:CMD.Signal.CMD_SIGNAL_SET_ROUTE + }, + { + label: '进路取消', + handler: this.cancelTrainRoute, + cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_ROUTE, + isShow: (signalDevice, work) => work === 'dispatchWork' + }, + { + label: '信号重开', + handler: this.reopenSignal, + cmdType: CMD.Signal.CMD_SIGNAL_REOPEN_SIGNAL + }, + { + label: '进路引导', + handler: this.guide, + cmdType: CMD.Signal.CMD_SIGNAL_ROUTE_GUIDE, + isShow: (signalDevice, work) => work === 'localWork' + }, + { + 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.setAutoInterlock, + cmdType: CMD.Signal.CMD_SIGNAL_SET_CI_AUTO, + isDisabled: signalDevice => signalDevice.fleetMode === 1, + isShow: (signalDevice, work) => work === 'localWork' + }, + { + label: '取消联锁自动进路', + handler: this.cancelAutoInterlock, + cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_CI_AUTO, + isDisabled: signalDevice => signalDevice.fleetMode !== 1, + isShow: (signalDevice, work) => work === 'localWork' + }, + { + label: '设置联锁自动触发', + handler: this.setAutoTrigger, + cmdType: CMD.Signal.CMD_SIGNAL_SET_CI_AUTO_TRIGGER, + isDisabled: signalDevice => signalDevice.ciControl === 1, + isShow: (signalDevice, work) => work === 'localWork' + }, + { + label: '取消联锁自动触发', + handler: this.cancelAutoTrigger, + cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_CI_AUTO_TRIGGER, + isDisabled: signalDevice => signalDevice.ciControl !== 1, + isShow: (signalDevice, work) => work === 'localWork' + }, + { + label: '查询进路状态', + handler: this.detail, + cmdType: CMD.Signal.CMD_SIGNAL_DETAIL + } + // Local: [ + // // { + // // 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.singalPassModel, + // // cmdType: CMD.Signal.CMD_SIGNAL_SET_CI_AUTO + // // }, + // // { + // // label: '取消自动进路', + // // handler: this.singalCancelPassModel, + // // cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_CI_AUTO + // // }, + // ], + ], menuForce: [ { label: '设置故障', @@ -221,7 +208,14 @@ export default { }; }, initMenu() { - // this.menu = MenuContextHandler.covert(this.menuNormal); + + // 编辑模式菜单列表 + this.menu = []; + this.menuNormal.forEach(menuItem => { + 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); + }); // 故障模式菜单列表 if (this.operatemode === OperateMode.FAULT) { this.menu = this.menuForce; diff --git a/src/jmapNew/theme/foshan_01/menus/menuSwitch.vue b/src/jmapNew/theme/foshan_01/menus/menuSwitch.vue index 8c557537e..0cde4859a 100644 --- a/src/jmapNew/theme/foshan_01/menus/menuSwitch.vue +++ b/src/jmapNew/theme/foshan_01/menus/menuSwitch.vue @@ -56,7 +56,6 @@ export default { return { menu: [], menuNormal: [ - { label: '道岔总定', handler: this.locate, @@ -196,9 +195,6 @@ export default { menuItem.show = menuItem.isShow ? menuItem.isShow(this.selected, this.work) : true; this.menu.push(menuItem); }); - if (this.operatemode === OperateMode.ADMIN) { - this.menu = [...this.menu, ...this.menuForce]; - } // 故障模式菜单列表 if (this.operatemode === OperateMode.FAULT) {