站控允许信号机操作

This commit is contained in:
Yuan 2023-11-22 13:21:08 +08:00
parent c2298f9995
commit 9b2db3957e
2 changed files with 37 additions and 17 deletions

View File

@ -1,19 +1,36 @@
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, isMenuAvailableInLocalMode) {
const centralStation = store.getters['map/getDeviceByCode'](centralStationCode);
export function judgeStationControl(
stationCode,
centralStationCode,
work,
isAvailableInOtherControlMode
) {
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';
if (work === "localWork") {
const flag1 =
centralStation.controlMode === "Center" &&
isAvailableInOtherControlMode;
const flag2 =
store.state.training.roleDeviceCode === stationCode ||
store.state.training.roleDeviceCode === centralStationCode;
return flag1 && flag2;
} else if ( work === 'dispatchWork' ) {
return centralStation.controlMode === 'Center' || (centralStation.controlMode === 'Local' && isMenuAvailableInLocalMode);
} else if (work === "dispatchWork") {
const flag1 =
centralStation.controlMode === "Local" ||
centralStation.controlMode === "Emergency";
return (
centralStation.controlMode === "Center" ||
(flag1 && isAvailableInOtherControlMode)
);
} else {
return true;
}

View File

@ -65,14 +65,15 @@ export default {
cmdType: CMD.Signal.CMD_SIGNAL_SET_ROUTE,
isDisabled: (signal, work) => false,
isShow: (signal, work) => true,
isAvailableInLocalMode: 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: '信号重开',
@ -128,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: '设置通过模式',