feat(M02): 면적산출 오른쪽 패널 — 지금 시트 연결 칸 주소를 일위대가 보기에 넘김 · 저장 전 잇기도 「수량 C3 = 12.5」 (PLAN 39-4 D6)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01W4uKaV4ZBhsJN4GHG7yRj4
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
* 몸 = 일위대가 보기 갈래(`Labor_View` · 고치기 없음) · 틀 = 공용 사이드바 카드 · 접기 손잡이 · 폭 손잡이
|
||||
* (폭 · 접힘 기억은 옛 조합 패널 키 그대로).
|
||||
* · 줄 누름 = 칸 지정 모달(`AreaLink` · 그 줄 알약 키를 면적 칸에 잇기 · 풀기)
|
||||
* · 시트 칸 값이 바뀌면 `refresh` — 받은 기준에 바로 곱함(서버 안 부름 · `Labor_View.setQty`)
|
||||
* · 시트 칸 값 · 연결이 바뀌면 `refresh` — 받은 기준에 바로 곱함 · 칸 주소도 넘김(서버 안 부름 · `Labor_View.setQty`)
|
||||
* ========================================================================== */
|
||||
|
||||
import { el, showToast } from "@ui/ui_template_elements";
|
||||
@@ -57,6 +57,13 @@ function quantities(sheet: SpreadsheetHandle | null): Record<string, number> {
|
||||
return out;
|
||||
}
|
||||
|
||||
/** 시트 연결 → `{알약 키: 칸 주소}` — 저장 전 잇기 · 풀기도(줄 아래 「수량 B6 = …」) */
|
||||
function cellsOf(sheet: SpreadsheetHandle | null): Record<string, string> {
|
||||
const out: Record<string, string> = {};
|
||||
for (const s of sheet?.getDoc().시트 ?? []) for (const l of s.연결 ?? []) out[l.키] = l.칸;
|
||||
return out;
|
||||
}
|
||||
|
||||
export function buildAreaPanel(opts: AreaPanelOptions): AreaPanel {
|
||||
const openLink = (row: LaborViewRow): void => {
|
||||
const sheet = opts.sheet();
|
||||
@@ -112,10 +119,12 @@ export function buildAreaPanel(opts: AreaPanelOptions): AreaPanel {
|
||||
setCollapsed(readStateRaw("m02-combo-panel-collapsed") === "true");
|
||||
|
||||
// 처음 = 저장 안 한 시트 칸 값으로 셈(서버 calc 한 번)
|
||||
const refresh = (): void => view.setQty(quantities(opts.sheet()), cellsOf(opts.sheet()));
|
||||
void view.show(opts.layer, opts.column, quantities(opts.sheet()));
|
||||
refresh(); // 칸 주소는 지금 시트 것 — 보기가 저장본 대신 씀
|
||||
return {
|
||||
root,
|
||||
refresh: () => view.setQty(quantities(opts.sheet())),
|
||||
refresh,
|
||||
destroy: () => {
|
||||
view.destroy();
|
||||
resizer.dispose();
|
||||
|
||||
@@ -33,7 +33,8 @@ def test_패널_몸은_보기_갈래_줄_누름은_칸_지정():
|
||||
panel = _text("M02_MasterTemplete_AreaPanel.ts")
|
||||
assert "createLaborView(openLink)" in panel
|
||||
assert "void view.show(opts.layer, opts.column, quantities(opts.sheet()));" in panel
|
||||
assert "refresh: () => view.setQty(quantities(opts.sheet()))," in panel
|
||||
assert "view.setQty(quantities(opts.sheet()), cellsOf(opts.sheet()))" in panel
|
||||
assert panel.index("void view.show(") < panel.index("refresh(); // 칸 주소")
|
||||
assert "openAreaLink({" in panel and "if (!row.pill) return showToast(TEXT.noPill" in panel
|
||||
for gone in ("fetchUsableCombos", "setColumnCombo", "branchCombo"):
|
||||
assert gone not in panel
|
||||
|
||||
Reference in New Issue
Block a user