feat(M01): 소요량/계수 「쓰는 로직」 키를 누르면 로직 탭에서 그 로직 바로 엶
Logic_Page 에 openKey 초기 인자 + LogicHandle.openKey 추가(이미 연 뒤에도 재호출 가능) Page.ts 는 복사 안내 대신 로직 탭 전환과 동시에 그 로직을 엶
This commit is contained in:
@@ -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);
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user