From e8c8db73837499bdab37da504a744e3e70dd1955 Mon Sep 17 00:00:00 2001 From: bicochan Date: Mon, 13 Jul 2026 14:05:25 +0900 Subject: [PATCH] =?UTF-8?q?[as]=20chore:=20=EB=B6=88=ED=95=84=EC=9A=94?= =?UTF-8?q?=ED=95=9C=20=EC=BD=94=EB=93=9C=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/as/src/widgets/pbadms-sprt/index.ts | 1 - .../pbadms-sprt/lib/checklist-form-utils.ts | 27 ++----------------- 2 files changed, 2 insertions(+), 26 deletions(-) diff --git a/apps/as/src/widgets/pbadms-sprt/index.ts b/apps/as/src/widgets/pbadms-sprt/index.ts index 858019e55..aeee59a58 100644 --- a/apps/as/src/widgets/pbadms-sprt/index.ts +++ b/apps/as/src/widgets/pbadms-sprt/index.ts @@ -9,7 +9,6 @@ export { buildCnstpScaleItems, recalculateBzScaleTotals } from "./lib/business-s export { buildChecklistTabs, isFormChecklistComplete, - orderCklstTreeNodes, syncCklstResultListFromTree, } from "./lib/checklist-form-utils"; export type { FnrsSharItemDef, FnrsSharListItem } from "./lib/fnrs-shar-form-utils"; diff --git a/apps/as/src/widgets/pbadms-sprt/lib/checklist-form-utils.ts b/apps/as/src/widgets/pbadms-sprt/lib/checklist-form-utils.ts index 2c43aca43..07f015648 100644 --- a/apps/as/src/widgets/pbadms-sprt/lib/checklist-form-utils.ts +++ b/apps/as/src/widgets/pbadms-sprt/lib/checklist-form-utils.ts @@ -26,29 +26,6 @@ interface CklstResultListItem { picRvwCn?: string | null; } -export function orderCklstTreeNodes(rows: CklstTreeNode[]): CklstTreeNode[] { - const childMap = new Map(); - - rows.forEach((row) => { - const parent = row.upCklstRvwSn ?? null; - if (!childMap.has(parent)) childMap.set(parent, []); - childMap.get(parent)!.push(row); - }); - - const ordered: CklstTreeNode[] = []; - - function walk(parent: number | null) { - (childMap.get(parent) ?? []).forEach((child) => { - ordered.push(child); - walk(child.cklstRvwSn); - }); - } - - walk(null); - - return ordered; -} - function groupCklstTreeByTaskSeComCd(cklstTree: CklstTreeNode[]): Map { const grouped = new Map(); @@ -69,7 +46,7 @@ function getOrderedSelectableNodes( const grouped = groupCklstTreeByTaskSeComCd(cklstTree); return taskSeComCdArray.flatMap((code) => - orderCklstTreeNodes(grouped.get(code) ?? []).filter((node) => node.bchckUseYn === "Y"), + (grouped.get(code) ?? []).filter((node) => node.bchckUseYn === "Y"), ); } @@ -86,7 +63,7 @@ export function buildChecklistTabs( return orderedCodes.map((code) => ({ code, label: taskCodeLabels[code] || code, - items: orderCklstTreeNodes(grouped.get(code) ?? []).map((node) => ({ + items: (grouped.get(code) ?? []).map((node) => ({ cklstSn: node.cklstSn, cklstArtclSn: node.cklstArtclSn, cklstRvwSn: node.cklstRvwSn,