diff --git a/B08_Quantity/B08_Quantity_UI_Page.ts b/B08_Quantity/B08_Quantity_UI_Page.ts index ece0199e..4d07414f 100644 --- a/B08_Quantity/B08_Quantity_UI_Page.ts +++ b/B08_Quantity/B08_Quantity_UI_Page.ts @@ -78,12 +78,21 @@ function field(label: string, value: string): HTMLElement { return row; } +/** 반영률 키 → 사람이 읽는 이름. 서버 키를 그대로 보이면 설계자가 못 읽는다. */ +const RATIO_LABEL_KEYS: Record = { + fill_slope_compaction: "B08_Quantity_Ratio_FillCompaction", + seed_spray_fill: "B08_Quantity_Ratio_SeedFill", + seed_spray_cut: "B08_Quantity_Ratio_SeedCut", + obstacle_removal: "B08_Quantity_Ratio_TreeRemoval", +}; + +function ratioLabel(key: string): string { + const localeKey = RATIO_LABEL_KEYS[key]; + return localeKey ? L(localeKey) : key; +} + /** 반영률·비율 입력 한 칸. 값은 **캐시에만** 쌓이고 [저장]에서 정본으로 간다(5장). */ -function numberField( - label: string, - value: number, - onInput: (value: number) => void, -): HTMLElement { +function numberField(label: string, value: number, onInput: (value: number) => void): HTMLElement { const row = document.createElement("label"); row.className = "b08-quantity__field"; const name = document.createElement("span"); @@ -149,7 +158,7 @@ function buildQuantitySidePanel( panel.append(field(L("B08_Quantity_Side_Ratios"), "")); for (const key of Object.keys(ratios)) { panel.append( - numberField(key, draft.application_ratios_pct[key] ?? 100, (value) => { + numberField(ratioLabel(key), draft.application_ratios_pct[key] ?? 100, (value) => { draft.application_ratios_pct[key] = value; draft.dirty = true; }), @@ -203,7 +212,10 @@ function buildQuantitySidePanel( const actions = document.createElement("div"); actions.className = "b08-quantity__actions ui-sidebar-actions"; - actions.append(confirmButton); + // [초기화]는 이번에 달지 않는다 — 5장의 [초기화]는 초기값(`initial_snapshot/`)을 작업본에 + // 덮어쓰는 것인데 설정에는 대응하는 초기값이 아직 없다. 재계산 단추로 오해될 자리다. + // TODO(미결) — 설정의 초기값을 무엇으로 볼지 사용자 확인 뒤에 붙인다. + actions.append(saveButton, confirmButton); panel.append(actions); return panel; } @@ -239,9 +251,7 @@ function buildQuantityBody(table: EarthworkTable | null, failed: boolean): HTMLE { label: L("B08_Quantity_Tab_Summary"), build: () => - table.summary - ? renderSummaryGrid(table.summary) - : message(L("B08_Quantity_Grid_Empty")), + table.summary ? renderSummaryGrid(table.summary) : message(L("B08_Quantity_Grid_Empty")), }, { label: L("B08_Quantity_Tab_Haul"), diff --git a/B08_Quantity/B08_Quantity_UI_SummaryGrid.ts b/B08_Quantity/B08_Quantity_UI_SummaryGrid.ts index 439817e6..317784e5 100644 --- a/B08_Quantity/B08_Quantity_UI_SummaryGrid.ts +++ b/B08_Quantity/B08_Quantity_UI_SummaryGrid.ts @@ -43,7 +43,14 @@ export interface HaulRow { export interface HaulTable { rows: HaulRow[]; - legs: { equipment: string; ground: string; volume_m3: number; distance_m: number; from_m: number; to_m: number }[]; + legs: { + equipment: string; + ground: string; + volume_m3: number; + distance_m: number; + from_m: number; + to_m: number; + }[]; bill_row_count: number; } @@ -141,7 +148,14 @@ export function renderHaulGrid(table: HaulTable, available: boolean): HTMLElemen const head = document.createElement("thead"); const headRow = document.createElement("tr"); - for (const label of ["운반수단", "지반유형", "토량(㎥)", "평균운반거리(m)", "근거 구간", "비고"]) { + for (const label of [ + "운반수단", + "지반유형", + "토량(㎥)", + "평균운반거리(m)", + "근거 구간", + "비고", + ]) { const th = document.createElement("th"); th.textContent = label; headRow.append(th); diff --git a/ui_template/ui_template_locale_b2.ts b/ui_template/ui_template_locale_b2.ts index 123f55c1..8e4c7cea 100644 --- a/ui_template/ui_template_locale_b2.ts +++ b/ui_template/ui_template_locale_b2.ts @@ -627,15 +627,17 @@ export const ui_locales_b2 = { ], B08_Quantity_Haul_Excluded: ["내역 제외", "Not billed"], B08_Quantity_Side_Ratios: ["반영률(%)", "Application ratios (%)"], + /* 반영률 항목 이름 — 서버 키를 사람이 읽는 말로. 거창 실무 시트 문구를 따른다. */ + B08_Quantity_Ratio_FillCompaction: ["성토면다짐", "Fill slope compaction"], + B08_Quantity_Ratio_SeedFill: ["초류종자살포(성토면)", "Seed spray (fill)"], + B08_Quantity_Ratio_SeedCut: ["초류종자살포(절토면)", "Seed spray (cut)"], + B08_Quantity_Ratio_TreeRemoval: ["지장목제거", "Obstacle removal"], B08_Quantity_Side_RockSet: ["암 갈래 세트", "Rock class set"], B08_Quantity_Side_RockRatios: ["지반 구성비(%)", "Ground composition (%)"], B08_Quantity_Btn_Save: ["저장", "Save"], B08_Quantity_Save_Success: ["산출 조건을 저장했습니다.", "Calculation settings saved."], B08_Quantity_Save_Failed: ["산출 조건을 저장하지 못했습니다.", "Failed to save the settings."], - B08_Quantity_Unsaved: [ - "저장하지 않은 변경이 있습니다.", - "You have unsaved changes.", - ], + B08_Quantity_Unsaved: ["저장하지 않은 변경이 있습니다.", "You have unsaved changes."], B08_Quantity_Side_Method: ["산출법", "Method"], B08_Quantity_Side_Method_Value: ["평균단면적법", "Average end area"], B08_Quantity_Side_Factors: ["토량환산계수(다짐)", "Conversion factors (compacted)"],