From 6142c2e90e3a5cef734e1bf89c3dc78150696083 Mon Sep 17 00:00:00 2001 From: fan Date: Thu, 13 Jul 2023 17:16:14 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B5=9B=E6=80=BB=E6=8C=87=E7=A4=BA=E8=B0=83?= =?UTF-8?q?=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../theme/datie_02/menus/localWorkMenuBar.vue | 7 +++-- .../theme/datie_02/menus/menuSection.vue | 23 ++++++++-------- .../theme/datie_02/menus/menuTrain.vue | 26 +++++++++---------- 3 files changed, 29 insertions(+), 27 deletions(-) diff --git a/src/jmapNew/theme/datie_02/menus/localWorkMenuBar.vue b/src/jmapNew/theme/datie_02/menus/localWorkMenuBar.vue index 3e349c741..f052e022f 100644 --- a/src/jmapNew/theme/datie_02/menus/localWorkMenuBar.vue +++ b/src/jmapNew/theme/datie_02/menus/localWorkMenuBar.vue @@ -35,7 +35,7 @@ export default { TrainOperation, SwitchControl, SignalControl, - OperationPlanDetail + OperationPlanDetail }, data() { return { @@ -232,7 +232,10 @@ export default { }); }, trainControlShow() { - this.$refs.trainOperation.doShow(); + const station = this.$store.getters['map/getDeviceByCode'](this.$store.state.training.roleDeviceCode); + if (station && station.controlMode === 'Local') { + this.$refs.trainOperation.doShow(); + } }, back() { if (this.$store.state.training.simulationCreator) { diff --git a/src/jmapNew/theme/datie_02/menus/menuSection.vue b/src/jmapNew/theme/datie_02/menus/menuSection.vue index 0b89097dc..a33f32318 100644 --- a/src/jmapNew/theme/datie_02/menus/menuSection.vue +++ b/src/jmapNew/theme/datie_02/menus/menuSection.vue @@ -55,12 +55,18 @@ export default { return { menu: [], menuNormal: [ + // { + // label: 'Increase the number of trips', + // handler: this.addSpare, + // cmdType: CMD.Section.CMD_TRAIN_LOAD_TRIP_NUMBER_TRAIN, + // isDisabled: (section, station, work) => station.controlMode === 'Interlock' && work === 'ctcWork', + // isShow: (section, work) => ['01', '02', '03'].includes(section.type) + // }, { - label: 'Increase the number of trips', - handler: this.addSpare, - cmdType: CMD.Section.CMD_TRAIN_LOAD_TRIP_NUMBER_TRAIN, - isDisabled: (section, station, work) => station.controlMode === 'Interlock' && work === 'ctcWork', - isShow: (section, work) => ['01', '02', '03'].includes(section.type) + label: 'Add Train', + handler: this.loadSpare, + cmdType: CMD.Section.CMD_TRAIN_LOAD_SPARE_TRAIN, + isDisabled: (section, station, work) => station.controlMode !== 'Local' && work === 'localWork' }, { label: 'Bad split', @@ -87,11 +93,6 @@ export default { label: 'Cancel faults', handler: this.cancelStoppage, cmdType: CMD.Fault.CMD_CANCEL_FAULT - }, - { - label: 'Add Train', - handler: this.loadSpare, - cmdType: CMD.Section.CMD_TRAIN_LOAD_SPARE_TRAIN } ] }; @@ -128,7 +129,7 @@ export default { initMenu() { // 编辑模式菜单列表 this.menu = []; - const station = this.$store.getters['map/getDeviceByCode'](this.$store.state.map.showCentralizedStationCode); + const station = this.$store.getters['map/getDeviceByCode'](this.$store.state.training.roleDeviceCode); this.menuNormal.forEach(menuItem => { menuItem.disabled = menuItem.isDisabled ? menuItem.isDisabled(this.selected, station || {}, this.work) : false; menuItem.show = menuItem.isShow ? menuItem.isShow(this.selected, this.work) : true; diff --git a/src/jmapNew/theme/datie_02/menus/menuTrain.vue b/src/jmapNew/theme/datie_02/menus/menuTrain.vue index 8183f6bf2..63b8b300b 100644 --- a/src/jmapNew/theme/datie_02/menus/menuTrain.vue +++ b/src/jmapNew/theme/datie_02/menus/menuTrain.vue @@ -58,22 +58,12 @@ export default { return { menu: [], menuNormal: [ - { - label: 'Change of train number', - handler: this.modifyTripNumber, - cmdType: CMD.Train.CMD_TRAIN_UPDATE_TRIP_NUMBER_TRAIN - }, { label: 'Remove train number', handler: this.removeTripNumber, cmdType: CMD.Train.CMD_TRAIN_REMOVE_TRAIN_TRACE, - isShow: (train, work) => work === 'localWork' || work === 'ctcWork' - }, - { - label: 'Change end', - handler: this.turnDirection, - cmdType: CMD.Train.CMD_TRAIN_REMOVE_TRAIN_TRACE, - isShow: (train, work) => work === 'localWork' || work === 'ctcWork' + isDisabled: (section, station, work) => station.controlMode !== 'Local' && work === 'localWork', + isShow: (train, work) => work === 'localWork' || work === 'dispatchWork' } ], menuForce: [ @@ -150,7 +140,15 @@ export default { }, '$store.state.menuOperation.selected': function (val) { if (val._type === 'Train' && val._event === MouseEvent.Left && this.project === 'thailandsandbox') { - this.$refs.trainOperation.doShow(val); + if (this.work === 'localWork') { + const station = this.$store.getters['map/getDeviceByCode'](this.$store.state.training.roleDeviceCode); + if (station && station.controlMode === 'Local') { + this.$refs.trainOperation.doShow(val); + } + } else { + this.$refs.trainOperation.doShow(val); + } + } } }, @@ -158,7 +156,7 @@ export default { initMenu() { // 编辑模式菜单列表 this.menu = []; - const station = this.$store.getters['map/getDeviceByCode'](this.$store.state.map.showCentralizedStationCode); + const station = this.$store.getters['map/getDeviceByCode'](this.$store.state.training.roleDeviceCode); this.menuNormal.forEach(menuItem => { menuItem.disabled = menuItem.isDisabled ? menuItem.isDisabled(this.selected, station || {}, this.work) : false; menuItem.show = menuItem.isShow ? menuItem.isShow(this.selected, this.work) : true;