车辆段关联集中站特殊处理

This commit is contained in:
joylink_zhaoerwei 2023-12-07 14:52:34 +08:00
parent f9fc9f058e
commit 39235cbc6d
2 changed files with 82 additions and 62 deletions

View File

@ -108,7 +108,7 @@ onMounted(() => {
.queryStore.queryByType<Station>(Station.Type);
centralizedStations.value = [];
stations.forEach((station) => {
if (station.datas.concentrationStations) {
if (station.datas.concentrationStations || station.datas.depots) {
centralizedStations.value.push({
label: station.datas.stationName,
value: station.datas.id,

View File

@ -648,67 +648,6 @@ function oneClickRelateCentralizedStation() {
const concentrationDividingLines = drawApp.queryStore
.queryByType<ConcentrationDividingLine>(ConcentrationDividingLine.Type)
.sort((a, b) => a.datas.points[0].x - b.datas.points[0].x);
//
const leftBoundary = concentrationDividingLines[0];
if (leftBoundary.datas.refLeftStationId) {
let containDeviceIds: string[] = [];
const leftSections: {
section: Section;
port: graphicData.RelatedRef.DevicePort;
}[] = [];
leftBoundary.datas.nodeConWithSecs.forEach((node) => {
if (node.leftSection.id !== '') {
leftSections.push({
section: drawApp.queryStore.queryById(node.leftSection.id),
port: node.leftSection.devicePort,
});
}
});
containDeviceIds = [...leftSections.map((g) => g.section.id)];
leftSections.forEach((leftSection) => {
findContainDevice(
leftSection.section,
leftSection.port,
containDeviceIds,
drawApp
);
containDeviceIds = Array.from(new Set(containDeviceIds));
});
handleContainDevices(containDeviceIds, [
leftBoundary.datas.refLeftStationId,
]);
}
//
const rightBoundary =
concentrationDividingLines[concentrationDividingLines.length - 1];
if (rightBoundary.datas.refRightStationId) {
let containDeviceIds: string[] = [];
const rightSections: {
section: Section;
port: graphicData.RelatedRef.DevicePort;
}[] = [];
rightBoundary.datas.nodeConWithSecs.forEach((node) => {
if (node.rightSection.id !== '') {
rightSections.push({
section: drawApp.queryStore.queryById(node.rightSection.id),
port: node.rightSection.devicePort,
});
}
});
containDeviceIds = [...rightSections.map((g) => g.section.id)];
rightSections.forEach((rightSections) => {
findContainDevice(
rightSections.section,
rightSections.port,
containDeviceIds,
drawApp
);
containDeviceIds = Array.from(new Set(containDeviceIds));
});
handleContainDevices(containDeviceIds, [
rightBoundary.datas.refRightStationId,
]);
}
for (let i = 0; i < concentrationDividingLines.length - 1; i++) {
let containDeviceIds: string[] = [];
//
@ -755,6 +694,27 @@ function oneClickRelateCentralizedStation() {
handleContainDevices(containDeviceIds, [rightDatas.refRightStationId]);
}
}
//
const leftBoundary = concentrationDividingLines[0];
handleLeftBoundary(leftBoundary);
const rightBoundary =
concentrationDividingLines[concentrationDividingLines.length - 1];
handleRightBoundary(rightBoundary);
concentrationDividingLines.forEach((concentrationDividingLine) => {
const datas = concentrationDividingLine.datas;
if (
datas.refLeftStationId &&
drawApp.queryStore.queryById<Station>(datas.refLeftStationId).datas.depots
) {
handleLeftBoundary(concentrationDividingLine);
} else if (
datas.refRightStationId &&
drawApp.queryStore.queryById<Station>(datas.refRightStationId).datas
.depots
) {
handleRightBoundary(concentrationDividingLine);
}
});
//
const axleCountings = drawApp.queryStore
.queryByType<AxleCounting>(AxleCounting.Type)
@ -856,6 +816,66 @@ function oneClickRelateCentralizedStation() {
centralizedStations
);
}
function handleLeftBoundary(leftBoundary: ConcentrationDividingLine) {
if (leftBoundary.datas.refLeftStationId) {
let containDeviceIds: string[] = [];
const leftSections: {
section: Section;
port: graphicData.RelatedRef.DevicePort;
}[] = [];
leftBoundary.datas.nodeConWithSecs.forEach((node) => {
if (node.leftSection.id !== '') {
leftSections.push({
section: drawApp.queryStore.queryById(node.leftSection.id),
port: node.leftSection.devicePort,
});
}
});
containDeviceIds = [...leftSections.map((g) => g.section.id)];
leftSections.forEach((leftSection) => {
findContainDevice(
leftSection.section,
leftSection.port,
containDeviceIds,
drawApp
);
containDeviceIds = Array.from(new Set(containDeviceIds));
});
handleContainDevices(containDeviceIds, [
leftBoundary.datas.refLeftStationId,
]);
}
}
function handleRightBoundary(rightBoundary: ConcentrationDividingLine) {
if (rightBoundary.datas.refRightStationId) {
let containDeviceIds: string[] = [];
const rightSections: {
section: Section;
port: graphicData.RelatedRef.DevicePort;
}[] = [];
rightBoundary.datas.nodeConWithSecs.forEach((node) => {
if (node.rightSection.id !== '') {
rightSections.push({
section: drawApp.queryStore.queryById(node.rightSection.id),
port: node.rightSection.devicePort,
});
}
});
containDeviceIds = [...rightSections.map((g) => g.section.id)];
rightSections.forEach((rightSections) => {
findContainDevice(
rightSections.section,
rightSections.port,
containDeviceIds,
drawApp
);
containDeviceIds = Array.from(new Set(containDeviceIds));
});
handleContainDevices(containDeviceIds, [
rightBoundary.datas.refRightStationId,
]);
}
}
}
function oneClickGeneratePlatformType() {