wip(802-4b-3): 중지 — 펼친 단가산출 블록 격자 전체 폭(정의 영역 전체 폭 · 기호 줄 오른쪽 칸 자리) · 금액 줄 비목 합 참조 값(moneyScope = 앞 줄 누계) · 빨강 헬퍼 틀(시험 · ORCA 안 돌림)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-07 20:30:13 +09:00
co-authored by Claude Opus 5.5
parent c80b5ae9d0
commit cbd02c09e9
5 changed files with 115 additions and 7 deletions
+16 -1
View File
@@ -218,8 +218,9 @@
color: var(--color-text-secondary);
}
/* 기호 정의 — 값 식 아래 한 줄씩 */
/* 기호 정의 — 값 식 아래 한 줄씩(오른쪽 칸 자리) · 펼친 단가산출 블록만 격자 전체 폭 */
.fdoc__defs {
grid-column: 1 / -1;
display: flex;
flex-direction: column;
gap: 2px;
@@ -254,6 +255,13 @@
font-size: var(--text-body-sm);
}
.fdoc__defs > .fdoc__colhead,
.fdoc__def,
.fdoc__defedit,
.fdoc__unused > summary {
margin-left: calc(50% + var(--spacing-24) / 2);
}
.fdoc__defedit {
display: flex;
flex-direction: column;
@@ -294,6 +302,13 @@
.fdoc__grid {
grid-template-columns: minmax(0, 1fr);
}
.fdoc__defs > .fdoc__colhead,
.fdoc__def,
.fdoc__defedit,
.fdoc__unused > summary {
margin-left: 0;
}
}
.fdoc__wrap,
+21 -5
View File
@@ -15,6 +15,7 @@ import { el } from "@ui/ui_template_elements";
import { createSelectField } from "@ui/ui_template_input";
import type { DocVar, FormulaDoc, MoneyLine, Node } from "../common_util/common_util_formula_doc";
import type { DocAnswer } from "../common_util/common_util_formula_doc_calc";
import { moneyScope } from "../common_util/common_util_formula_doc_view";
import {
lineMap,
litsOf,
@@ -74,8 +75,15 @@ function vals(h: LinesHooks): Values {
return got;
}
/** 식 글 → 그림(못 풀면 글 그대로 빨강) */
function expr(text: unknown, h: LinesHooks, side: "sym" | "val", inline = false, cost?: string) {
/** 식 글 → 그림(못 풀면 글 그대로 빨강) · scope = 금액 줄이 부르는 비목 합(앞 줄 누계) */
function expr(
text: unknown,
h: LinesHooks,
side: "sym" | "val",
inline = false,
cost?: string,
scope?: Values,
) {
const n = tryParse(text);
if (!n) {
const raw = span("fdoc__raw", String(text ?? ""));
@@ -84,7 +92,14 @@ function expr(text: unknown, h: LinesHooks, side: "sym" | "val", inline = false,
}
const lits = side === "val" ? litsOf(n) : undefined;
return {
node: renderNode(n, { side, vals: vals(h), vars: h.vars, inline, cost, lits }),
node: renderNode(n, {
side,
vals: scope ? { ...vals(h), ...scope } : vals(h),
vars: h.vars,
inline,
cost,
lits,
}),
tree: n,
};
}
@@ -256,15 +271,16 @@ function moneyRow(i: number, h: LinesHooks): HTMLElement[] {
}
const right = el("div", { className: "fdoc__cell fdoc__valcell fdoc__money" });
const costs = line.비목 === "묶음" ? [...COSTS] : [null];
const scope = moneyScope(h.answer.줄, i);
for (const cost of costs) {
const row = span("fdoc__mrow");
if (cost) row.append(span("fdoc__cost", cost), span("ui-eq__op", ":"));
const pv = span("fdoc__edit");
pv.append(expr(line.단가, h, "val", true, cost ?? undefined).node);
pv.append(expr(line.단가, h, "val", true, cost ?? undefined, scope).node);
row.append(pv);
if (hasQty) {
const qv = span("fdoc__edit");
qv.append(expr(line.수량, h, "val", true).node);
qv.append(expr(line.수량, h, "val", true, undefined, scope).node);
row.append(span("ui-eq__op", "×"), qv);
if (h.admin)
qv.addEventListener("click", (ev) => onValueClick(ev, qv, h, "qty", i, () => undefined));
-1
View File
@@ -521,7 +521,6 @@ export function createDocScreen(opt: DocScreenOptions) {
el("div", { className: "fdoc__colhead", text: ft("Sym_Head") }),
el("div", { className: "fdoc__colhead", text: ft("Val_Head") }),
...lines,
el("div"),
defs,
);
};