mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-30 11:08:12 +00:00
changes
This commit is contained in:
@@ -68,6 +68,7 @@ import {
|
||||
ScheduleWarningsAlert,
|
||||
} from "@/components/trainScheduling/ScheduleWarningsAlert";
|
||||
import { TrainCompositionDiagram } from "@/components/trainScheduling/TrainCompositionDiagram";
|
||||
import { TrainConsistView } from "@/components/trainScheduling/compositionEditor";
|
||||
import { WagonPlanGrid } from "@/components/trainScheduling/WagonPlanGrid";
|
||||
import { WorkflowRail, WorkflowStep } from "@/components/trainScheduling/WorkflowStep";
|
||||
import { openPdfBlob } from "@/components/warehouses/pdf";
|
||||
@@ -252,12 +253,6 @@ export default function TrainScheduleV2DetailPage() {
|
||||
() => (isExportDisplay ? [...displayWagonPlan].reverse() : displayWagonPlan),
|
||||
[displayWagonPlan, isExportDisplay],
|
||||
);
|
||||
const diagramWagons = useMemo(() => {
|
||||
const source = schedule?.trainSet?.wagons?.length
|
||||
? schedule.trainSet.wagons
|
||||
: displayWagonPlan;
|
||||
return isExportDisplay ? [...source].reverse() : source;
|
||||
}, [schedule?.trainSet?.wagons, displayWagonPlan, isExportDisplay]);
|
||||
|
||||
const runPreview = useCallback(
|
||||
async (options?: { silent?: boolean; advanceStep?: boolean }) => {
|
||||
@@ -774,22 +769,26 @@ export default function TrainScheduleV2DetailPage() {
|
||||
);
|
||||
}
|
||||
|
||||
// finalize
|
||||
// finalize — the train is known here, so draw the full composition the
|
||||
// same way the batch board's composition tab does (interactive consist).
|
||||
return (
|
||||
<Stack gap="md">
|
||||
<TrainCompositionDiagram
|
||||
locomotive={schedule.trainSet?.locomotive}
|
||||
locomotives={locomotives}
|
||||
wagons={diagramWagons}
|
||||
freightType={freightType}
|
||||
trainNumber={schedule.trainNumber ?? schedule.train?.code ?? null}
|
||||
totalLengthMeters={schedule.trainSet?.totalLengthMeters}
|
||||
/>
|
||||
{isExportDisplay && diagramWagons.length ? (
|
||||
<Text size="xs" c="dimmed">
|
||||
Shown rear-first (export direction) — positions keep their original numbers.
|
||||
</Text>
|
||||
) : null}
|
||||
{schedule.trainSet ? (
|
||||
<TrainConsistView
|
||||
scheduleDetail={schedule}
|
||||
scheduleId={scheduleId ?? ""}
|
||||
maxWagons={schedule.maxWagons ?? 53}
|
||||
/>
|
||||
) : (
|
||||
<TrainCompositionDiagram
|
||||
locomotive={null}
|
||||
locomotives={locomotives}
|
||||
wagons={[]}
|
||||
freightType={freightType}
|
||||
trainNumber={schedule.trainNumber ?? schedule.train?.code ?? null}
|
||||
totalLengthMeters={null}
|
||||
/>
|
||||
)}
|
||||
<Paper
|
||||
p="lg"
|
||||
radius="lg"
|
||||
|
||||
Reference in New Issue
Block a user