diff --git a/src/jmapNew/shape/graph/ZcControl/EMouse.js b/src/jmapNew/shape/graph/ZcControl/EMouse.js index ae8bbdb5c..a86bb22b1 100644 --- a/src/jmapNew/shape/graph/ZcControl/EMouse.js +++ b/src/jmapNew/shape/graph/ZcControl/EMouse.js @@ -48,7 +48,8 @@ export default class EMouse extends Group { e.target._subType == 'Text') { this.text.hide(); } else { - this.device.control.setControlColor(this.device.style.ZcControl.lamp.controlColor); + // this.device.control.setControlColor(this.device.style.ZcControl.lamp.controlColor); + this.device.setState(this.device.model) this.device.control.setTextColor('#FFFFFF'); this.device.control.setTextBorder(false); this.device.control.setArcBorder(false); diff --git a/src/jmapNew/shape/graph/ZcControl/index.js b/src/jmapNew/shape/graph/ZcControl/index.js index 4f4f0fb80..cac7fbb16 100644 --- a/src/jmapNew/shape/graph/ZcControl/index.js +++ b/src/jmapNew/shape/graph/ZcControl/index.js @@ -73,7 +73,6 @@ export default class ZcControl extends Group { // 设置状态 setState(model) { this.recover(); - // 只响应前端自定义类型的状态变化 if (model._free) { this.setAshShow(); diff --git a/src/jmapNew/theme/components/utils/menuJudge.js b/src/jmapNew/theme/components/utils/menuJudge.js index 1147fbb12..23ca52bb2 100644 --- a/src/jmapNew/theme/components/utils/menuJudge.js +++ b/src/jmapNew/theme/components/utils/menuJudge.js @@ -1,20 +1,35 @@ -import store from '@/store/index'; +import store from "@/store/index"; /** * 判断菜单行值控制全 * @param {String} stationCode 所属车站code * @param {String} centralStationCode 所属集中站code * @param {String} work 当前客户端 * */ -export function judgeStationControl(stationCode, centralStationCode, work) { - const centralStation = store.getters['map/getDeviceByCode'](centralStationCode); - // 角色车站是 设备所属车站或所属集中站 - if (work === 'localWork') { - const flag1 = store.state.training.roleDeviceCode === stationCode || store.state.training.roleDeviceCode === centralStationCode; - const flag2 = centralStation.controlMode === 'Local' || centralStation.controlMode === 'Emergency'; - return flag1 && flag2; - } else if ( work === 'dispatchWork' ) { - return centralStation.controlMode === 'Center'; - } else { - return true; - } +export function judgeStationControl( + stationCode, + centralStationCode, + work, + isAvailableInOtherControlMode +) { + const centralStation = store.getters["map/getDeviceByCode"]( + centralStationCode + ); + const isCenterMode = centralStation.controlMode === "Center"; + const isLocalMode = + centralStation.controlMode === "Local" || + centralStation.controlMode === "Emergency"; + // 角色车站是 设备所属车站或所属集中站 + if (work === "localWork") { + const isBelongingStation = + store.state.training.roleDeviceCode === stationCode || + store.state.training.roleDeviceCode === centralStationCode; + return ( + ((isCenterMode && isAvailableInOtherControlMode) || isLocalMode) && + isBelongingStation + ); + } else if (work === "dispatchWork") { + return isCenterMode || (isLocalMode && isAvailableInOtherControlMode); + } else { + return true; + } } diff --git a/src/jmapNew/theme/race_01/menus/menuSignal.vue b/src/jmapNew/theme/race_01/menus/menuSignal.vue index 960351990..a5b288d37 100644 --- a/src/jmapNew/theme/race_01/menus/menuSignal.vue +++ b/src/jmapNew/theme/race_01/menus/menuSignal.vue @@ -64,14 +64,16 @@ export default { handler: this.arrangementRoute, cmdType: CMD.Signal.CMD_SIGNAL_SET_ROUTE, isDisabled: (signal, work) => false, - isShow: (signal, work) => true + isShow: (signal, work) => true, + isAvailableInOtherControlMode: true }, { label: '取消进路', handler: this.cancelTrainRoute, cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_ROUTE, isDisabled: (signal, work) => false, - isShow: (signal, work) => true + isShow: (signal, work) => true, + isAvailableInOtherControlMode: true }, { label: '信号重开', @@ -127,14 +129,16 @@ export default { handler: this.humanControl, cmdType: CMD.Signal.CMD_SIGNAL_CLOSE_AUTO_SETTING, isDisabled: (signal, work) => false, - isShow: (signal, work) => true + isShow: (signal, work) => true, + isAvailableInOtherControlMode: true }, { label: '进路自排开', handler: this.atsAutoControl, cmdType: CMD.Signal.CMD_SIGNAL_OPEN_AUTO_SETTING, isDisabled: (signal, work) => false, - isShow: (signal, work) => true + isShow: (signal, work) => true, + isAvailableInOtherControlMode: true }, { label: '设置通过模式', @@ -206,7 +210,7 @@ export default { initMenu() { 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 = !judgeStationControl(this.selected.belongStationCode, this.selected.stationCode, this.work, menuItem.isAvailableInOtherControlMode) || menuItem.isDisabled(this.selected, this.work); menuItem.show = menuItem.isShow(this.selected, this.work); this.menu.push(menuItem); }); diff --git a/src/jmapNew/theme/race_01/menus/menuStationStand.vue b/src/jmapNew/theme/race_01/menus/menuStationStand.vue index c74ac5328..a6127e742 100644 --- a/src/jmapNew/theme/race_01/menus/menuStationStand.vue +++ b/src/jmapNew/theme/race_01/menus/menuStationStand.vue @@ -70,7 +70,7 @@ export default { label: '取消扣车', handler: this.cancelDetainTrain, cmdType:CMD.Stand.CMD_STAND_CANCEL_HOLD_TRAIN, - isDisabled: (stand, work) => stand.stationHoldTrain === 1, + isDisabled: (stand, work) => stand.stationHoldTrain !== 1, isShow: (stand, work) => work === 'localWork' }, { @@ -84,7 +84,7 @@ export default { label: '取消扣车', handler: this.cancelDetainTrain, cmdType:CMD.Stand.CMD_STAND_CANCEL_HOLD_TRAIN, - isDisabled: (stand, work) => stand.centerHoldTrain === 1, + isDisabled: (stand, work) => stand.centerHoldTrain !== 1, isShow: (stand, work) => work === 'dispatchWork' }, {