/* ============================================================================= * B08_Quantity_UI_Earthwork_Sheets.ts * 토공 보조 탭 셋(PLAN 69-2) — 토공집계표 · 평균운반거리 · 종방향 무대운반거리. * * 칸 · 식 = 거창 실무 워크북 같은 이름 시트 그대로 · 값은 서버가 셈(`…_Engine_Earthwork_Summary`). * 운반 Q · L = 저장된 유토곡선 배분(B07 토적도와 같은 정본) — 없으면 그 사유만 보임. * 표 = 공용 많은 자료 표(`ui_template_data_table`). * 표 짜기 = `B08_Quantity_Earthwork_Tables`(화면 없음 · 인쇄 미리보기도 씀 · 302-3) * ========================================================================== */ import { createDataTable } from "@ui/ui_template_data_table"; import { note, tableCard } from "./B08_Quantity_UI_Earthwork"; import { earthworkSummaryOptions, HAUL_SHEETS, haulOptions, type EarthworkTable, } from "./B08_Quantity_Earthwork_Tables"; import { footNote } from "./B08_Quantity_UI_Foot"; /** 토공집계표 — 구분 · 공종 · 규격 · 단위 · 계 · 비고 */ export function renderEarthworkSummary(host: HTMLElement, table: EarthworkTable): void { const info = footNote( "연암 · 경암은 좌측 패널 비율대로 나눈 암 · 「비율 미정」은 비율 확인 뒤 채움", ); const grid = createDataTable({ ...earthworkSummaryOptions(table), fillViewport: true }); host.replaceChildren(tableCard([info], grid.root)); } function haulNote(table: EarthworkTable): HTMLElement[] { return table.haul_saved ? [] : [footNote("유토곡선 배분이 저장되지 않았습니다 — 횡단 설계 [확정] 뒤에 채워집니다.")]; } /** 운반 시트 한 장 — 표 + 아래 평균운반거리 줄 */ function haulSheet( host: HTMLElement, table: EarthworkTable, sheet: keyof typeof HAUL_SHEETS, ): void { const { groups, caption } = HAUL_SHEETS[sheet](table); const { options, averages } = haulOptions(groups, caption); const grid = createDataTable({ ...options, fillViewport: true }); host.replaceChildren(tableCard(haulNote(table), grid.root, averages.map(note))); } export function renderHaulDistance(host: HTMLElement, table: EarthworkTable): void { haulSheet(host, table, "haul"); } export function renderFreeHaul(host: HTMLElement, table: EarthworkTable): void { haulSheet(host, table, "free"); }