From 56b73b79b8ddf02b4eb5fe51b6bf6c5d399dc6a2 Mon Sep 17 00:00:00 2001 From: umsangdon Date: Thu, 5 Nov 2026 07:41:33 +0900 Subject: [PATCH] =?UTF-8?q?fix(786-2):=20=ED=99=94=EB=A9=B4=20=EA=B2=80?= =?UTF-8?q?=EC=A6=9D=20=ED=9D=A0=20=EA=B3=A0=EC=B9=A8=20=E2=80=94=20[?= =?UTF-8?q?=EA=B5=AC=EC=A1=B0=EB=AC=BC=20=EC=A1=B0=ED=95=A9=EC=9C=BC?= =?UTF-8?q?=EB=A1=9C]=20=EC=B0=B8=EC=A1=B0=20=EC=A3=BC=EC=9D=B8=20=C2=B7?= =?UTF-8?q?=20=EC=8B=A4=ED=8C=A8=20=EB=90=98=EB=8F=8C=EB=A6=BC=20=C2=B7=20?= =?UTF-8?q?=ED=91=9C=20=EB=A8=B8=EB=A6=AC=20=EC=B9=B8=20=C2=B7=20=EC=9D=B4?= =?UTF-8?q?=EB=A6=84=20=EC=B9=B8=20=EB=8D=A7=EA=B8=80=20=EC=A4=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - ToItem: SC 참조 주인 = 실제 주인 id(개인 「회사/사용자」 · Find_Pick.upper 와 같은 ownOwner 길) — null 이면 서버 400 「참조 층 · 주인 꼴이 틀림」 · 일위대가 못 담으면 방금 더한 항목 지움(빈 항목 안 남김) - CheckRows: [확인] · 행 머리 칸 = 표마다 새 노드(두 표가 같은 노드를 써 로직 표 머리가 두 칸 밀림) - Hopyo.css: 이름 칸 덧글(셈 못 함 · 입력 필요) 한 줄씩 Co-Authored-By: Claude Opus 5.5 --- .../M02_MasterTemplete_Hopyo.css | 4 ++++ .../M02_MasterTemplete_Hopyo_CheckRows.ts | 6 ++--- .../M02_MasterTemplete_Hopyo_ToItem.ts | 23 +++++++++++++++++-- 3 files changed, 28 insertions(+), 5 deletions(-) diff --git a/M02_MasterTemplete/M02_MasterTemplete_Hopyo.css b/M02_MasterTemplete/M02_MasterTemplete_Hopyo.css index 3529b36c5..0d12c6877 100644 --- a/M02_MasterTemplete/M02_MasterTemplete_Hopyo.css +++ b/M02_MasterTemplete/M02_MasterTemplete_Hopyo.css @@ -306,6 +306,10 @@ white-space: normal; } +.m02-hopyo__lines .m02-labrow__name > small { + display: block; +} + .m02-hopyo__lines td.m02-hopyo__compare { min-width: 7em; white-space: pre-line; diff --git a/M02_MasterTemplete/M02_MasterTemplete_Hopyo_CheckRows.ts b/M02_MasterTemplete/M02_MasterTemplete_Hopyo_CheckRows.ts index cfcdfe272..15038eb23 100644 --- a/M02_MasterTemplete/M02_MasterTemplete_Hopyo_CheckRows.ts +++ b/M02_MasterTemplete/M02_MasterTemplete_Hopyo_CheckRows.ts @@ -263,13 +263,13 @@ const grid = (heads: HTMLElement[], rows: HTMLElement[], kind: string): HTMLElem export function checkTables(rows: JudgeRow[], ctx: CheckCtx): HTMLElement[] { const logic = rows.filter((r) => tableOf(r, ctx.kit.picksOf(r)) === "logic"); const mat = rows.filter((r) => !logic.includes(r)); - const first = [head(L("M02_JudgeColOk"), true), head(L("M02_JudgeColRow"))]; + const first = (): HTMLElement[] => [head(L("M02_JudgeColOk"), true), head(L("M02_JudgeColRow"))]; // 표마다 새 노드 const out: HTMLElement[] = []; if (logic.length) out.push( grid( [ - ...first, + ...first(), head(`${tc("Sub")} · ${L("M02_JudgeColVerdict")}`, true), head(`${tc("Col_Name")} · ${L("M02_JudgeColPick")}`, true), head(tc("Col_Alias")), @@ -288,7 +288,7 @@ export function checkTables(rows: JudgeRow[], ctx: CheckCtx): HTMLElement[] { el("h4", { className: "m02-hopyo__subhead", text: L("M02_CheckMat") }), grid( [ - ...first, + ...first(), head(tc("Labor_Code")), head(`${tc("Col_Name")} · ${L("M02_JudgeColPick")}`, true), head(tc("Labor_Spec")), diff --git a/M02_MasterTemplete/M02_MasterTemplete_Hopyo_ToItem.ts b/M02_MasterTemplete/M02_MasterTemplete_Hopyo_ToItem.ts index 71bae1765..1bb676024 100644 --- a/M02_MasterTemplete/M02_MasterTemplete_Hopyo_ToItem.ts +++ b/M02_MasterTemplete/M02_MasterTemplete_Hopyo_ToItem.ts @@ -11,8 +11,10 @@ import { createInputField } from "@ui/ui_template_input"; import { t as L } from "@ui/ui_template_locale"; import { openModal } from "@ui/ui_template_modal"; import { createText } from "@ui/ui_template_text"; +import { fetchSessionUser } from "../A06_Login/A06_Login_Api_Fetch"; import { editTree, fetchTree, readTemplate, saveTemplate } from "./M02_MasterTemplete_Api_Fetch"; import type { HopyoScope } from "./M02_MasterTemplete_Hopyo_Api"; +import { ownOwner } from "./M02_MasterTemplete_Layer"; /** 만든 항목이 놓이는 폴더 */ export const ITEM_PATH = ["실무자료"]; @@ -33,16 +35,33 @@ export async function makeItem(o: ToItemOptions, label: string): Promise const made = await editTree(layer, { op: "add-item", 경로: ITEM_PATH, 이름: label, 단위: o.unit }, tree.판, owner); // prettier-ignore const col = [made.알림?.열].flat()[0]; if (!col) throw new Error(L("M02_CheckToItemFail")); + try { + await fillLabor(o, col); + } catch (e) { + // 일위대가 못 담음 = 빈 항목 남기지 않음(방금 더한 항목만 지움) + await editTree(layer, { op: "delete", 키: col }, made.판, owner).catch(() => null); + throw e; + } + return col; +} + +/** 새 항목 일위대가 문서 = SC 참조 한 줄 */ +async function fillLabor(o: ToItemOptions, col: string): Promise { + const { layer, owner } = o.target; const now = await readTemplate(layer, "labor", col, null, owner); const doc = (now.문서 ?? {}) as Record; + // 참조 주인 = 실제 주인 id(개인 「회사/사용자」 · 자기 층이면 세션에서 · `Find_Pick.upper` 와 같은 길) + const who = + layer === "system" || layer === "project" + ? null + : (owner ?? ownOwner(layer, await fetchSessionUser())); const line = { - 참조: { 층: layer, 주인: owner, 키: o.sc }, + 참조: { 층: layer, 주인: who, 키: o.sc }, 별칭: null, 메모: null, 수량: { 손: 1 }, }; await saveTemplate(layer, "labor", col, null, now.판 ?? "", { ...doc, 담은로직: [line], 단위: o.unit || doc.단위 || null }, owner); // prettier-ignore - return col; } export function toItem(o: ToItemOptions): void {