diff --git a/M01_MasterData/M01_MasterData_UI_Machine.css b/M01_MasterData/M01_MasterData_UI_Machine.css index c7498e470..07f888bd0 100644 --- a/M01_MasterData/M01_MasterData_UI_Machine.css +++ b/M01_MasterData/M01_MasterData_UI_Machine.css @@ -22,18 +22,25 @@ table.m01-master__grid.m01-machine__grid { table-layout: fixed; } +/* 글 열을 줄여 수 열(가격 · 손료 · 연료 · 인력 · 시간당) 몫을 남김 — 1277px 화면에서 수가 「76…」 로 잘리지 않게 */ .m01-machine__grid th:nth-child(1) { - width: 16%; + width: 13%; +} + +.m01-machine__grid th:nth-child(3) { + width: 11%; } -.m01-machine__grid th:nth-child(3), .m01-machine__grid th:nth-child(10) { - width: 14%; + width: 9%; +} + +.m01-machine__grid th:nth-child(2) { + width: 7%; } -.m01-machine__grid th:nth-child(2), .m01-machine__grid th:nth-child(9) { - width: 10%; + width: 6%; } .m01-machine-detail { @@ -49,6 +56,11 @@ table.m01-master__grid.m01-machine__grid { gap: var(--spacing-8) var(--spacing-12); } +/* 비고(머리 칸 끝) = 한 줄 통째 — 긴 원문 비고가 한 칸 폭에서 잘리지 않게 */ +.m01-machine-detail__meta > :last-child { + grid-column: 1 / -1; +} + .m01-machine-detail__uses { display: flex; flex-direction: column; diff --git a/M01_MasterData/M01_MasterData_UI_Page.ts b/M01_MasterData/M01_MasterData_UI_Page.ts index 72981087e..464eda5da 100644 --- a/M01_MasterData/M01_MasterData_UI_Page.ts +++ b/M01_MasterData/M01_MasterData_UI_Page.ts @@ -30,7 +30,7 @@ import { mountSettingsDrawer } from "../A00_Common/m_settings_nav"; import { currentQuery, navigateTo, setLeaveGuard } from "../A00_Common/router"; import { fetchSessionUser } from "../A06_Login/A06_Login_Api_Fetch"; import { saveFiles, type FileInfo } from "./M01_MasterData_Api_Fetch"; -import { discard, isStale, onDraftChange, payload, totalCount } from "./M01_MasterData_Draft"; +import { discard, isStale, onDraftChange, payload, peek, totalCount } from "./M01_MasterData_Draft"; import { buildHeadBar, buildHeadFilters } from "./M01_MasterData_UI_Head"; import { setLogicApiPaths } from "./M01_MasterData_UI_Logic_Api"; import { renderRows } from "./M01_MasterData_UI_Rows"; @@ -252,12 +252,16 @@ function buildPage(): HTMLElement { save.disabled = true; try { if (!(await confirmMachineImpact(payload()))) return; // 기계 정본 = 영향 보고 저장(848-5) + // 기계 상세에서 저장 = 저장 뒤에도 그 상세(새 기계 · 지운 기계는 목록) + const stay = currentQuery().get("machine") ?? ""; + const keep = /^EQ\d{6}$/.test(stay) && !peek(MACHINE_FILE)?.deletes.includes(stay); const result = await saveFiles(payload()); if (result.status === 200 && "files" in result) { discard(result.files.map((f) => f.file)); showNotice([]); showToast(L("M01_Saved"), "success"); await reloadFiles(); + if (keep) openMachine(stay, false); } else if (result.status === 409 && "stale" in result) { showNotice(staleNotice(result.stale)); } else if (result.status === 422 && "errors" in result) { diff --git a/M01_MasterData/M01_MasterData_UI_Pick.ts b/M01_MasterData/M01_MasterData_UI_Pick.ts index 855520a55..9e9b265c3 100644 --- a/M01_MasterData/M01_MasterData_UI_Pick.ts +++ b/M01_MasterData/M01_MasterData_UI_Pick.ts @@ -18,6 +18,8 @@ export interface PickOptions { current: string; /** 처음 찾을 글 — 그 재료 이름·규격 (없는 결과면 첫 낱말만으로 다시). */ seed: string; + /** 목록에서 뺄 ref — 준용 직종 = 자기 줄(자기 자신을 준용하지 않게). */ + skip?: string; /** 고르면 ref · 연결 끊기 = null. */ onPick: (ref: string | null, name?: string, value?: unknown) => void; } @@ -48,7 +50,8 @@ export function openPickModal(opt: PickOptions): void { mount: (body) => body.append(createText(opt.current), searchField.root, list), }); - const paint = (items: PickItem[], total: number): void => { + const paint = (all: PickItem[], total: number): void => { + const items = all.filter((it) => it.ref !== opt.skip); list.replaceChildren( ...(items.length ? items.map((it) => { diff --git a/M01_MasterData/M01_MasterData_UI_Rows.ts b/M01_MasterData/M01_MasterData_UI_Rows.ts index 5a34eec32..5cd726c92 100644 --- a/M01_MasterData/M01_MasterData_UI_Rows.ts +++ b/M01_MasterData/M01_MasterData_UI_Rows.ts @@ -74,11 +74,12 @@ function loadCell( return td; } -/** 새 줄 바탕 — 본 줄과 같은 칸 · 글 칸은 "" · 수·값 칸은 null. */ +/** 새 줄 바탕 — 본 줄과 같은 칸 · 글 칸은 "" · 목록 칸(옛이름)은 [] · 수·값 칸은 null. */ function blank(sample: Row): Row { const out: Row = {}; for (const [k, v] of Object.entries(sample)) { - if (v && typeof v === "object" && !Array.isArray(v)) out[k] = blank(v as Row); + if (Array.isArray(v)) out[k] = k === "값" ? null : []; + else if (v && typeof v === "object") out[k] = blank(v as Row); else if (k !== ALIAS) out[k] = typeof v === "string" && k !== "값" ? "" : null; } return out; @@ -336,6 +337,7 @@ function wageCell(row: Row, cur: Row, put?: Put): HTMLTableCellElement { title: `${L("M01_JobTitle")} · ${cur["이름"] ?? ""}`, current: text, seed: "", + skip: String(row["키"]), onPick: (ref, name, value) => { remember(ref, name); // 준용을 고르면 값도 그 직종 값으로 · 비우면 원래 값 (저장 때 서버가 다시 읽음)