From 7c6735613ee0db3b4f2aed0b84718cd053175fe0 Mon Sep 17 00:00:00 2001 From: umsangdon Date: Sun, 11 Oct 2026 21:45:06 +0900 Subject: [PATCH] =?UTF-8?q?feat(b08,b09):=20=EB=8B=A8=EA=B0=80=EC=97=B0?= =?UTF-8?q?=EA=B2=B0=20=E2=80=94=20=EC=97=B0=EA=B2=B0=20=EC=97=86=EC=9D=8C?= =?UTF-8?q?=20=3D=20=EC=A1=B0=ED=9A=8C=20=E2=86=92=20=EC=98=B5=EC=85=98=20?= =?UTF-8?q?=EB=AA=A8=EB=8B=AC(=EC=98=9B=20=EA=B8=B8)=20=C2=B7=20=EC=97=B0?= =?UTF-8?q?=EA=B2=B0=20=EC=9E=88=EC=9D=8C=20=3D=20=EC=9E=91=EC=9D=80=20?= =?UTF-8?q?=EC=9A=B4=EB=B0=98=20=EB=8B=A8=EA=B0=80=20=EB=AA=A8=EB=8B=AC=20?= =?UTF-8?q?(276)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - B08 거리이정표 우클릭 [단가연결] · B09 운반공 줄 — 연결 없으면 단가연결 목록 → 옵션 값 창(askInputs) - 연결 있으면 「운반 단가」 모달 · 그 밖 B09 줄 그대로 - 운반 단가 모달 크기 96vw × 94vh → min(1100px, 94vw) × min(680px, 86vh) · 가운데 · 두 칸 따로 스크롤 - 옛 결정(연결 · 미연결 같은 모달)을 고정한 시험 두 줄 고침 · test_276_1 추가 Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01KjUPRxjDxULvh5VA7kX5py --- B08_Quantity/B08_Quantity_UI_Milestone.ts | 19 ++++++---- .../B09_Estimation_UI_Haul_Modal.ts | 12 ++++-- .../B09_Estimation_UI_Tabs_Bill_Link.ts | 5 ++- resources/tester/test_253_3_haul_preview.py | 2 +- resources/tester/test_263_1_haul_modal.py | 2 +- resources/tester/test_276_1_haul_link_flow.py | 38 +++++++++++++++++++ 6 files changed, 63 insertions(+), 15 deletions(-) create mode 100644 resources/tester/test_276_1_haul_link_flow.py diff --git a/B08_Quantity/B08_Quantity_UI_Milestone.ts b/B08_Quantity/B08_Quantity_UI_Milestone.ts index 2d524c63f..817f0bd4c 100644 --- a/B08_Quantity/B08_Quantity_UI_Milestone.ts +++ b/B08_Quantity/B08_Quantity_UI_Milestone.ts @@ -10,8 +10,8 @@ * 위쪽 다이어그램 = `…_UI_Milestone_Diagram`(상자 누름 = 모달 · [+] = 항목 추가 모달 · 팬 · 줌) * 경로 탭 = `…_UI_Milestone_Route`(길찾기 지도 그림만) · 데이터 · [저장] = `…_UI_Milestone_State` * 단가연결(251-4) = 항목 칸 앞 램프(초록 = 연결 · 노랑 = 없음 · 호버 = 무엇) · 줄 우클릭 [단가연결] · - * [단가연결 풀기] — 창 = 「운반 단가」 모달(253-3 · B09 운반공 줄과 같음 · 그 행 거리) · 경로 `ref` · - * B09 운반공 줄이 받음 + * [단가연결 풀기] — 창 = 연결 없음 → 단가연결 목록 → 옵션 값 창(276 · 옛 길) · 연결 있음 → + * 「운반 단가」 모달(253-3 · B09 운반공 줄과 같음 · 그 행 거리) · 경로 `ref` · B09 운반공 줄이 받음 * ========================================================================== */ import "./B08_Quantity_UI_Milestone.css"; @@ -20,6 +20,7 @@ import { createButton, el, showToast } from "@ui/ui_template_elements"; import { attachHoverInfo } from "@ui/ui_template_hover_info"; import type { Row } from "../B09_Estimation/B09_Estimation_Calc_Base"; import { openHaulModal } from "../B09_Estimation/B09_Estimation_UI_Haul_Modal"; +import { openPriceLink } from "../B09_Estimation/B09_Estimation_UI_Tabs_Bill_Link"; import { computeMilestone, type MilestoneRoute } from "./B08_Quantity_Milestone_Calc"; import { createDiagram } from "./B08_Quantity_UI_Milestone_Diagram"; import { @@ -157,12 +158,14 @@ function tableView(projectId: string): MilestoneView { [ "단가연결", () => - openHaulModal({ - ref: (route.ref as Row | null) ?? null, - dist: at && { L1: at.L1, L2: at.L2 }, - name: route.rows[at?.index ?? 0]?.item || route.name || "운반", - apply: link, - }), + route.ref + ? openHaulModal({ + ref: route.ref as Row, + dist: at && { L1: at.L1, L2: at.L2 }, + name: route.rows[at?.index ?? 0]?.item || route.name || "운반", + apply: link, + }) + : void openPriceLink({ apply: link }), ], ...(route.ref ? [["단가연결 풀기", () => link(null)] as [string, () => void]] : []), ]); diff --git a/B09_Estimation/B09_Estimation_UI_Haul_Modal.ts b/B09_Estimation/B09_Estimation_UI_Haul_Modal.ts index 41956e4e1..a1f6f97bb 100644 --- a/B09_Estimation/B09_Estimation_UI_Haul_Modal.ts +++ b/B09_Estimation/B09_Estimation_UI_Haul_Modal.ts @@ -9,8 +9,9 @@ * 거리 칸(운반거리 · Cm · 사이클시간 · t2) = 거리에서 채움(「거리에서」) · 손으로 고치면 덮음(`own`) · * 빈칸으로 지우면 다시 거리에서. 옛 사이클 손 값(`cycle`) = 칸 없음 · [적용]하면 지움(기본값). * 조합 [적용] = 거리 · 손 값 사본(서버 · 같은 값 = 같은 사본) · 연결 {tab dg, key, lib, given, own}. - * 연결 없는 줄도 같은 모달(빈칸 → [고르기]) · [적용] = 부르는 쪽 `apply`(캐시 → [저장] 때 서버 정본). - * 여는 곳 = B08 거리이정표 표 우클릭 · B09 설계내역서 운반공 줄 단가연결. + * [적용] = 부르는 쪽 `apply`(캐시 → [저장] 때 서버 정본) · 크기 = 큰 창보다 작게(276). + * 여는 곳 = B08 거리이정표 표 우클릭 · B09 설계내역서 운반공 줄 단가연결 — 연결 있는 줄만(276 · + * 연결 없음 = 단가연결 목록 → 옵션 값 창 옛 길). * ========================================================================== */ import { API_BASE_URL, CURRENT_PROJECT_ID_KEY } from "@config/config_frontend"; @@ -134,6 +135,11 @@ export function openHaulModal(o: HaulModalOpts): void { wide: true, dialogClass: "b09-haul-modal", mount: (body, close, head) => { + // 크기(276) — 공용 큰 창(96vw × 94vh)보다 작게 · 가운데 · 몸 안 두 칸이 따로 스크롤 + body.parentElement?.setAttribute( + "style", + "--modal-max:min(680px,86vh);width:min(1100px,94vw);height:var(--modal-max)", + ); const title = el("strong"); const linkBox = el("div", { attrs: { style: "display:flex;gap:8px;align-items:center;margin-bottom:8px" }, @@ -388,7 +394,7 @@ export function openHaulModal(o: HaulModalOpts): void { el("div", { attrs: { style: - "display:grid;grid-template-columns:minmax(320px,1fr) minmax(360px,1.4fr);gap:16px;min-height:60vh", + "display:grid;grid-template-columns:minmax(300px,1fr) minmax(340px,1.4fr);gap:16px;flex:1;min-height:0", }, children: [left, right], }), diff --git a/B09_Estimation/B09_Estimation_UI_Tabs_Bill_Link.ts b/B09_Estimation/B09_Estimation_UI_Tabs_Bill_Link.ts index 050b30ed8..bdc49755d 100644 --- a/B09_Estimation/B09_Estimation_UI_Tabs_Bill_Link.ts +++ b/B09_Estimation/B09_Estimation_UI_Tabs_Bill_Link.ts @@ -144,7 +144,8 @@ export async function importLib( } /** 항목 줄 단가연결 메뉴(251-6) — [단가연결 모달, 그 밖(로직 입력값 · 단가연결 풀기)] · ref = 지금 연결 · - * haul = 운반공 줄(253-3 · 그 행 거리 · 이름) → 「운반 단가」 모달([변경] = 같은 목록 · 263-1) */ + * haul = 운반공 줄(253-3 · 그 행 거리 · 이름) → 연결 있음 = 「운반 단가」 모달([변경] = 같은 목록 · 263-1) · + * 연결 없음 = 옛 길(목록 → 옵션 값 창 · 276) */ export function linkItems( ctx: TabContext, ref: Row | null, @@ -163,7 +164,7 @@ export function linkItems( if (ref?.tab === "logic" && !haul) more.push(["로직 입력값 고치기", () => askInputs(apply, ref.code, ref.name || "", ref)]); if (ref) more.push(["단가연결 풀기", () => apply(null)]); - return [[["단가연결", haul ? haulModal : priceLink]], more]; + return [[["단가연결", haul && ref ? haulModal : priceLink]], more]; } /** 단가연결 모달(251 · 159 · 160) — 한 목록에 단가산출 로직 · 일위대가 사전조합 · 구조물 조합(마스터 · 회사 · diff --git a/resources/tester/test_253_3_haul_preview.py b/resources/tester/test_253_3_haul_preview.py index aa8febe95..424dece0d 100644 --- a/resources/tester/test_253_3_haul_preview.py +++ b/resources/tester/test_253_3_haul_preview.py @@ -54,7 +54,7 @@ def test_모달_여는_곳(): milestone = _src("B08_Quantity/B08_Quantity_UI_Milestone.ts") assert "openHaulModal({" in milestone and "L1: paved" in milestone link = _src("B09_Estimation/B09_Estimation_UI_Tabs_Bill_Link.ts") - assert '[["단가연결", haul ? haulModal : priceLink]]' in link + assert '[["단가연결", haul && ref ? haulModal : priceLink]]' in link # 276 연결 있는 줄만 edit = _src("B09_Estimation/B09_Estimation_UI_Tabs_Bill_Edit.ts") assert ( 'key.startsWith("haul:")' in edit diff --git a/resources/tester/test_263_1_haul_modal.py b/resources/tester/test_263_1_haul_modal.py index dfdc2ad01..e3fb6c099 100644 --- a/resources/tester/test_263_1_haul_modal.py +++ b/resources/tester/test_263_1_haul_modal.py @@ -41,7 +41,7 @@ def test_변경_한_목록(): link = _src("B09_Estimation/B09_Estimation_UI_Tabs_Bill_Link.ts") assert "o.onPick ??" in link and "openHaulModal({ ...link, ref" in link milestone = _src("B08_Quantity/B08_Quantity_UI_Milestone.ts") - assert "other:" not in milestone and "openPriceLink" not in milestone + assert "other:" not in milestone # 276 = 연결 없음은 옛 길(openPriceLink) — test_276_1 def test_거리_칸_자동_손_값_이김(): diff --git a/resources/tester/test_276_1_haul_link_flow.py b/resources/tester/test_276_1_haul_link_flow.py new file mode 100644 index 000000000..0a0353374 --- /dev/null +++ b/resources/tester/test_276_1_haul_link_flow.py @@ -0,0 +1,38 @@ +"""276 단가연결 — 연결 없음 = 옛 길(단가연결 목록 → 옵션 값 창) · 연결 있음 = 「운반 단가」 모달(작게) · +B08 거리이정표 · B09 운반공 줄 같음 · 옛 길 연결(own 없음 · 빈칸)도 서버가 그 행 거리로 채움.""" + +import re +import sys +from pathlib import Path + +ROOT = Path(__file__).resolve().parents[2] +sys.path.insert(0, str(ROOT)) + +from B08_Quantity.B08_Quantity_Haul_Cycle import fill_given # noqa: E402 +from B09_Estimation.B09_Estimation_Sangeun import _input_names # noqa: E402 + + +def _src(name: str) -> str: + return re.sub(r"\s+", " ", (ROOT / name).read_text(encoding="utf-8")) + + +def test_연결_있으면_운반_모달_없으면_옛_길(): + milestone = _src("B08_Quantity/B08_Quantity_UI_Milestone.ts") + assert "() => route.ref ? openHaulModal({ ref: route.ref as Row," in milestone + assert ": void openPriceLink({ apply: link })," in milestone + link = _src("B09_Estimation/B09_Estimation_UI_Tabs_Bill_Link.ts") + assert '[["단가연결", haul && ref ? haulModal : priceLink]]' in link + # 옛 길 = 목록에서 로직 고르면 옵션 값 창(askInputs) + assert 'if (p.kind === "logic") askInputs(o.apply, p.code, p.name);' in link + + +def test_운반_모달_작게(): + modal = _src("B09_Estimation/B09_Estimation_UI_Haul_Modal.ts") + assert '"--modal-max:min(680px,86vh);width:min(1100px,94vw);height:var(--modal-max)"' in modal + assert "min-height:60vh" not in modal and "flex:1;min-height:0" in modal + + +def test_옛_길_연결도_거리로_채움(): + ref = {"tab": "logic", "code": "GF000284", "given": {}} # askInputs 꼴 — own 없음 · 빈칸 + got = fill_given(ref, _input_names("GF000284"), {"L1": 23.8, "L2": 10.5}) + assert got["운반거리"] == 34.3