feat(M01): 요소 찾기에 기계 구분·상세구분 싣기 · 소요량/계수 로직키 눌러 로직 탭 연결
_brief 응답에 구분·상세구분 추가(테스트 컨테이너 기계 후보 거름용) 표 상세화면 용도의 로직키를 누르면 로직 탭으로 전환 + 키 클립보드 복사(찾기용) 로직 목록을 직접 열지는 못함(로직 부분은 sub1 담당) — _화면_계약.md 한 줄 추가
This commit is contained in:
@@ -23,7 +23,15 @@ import { fetchSessionUser } from "../A06_Login/A06_Login_Api_Fetch";
|
||||
import { saveFiles } from "./M01_MasterData_Api_Fetch";
|
||||
import { discard, isStale, onDraftChange, payload, totalCount } from "./M01_MasterData_Draft";
|
||||
import { renderRows } from "./M01_MasterData_UI_Rows";
|
||||
import { buildSide, fileLabel, loadView, saveView, type Pick } from "./M01_MasterData_UI_Side";
|
||||
import {
|
||||
buildSide,
|
||||
fileLabel,
|
||||
loadView,
|
||||
saveView,
|
||||
setPendingLogicKey,
|
||||
takePendingLogicKey,
|
||||
type Pick,
|
||||
} from "./M01_MasterData_UI_Side";
|
||||
import { renderTables } from "./M01_MasterData_UI_Tables";
|
||||
import "./M01_MasterData_UI_Style.css";
|
||||
|
||||
@@ -95,8 +103,9 @@ function buildPage(): HTMLElement {
|
||||
current = { ...pick, view: undefined };
|
||||
const groupTitle = pick.group === pick.label ? [pick.group] : [pick.group, pick.label];
|
||||
title.textContent = groupTitle.join(" · ");
|
||||
const view = TABLE_GROUPS.includes(pick.group) ? renderTables : renderRows;
|
||||
dispose = view(body, pick, query);
|
||||
dispose = TABLE_GROUPS.includes(pick.group)
|
||||
? renderTables(body, pick, query, openLogicTab)
|
||||
: renderRows(body, pick, query);
|
||||
showNotice(isStale(pick.file.file, pick.file.version) ? [L("M01_FileStale")] : []);
|
||||
};
|
||||
|
||||
@@ -165,18 +174,35 @@ 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");
|
||||
};
|
||||
|
||||
const openLogicTab = (key?: string): void => {
|
||||
if (key) setPendingLogicKey(key);
|
||||
dispose();
|
||||
dispose = (): void => {};
|
||||
current = null;
|
||||
showMode("logic");
|
||||
if (logicMounted) {
|
||||
if (key) notifyLogicKey(key);
|
||||
return;
|
||||
}
|
||||
logicMounted = true;
|
||||
void import("./M01_MasterData_UI_Logic_Page").then((m) => {
|
||||
void m.mountM01Logic(logicHost, side);
|
||||
const pending = takePendingLogicKey();
|
||||
if (pending) notifyLogicKey(pending);
|
||||
});
|
||||
};
|
||||
|
||||
/* --- 좌측: 컨테이너 아홉 --- */
|
||||
const side = buildSide(
|
||||
openFile,
|
||||
() => {
|
||||
dispose();
|
||||
dispose = (): void => {};
|
||||
current = null;
|
||||
showMode("logic");
|
||||
if (logicMounted) return;
|
||||
logicMounted = true;
|
||||
void import("./M01_MasterData_UI_Logic_Page").then((m) => m.mountM01Logic(logicHost, side));
|
||||
},
|
||||
() => openLogicTab(),
|
||||
() => {
|
||||
dispose();
|
||||
dispose = (): void => {};
|
||||
|
||||
Reference in New Issue
Block a user