bugfix - 信号机站控操作
This commit is contained in:
parent
c6c3a3a377
commit
05788794cd
@ -14,23 +14,21 @@ export function judgeStationControl(
|
|||||||
const centralStation = store.getters["map/getDeviceByCode"](
|
const centralStation = store.getters["map/getDeviceByCode"](
|
||||||
centralStationCode
|
centralStationCode
|
||||||
);
|
);
|
||||||
|
const isCenterMode = centralStation.controlMode === "Center";
|
||||||
|
const isLocalMode =
|
||||||
|
centralStation.controlMode === "Local" ||
|
||||||
|
centralStation.controlMode === "Emergency";
|
||||||
// 角色车站是 设备所属车站或所属集中站
|
// 角色车站是 设备所属车站或所属集中站
|
||||||
if (work === "localWork") {
|
if (work === "localWork") {
|
||||||
const flag1 =
|
const isBelongingStation =
|
||||||
centralStation.controlMode === "Center" &&
|
|
||||||
isAvailableInOtherControlMode;
|
|
||||||
const flag2 =
|
|
||||||
store.state.training.roleDeviceCode === stationCode ||
|
store.state.training.roleDeviceCode === stationCode ||
|
||||||
store.state.training.roleDeviceCode === centralStationCode;
|
store.state.training.roleDeviceCode === centralStationCode;
|
||||||
return flag1 && flag2;
|
|
||||||
} else if (work === "dispatchWork") {
|
|
||||||
const flag1 =
|
|
||||||
centralStation.controlMode === "Local" ||
|
|
||||||
centralStation.controlMode === "Emergency";
|
|
||||||
return (
|
return (
|
||||||
centralStation.controlMode === "Center" ||
|
((isCenterMode && isAvailableInOtherControlMode) || isLocalMode) &&
|
||||||
(flag1 && isAvailableInOtherControlMode)
|
isBelongingStation
|
||||||
);
|
);
|
||||||
|
} else if (work === "dispatchWork") {
|
||||||
|
return isCenterMode || (isLocalMode && isAvailableInOtherControlMode);
|
||||||
} else {
|
} else {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user