Merge remote-tracking branches 'origin/sub_desktop_1' and 'origin/sub_laptop_2' into sub_laptop_1

This commit is contained in:
2026-09-20 23:19:41 +09:00
4 changed files with 43 additions and 15 deletions
+22 -1
View File
@@ -27,6 +27,7 @@ import {
type ElementBrief,
type LogicFile,
type LogicRow,
type LogicSummary,
type SaveFile,
} from "./M01_MasterData_UI_Logic_Api";
import { buildCalc } from "./M01_MasterData_UI_Logic_Calc";
@@ -68,7 +69,16 @@ function loadDrafts(): Record<string, Draft> {
}
}
export async function mountM01Logic(host: HTMLElement, side: SideHandle): Promise<void> {
export interface LogicHandle {
/** 밖(요소 화면)에서 이 키를 바로 엶 — 소요량·계수 표의 「쓰는 로직」 눌렀을 때. */
openKey: (key: string) => Promise<void>;
}
export async function mountM01Logic(
host: HTMLElement,
side: SideHandle,
openKey?: string,
): Promise<LogicHandle> {
let drafts = loadDrafts();
let files: LogicFile[] = [];
let opened: Opened | null = null;
@@ -220,6 +230,8 @@ export async function mountM01Logic(host: HTMLElement, side: SideHandle): Promis
}
};
let allLogics: LogicSummary[] = [];
const reload = async (): Promise<void> => {
const [logics, logicFiles, subs] = await Promise.all([
fetchLogics(),
@@ -227,6 +239,7 @@ export async function mountM01Logic(host: HTMLElement, side: SideHandle): Promis
fetchLogicSubs(),
]);
files = logicFiles;
allLogics = logics;
list.setItems(logics);
// 왼쪽 「전체」 + 구분 → 상세구분 거름 — 고르면 목록으로 돌아와 그 범위만
filterHost.replaceChildren(
@@ -390,11 +403,19 @@ export async function mountM01Logic(host: HTMLElement, side: SideHandle): Promis
side.logicHost.replaceChildren(filterHost);
show(null);
showLoadingOverlay();
const openKeyOn = async (key: string): Promise<void> => {
const found = allLogics.find((x) => x. === key);
if (found) await open(logicId(found., found.), found., found.);
else showToast(tx("Load_Failed"), "error");
};
try {
await reload();
if (openKey) await openKeyOn(openKey);
} catch (error) {
showToast(error instanceof Error ? error.message : tx("Load_Failed"), "error");
} finally {
hideLoadingOverlay();
}
return { openKey: openKeyOn };
}
+7 -10
View File
@@ -33,6 +33,7 @@ import {
type Pick,
} from "./M01_MasterData_UI_Side";
import { renderTables } from "./M01_MasterData_UI_Tables";
import type { LogicHandle } from "./M01_MasterData_UI_Logic_Page";
import "./M01_MasterData_UI_Style.css";
const TABLE_GROUPS = ["소요량", "계수"];
@@ -174,13 +175,9 @@ function buildPage(): HTMLElement {
return [L("M01_Stale").replace("{value}", stale.map(fileLabel).join(", ")), again];
};
/** 로직 탭으로 전환 — `key` 가 있으면 들고 가서 로직 목록 찾기 칸에 넣으라고 안내
* (로직 목록이 직접 그 키를 열지는 못함 — 로직 부분은 sub1 담당 파일). */
const notifyLogicKey = (key: string): void => {
navigator.clipboard?.writeText(key).catch(() => undefined);
showToast(L("M01_LogicKeyCopy").replace("{value}", key), "success");
};
let logicHandle: LogicHandle | null = null;
/** 로직 탭으로 전환 — `key` 가 있으면 그 로직을 바로 엶. */
const openLogicTab = (key?: string): void => {
if (key) setPendingLogicKey(key);
dispose();
@@ -188,14 +185,14 @@ function buildPage(): HTMLElement {
current = null;
showMode("logic");
if (logicMounted) {
if (key) notifyLogicKey(key);
const pending = takePendingLogicKey();
if (pending) void logicHandle?.openKey(pending);
return;
}
logicMounted = true;
void import("./M01_MasterData_UI_Logic_Page").then((m) => {
void m.mountM01Logic(logicHost, side);
void import("./M01_MasterData_UI_Logic_Page").then(async (m) => {
const pending = takePendingLogicKey();
if (pending) notifyLogicKey(pending);
logicHandle = await m.mountM01Logic(logicHost, side, pending ?? undefined);
});
};
@@ -0,0 +1,14 @@
# 요소 화면 검증 — 깨진 것만
`#/m01-master-data` · 포트 5177 · ORCA 내장 브라우저 · 2026-09-20. 조작한 거름은 모두 「전체」로 되돌림.
| 어디 | 무엇 | 기대 |
|---|---|---|
| 재료 자재품목 (30,592줄) | 왼쪽에 구분·상세구분 드롭다운이 없음 — 「전체」 한 줄만 있고 거를 수 없음(유가·전력·기계·인력·소요량·계수에는 있음). 값 다섯 열(물가자료·유통물가·물가정보·거래가격·관급) 머리는 정상 | 자재품목에도 구분 → 상세구분 2단 거름(구분 목록·줄 수는 `재료_자재품목.json` 대로) |
| 소요량·계수 표 › 용도 줄의 로직키(예 QC000497 표의 GC000277) 클릭 | 로직 컨테이너로 넘어가지만 그 키가 골라지지도 찾기에 들어가지도 않음 — 목록 1쪽(1,354줄)이 그대로 뜸 | 눌린 로직키 줄이 선택돼 열리거나 목록이 그 키로 좁혀짐 |
## 이상 없음(확인한 것)
- 기계: 구분 11갈래(건설 [00]~[90] + 임업기계) 줄 수 합 654 = 전체. 상세구분이 구분마다 채워짐(임업기계 11 · 집재장비 20줄). 상세구분 거름이 1줄·20줄 등 데이터와 일치.
- 소요량·계수: 표 머리에 「용도: 공종 · 대상 · 로직키」 줄. 대상 거름 — 소요량 인력 1,264 · 기계 324 · 재료 166 · 할증 34 · 환산 4 · 작업량 조건 2,390 / 계수 인력 4 · 기계 11 · 재료 17 · 할증 55 · 환산 6 · 작업량 조건 490 — 모두 데이터와 일치.
- 인력: 구분 7갈래 줄 수(건설업 146 · 제조업 132 · 엔지니어링 57 · 측량 20 · SW 17 · 건설사업관리 4 · 산림 2 = 378) · 상세구분 · 상태 거름(건설업+공표 118) 전과 같이 동작.
-4
View File
@@ -64,10 +64,6 @@ export const ui_locales_m1 = {
M01_TableUsage: ["용도", "Usage"],
M01_TableUsageLogicCount: ["로직 {value}개", "{value} logic rules"],
M01_OpenLogic: ["눌러 로직 탭으로", "Click to jump to the Logic tab"],
M01_LogicKeyCopy: [
"로직 탭으로 이동 — 키 {value} 복사함(찾기에 붙여넣을 것)",
"Switched to Logic tab — copied key {value} (paste it into the search box)",
],
M01_GroupLabor: ["인력", "Labor"],
M01_GroupMaterial: ["재료", "Materials"],
M01_GroupMachine: ["기계", "Machines"],