260715_0
This commit is contained in:
@@ -11,8 +11,9 @@
|
||||
* 텍스트는 ui_template_locale에 선(先) 등록 후 참조 (frontend.md §3).
|
||||
* ========================================================================== */
|
||||
|
||||
import { CURRENT_PROJECT_ID_KEY } from "@config/config_frontend";
|
||||
import { CURRENT_PROJECT_ID_KEY, ROUTES, type RoutePath } from "@config/config_frontend";
|
||||
import { currentLanguageIndex, ui_locales } from "@ui/ui_template_locale";
|
||||
import { navigateTo } from "../A00_Common/router";
|
||||
import {
|
||||
createButton,
|
||||
createTag,
|
||||
@@ -32,7 +33,7 @@ import {
|
||||
type SurfaceModelSummary,
|
||||
type SurfaceStatusResponse,
|
||||
} from "./B04_wf1_Surface_Api_Fetch";
|
||||
import { createWorkflowLayout } from "@ui/ui_template_workflow_layout";
|
||||
import { createWorkflowLayout, type WorkflowStage } from "@ui/ui_template_workflow_layout";
|
||||
import { createSurfacePointCloudViewer } from "./B04_wf1_Surface_UI_Viewer";
|
||||
import { createSurfaceTerrainViewer } from "./B04_wf1_Surface_UI_TerrainViewer";
|
||||
import "./B04_wf1_Surface_UI_Style.css";
|
||||
@@ -91,7 +92,7 @@ function buildInfoLine(label: string, value: unknown): HTMLElement {
|
||||
return row;
|
||||
}
|
||||
|
||||
export function renderB04Surface(root: HTMLElement): void {
|
||||
export async function renderB04Surface(root: HTMLElement): Promise<void> {
|
||||
let selectedInputFile: SurfaceInputFileSummary | null = null;
|
||||
let inputFiles: SurfaceInputFileSummary[] = [];
|
||||
|
||||
@@ -190,12 +191,44 @@ export function renderB04Surface(root: HTMLElement): void {
|
||||
bottom.append(statsSection, modelsSection);
|
||||
workspace.append(topbar, viewer.root, terrainViewer.root, bottom);
|
||||
|
||||
const workflowRoutes = [
|
||||
ROUTES.B03_FILE_INPUT,
|
||||
ROUTES.B04_WF1_SURFACE,
|
||||
ROUTES.B05_WF2_ROUTE,
|
||||
ROUTES.B06_WF3_PROFILE_CROSS,
|
||||
ROUTES.B07_WF4_DESIGN_DETAIL,
|
||||
ROUTES.B08_WF5_QUANTITY,
|
||||
ROUTES.B09_WF6_ESTIMATION,
|
||||
];
|
||||
|
||||
let workflowStages: WorkflowStage[] = [];
|
||||
const layoutProjectId = localStorage.getItem(CURRENT_PROJECT_ID_KEY);
|
||||
if (layoutProjectId) {
|
||||
try {
|
||||
const res = await fetch(`/api/projects/${layoutProjectId}/workflow-state`);
|
||||
if (res.ok) {
|
||||
const data = await res.json();
|
||||
workflowStages = data.workflow_state?.stages ?? data.stages ?? [];
|
||||
}
|
||||
} catch {
|
||||
/* 실패 시 빈 배열 → activeStep 기준 폴백으로 이동 허용 */
|
||||
}
|
||||
}
|
||||
|
||||
const layout = createWorkflowLayout({
|
||||
title: L("B04_Surface_Title"),
|
||||
steps: workflowSteps(),
|
||||
activeStep: 1,
|
||||
leftPanel: panel,
|
||||
mainContent: workspace,
|
||||
stages: workflowStages,
|
||||
routes: workflowRoutes,
|
||||
onStepClick: (_stepIndex, route) => {
|
||||
if (layoutProjectId) {
|
||||
localStorage.setItem(CURRENT_PROJECT_ID_KEY, layoutProjectId);
|
||||
navigateTo(route as RoutePath);
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
function getProjectId(): string | null {
|
||||
|
||||
Reference in New Issue
Block a user