bugfix - 信号机站控操作

This commit is contained in:
Yuan 2023-11-22 17:14:57 +08:00
parent c6c3a3a377
commit 05788794cd

View File

@ -14,23 +14,21 @@ export function judgeStationControl(
const centralStation = store.getters["map/getDeviceByCode"](
centralStationCode
);
const isCenterMode = centralStation.controlMode === "Center";
const isLocalMode =
centralStation.controlMode === "Local" ||
centralStation.controlMode === "Emergency";
// 角色车站是 设备所属车站或所属集中站
if (work === "localWork") {
const flag1 =
centralStation.controlMode === "Center" &&
isAvailableInOtherControlMode;
const flag2 =
const isBelongingStation =
store.state.training.roleDeviceCode === stationCode ||
store.state.training.roleDeviceCode === centralStationCode;
return flag1 && flag2;
} else if (work === "dispatchWork") {
const flag1 =
centralStation.controlMode === "Local" ||
centralStation.controlMode === "Emergency";
return (
centralStation.controlMode === "Center" ||
(flag1 && isAvailableInOtherControlMode)
((isCenterMode && isAvailableInOtherControlMode) || isLocalMode) &&
isBelongingStation
);
} else if (work === "dispatchWork") {
return isCenterMode || (isLocalMode && isAvailableInOtherControlMode);
} else {
return true;
}