Merge remote-tracking branch 'origin/dev' into sub_laptop_3

This commit is contained in:
2026-11-03 06:16:18 +09:00
35 changed files with 979 additions and 198 deletions
@@ -158,7 +158,8 @@ export function buildFormula(host: HTMLElement, ctx: FormulaContext): void {
onInput ? specs.find((x) => x.이름 === name) : undefined;
// 737-2 비목마다 구분 상자 — 맨 위 옵션 칸 · 아래 두 칸 식 줄들 · 소계
const boxes = text.groups.map((g) => {
const lines = g.줄.map((line, i) => {
const visible = g.줄.filter((l) => !l.옵션꺼짐); // 753-2 옵션으로 빠진 줄은 안 그림
const lines = visible.map((line, i) => {
const pair = String(line.짝 ?? `${g.비목}${i}`);
const open = ctx.open?.(line);
return el("div", {
@@ -615,9 +615,12 @@ function boxCard(
const notes = [...new Set(lines.map((e) => e.textLine?.환산근거).filter(Boolean))];
const { root, tbody } = tableShell(COLS, { density: "data" });
root.classList.add("m01lab__ho");
// 753-2 옵션으로 빠진 줄은 안 그림(옵션 칸 · 소계는 그대로 — 옵션을 바꾸면 보이는 줄이 바뀜)
const off = (e: Entry): boolean => !!(e.line?.옵션꺼짐 || e.textLine?.옵션꺼짐);
const rows = b.줄.filter((r) => !("몫" in r ? r.몫.every(off) : off(r)));
tbody.append(
...(b.줄.length
? b.줄.flatMap((r) => ("몫" in r ? mergedRows(r, ctx) : [lineRow(r, ctx)]))
...(rows.length
? rows.flatMap((r) => ("몫" in r ? mergedRows(r, ctx) : [lineRow(r, ctx)]))
: [emptyRow(COLS, tl("Empty_Group"))]),
);
const sub = tableRow(COLS, [
@@ -105,6 +105,8 @@ export interface CalcLine {
까닭?: string;
/** (M02 744-1) 둘째 기초 세부 줄 — `수량`은 M01 원문 · 이 칸은 1 기준단위 몫 비목(금액 · 비목은 머리 수량 곱한 상자 몫) */
원문?: { 비목?: Record<string, number | null> };
/** (753-1) 옵션으로 빠진 줄 — 화면은 안 그림 */
옵션꺼짐?: boolean;
}
/** % 덧줄 표기(149-4) — 율 있으면 수량 = 율 · 단위 % · 이름 뒤 규격 괄호 · 금액은 그대로(M01 · M02 한 벌) */
@@ -160,6 +162,8 @@ export interface TextLine {
환산근거?: string;
/** (M02 750-1) SK 셈 답 줄 cid — 상세 줄과 이음 */
cid?: string;
/** (753-1) 옵션으로 빠진 줄(수량 0 이 만약 갈래 탓) — 화면은 그 줄을 안 그림(금액 · 차례 그대로) */
옵션꺼짐?: boolean;
}
/** `POST /text` 답 — 서버가 만든 읽는 식 줄(화면은 그대로 찍음) */
export type TextAnswer =
@@ -262,7 +262,8 @@ export function answerView(answer: CalcAnswer, draft: boolean, money: boolean):
}
const parts: HTMLElement[] = [...note];
if (answer.lines) {
const rows = answer.lines.map((line) =>
const visible = answer.lines.filter((line) => !line.옵션꺼짐); // 753-2 옵션으로 빠진 줄은 안 그림
const rows = visible.map((line) =>
el("tr", {
children: [
el("td", {