diff --git a/services/pcp-tgu-ops-ui/src/features/tgu-editor/EditorPanels.tsx b/services/pcp-tgu-ops-ui/src/features/tgu-editor/EditorPanels.tsx index 016ff09..6219284 100644 --- a/services/pcp-tgu-ops-ui/src/features/tgu-editor/EditorPanels.tsx +++ b/services/pcp-tgu-ops-ui/src/features/tgu-editor/EditorPanels.tsx @@ -1,5 +1,6 @@ import { formatDate, formatDateTime, formatDuration, formatTime, kindColor, kindLabel } from "./editorPresentation"; import { statusStyle } from "../tgu-planning/tguStatus"; +import { formatUtcDateTime, parseUtc } from "../../utils/utcTime"; import type { RvaZone } from "../../api/ballisticsApi"; import type { SurveyRoute, SurveyRouteAnchor } from "../../api/missionPlanningApi"; import type { Tgu2DMapSelection } from "../tgu-map-2d/model/mapSelectionTypes"; @@ -28,6 +29,8 @@ type WorkInspectorProps = { modes: EditorMode[]; stations: EditorGroundStation[]; conflicts: string[]; + /** Включение существующего плана — показываем только информацию, без правок. */ + readOnly?: boolean; onUpdate: (workId: string, patch: EditorWorkPatch) => void; onDelete: (workId: string) => void; onDuplicate: (workId: string) => void; @@ -96,6 +99,7 @@ export function WorkInspector({ modes, stations, conflicts, + readOnly, onUpdate, onDelete, onDuplicate, @@ -118,26 +122,43 @@ export function WorkInspector({
Время
- onUpdate(work.id, { startMs: value })} /> - onUpdate(work.id, { endMs: value })} /> -
длительность: {formatDuration(work.endMs - work.startMs)}
+ {readOnly ? ( +
+
Начало
+
{formatDateTime(work.startMs)}
+
Конец
+
{formatDateTime(work.endMs)}
+
Длительность
+
{formatDuration(work.endMs - work.startMs)}
+
+ ) : ( + <> + onUpdate(work.id, { startMs: value })} /> + onUpdate(work.id, { endMs: value })} /> +
длительность: {formatDuration(work.endMs - work.startMs)}
+ + )}
{work.kind === "shoot" && (
Режим аппаратуры
-
- {modes.map((mode) => ( - - ))} -
+ {readOnly ? ( +
{modes.find((mode) => mode.id === work.modeId)?.label ?? "—"}
+ ) : ( +
+ {modes.map((mode) => ( + + ))} +
+ )} {work.targetName &&
цель: {work.targetName}
}
)} @@ -145,24 +166,30 @@ export function WorkInspector({ {work.kind === "downlink" && (
Станция приёма
- + {readOnly ? ( +
{stations.find((station) => station.id === work.stationId)?.name ?? work.stationId ?? "—"}
+ ) : ( + + )}
)} -
- - -
+ {!readOnly && ( +
+ + +
+ )}