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} />