diff --git a/A00_Common/calc_sheet.css b/A00_Common/calc_sheet.css index 9ddd4e44a..27e4cf53d 100644 --- a/A00_Common/calc_sheet.css +++ b/A00_Common/calc_sheet.css @@ -12,3 +12,8 @@ [data-sheet-part] .ui-calc-row__label { padding-left: var(--spacing-16); } + +p[data-sheet-part] { + margin: 0; + padding-left: var(--spacing-16); +} diff --git a/A00_Common/calc_sheet.ts b/A00_Common/calc_sheet.ts index d5c3bad9a..d3edd2d2e 100644 --- a/A00_Common/calc_sheet.ts +++ b/A00_Common/calc_sheet.ts @@ -29,6 +29,15 @@ export interface SheetLine { 장비?: boolean | null; 기준단위?: string | null; 환산근거?: string; + /** 714-1b 장비 줄 펼침 — 부른 기계경비 로직의 시간당 줄(조종원 · 주연료 · 잡재료비 · 기계손료) */ + 펼침?: SheetUnfold | null; +} +export interface SheetUnfold { + 키: string; + 이름: string; + 단위: string; + 줄: { 비목: string; 이름: string; 글: string; 금액: number | null }[]; + 계: number | null; } export interface SheetGroup { 비목: string; @@ -130,7 +139,8 @@ const TEXT = { 하위: ["하위 로직", "Sub logic"], Basis: ["기준", "Basis"], Short: ["노 {a} · 재 {b} · 경 {c}", "L {a} · M {b} · E {c}"], - Fold: ["누르면 노 · 재 · 경 식 펼침", "Click to expand labor · material · expense"], + Fold: ["누르면 펼침", "Click to expand"], + Per: ["{n} — {v} 원/{u}", "{n} — {v} KRW/{u}"], } as const satisfies Record; const t = (k: keyof typeof TEXT): string => TEXT[k][currentLanguageIndex as 0 | 1] ?? TEXT[k][0]; const bundleName = (b: string): string => (b in TEXT ? t(b as keyof typeof TEXT) : b); @@ -177,7 +187,23 @@ function mergedRows(m: SheetMerged): HTMLElement[] { .replace("{b}", won(share("재료비"), 1)) .replace("{c}", won(share("경비"), 1)); const head = createCalcFormulaRow(`▸ ${m.이름}`, createCalcFormula(short), out(m.금액, false, 1)); - const parts = m.몫.map((x) => lineRow(x.줄, `${x.비목}`)); + // 펼침 = 부른 기계경비 로직 시간당 줄(손료 · 주연료 · 잡품 · 운전사 · 714-1b) → 이 줄 노 · 재 · 경 몫 식 + const unfold = m.몫.find((x) => x.줄.펼침)?.줄.펼침; + const parts = [ + ...(unfold + ? [ + createText( + t("Per") + .replace("{n}", unfold.이름) + .replace("{v}", won(unfold.계, 1)) + .replace("{u}", unfold.단위 || "-"), + "hint", + ), + ...unfold.줄.map((x) => lineRow(x, `${x.이름} (${x.비목})`)), + ] + : []), + ...m.몫.map((x) => lineRow(x.줄, `${x.비목}`)), + ]; for (const p of parts) { p.hidden = true; p.dataset.sheetPart = m.이름; diff --git a/resources/tester/test_714_2_calc_sheet.py b/resources/tester/test_714_2_calc_sheet.py index 5b2c4418e..831c72cd8 100644 --- a/resources/tester/test_714_2_calc_sheet.py +++ b/resources/tester/test_714_2_calc_sheet.py @@ -31,6 +31,8 @@ def test_부품_상자만(): s = _text(SHEET) assert "