From be47ac0edb01ab90728e79f8b2587c478893660e Mon Sep 17 00:00:00 2001 From: swcho Date: Fri, 25 Jul 2025 10:06:19 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20-=20=ED=95=98=EC=88=98=EC=B2=98=EB=A6=AC?= =?UTF-8?q?=EC=8B=9C=EC=84=A4=20=EC=A0=95=EB=B3=B4=EC=97=90=EC=84=9C=20?= =?UTF-8?q?=EB=94=94=EC=A7=80=ED=84=B8=20=EC=9E=90=EB=A3=8C=EA=B4=80=20?= =?UTF-8?q?=EC=97=B0=EA=B3=84=20=EC=A0=95=EB=B3=B4=20=EA=B8=B0=EB=8A=A5=20?= =?UTF-8?q?=EC=A3=BC=EC=84=9D=20=EC=B2=98=EB=A6=AC=20-=20=EC=9A=B4?= =?UTF-8?q?=EC=98=81=EC=A0=95=EB=B3=B4=20=EA=B2=80=EC=83=89=20=EC=8B=9C=20?= =?UTF-8?q?=ED=8E=98=EC=9D=B4=EC=A7=80=20=EB=A6=AC=EC=85=8B=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80=20-=20=ED=95=98=EC=88=98=EA=B4=80=EB=A1=9C=20?= =?UTF-8?q?=EC=97=B0=EA=B3=84=EC=A0=95=EB=B3=B4=EC=97=90=EC=84=9C=20?= =?UTF-8?q?=EC=82=AC=EC=97=85=EB=AA=85=20=EC=A4=84=EB=B0=94=EA=BF=88=20?= =?UTF-8?q?=EC=B2=98=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../map/components/InputSection.tsx | 4 +- .../map/components/common/index.ts | 2 +- .../components/popupComponent/MsSwagePpl.tsx | 12 ------ .../map/searchModal/searchModal.tsx | 38 +++++++++++++++---- 4 files changed, 33 insertions(+), 23 deletions(-) diff --git a/apps/sn/app/(map-layout)/map/components/InputSection.tsx b/apps/sn/app/(map-layout)/map/components/InputSection.tsx index 539122d44..e35165bd2 100644 --- a/apps/sn/app/(map-layout)/map/components/InputSection.tsx +++ b/apps/sn/app/(map-layout)/map/components/InputSection.tsx @@ -21,7 +21,7 @@ const InputSection: React.FC = ({ title, data, sectionKey, on 구분 - 년도 + 진단연도 사업명 유형 @@ -40,7 +40,7 @@ const InputSection: React.FC = ({ title, data, sectionKey, on className="w-full text-xl border-radius-0 px-3 py-2 text-base text-center leading-normal" /> - + {row.bizNm} diff --git a/apps/sn/app/(map-layout)/map/components/common/index.ts b/apps/sn/app/(map-layout)/map/components/common/index.ts index 23602b632..9860b211a 100644 --- a/apps/sn/app/(map-layout)/map/components/common/index.ts +++ b/apps/sn/app/(map-layout)/map/components/common/index.ts @@ -22,7 +22,7 @@ type LayerContentMap = { // 레이어 이름과 컴포넌트를 매핑 // 레이어 선택시 변경되는 팝업 컨텐츠 동적으로 변경하도록 작업 const layerContentMap: LayerContentMap = { - "하수처리시설": { component: SwtrmtFclt, }, + // "하수처리시설": { component: SwtrmtFclt, }, // 디지털 자료관 연계정보가 없으니 일단 주석 처리 "하수처리구역": {}, "우수토실": { component: Ssc, }, "중점우수토실": { component: Ssc, }, // 중점우수토실 여부 설정 diff --git a/apps/sn/app/(map-layout)/map/components/popupComponent/MsSwagePpl.tsx b/apps/sn/app/(map-layout)/map/components/popupComponent/MsSwagePpl.tsx index a87cfcad1..9dc37064c 100644 --- a/apps/sn/app/(map-layout)/map/components/popupComponent/MsSwagePpl.tsx +++ b/apps/sn/app/(map-layout)/map/components/popupComponent/MsSwagePpl.tsx @@ -122,18 +122,6 @@ const MsSwagePpl = ({ featureData, onSaveClick }: { featureData: any, onSaveClic } }; - // 변환 함수: 객체 → [{ year, type }] - // function convertToYearTypeArray(obj: any): { year: string, type: string }[] { - // if (!obj || typeof obj !== "object") return []; - // // 이미 배열이면 그대로 반환 - // if (Array.isArray(obj)) return obj; - // // 객체의 각 key를 type, value를 year로 변환 - // return Object.entries(obj).map(([type, year]) => ({ - // year: String(year ?? ""), - // type: String(type ?? ""), - // })); - // } - return ( <> diff --git a/apps/sn/app/(map-layout)/map/searchModal/searchModal.tsx b/apps/sn/app/(map-layout)/map/searchModal/searchModal.tsx index 426b606aa..521d9d3c4 100644 --- a/apps/sn/app/(map-layout)/map/searchModal/searchModal.tsx +++ b/apps/sn/app/(map-layout)/map/searchModal/searchModal.tsx @@ -58,6 +58,12 @@ const SearchModal: React.FC = ({ const [detailTableCount, setDetailTableCount] = useState(0); const [curPage, setCurPage] = useState(1); const [detailCurPage, setDetailCurPage] = useState(1); + const [isLoading, setIsLoading] = useState(false); + const [isDetailLoading, setIsDetailLoading] = useState(false); + const [isResetPage, setIsResetPage] = useState(false); + const [isResetDetailPage, setIsResetDetailPage] = useState(false); + const [isResetSelection, setIsResetSelection] = useState(false); + const [isResetDetailSelection, setIsResetDetailSelection] = useState(false); const [detailBizId, setDetailBizId] = useState(0); const [city, setCity] = useState(0); const [sgg, setSgg] = useState(0); @@ -76,10 +82,6 @@ const SearchModal: React.FC = ({ const [yearFilter, setYearFilter] = useState({ start: "", end: "" }); const [filteredSiguns, setFilteredSiguns] = useState([{ val: '0', text: '전체', sido: '0' }]); - // 로딩바 - const [isLoading, setIsLoading] = useState(false); - const [isDetailLoading, setIsDetailLoading] = useState(false); - const sidos = useCityCd(); const siguns = useSggCd(); const reportOriginData = useDcTree(""); //:Folder[] @@ -161,14 +163,20 @@ const SearchModal: React.FC = ({ // 페이지 변경 시마다 데이터 fetch useEffect(() => { + setIsResetSelection(true); + setIsResetDetailSelection(true); // showTable이 true일 때만 fetch (최초 렌더 방지) - if (showTable) handleOperationPageNation(Number(detailBizId)); + if (showTable) { + handleOperationPageNation(Number(detailBizId)); + } }, [detailCurPage]); // 검색 API 호출 함수 const fetchFilteredData = async () => { setIsLoading(true); // 로딩 시작 + setIsResetSelection(true); // 선택 초기화 + setIsResetDetailSelection(true); // 선택 초기화 try { let cqlFilters: string[] = []; if (activeTab === 'basic') { @@ -285,6 +293,8 @@ const SearchModal: React.FC = ({ setTableData([]); } finally { setIsLoading(false); // 로딩 종료 + setIsResetSelection(false); + setIsResetDetailSelection(false); } }; @@ -450,6 +460,10 @@ const SearchModal: React.FC = ({ const handleSearch = () => { setCurPage(1); // 페이지를 1로 초기화 setDetailCurPage(1); // 페이지를 1로 초기화 + setIsResetPage(true); // 페이지를 1로 초기화 + setIsResetDetailPage(true); // 페이지를 1로 초기화 + setIsResetSelection(true); // 선택 초기화 + setIsResetDetailSelection(true); // 선택 초기화 fetchFilteredData(); setShowTable(true); }; @@ -463,6 +477,9 @@ const SearchModal: React.FC = ({ }; // 운영정보 테이블 cellClick 핸들러 const handleOperationCellClick = async (index?: number | undefined, headId?: String) => { + setIsResetDetailPage(true); // 페이지를 1로 초기화 + setIsResetDetailSelection(true); // 선택 초기화 + if (typeof index === "number") { setIsDetailLoading(true); setDetailBizId(tableData[index].bizId); @@ -494,6 +511,8 @@ const SearchModal: React.FC = ({ console.error('운영정보 cellClick 에러:', error); } finally { setIsDetailLoading(false); + setIsResetDetailPage(false); + setIsResetDetailSelection(false); } } }; @@ -649,7 +668,8 @@ const SearchModal: React.FC = ({ total={tableCount} cellClick={activeTab === 'report' ? handleReportCellClick : handleBasicCellClick} onPageChange={setCurPage} - resetPageNo={false} + resetPageNo={isResetPage} + resetSelection={isResetSelection} /> @@ -673,7 +693,8 @@ const SearchModal: React.FC = ({ total={tableCount} cellClick={handleOperationCellClick} onPageChange={setCurPage} - resetPageNo={false} + resetPageNo={isResetPage} + resetSelection={isResetSelection} /> @@ -694,7 +715,8 @@ const SearchModal: React.FC = ({ total={detailTableCount} cellClick={undefined} onPageChange={setDetailCurPage} - resetPageNo={false} + resetPageNo={isResetDetailPage} + resetSelection={isResetDetailSelection} />