From c4732ebb8f14e0db90c0b07adc8c9f62c402a8e8 Mon Sep 17 00:00:00 2001 From: swcho Date: Wed, 20 Aug 2025 11:07:51 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20-=20=EC=9A=B4=EC=98=81=EC=A0=95?= =?UTF-8?q?=EB=B3=B4=20=EA=B2=B0=EA=B3=BC=20=EA=B4=80=EB=A1=9C=20=ED=81=B4?= =?UTF-8?q?=EB=A6=AD=EC=8B=9C=20=ED=95=B4=EB=8B=B9=20=EA=B4=80=EB=A1=9C?= =?UTF-8?q?=EB=A1=9C=20=EC=9D=B4=EB=8F=99=20=EA=B8=B0=EB=8A=A5=20=EA=B5=AC?= =?UTF-8?q?=ED=98=84=20-=20searchModal=20=EB=8D=B0=EC=9D=B4=ED=84=B0=20?= =?UTF-8?q?=EC=9C=A0=EC=A7=80=EB=90=98=EB=8F=84=EB=A1=9D=20=EB=B3=80?= =?UTF-8?q?=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../map/searchModal/searchModal.tsx | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/apps/sn/app/(map-layout)/map/searchModal/searchModal.tsx b/apps/sn/app/(map-layout)/map/searchModal/searchModal.tsx index 61f7f5acf..7c4762a3c 100644 --- a/apps/sn/app/(map-layout)/map/searchModal/searchModal.tsx +++ b/apps/sn/app/(map-layout)/map/searchModal/searchModal.tsx @@ -149,18 +149,7 @@ const SearchModal: React.FC = ({ setIsResetDetailSelection(true); // 선택 초기화 setDetailBizId(0); // queryParams는 fetchFilteredData 내에서 매번 새로 생성되므로 별도 상태 초기화는 필요 없음 - }, [activeTab, basicType, workType, open]); - - useEffect(() => { - setActiveTab(TABS[0]?.val ?? "basic"); - setBasicType(BASIC_TYPES[0]?.val ?? ""); - setWorkType(WORK_TYPES[0]?.val ?? ""); - setTableCount(0); - setTableData([]); - setDetailTableCount(0); - setDetailTableData([]); - setDetailBizId(0); - }, [open]); + }, [activeTab, basicType, workType]); // 페이지 변경 시마다 데이터 fetch useEffect(() => { @@ -521,8 +510,7 @@ const SearchModal: React.FC = ({ RequestDTO.workTypes = JSON.parse(workType.replace(/'/g, '"')); const res = await getData(`v1/bizInfo/fclts?${new URLSearchParams(RequestDTO).toString()}`); - console.log('운영정보 cellClick 데이터1:', res); - console.log('운영정보 cellClick 데이터2:', res.data); + console.log('운영정보 cellClick 데이터:', res.data); const mappedData = (res.data || []).map((item: any, detailIndex: number) => { const formattedItem = formatDisplayData(item); @@ -587,6 +575,18 @@ const SearchModal: React.FC = ({ } }; + const handleOperationResultCellClick = async (index?: number | undefined, headId?: String) => { + if (typeof index === "number") { + + const row = detailTableData[index]; + const layerNm = row.lyrTypeNm; + const fid = row.fid; + const core = GisApp.Module.layer as any; + core.showSearchResultsFromGeoJSON(layerNm, fid); + onOpenChange(false); // SearchModal 닫기 + } + }; + // 기본정보 Excel 다운로드 핸들러 const BasicExcelDownload = async () => { if (tableData.length === 0) { @@ -1006,7 +1006,7 @@ const SearchModal: React.FC = ({ <> {/* 탭 영역 */} ({ value: tab.val, label: tab.text @@ -1133,7 +1133,7 @@ const SearchModal: React.FC = ({ headlist={dynamicHeadlist2} pageSize={OPERATION_TABLE_SIZE} total={detailTableCount} - cellClick={undefined} + cellClick={handleOperationResultCellClick} onPageChange={setDetailCurPage} resetPageNo={isResetDetailPage} resetSelection={isResetDetailSelection}