From 127fb4114539fa2f54f3c9925fc94fd487fa2f0e Mon Sep 17 00:00:00 2001 From: ljpark Date: Wed, 8 Jul 2026 17:05:57 +0900 Subject: [PATCH] =?UTF-8?q?dm:=20=EC=88=98=EC=9A=94=EC=8B=A0=EC=B2=AD?= =?UTF-8?q?=ED=98=84=ED=99=A9=20api=20=EC=88=98=EC=A0=95,=20=EC=88=98?= =?UTF-8?q?=EC=A0=95=EC=8B=9C=20=EB=B9=84=EB=B2=88=20=EC=B2=98=EB=A6=AC,?= =?UTF-8?q?=EB=AC=B4=ED=95=9C=EB=A3=A8=ED=94=84=EC=B2=98=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/dm/app/store/sdmMng/index.tsx | 2 +- .../matMng/coMng/coSttn/page.tsx | 20 ++++++++--- .../prfmncReg/pbnstPrfmncReg/page.tsx | 33 +++++++++++-------- .../store/prfmncReg/pbnstPrfmncReg/index.tsx | 2 +- .../coSttnDetailPopup/coSttnDetailPopup.tsx | 4 ++- 5 files changed, 41 insertions(+), 20 deletions(-) diff --git a/apps/dm/app/store/sdmMng/index.tsx b/apps/dm/app/store/sdmMng/index.tsx index 2627909b6..c51209515 100644 --- a/apps/dm/app/store/sdmMng/index.tsx +++ b/apps/dm/app/store/sdmMng/index.tsx @@ -558,7 +558,7 @@ const getDemandCompList = async (searchText: string, pageCnt: number) => { const getSdmInfoStatusList = async (dmdInfoId: string) => { try { - const url = '/reuseFc/request/' + dmdInfoId; + const url = '/reuseFc/request/' + dmdInfoId + '?infoListYn=Y'; const res = await getFetch(fetchType.WR, url); return res?.data || []; } catch (error) { diff --git a/apps/wr/app/(with-layout)/matMng/coMng/coSttn/page.tsx b/apps/wr/app/(with-layout)/matMng/coMng/coSttn/page.tsx index b56e7a230..deeb4ca77 100644 --- a/apps/wr/app/(with-layout)/matMng/coMng/coSttn/page.tsx +++ b/apps/wr/app/(with-layout)/matMng/coMng/coSttn/page.tsx @@ -70,6 +70,16 @@ export default function CoSttn() { const [updateData, setUpdateData] = useState(); const [isResetSelection, setIsResetSelection] = useState(false); + const sanitizeDemandForPopup = useCallback((data?: DemandCompType) => { + if (!data) { + return undefined; + } + + const nextData = { ...data }; + delete nextData.dmdAplyPswd; + return nextData; + }, []); + const getSelCity = useCallback( (val: string | number) => { const cityValue = String(val); @@ -330,11 +340,13 @@ export default function CoSttn() { total={coSttnResCount || 0} cellClick={async(index: number | undefined) => { const uuid = await getMyUUID(); - const updateData = coSttnRes[index as number]; - if (updateData && typeof uuid === "string") { - updateData.mdfr = uuid; + const selectedData = sanitizeDemandForPopup( + coSttnRes[index as number] + ); + if (selectedData && typeof uuid === "string") { + selectedData.mdfr = uuid; } - setUpdateData(coSttnRes[index as number]); + setUpdateData(selectedData); }} onPageChange={(page) => { const con = diff --git a/apps/wr/app/(with-layout)/ruseFcltMng/prfmncReg/pbnstPrfmncReg/page.tsx b/apps/wr/app/(with-layout)/ruseFcltMng/prfmncReg/pbnstPrfmncReg/page.tsx index fca1b511a..8308d9e4e 100644 --- a/apps/wr/app/(with-layout)/ruseFcltMng/prfmncReg/pbnstPrfmncReg/page.tsx +++ b/apps/wr/app/(with-layout)/ruseFcltMng/prfmncReg/pbnstPrfmncReg/page.tsx @@ -35,7 +35,7 @@ import { } from "@common/business_components/ui"; import ListDiv from "@common/business_components/ui/list_div"; import { Button, Label, Table, TableBody, TableHeader } from "@common/components/ui"; -import { useCallback, useEffect, useMemo, useState } from "react"; +import { useCallback, useEffect, useMemo, useRef, useState } from "react"; import { useAlertStore } from "@/src/shared/lib"; import { useTranslation } from "react-i18next"; import { headMakeprfmnc } from "../chkgdnReg/TableHead"; @@ -150,6 +150,7 @@ export default function PrfmncPrfmncReg() { const [searchTxt, setSearchTxt] = useState(""); const [selectedFacilityId, setSelectedFacilityId] = useState(""); const [selectedIndex, setSelectedIndex] = useState(0); + const [shouldLoadFirstRow, setShouldLoadFirstRow] = useState(true); const [inputData, setInputData] = useState([]); const [isExcelOpen, setIsExcelOPen] = useState<{ isModal: boolean; @@ -159,6 +160,7 @@ export default function PrfmncPrfmncReg() { const { confirm } = useConfirm(); const alert = useAlertStore((state) => state.setMessage); const { t } = useTranslation("base"); + const prevSearchYearRef = useRef(searchYear); const bdstTable = useMemo( () => @@ -190,7 +192,6 @@ export default function PrfmncPrfmncReg() { const detail = await getPbnstPrfRegDtl(searchYear, facilityId); if (detail) { - setSelectedFacilityId(facilityId); setIsExcelOPen((prev) => ({ ...prev, data: detail, @@ -203,6 +204,7 @@ export default function PrfmncPrfmncReg() { const handleSearch = useCallback(() => { if (!laeSeCd) return; + setShouldLoadFirstRow(true); setIsReset(true); }, [laeSeCd]); @@ -233,6 +235,7 @@ export default function PrfmncPrfmncReg() { useEffect(() => { if (!laeSeCd) return; + setShouldLoadFirstRow(true); void prfmncHasuInit(1, laeSeCd); }, [laeSeCd, prfmncHasuInit]); @@ -245,20 +248,21 @@ export default function PrfmncPrfmncReg() { return; } - const nextIndex = Math.max( - prfmncRes.findIndex((item) => item.pbnstRuseFcltId === selectedFacilityId), - 0 - ); - const nextFacility = prfmncRes[nextIndex]; - if (!nextFacility) { - return; - } + if (!shouldLoadFirstRow) return; - setSelectedIndex(nextIndex); - void loadDetail(nextFacility.pbnstRuseFcltId); - }, [loadDetail, prfmncRes]); + const firstFacility = prfmncRes[0]; + if (!firstFacility) return; + + setSelectedIndex(0); + setSelectedFacilityId(firstFacility.pbnstRuseFcltId); + void loadDetail(firstFacility.pbnstRuseFcltId); + setShouldLoadFirstRow(false); + }, [loadDetail, prfmncRes, shouldLoadFirstRow]); useEffect(() => { + if (prevSearchYearRef.current === searchYear) return; + + prevSearchYearRef.current = searchYear; if (!selectedFacilityId) return; void loadDetail(selectedFacilityId); }, [loadDetail, searchYear, selectedFacilityId]); @@ -356,9 +360,12 @@ export default function PrfmncPrfmncReg() { if (!selected) return; setSelectedIndex(index); + setSelectedFacilityId(selected.pbnstRuseFcltId); + setShouldLoadFirstRow(false); void loadDetail(selected.pbnstRuseFcltId); }} onPageChange={(page: number) => { + setShouldLoadFirstRow(true); if (searchTxt.trim().length > 0) { void prfmncHasuNmSearch(page, laeSeCd, searchTxt); } else { diff --git a/apps/wr/app/store/prfmncReg/pbnstPrfmncReg/index.tsx b/apps/wr/app/store/prfmncReg/pbnstPrfmncReg/index.tsx index cadba69d4..7b66a5b44 100644 --- a/apps/wr/app/store/prfmncReg/pbnstPrfmncReg/index.tsx +++ b/apps/wr/app/store/prfmncReg/pbnstPrfmncReg/index.tsx @@ -20,7 +20,7 @@ export type pbnstPrfmncState = { isInit: boolean; pbnstPrfmncHeadList: TableUpperProps[]; monthHeadList: TableUpperProps[]; - prfmncRes: PbnstPrfRegListType[]; + prfmncRes: PbnstPrfRegListType[]; // 하수재이용시설 목록 prfmncResCount: number; excelList: number[]; pageKey: number; diff --git a/apps/wr/components/ui/map/detailPopup/coSttnDetailPopup/coSttnDetailPopup.tsx b/apps/wr/components/ui/map/detailPopup/coSttnDetailPopup/coSttnDetailPopup.tsx index bb655f923..79cd6dc30 100644 --- a/apps/wr/components/ui/map/detailPopup/coSttnDetailPopup/coSttnDetailPopup.tsx +++ b/apps/wr/components/ui/map/detailPopup/coSttnDetailPopup/coSttnDetailPopup.tsx @@ -7,6 +7,8 @@ export default function CoSttnDetailPopup({isDetail} :{isDetail:DemandCompType}) code } = useWrStore((state) => state); + const detailData = { ...isDetail }; + delete detailData.dmdAplyPswd; return(
@@ -21,7 +23,7 @@ export default function CoSttnDetailPopup({isDetail} :{isDetail:DemandCompType}) console.log(data) }} bodyClassNm={"w-full mx-auto bg-background rounded-lg shadow-md p-6"} - updateList={isDetail} + updateList={detailData} readOnly={true} openNetwork={false} >