feat(716-1·716-2): 구조물 옵션 정의 입구 M01 · 메뉴 표 둘 · M01 open 인자 (중간 — 구분선 부품 · 시험 정리 전)

- M01 왼쪽 단가산출 로직 칸 아래 구조물 옵션 정의 칸 · 본 칸 셋째 모드(저장 안 한 고침 물음)
- M02 옛 open=옵션 주소 = 시스템 관리자면 M01 로 돌려보냄
- settingLinks = 대시보드 칸별 줄(group · ?open=) · pageLinks = ☰ 페이지 둘
- 새 글 키 덧만: B01_Dashboard_CardLogic · CardStructOptionDef · CardPrecombo

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-01 14:43:23 +09:00
co-authored by Claude Sonnet 5.5
parent 9827926a20
commit a961e9cb69
9 changed files with 166 additions and 38 deletions
+44 -4
View File
@@ -1,13 +1,18 @@
/* =============================================================================
* M01_MasterData_UI_Side.ts
* 왼쪽 패널 — 공용 접기 컨테이너(`ui-collapsible ui-sidebar-section`) 아홉 개
* 왼쪽 패널 — 공용 접기 컨테이너(`ui-collapsible ui-sidebar-section`)
* 인력 · 재료 · 기계 · 소요량 · 계수 · 환율 · 요율 · 단가산출 로직(일위대가 조합은 M02 · PLAN 27-2b)
* ─ 구분선 ─ 구조물 옵션 정의(716-1 · 화면 코드는 M02 `StructOptions/` 그대로 · 입구만 여기)
* 펼치면 하위 목록(거름 · 파일) · 환율/요율은 누르면 바로 표 · 로직은 안에 로직 목록
* ========================================================================== */
import { createSelectField, el, showToast } from "@ui/ui_template_elements";
import { attachCollapsible } from "@ui/ui_template_collapsible";
import { currentLanguageIndex, t as L } from "@ui/ui_template_locale";
import {
buildOptionsSection,
type OptionsSectionOptions,
} from "../M02_MasterTemplete/StructOptions/M02_SO_Options";
import { fetchFiles, fetchSubsAll, type FileInfo, type SubInfo } from "./M01_MasterData_Api_Fetch";
import { tx } from "./M01_MasterData_UI_Logic_Text";
import { renderTree, type MakeRow } from "./M01_MasterData_UI_Tree";
@@ -103,6 +108,10 @@ export interface SideHandle {
setOnPicked: (fn: () => void) => void;
/** 「전체」 + 드롭다운 거름 한 벌 — 로직 컨테이너도 씀 */
filter: (args: FilterArgs) => HTMLElement;
/** 주소 `open` — 그 컨테이너를 펼치고 고름(로직 = 로직 목록 · 옵션 = 정의 화면까지) */
reveal: (target: "로직" | "옵션") => void;
/** 옵션 줄 고름 표시 지움(다른 화면을 열었음) · 켬(떠나기를 취소해 머묾) */
setOptionsMark: (on: boolean) => void;
}
export interface FilterArgs {
@@ -157,7 +166,11 @@ const LEAF: Group[] = ["환율", "요율"];
const FILTERED: Group[] = ["인력", "기계", "소요량", "계수"];
const LOGIC_ID = "로직|";
export function buildSide(onOpen: (pick: Pick) => void, onLogic: () => void): SideHandle {
export function buildSide(
onOpen: (pick: Pick) => void,
onLogic: () => void,
optionsOpt: Omit<OptionsSectionOptions, "isAdmin">,
): SideHandle {
const lists = new Map<Group, FileInfo[]>();
const bodies = new Map<Group, HTMLElement>();
const buttons = new Map<string, HTMLElement>();
@@ -483,9 +496,12 @@ ${first.file}`
onLogic();
});
// 구조물 옵션 정의 — 로직 칸 아래 구분선 + 칸 하나(시스템 관리자 화면이라 고침 가능)
const options = buildOptionsSection({ ...optionsOpt, isAdmin: true });
const optionsSec = section(options.title, options.body);
const root = el("div", {
className: "m01-side ui-sidebar-panel",
children: [...groups, logic],
children: [...groups, logic, el("hr", { className: "ui-sidebar-divider" }), optionsSec],
});
attachCollapsible(root);
void Promise.all(GROUPS.filter((g) => g !== FUEL_GROUP).map(refresh)).catch((error) =>
@@ -497,5 +513,29 @@ ${first.file}`
// 재료는 유가 · 전력 파일까지 다(알약 → 마스터 화면 길이 파일로 찾음) · 유가 · 전력은 그 파일만
const files = (group: string): FileInfo[] =>
group === FUEL_GROUP ? shown(FUEL_GROUP) : (lists.get(group as Group) ?? []);
return { root, logicHost, refresh, files, setActive, setOnPicked, filter };
const reveal = (target: "로직" | "옵션"): void => {
if (target === "옵션") {
optionsSec.classList.remove("is-collapsed");
options.body.querySelector<HTMLElement>("button")?.click();
return;
}
logic.classList.remove("is-collapsed");
setActive(buttons.has(LOGIC_ID) ? LOGIC_ID : null);
onLogic();
};
const setOptionsMark = (on: boolean): void => {
if (!on) return options.clear();
options.body.querySelector("button")?.classList.add("is-active");
};
return {
root,
logicHost,
refresh,
files,
setActive,
setOnPicked,
filter,
reveal,
setOptionsMark,
};
}