fix(E04): 2D 최소 = GET …/stab/result2d · 구간 바뀌면 늘 저장본 다시 엶 (533-3)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-25 20:38:06 +09:00
co-authored by Claude Opus 5.5
parent d37efddc46
commit 8b0998883d
+7 -6
View File
@@ -3,7 +3,7 @@
* E04 안정성평가 3D 해석(요구 347-1 · 요구서 4-2 · 4-3 · PLAN 533-3) — B05~B09 틀(group_workflow).
* 좌 = 구간 목록 · 탐색 설정(기본 · 고급 접힘) · [해석] · 진행률 · [끊기]
* 가운데 = 평면 지도(셀별 최소 안전율 · 임계 체적) · [3D 보기](지표 + 노선면 + 임계 활동면)
* 우 = 구간 결과(3D 최소 · 2D 최소(같은 구간) · 3D/2D 비 · 체적 · 방법)
* 우 = 구간 결과(3D 최소 · 2D 최소(같은 구간 E03 측점 fs_min 최소) · 3D/2D 비 · 체적 · 방법)
* 계산 = 서버 단독(POST …/stab/analyze3d · 뒤에서) · 화면은 값 · 그림만. 탐색 설정 = sessionStorage.
* ========================================================================== */
@@ -74,13 +74,13 @@ async function api<T>(path: string, init?: RequestInit): Promise<T> {
return body;
}
/** E03 2D 측점 결과(sub2 · GET …/stab/section) — 없으면 빈 목록 */
/** E03 2D 측점 요약(GET …/stab/result2d · stations[].fs_min · 측점 하나에 깎기 · 쌓기 두 줄) — 없으면 빈 목록 */
async function fetch2d(
projectId: string,
): Promise<{ chainage_m: number; fs_min: number | null }[]> {
try {
const body = await api<{ stations?: Record<string, unknown>[] }>(
`/projects/${projectId}/stab/section`,
`/projects/${projectId}/stab/result2d`,
);
return (body.stations ?? []).map((s) => ({
chainage_m: Number(s.chainage_m),
@@ -233,12 +233,13 @@ export function renderE04Stab3D(root: HTMLElement): void {
const remember = (): void =>
sessionStorage.setItem(cacheKey(projectId), JSON.stringify(settings.read()));
let shownKey = "";
settings.onChange(() => {
remember();
const { start_m, end_m } = settings.read();
map.setRange(start_m, end_m);
paintSections();
if (result && result.key !== sectionKey(start_m, end_m)) void openResult();
if (shownKey !== sectionKey(start_m, end_m)) void openResult();
});
function paintButtons(): void {
@@ -285,13 +286,12 @@ export function renderE04Stab3D(root: HTMLElement): void {
}
function paintResult(): void {
const { start_m, end_m } = settings.read();
if (!result) {
resultBody.replaceChildren(el("p", { className: "e04-empty", text: t("E04_Result_None") }));
return;
}
const s = result.summary;
const f2d = min2d(stations2d, start_m, end_m);
const f2d = min2d(stations2d, s.start_m, s.end_m);
const ratio = ratio3d2d(s.f_min, f2d);
const station = overview?.stations.reduce<StationPoint | null>(
(best, x) =>
@@ -331,6 +331,7 @@ export function renderE04Stab3D(root: HTMLElement): void {
async function openResult(): Promise<void> {
const { start_m, end_m } = settings.read();
const key = sectionKey(start_m, end_m);
shownKey = key;
const saved = overview?.saved.some((s) => s.key === key);
result = saved
? await api<Result3d>(`/projects/${projectId}/stab/result3d?key=${key}`).catch(() => null)