knowledge(마스터): 소요량·계수·로직에 구분·상세구분 — 표·줄마다 칸 · 갈래 목록은 서버가 줌
- 장 파일 137 개의 표 3,028 · 로직 1,351 줄에 구분(원문 + 부문 · 「건설품셈 공통」) · 상세구분(「03장 토공사」) 칸을 직접 둠 · 파일 머리의 부문·차례는 목록 차례로 남김 - 열 차례 — 표는 키 · 원문번호 · 구분 · 상세구분 · 이름 · 기준 · 출처 · 비고 · 조건 · 범위규칙 · 값칸 · 줄 · 주 · 그룹(맨 뒤) · 로직은 소유 다음에 비고 - 서버 — GET /subs?group= 이 구분·상세구분 목록(장 차례대로) · GET /tables 가 파일을 가로질러 구분·상세구분·찾기로 거르고 쪽 나눔 · GET /logics 도 구분·상세구분으로 거름 · 새 줄은 서버가 갈래를 채움 · 죽은 book 칸 걷어냄 - check_master 가 구분·상세구분이 파일 머리·이름과 맞는지 봄 · adopt 가 빌더 줄에 갈래를 찍어 되돌리기 시험 글자까지 같음 · _틀.md · 화면 계약 · 화면 트리 · 시험 같이 고침 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JgUhN55Z3BCYhUJTjwTNfj
This commit is contained in:
@@ -15,7 +15,7 @@ import {
|
||||
type FileInfo,
|
||||
type SubInfo,
|
||||
} from "./M01_MasterData_Api_Fetch";
|
||||
import { bookTree, renderTree, type MakeRow, type TreeNode } from "./M01_MasterData_UI_Tree";
|
||||
import { renderTree, type MakeRow, type TreeNode } from "./M01_MasterData_UI_Tree";
|
||||
|
||||
/** 요소 화면에서 열 것 — 파일 · 하위 거름(구분·세부분류) · 상세구분 · 제목 */
|
||||
export interface Pick {
|
||||
@@ -212,21 +212,36 @@ export function buildSide(onOpen: (pick: Pick) => void, onLogic: () => void): Si
|
||||
return;
|
||||
}
|
||||
if (group === "소요량" || group === "계수") {
|
||||
const tree = bookTree(
|
||||
files,
|
||||
(f, division): TreeNode => {
|
||||
const label = fileLabel(f.file);
|
||||
return {
|
||||
id: `${group}\n${f.file}`,
|
||||
label: division ? f.chapter.slice(division.length + 1) : f.chapter,
|
||||
count: f.rows,
|
||||
run: () => open(f, "", label),
|
||||
};
|
||||
},
|
||||
(parts) => `${group}\n#${parts.join("\n")}`,
|
||||
(list) => list.reduce((n, f) => n + f.rows, 0),
|
||||
);
|
||||
body.replaceChildren(...renderTree(tree, make));
|
||||
// 전체 → 구분(원문+부문) → 상세구분(장) — 목록은 서버가 준 것 · 장 차례대로
|
||||
const list = kinds.get(group) ?? [];
|
||||
const chapter = (k: SubInfo, detail: string): FileInfo | undefined =>
|
||||
files.find((f) => f.file === `${group}_${k.book}_${detail.replaceAll(" ", "_")}.json`);
|
||||
const rows = (k: SubInfo): number =>
|
||||
k.details.reduce((n, d) => n + (chapter(k, d)?.rows ?? 0), 0);
|
||||
const all: TreeNode[] = one
|
||||
? [
|
||||
{
|
||||
id: `${group}\n`,
|
||||
label: L("M01_All"),
|
||||
count: files.reduce((n, f) => n + f.rows, 0),
|
||||
open: true,
|
||||
run: () => open(one, "", L("M01_All")),
|
||||
children: list.map((k) => ({
|
||||
id: `${group}\n${k.name}`,
|
||||
label: k.name,
|
||||
count: rows(k),
|
||||
run: () => open(chapter(k, k.details[0] ?? "") ?? one, k.name, k.name),
|
||||
children: k.details.map((d) => ({
|
||||
id: `${group}\n${k.name}\n${d}`,
|
||||
label: d,
|
||||
count: chapter(k, d)?.rows ?? null,
|
||||
run: () => open(chapter(k, d) ?? one, k.name, `${k.name} · ${d}`, d),
|
||||
})),
|
||||
})),
|
||||
},
|
||||
]
|
||||
: [];
|
||||
body.replaceChildren(...renderTree(all, make));
|
||||
return;
|
||||
}
|
||||
body.replaceChildren(
|
||||
@@ -245,13 +260,15 @@ export function buildSide(onOpen: (pick: Pick) => void, onLogic: () => void): Si
|
||||
const list = await fetchFiles(group);
|
||||
if (list[0] && (group === "인력" || group === "기계")) {
|
||||
const file = list[0].file;
|
||||
const subs = await fetchSubs(file);
|
||||
const subs = await fetchSubs({ file });
|
||||
kinds.set(group, subs);
|
||||
await Promise.all(
|
||||
(group === "기계" ? subs : []).map(async (k) =>
|
||||
counts.set(`${group}\n${k.name}`, (await fetchRows(file, 1, 1, "", false, k.name)).total),
|
||||
),
|
||||
);
|
||||
} else if (group === "소요량" || group === "계수") {
|
||||
kinds.set(group, await fetchSubs({ group }));
|
||||
}
|
||||
lists.set(group as Group, list);
|
||||
drawGroup(group as Group);
|
||||
|
||||
Reference in New Issue
Block a user