From 6808430c9ae74890d0f0e84f20a0ffe5409de157 Mon Sep 17 00:00:00 2001 From: swcho Date: Thu, 31 Jul 2025 16:09:36 +0900 Subject: [PATCH 1/4] =?UTF-8?q?feat:=20UITable=20=EC=BB=B4=ED=8F=AC?= =?UTF-8?q?=EB=84=8C=ED=8A=B8=EC=9D=98=20index=20props=EB=A5=BC=20?= =?UTF-8?q?=ED=86=B5=ED=95=B4=20=EC=99=B8=EB=B6=80=EC=97=90=EC=84=9C=20?= =?UTF-8?q?=EB=82=B4=EB=B6=80=20select=20idx=EB=A5=BC=20=EC=A0=9C=EC=96=B4?= =?UTF-8?q?=ED=95=A0=20=EC=88=98=20=EC=9E=88=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 --- .../src/ui/table/index.tsx | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/packages/common/business_components/src/ui/table/index.tsx b/packages/common/business_components/src/ui/table/index.tsx index c3f5f8a60..fa7c9b7fe 100644 --- a/packages/common/business_components/src/ui/table/index.tsx +++ b/packages/common/business_components/src/ui/table/index.tsx @@ -78,6 +78,10 @@ export function UiTable({ } }, [tableData, headlist]); + useEffect(() => { + setIdx(index); + }, [index]) + const handlePageChange = (page: number) => { setCur(page); onPageChange(page); @@ -120,10 +124,10 @@ export function UiTable({ (boldArray.includes(index) ? ( handleCellClick(index, head.id)} @@ -151,10 +155,10 @@ export function UiTable({ ) : ( handleCellClick(index, head.id)} key={`cell-${head.id}-${index}`} From d6cab7b35cff8beaa220415adbdfa0c1f1e89e35 Mon Sep 17 00:00:00 2001 From: swcho Date: Thu, 31 Jul 2025 16:13:52 +0900 Subject: [PATCH 2/4] =?UTF-8?q?refactor:=20=ED=98=B8=EC=B6=9C=20API=20?= =?UTF-8?q?=EC=BB=B4=ED=8F=AC=EB=84=8C=ED=8A=B8=EC=97=90=EC=84=9C=20?= =?UTF-8?q?=EC=A3=BC=EC=84=9D=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/sn/app/components/lib/api/index.ts | 3 --- 1 file changed, 3 deletions(-) diff --git a/apps/sn/app/components/lib/api/index.ts b/apps/sn/app/components/lib/api/index.ts index 6574567ad..df1d9f509 100644 --- a/apps/sn/app/components/lib/api/index.ts +++ b/apps/sn/app/components/lib/api/index.ts @@ -41,8 +41,6 @@ export const postData = async (url: string, data: object): Promise => { body: JSON.stringify(data), }; const res = await fetch(`${BASE_URL}/${url}`, options); - console.log('res', res); - console.log('res.status', res.status); if (res.ok) { const resData = await res.json(); return resData; @@ -99,7 +97,6 @@ export const getDcData = async (url: string, data?: object): Promise => { // CMS API 호출 export const getCmsData = async (url: string, data?: object): Promise => { - console.log(url); const res = await fetch('/cms-service' + url, { method: "GET", }); From 62a7dc74518d6df57191f4367e629dfae0b599e5 Mon Sep 17 00:00:00 2001 From: swcho Date: Thu, 31 Jul 2025 16:43:59 +0900 Subject: [PATCH 3/4] =?UTF-8?q?feat,=20fix:=20-=20=EC=A4=91=EC=A0=90?= =?UTF-8?q?=EC=9A=B0=EC=88=98=ED=86=A0=EC=8B=A4=20=EA=B0=95=EC=9A=B0?= =?UTF-8?q?=EC=A0=95=EB=B3=B4=20=ED=85=8C=EC=9D=B4=EB=B8=94,=20=EC=B8=A1?= =?UTF-8?q?=EC=A0=95=EC=A0=95=EB=B3=B4=20=ED=85=8C=EC=9D=B4=EB=B8=94=20sel?= =?UTF-8?q?ected=20index,=20page=20=EB=8F=99=EA=B8=B0=ED=99=94=20-=20?= =?UTF-8?q?=EC=88=98=EB=9F=89/=EC=88=98=EC=A7=88=EC=B8=A1=EC=A0=95=20?= =?UTF-8?q?=EC=A0=95=EB=B3=B4=20=ED=8E=98=EC=9D=B4=EC=A7=80=EB=84=A4?= =?UTF-8?q?=EC=9D=B4=EC=85=98=20=EC=97=90=EB=9F=AC=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../map/components/popupComponent/Ssc.tsx | 23 +++++++++++-------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/apps/sn/app/(map-layout)/map/components/popupComponent/Ssc.tsx b/apps/sn/app/(map-layout)/map/components/popupComponent/Ssc.tsx index 4542e56c9..801164eb8 100644 --- a/apps/sn/app/(map-layout)/map/components/popupComponent/Ssc.tsx +++ b/apps/sn/app/(map-layout)/map/components/popupComponent/Ssc.tsx @@ -29,13 +29,16 @@ const Ssc = ({ featureData, isMainSsc, chmbrXcnts, chmbrYdnts, onSaveClick }: { const [selectedRowIndex, setSelectedRowIndex] = useState(-1); const [curPage, setCurPage] = useState(1); const [curDetailPage, setCurDetailPage] = useState(1); - const [isResetPage, setIsResetPage] = useState(false); - const [isResetDetailPage, setIsResetDetailPage] = useState(false); + const [isResetPage, setIsResetPage] = useState(true); + const [isResetDetailPage, setIsResetDetailPage] = useState(true); const [isResetSelection, setIsResetSelection] = useState(false); - const [curIdx, setCurIdx] = useState(0); + + console.log('featureData', featureData); // 강우, 측정 정보 API 호출 함수 const fetchRainMeasureData = async (chmbrXcnts: string, chmbrYdnts: string) => { + setIsResetDetailPage(true); + setIsResetSelection(true); if (!chmbrXcnts || !chmbrYdnts) { console.warn('추가 데이터 호출 실패: 필수 매개변수 누락', { chmbrXcnts, chmbrYdnts }); return []; @@ -76,6 +79,7 @@ const Ssc = ({ featureData, isMainSsc, chmbrXcnts, chmbrYdnts, onSaveClick }: { // 수량/수질측정 정보 API 호출 함수 const fetchMntrngsData = async (adstDstrCd: string, manageNo: string) => { + setIsResetDetailPage(true); if (!adstDstrCd || !manageNo) { console.warn('추가 데이터 호출 실패: 필수 매개변수 누락', { adstDstrCd, manageNo }); return []; @@ -87,7 +91,7 @@ const Ssc = ({ featureData, isMainSsc, chmbrXcnts, chmbrYdnts, onSaveClick }: { size: '3', }); - console.log(`SSC 추가 데이터 API 호출 시작: v1/onsemiro/swgRain?${queryParams.toString()}`); + console.log(`SSC 추가 데이터 API 호출 시작: v1/onsemiro/swgRain/${adstDstrCd}/${manageNo}/mntrngs?${queryParams.toString()}`); const result = await getData(`v1/onsemiro/swgRain/${adstDstrCd}/${manageNo}/mntrngs?${queryParams.toString()}`); @@ -143,14 +147,14 @@ const Ssc = ({ featureData, isMainSsc, chmbrXcnts, chmbrYdnts, onSaveClick }: { // featureData가 변경될 때 formData 초기화 useEffect(() => { // showTable이 true일 때만 fetch (최초 렌더 방지) - setIsResetPage(false); - setIsResetDetailPage(true); + setIsResetDetailPage(false); + setSelectedRowIndex(-1); if (chmbrXcnts && chmbrYdnts) fetchRainMeasureData(chmbrXcnts, chmbrYdnts); }, [curPage]); // 페이지 변경 시마다 데이터 fetch useEffect(() => { - if (chmbrXcnts && chmbrYdnts) fetchMntrngsData(chmbrXcnts, chmbrYdnts); + if (chmbrXcnts && chmbrYdnts && selectedRowIndex !== -1) fetchMntrngsData(rainMeasureData[selectedRowIndex].adstDstrCd, rainMeasureData[selectedRowIndex].manageNo); }, [curDetailPage]); // 폼 데이터가 변경될 때 호출될 핸들러 @@ -187,7 +191,7 @@ const Ssc = ({ featureData, isMainSsc, chmbrXcnts, chmbrYdnts, onSaveClick }: { onPageChange={setCurPage} resetPageNo={isResetPage} resetSelection={isResetSelection} - index={curIdx} + index={selectedRowIndex} /> {/* 측정정보 테이블 */} @@ -201,7 +205,7 @@ const Ssc = ({ featureData, isMainSsc, chmbrXcnts, chmbrYdnts, onSaveClick }: { onPageChange={setCurPage} resetPageNo={isResetPage} resetSelection={isResetSelection} - index={curIdx} + index={selectedRowIndex} > {/* 커스텀 헤더 */} @@ -229,6 +233,7 @@ const Ssc = ({ featureData, isMainSsc, chmbrXcnts, chmbrYdnts, onSaveClick }: { total={totalDetailCount} cellClick={undefined} onPageChange={setCurDetailPage} + resetPageNo={isResetDetailPage} /> ) From 416677dcf444a02a26067816bc36f64f35f0def2 Mon Sep 17 00:00:00 2001 From: swcho Date: Thu, 31 Jul 2025 17:08:28 +0900 Subject: [PATCH 4/4] =?UTF-8?q?feat,=20refactor:=20-=20=EC=A4=91=EC=A0=90?= =?UTF-8?q?=EC=9A=B0=EC=88=98=ED=86=A0=EC=8B=A4=20=EC=9C=84=EA=B2=BD?= =?UTF-8?q?=EB=8F=84=20=EC=86=8C=EC=88=98=EC=A0=90=20=EC=95=84=EB=9E=98=20?= =?UTF-8?q?=EB=84=A4=EC=9E=90=EB=A6=AC=EA=B9=8C=EC=A7=80=EB=A7=8C=20?= =?UTF-8?q?=ED=91=9C=EC=8B=9C=20-=20=EC=A4=91=EC=A0=90=EC=9A=B0=EC=88=98?= =?UTF-8?q?=ED=86=A0=EC=8B=A4=20=EC=9C=84=EA=B2=BD=EB=8F=84=20=EB=B3=80?= =?UTF-8?q?=EC=88=98=20=ED=83=80=EC=9E=85=20=EC=84=A0=EC=96=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app/(map-layout)/map/components/common/index.ts | 2 ++ .../app/(map-layout)/map/components/common/table.ts | 3 ++- .../popupComponent/featureClickEventPopup.tsx | 11 +++-------- .../app/components/lib/utils/formatDisplayValue.tsx | 13 +++++++++---- 4 files changed, 16 insertions(+), 13 deletions(-) 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 9860b211a..e328cf983 100644 --- a/apps/sn/app/(map-layout)/map/components/common/index.ts +++ b/apps/sn/app/(map-layout)/map/components/common/index.ts @@ -12,6 +12,8 @@ type LayerComponentProps = { rainMeasureData?: any; onSaveClick?: () => void; onFormDataChange?: (data: any) => void; // 추가 + chmbrXcnts: string; + chmbrYdnts: string; }; type LayerContentMap = { [key: string]: { diff --git a/apps/sn/app/(map-layout)/map/components/common/table.ts b/apps/sn/app/(map-layout)/map/components/common/table.ts index 51ef93ddf..5604d1b55 100644 --- a/apps/sn/app/(map-layout)/map/components/common/table.ts +++ b/apps/sn/app/(map-layout)/map/components/common/table.ts @@ -686,5 +686,6 @@ export const numberFields = [ 'swrPplEqpAr', 'swrTrtPopl', 'weirHg', 'weirLt', 'precdngDry', 'rainFall', 'cntncTime', 'rainIn', 'mesureIntrvl', 'qltwtrCo', 'rnysnFvlc', 'clarFvlc', - 'bizAmt', 'count' + 'bizAmt', 'count', + 'chmbr_xcnts', 'chmbr_ydnts' ]; \ No newline at end of file diff --git a/apps/sn/app/(map-layout)/map/components/popupComponent/featureClickEventPopup.tsx b/apps/sn/app/(map-layout)/map/components/popupComponent/featureClickEventPopup.tsx index 679122d6b..cf0dd303b 100644 --- a/apps/sn/app/(map-layout)/map/components/popupComponent/featureClickEventPopup.tsx +++ b/apps/sn/app/(map-layout)/map/components/popupComponent/featureClickEventPopup.tsx @@ -21,7 +21,6 @@ const FeatureClickEventPopup = ({ onClose, featureData }: { onClose: () => void, const [layerNm, setLayerNm] = useState(""); // 레이어 이름 상태 const [layerSpecificNm, setLayerSpecificNm] = useState(""); // 레이어 이름 상태 const [tableData, setTableData] = useState(null); // 피처 데이터 - const [rainMeasureData, setRainMeasureData] = useState([]); // 강우/측정 측정 정보 const [headlist, setHeadlist] = useState<{ id: string; title: string; }[]>([]); // 컬럼리스트 변경상태 const [headlist2, setHeadlist2] = useState<{ id: string; title: string; }[]>([]); // 컬럼리스트 변경상태 const [buttonChk, setButtonChk] = useState(true) @@ -35,8 +34,8 @@ const FeatureClickEventPopup = ({ onClose, featureData }: { onClose: () => void, const { setIsOpen: setIsModalRdii } = useRdiiChartModalStore(); const [isClicked, setIsClicked] = useState(true); // 클릭 여부 상태 const [isLoading, setIsLoading] = useState(false); // 로딩 상태 - const [chmbrXcnts, setChmbrXcnts] = useState(); // 로딩 상태 - const [chmbrYdnts, setChmbrYdnts] = useState(); // 로딩 상태 + const [chmbrXcnts, setChmbrXcnts] = useState(''); // 로딩 상태 + const [chmbrYdnts, setChmbrYdnts] = useState(''); // 로딩 상태 // 🎯 관로관리번호 추출 const pplMngNo = featureData?.values_?.fclt_mng_no || ""; @@ -406,7 +405,7 @@ const FeatureClickEventPopup = ({ onClose, featureData }: { onClose: () => void,
- {/* 🎯 하수관로일 때만 Infil/RDII 버튼 표시 */} + {/* 하수관로일 때만 Infil/RDII 버튼 표시 */} {layerNm === '하수관로' && ( <>