From 78878e13f444c63c03c1ba920195ee8ad8faee65 Mon Sep 17 00:00:00 2001 From: umsangdon Date: Sat, 31 Oct 2026 19:48:27 +0900 Subject: [PATCH] =?UTF-8?q?fix(M02=20=EC=B9=B4=EB=93=9C=20=EB=B2=88?= =?UTF-8?q?=ED=98=B8=20=EB=B0=B0=EC=A7=80):=20=EC=B9=B4=EB=93=9C=20?= =?UTF-8?q?=EB=A8=B8=EB=A6=AC=20=EB=B2=88=ED=98=B8(SD=20=C2=B7=20SU=20?= =?UTF-8?q?=C2=B7=20SA)=20=EB=B0=B0=EC=A7=80=20=3D=20=EC=8B=9C=EC=8A=A4?= =?UTF-8?q?=ED=85=9C=20=EA=B4=80=EB=A6=AC=EC=9E=90=EC=97=90=EA=B2=8C?= =?UTF-8?q?=EB=A7=8C=20=C2=B7=20=EA=B7=B8=20=EB=B0=96=EC=9D=80=20=EC=9D=B4?= =?UTF-8?q?=EB=A6=84=20=ED=92=8D=EC=84=A0=EB=A7=90=EB=A1=9C=EB=A7=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Sonnet 5.5 --- .../M02_MasterTemplete_ItemCards.ts | 23 +++++++++++++------ 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/M02_MasterTemplete/M02_MasterTemplete_ItemCards.ts b/M02_MasterTemplete/M02_MasterTemplete_ItemCards.ts index 478a2b0f7..8c41aceb2 100644 --- a/M02_MasterTemplete/M02_MasterTemplete_ItemCards.ts +++ b/M02_MasterTemplete/M02_MasterTemplete_ItemCards.ts @@ -38,6 +38,7 @@ import type { ItemPart, ItemSource } from "./M02_MasterTemplete_ItemSource"; import type { LaborDetailHandle } from "./M02_MasterTemplete_Labor_Detail"; import "./M02_MasterTemplete_Structure.css"; import { createBadge } from "@ui/ui_template_badge"; +import { fetchSessionUser } from "../A06_Login/A06_Login_Api_Fetch"; /** 집계표 열 하나에 딸린 문서 셋 — 번호 칸 · 이름 */ export type EditKind = ItemPart; @@ -188,6 +189,10 @@ export function createItemCards(opts: ItemCardsOptions): ItemCardsHandle { const reload = (): void => void load(column ? { id: column, label } : null, true); /** 카드 틀 하나 — 제목 옆 = ? · 제목 줄 오른쪽 = [저장] · [〇〇 수정](빈 단추 한 모양) · 부제 = 번호 · 이름 */ + const setNo = (card: Pick, text: string): void => { + card.no.textContent = text; + card.name.title = text; + }; const makeCard = ( kind: CardKind, title: string, @@ -195,7 +200,10 @@ export function createItemCards(opts: ItemCardsOptions): ItemCardsHandle { save: () => Promise, ) => { const no = createBadge("", "accent"); // 번호 = 배지 부품 - no.hidden = !!opts.picker; + no.hidden = true; // 번호 배지 = 시스템 관리자에게만 · 그 밖은 이름 풍선말 + void fetchSessionUser().then((user) => { + no.hidden = user?.role !== "SYSTEM_ADMIN"; + }); no.classList.add("m02-struct__no"); const name = el("span", { className: "m02-struct__title" }); const shell = cardShell({ title, body, sub: [no, name] }); @@ -312,8 +320,10 @@ export function createItemCards(opts: ItemCardsOptions): ItemCardsHandle { if (mine !== seq) return; laborVer = got.판 ?? ""; const d = (got.문서 ?? {}) as { 일위대가번?: string }; - laborCard.no.textContent = - d.일위대가번 || numberOf("labor", at) || fill(TEXT.noFieldNumber, PART_FIELD.labor); + setNo( + laborCard, + d.일위대가번 || numberOf("labor", at) || fill(TEXT.noFieldNumber, PART_FIELD.labor), + ); const via = src.labor; // 자료 자리 길(142-1 · 고르기 모달) — 셈 · 면적도 그 자리에서 laborEd = mod.mountLaborDetail(laborHost, got.문서, { layer, @@ -449,10 +459,9 @@ export function createItemCards(opts: ItemCardsOptions): ItemCardsHandle { const paintBody = (mine: number): void => { const at = column ?? ""; paintTools(); - info.no.textContent = doc?.도번 || numberOf("structure", at) || TEXT.noNumber; + setNo(info, doc?.도번 || numberOf("structure", at) || TEXT.noNumber); for (const c of sheets) { - c.no.textContent = - c.number || numberOf(c.kind, at) || fill(TEXT.noFieldNumber, PART_FIELD[c.kind]); + setNo(c, c.number || numberOf(c.kind, at) || fill(TEXT.noFieldNumber, PART_FIELD[c.kind])); void paintSheet(c, mine); } paintDrawing(); @@ -505,7 +514,7 @@ export function createItemCards(opts: ItemCardsOptions): ItemCardsHandle { column = col.id; label = col.label; for (const c of cards) c.name.textContent = label; - info.no.textContent = numberOf("structure", col.id) || TEXT.noNumber; + setNo(info, numberOf("structure", col.id) || TEXT.noNumber); doc = null; docVersion = null; previewHost.replaceChildren();