feat(M02): 일위대가 라이브러리 화면 — 좌측 「일위대가 조합」 컨테이너 · 뿌리 셋 나무 · 조합 편집 · M01 컨테이너 뺌(PLAN 27-2b · 27-2c 화면)
- 좌측 「일위대가 조합」(구조물 조합 위) → 메인 칸 왼쪽 뿌리 셋 + 조합 나무(폴더 [구분, 상세구분] 깊이 2 · TreePanel 공용) · 오른쪽 목록 · 상세(옛 M01 조합 화면 옮김 · Labor_Edit)
- 나무 오른쪽 클릭: 폴더 더하기(2 단까지) · 조합 더하기(그 폴더 채운 빈 조합) · 이름 · 옮기기 · 지우기 · 조합 이름 바꾸기 서버 길 더함
- 해시 open=일위대가 로 진입 · 다른 뿌리를 누르면 그 뿌리 일위대가로
- 읽기만 뿌리는 저장 · 지우기 · 로직 더하기 없음
- TreePanel 에 maxDepth · item(부르는 말 · 새 항목 화면) 선택지 더함(구조물 라이브러리는 그대로)
- 조합 고르기(면적산출 옆 목록 · 일위대가 고르기)가 이 층이 쓸 수 있는 세 층 조합 · 알약은 /api/m02/combos/key/{키}/inputs
- M01 좌측 · 페이지에서 일위대가 조합 컨테이너 뺌
- 시험 test_m02_labor_tree(새) · test_m02_combo_layers 더함
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BU9gbNE3aWFUvE61pS2WGt
This commit is contained in:
@@ -134,6 +134,38 @@ export const fetchCombos = (scope: LaborScope = SYSTEM_SCOPE): Promise<ComboSumm
|
||||
/** 세 층 목록 — 고르기(use-combo · 갈라 내기) */
|
||||
export const fetchAllCombos = (): Promise<ComboLayerList[]> => request("/combos/all");
|
||||
|
||||
/** 조합 고르기(PLAN 27-2c) — 이 층 항목이 쓸 수 있는 조합: 마스터 · 회사(회사 · 개인 층) · 개인(개인 층) ·
|
||||
* 차례 = 마스터 → 회사 → 개인 · `layer` = 그 조합의 층 */
|
||||
export async function fetchUsableCombos(
|
||||
layer: Layer,
|
||||
): Promise<(ComboSummary & { layer: LaborScope["layer"] })[]> {
|
||||
const usable: LaborScope["layer"][] =
|
||||
layer === "personal" || layer === "project"
|
||||
? ["system", "company", "personal"]
|
||||
: layer === "company"
|
||||
? ["system", "company"]
|
||||
: ["system"];
|
||||
const all = await fetchAllCombos();
|
||||
return all
|
||||
.filter((group) => usable.includes(group.layer))
|
||||
.flatMap((group) => group.줄.map((c) => ({ ...c, layer: group.layer })));
|
||||
}
|
||||
|
||||
/** 조합 알약 물량 하나 — 키 = 「이름|단위」 · 담은 로직 결과단위 분모(같은 이름 · 단위는 합침) · `배` = 원/10㎡ 의 10 */
|
||||
export interface ComboQuantity {
|
||||
키: string;
|
||||
이름: string;
|
||||
단위: string;
|
||||
로직: string[];
|
||||
배?: number;
|
||||
}
|
||||
|
||||
/** 조합 알약(어느 층이든 · 옛 M01 `/combo/{키}/inputs`) */
|
||||
export const fetchComboInputs = (
|
||||
key: string,
|
||||
): Promise<{ 키: string; 이름: string; 물량: ComboQuantity[]; 조건: unknown[] }> =>
|
||||
request(`/combos/key/${enc(key)}/inputs`);
|
||||
|
||||
/** 키 하나 — 어느 층이든(그 층 읽기 권한) · `version` = 그 층 조합 표 판 */
|
||||
export const fetchCombo = (key: string): Promise<ComboOne & LaborScope> =>
|
||||
request<Omit<ComboOne, "file" | "version"> & LaborScope & { 판: string }>(
|
||||
|
||||
Reference in New Issue
Block a user