diff --git a/B07_DesignDetail/B07_DesignDetail_Api_Fetch.ts b/B07_DesignDetail/B07_DesignDetail_Api_Fetch.ts index 2efd5bcc4..03fbc6088 100644 --- a/B07_DesignDetail/B07_DesignDetail_Api_Fetch.ts +++ b/B07_DesignDetail/B07_DesignDetail_Api_Fetch.ts @@ -16,6 +16,7 @@ export interface DesignDrawingItem { | "landuse" | "plan_lidar" | "cross_standard" + | "structure" | "blank"; label: string; chainage_m: number | null; @@ -112,6 +113,7 @@ export interface DesignDrawingResponse { | "landuse" | "plan_lidar" | "cross_standard" + | "structure" | "blank"; label: string; drawing: CadDrawing; diff --git a/B07_DesignDetail/B07_DesignDetail_UI_Panels.ts b/B07_DesignDetail/B07_DesignDetail_UI_Panels.ts index a9eb48d9f..e45c4d2d0 100644 --- a/B07_DesignDetail/B07_DesignDetail_UI_Panels.ts +++ b/B07_DesignDetail/B07_DesignDetail_UI_Panels.ts @@ -37,6 +37,8 @@ export const DRAWING_GROUPS: readonly { // 표준 횡단면도는 횡단도 묶음 맨 위 한 줄(93-5). { label: "횡단도", kind: "cross" }, { label: "토적도(유토곡선)", kind: "mass_haul" }, + // 구조물 도면(376) — B05 · B06 배치에 연결된 구조물 조합마다 한 장(더한장은 장마다) · 늘 묶음. + { label: "구조물 도면", kind: "structure" }, ]; /** 311 기본 접힘 묶음 — 그 밖 묶음(토적도 등)은 기본 펼침. */ @@ -128,8 +130,9 @@ export function buildDrawingSidePanel( ) : drawings.filter((item) => item.id === group.blankId); const cross = group.kind === "cross"; - // 한 장짜리(와 아직 내용이 없는 도면)는 컨테이너 없이 버튼 하나로 둔다 — 횡단도는 늘 묶음. - if (items.length <= 1 && !cross) { + const structure = group.kind === "structure"; + // 한 장짜리(와 아직 내용이 없는 도면)는 컨테이너 없이 버튼 하나로 둔다 — 횡단도 · 구조물 도면은 늘 묶음. + if (items.length <= 1 && !cross && !structure) { const [drawing] = items; // 서버가 빈 도각을 내주지 못한 경우에만 회색 버튼으로 남는다. if (!drawing) { @@ -166,6 +169,12 @@ export function buildDrawingSidePanel( // 횡단면도는 장 단위(여러 측점)라 서버가 준 "N장 (구간)" 라벨을 그대로 쓴다. section.append(drawingButton(drawing, drawing.label)); } + if (structure && items.length === 0) { + const empty = document.createElement("p"); + empty.className = "b07-drawing-list__empty"; + empty.textContent = "B05 · B06 구조물 배치에 연결된 구조물 도면이 없습니다."; + section.append(empty); + } if (cross && crossTools) section.append(crossTools); panel.append(section); } diff --git a/resources/tester/helper_311_panel_folded.cjs b/resources/tester/helper_311_panel_folded.cjs index b7d2d8bbe..2df9bb2fa 100644 --- a/resources/tester/helper_311_panel_folded.cjs +++ b/resources/tester/helper_311_panel_folded.cjs @@ -249,4 +249,15 @@ const again = b07.buildDrawingSidePanel( b07.foldedGroups(host), ); out.b07Redraw = groups(again); +// 376-2 구조물 도면 카드 — 연결 없으면 카드 안 빈 글 · 있으면 단추 = 조합 이름(늘 카드) +const structureCard = (p) => + p.querySelectorAll(".b07-drawing-group").find((s) => s.dataset.kind === "structure"); +out.b07StructureEmpty = structureCard(first).querySelector(".b07-drawing-list__empty")?.textContent; +const one = b07.buildDrawingSidePanel( + [...drawings, { id: "structure_k", kind: "structure", label: "관보호공 조합", confirmed: false }], + () => undefined, +); +out.b07StructureButtons = structureCard(one) + .querySelectorAll(".b07-drawing-button") + .map((b) => [b.dataset.drawingId, b.textContent]); process.stdout.write(JSON.stringify(out)); diff --git a/resources/tester/test_311_panel_folded.py b/resources/tester/test_311_panel_folded.py index 7b4aaf40a..755ed6127 100644 --- a/resources/tester/test_311_panel_folded.py +++ b/resources/tester/test_311_panel_folded.py @@ -64,6 +64,7 @@ def test_B07_첫_그림_접힘(out): "longitudinal": True, "cross": True, "mass_haul": False, + "structure": False, # 376-2 늘 카드 · 기본 펼침 } @@ -73,9 +74,15 @@ def test_B07_다시_세워도_접힘_이어_받음(out): "longitudinal": True, "cross": False, "mass_haul": True, + "structure": False, } +def test_376_2_구조물_도면_카드(out): + assert out["b07StructureEmpty"] == "B05 · B06 구조물 배치에 연결된 구조물 도면이 없습니다." + assert out["b07StructureButtons"] == [["structure_k", "관보호공 조합"]] + + def test_B07_다시_세우기는_옛_목록을_기다리기_전에_읽음(): page = _read("B07_DesignDetail/B07_DesignDetail_UI_Page.ts") body = page[page.index("export async function renderB07DesignDetail(") :]