From d2c15d519d96e507268c29fa626ad0a0b09bd33e Mon Sep 17 00:00:00 2001 From: kjs Date: Thu, 8 Jan 2026 17:36:40 +0900 Subject: [PATCH] =?UTF-8?q?=EB=B6=84=ED=95=A0=ED=8C=A8=EB=84=90=20?= =?UTF-8?q?=EC=88=98=EC=A0=95=EB=B2=84=ED=8A=BC=20=EB=8F=99=EC=9E=91?= =?UTF-8?q?=ED=95=98=EA=B2=8C=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SplitPanelLayoutComponent.tsx | 39 +++++-------------- 1 file changed, 9 insertions(+), 30 deletions(-) diff --git a/frontend/lib/registry/components/split-panel-layout/SplitPanelLayoutComponent.tsx b/frontend/lib/registry/components/split-panel-layout/SplitPanelLayoutComponent.tsx index e674e1a9..c3991ae3 100644 --- a/frontend/lib/registry/components/split-panel-layout/SplitPanelLayoutComponent.tsx +++ b/frontend/lib/registry/components/split-panel-layout/SplitPanelLayoutComponent.tsx @@ -1451,27 +1451,8 @@ export const SplitPanelLayoutComponent: React.FC // 커스텀 모달 화면 열기 const rightTableName = componentConfig.rightPanel?.tableName || ""; - // Primary Key 찾기 (우선순위: id > ID > 첫 번째 필드) - let primaryKeyName = "id"; - let primaryKeyValue: any; - - if (item.id !== undefined && item.id !== null) { - primaryKeyName = "id"; - primaryKeyValue = item.id; - } else if (item.ID !== undefined && item.ID !== null) { - primaryKeyName = "ID"; - primaryKeyValue = item.ID; - } else { - // 첫 번째 필드를 Primary Key로 간주 - const firstKey = Object.keys(item)[0]; - primaryKeyName = firstKey; - primaryKeyValue = item[firstKey]; - } - console.log("✅ 수정 모달 열기:", { tableName: rightTableName, - primaryKeyName, - primaryKeyValue, screenId: modalScreenId, fullItem: item, }); @@ -1490,27 +1471,25 @@ export const SplitPanelLayoutComponent: React.FC hasGroupByColumns: groupByColumns.length > 0, }); - // ScreenModal 열기 이벤트 발생 (URL 파라미터로 ID + groupByColumns 전달) + // 🔧 수정: URL 파라미터 대신 editData로 직접 전달 + // 이렇게 하면 테이블의 Primary Key가 무엇이든 상관없이 데이터가 정확히 전달됨 window.dispatchEvent( new CustomEvent("openScreenModal", { detail: { screenId: modalScreenId, - urlParams: { - mode: "edit", - editId: primaryKeyValue, - tableName: rightTableName, - ...(groupByColumns.length > 0 && { + editData: item, // 전체 데이터를 직접 전달 + ...(groupByColumns.length > 0 && { + urlParams: { groupByColumns: JSON.stringify(groupByColumns), - }), - }, + }, + }), }, }), ); - console.log("✅ [SplitPanel] openScreenModal 이벤트 발생:", { + console.log("✅ [SplitPanel] openScreenModal 이벤트 발생 (editData 직접 전달):", { screenId: modalScreenId, - editId: primaryKeyValue, - tableName: rightTableName, + editData: item, groupByColumns: groupByColumns.length > 0 ? JSON.stringify(groupByColumns) : "없음", });