From ffb59b4e1b867b3c666af099954824a182958e82 Mon Sep 17 00:00:00 2001 From: SeongHyun Kim Date: Mon, 15 Dec 2025 18:09:55 +0900 Subject: [PATCH] =?UTF-8?q?=EC=B6=9C=ED=95=98=EA=B3=84=ED=9A=8D=20?= =?UTF-8?q?=EB=AA=A8=EB=8B=AC=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/lib/utils/buttonActions.ts | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/frontend/lib/utils/buttonActions.ts b/frontend/lib/utils/buttonActions.ts index cb21ac5a..587513e4 100644 --- a/frontend/lib/utils/buttonActions.ts +++ b/frontend/lib/utils/buttonActions.ts @@ -1780,16 +1780,15 @@ export class ButtonActionExecutor { /** * 모달 액션 처리 - * 🔧 modal 액션은 항상 신규 등록(INSERT) 모드로 동작 - * edit 액션만 수정(UPDATE) 모드로 동작해야 함 + * 선택된 데이터가 있으면 함께 전달 (출하계획 등에서 사용) */ private static async handleModal(config: ButtonActionConfig, context: ButtonActionContext): Promise { // 모달 열기 로직 - console.log("모달 열기 (신규 등록 모드):", { + console.log("모달 열기:", { title: config.modalTitle, size: config.modalSize, targetScreenId: config.targetScreenId, - // 🔧 selectedRowsData는 modal 액션에서 사용하지 않음 (신규 등록이므로) + selectedRowsData: context.selectedRowsData, }); if (config.targetScreenId) { @@ -1806,11 +1805,10 @@ export class ButtonActionExecutor { } } - // 🔧 modal 액션은 신규 등록이므로 selectedData를 전달하지 않음 - // selectedData가 있으면 ScreenModal에서 originalData로 인식하여 UPDATE 모드로 동작하게 됨 - // edit 액션만 selectedData/editData를 사용하여 UPDATE 모드로 동작 - console.log("📦 [handleModal] 신규 등록 모드 - selectedData 전달하지 않음"); - console.log("📦 [handleModal] 분할 패널 부모 데이터 (초기값으로 사용):", context.splitPanelParentData); + // 선택된 행 데이터 수집 + const selectedData = context.selectedRowsData || []; + console.log("📦 [handleModal] 선택된 데이터:", selectedData); + console.log("📦 [handleModal] 분할 패널 부모 데이터:", context.splitPanelParentData); // 전역 모달 상태 업데이트를 위한 이벤트 발생 const modalEvent = new CustomEvent("openScreenModal", { @@ -1819,11 +1817,10 @@ export class ButtonActionExecutor { title: config.modalTitle || "화면", description: description, size: config.modalSize || "md", - // 🔧 신규 등록이므로 selectedData/selectedIds를 전달하지 않음 - // edit 액션에서만 이 데이터를 사용 - selectedData: [], - selectedIds: [], - // 🆕 분할 패널 부모 데이터 전달 (탭 안 모달에서 초기값으로 사용) + // 선택된 행 데이터 전달 + selectedData: selectedData, + selectedIds: selectedData.map((row: any) => row.id).filter(Boolean), + // 분할 패널 부모 데이터 전달 (탭 안 모달에서 사용) splitPanelParentData: context.splitPanelParentData || {}, }, });