Merge remote-tracking branch 'origin/dev' into sub_laptop_2
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();
|
||||
|
||||
Reference in New Issue
Block a user