feat(M01): 테스트 컨테이너 세 방식 첫 화면 안내 · B 하위 로직 줄·합계 표시 · 규격·단가 멈춤 글 쉬운 말
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WRFJmmhPi4exAzHgPZHMT
This commit is contained in:
@@ -27,7 +27,7 @@ import {
|
||||
} from "./M01_MasterData_UI_Logic_Api";
|
||||
import { formatNumber } from "./M01_MasterData_UI_Logic_Edit";
|
||||
import { hasPickable, pickPanel, swappedRow, type Swaps } from "./M01_MasterData_UI_Test_Pick";
|
||||
import { plainReason, tt } from "./M01_MasterData_UI_Test_Text";
|
||||
import { guideLines, plainReason, tt } from "./M01_MasterData_UI_Test_Text";
|
||||
|
||||
/* ── 원문 표(소요량·계수) 미리보기 — /elements 로 파일을 찾고 /table 로 통째 읽음 ── */
|
||||
|
||||
@@ -232,7 +232,12 @@ export function render(host: HTMLElement, logicKey: string): void {
|
||||
const swaps: Swaps = new Map();
|
||||
const state: State = {
|
||||
one,
|
||||
values: {},
|
||||
// 고르기 칸은 첫 값으로 시작 — 방식 C 와 같게(바로 계산이 돎)
|
||||
values: Object.fromEntries(
|
||||
(one.logic.입력 ?? [])
|
||||
.filter((spec) => spec.고르기?.length)
|
||||
.map((spec) => [spec.이름, String(spec.고르기?.[0])]),
|
||||
),
|
||||
answer: null,
|
||||
selected: 0,
|
||||
calcSeq: 0,
|
||||
@@ -322,6 +327,10 @@ function paint(host: HTMLElement, state: State): void {
|
||||
main.style.cssText = "flex:1 1 60%;min-width:0;";
|
||||
main.append(
|
||||
el("h3", { text: `${row.원문번호} ${row.이름}` }),
|
||||
el("ul", {
|
||||
className: "m01-logic__muted",
|
||||
children: guideLines("B").map((t) => el("li", { text: t })),
|
||||
}),
|
||||
inputWrap,
|
||||
...(hasPickable(state.one.logic)
|
||||
? [
|
||||
@@ -387,7 +396,35 @@ function buildHoTable(host: HTMLElement, state: State): HTMLElement {
|
||||
}),
|
||||
],
|
||||
}),
|
||||
el("tbody", { children: rows }),
|
||||
el("tbody", {
|
||||
children: [
|
||||
...rows,
|
||||
// 하위 로직이 여러 줄로 풀린 경우 — 호표 줄 수보다 많은 줄도 빠짐없이 보임
|
||||
...(lines ?? []).slice((state.one.logic.호표 ?? []).length).map((calc) =>
|
||||
el("tr", {
|
||||
children: [
|
||||
el("td", { text: calc.이름 }),
|
||||
el("td", { text: "" }),
|
||||
el("td", { text: `${formatNumber(calc.수량)} ${calc.단위}` }),
|
||||
el("td", { className: "m01-logic__money", text: formatNumber(calc.금액) }),
|
||||
],
|
||||
}),
|
||||
),
|
||||
...(state.answer?.ok && state.answer.sums
|
||||
? [
|
||||
el("tr", {
|
||||
attrs: { "data-total": String(state.answer.sums["계"] ?? 0) },
|
||||
children: [
|
||||
el("td", { text: tt("Sum_Total") }),
|
||||
el("td", { text: "" }),
|
||||
el("td", { text: "" }),
|
||||
el("td", { text: formatNumber(state.answer.sums["계"] ?? 0) }),
|
||||
],
|
||||
}),
|
||||
]
|
||||
: []),
|
||||
],
|
||||
}),
|
||||
],
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user