From 90d6f415269f108a4e97853f3c177a70806f3a24 Mon Sep 17 00:00:00 2001 From: leedj312 Date: Tue, 24 Jun 2025 10:05:58 +0900 Subject: [PATCH 01/12] =?UTF-8?q?=EB=B9=97=EB=AC=BC=20=EC=9E=91=EC=97=85?= =?UTF-8?q?=EC=A4=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/wr/app/ruseFcltMng/fcltReg/htdflReg/page.tsx | 4 ++-- .../app/ruseFcltMng/prfmncReg/chkgdnReg/page.tsx | 1 - apps/wr/app/store/matDmd/ruseRvwHstry/index.tsx | 14 +++++--------- .../ui/form/fcltReg/rainReg/rainRegForm.tsx | 1 + 4 files changed, 8 insertions(+), 12 deletions(-) diff --git a/apps/wr/app/ruseFcltMng/fcltReg/htdflReg/page.tsx b/apps/wr/app/ruseFcltMng/fcltReg/htdflReg/page.tsx index 8cb85e9fb..8227e0347 100644 --- a/apps/wr/app/ruseFcltMng/fcltReg/htdflReg/page.tsx +++ b/apps/wr/app/ruseFcltMng/fcltReg/htdflReg/page.tsx @@ -40,7 +40,7 @@ export default function Home() { useEffect(() => { if (!htdfl.isInit) { - initHtdfl('41'); + initHtdfl('0'); } }, [htdfl.isInit, initHtdfl]); @@ -82,7 +82,7 @@ export default function Home() { setBdstChgProps({ isOpen: true, chgBuilding: chgBuilding }); }; useEffect(() => { - getHtdflBdstData(pageNation, "41"); + getHtdflBdstData(pageNation, "0"); }, [pageNation]); return ( diff --git a/apps/wr/app/ruseFcltMng/prfmncReg/chkgdnReg/page.tsx b/apps/wr/app/ruseFcltMng/prfmncReg/chkgdnReg/page.tsx index 3517adfc3..5e807d2e1 100644 --- a/apps/wr/app/ruseFcltMng/prfmncReg/chkgdnReg/page.tsx +++ b/apps/wr/app/ruseFcltMng/prfmncReg/chkgdnReg/page.tsx @@ -72,7 +72,6 @@ export default function Page() { if (!rainChkgdn.isInit) { rainChkInit(new Date().getFullYear().toString(), "0"); isRainSttn(false) - setIsModal({ data: {}, open: false }); setIsRegExcel(false); } diff --git a/apps/wr/app/store/matDmd/ruseRvwHstry/index.tsx b/apps/wr/app/store/matDmd/ruseRvwHstry/index.tsx index 20eded05f..3338bc467 100644 --- a/apps/wr/app/store/matDmd/ruseRvwHstry/index.tsx +++ b/apps/wr/app/store/matDmd/ruseRvwHstry/index.tsx @@ -78,14 +78,13 @@ const irvwHistInit = async ( pageCnt: number, startYear: string, endYear: string, - sggCd?: string ) => { let url = `/reuseFc/request/infoList/matched/${pageNo}/${pageCnt}/${startYear}/${endYear}`; - console.log("sggCd ", sggCd); - if (sggCd) { - url += `/${sggCd}`; - } + // console.log("sggCd ", sggCd); + // if (sggCd) { + // url += `/${sggCd}`; + // } const rvwHistRes = await getFetch(fetchType.WR, url); @@ -108,7 +107,7 @@ export const ruseHstryActionsExport: (set: any) => ruseHstryActions = ( pageCnt, startYear, endYear, - sggCd + // sggCd ); return set((state: ruseHstryState) => ({ @@ -135,7 +134,6 @@ export const ruseHstryActionsExport: (set: any) => ruseHstryActions = ( 10, new Date().getFullYear().toString(), new Date().getFullYear().toString(), - "0" ); return set((state: ruseHstryState) => ({ ...state, @@ -225,8 +223,6 @@ export const ruseHstryActionsExport: (set: any) => ruseHstryActions = ( 10, new Date().getFullYear().toString(), new Date().getFullYear().toString(), - "0", - '0' ); } } catch (e) { diff --git a/apps/wr/components/ui/form/fcltReg/rainReg/rainRegForm.tsx b/apps/wr/components/ui/form/fcltReg/rainReg/rainRegForm.tsx index 8c6f5f1db..8b9c745e1 100644 --- a/apps/wr/components/ui/form/fcltReg/rainReg/rainRegForm.tsx +++ b/apps/wr/components/ui/form/fcltReg/rainReg/rainRegForm.tsx @@ -147,6 +147,7 @@ export default function RainRegForm({ ? new Date(field.value) : new Date(), // Provide a default Date value onChange: (date) => field.onChange(date), + }} selectClass={"w-full"} /> From b8dc4ed3b354c46931c388ca59db2f8f39723bba Mon Sep 17 00:00:00 2001 From: YangJinSoo94 Date: Tue, 24 Jun 2025 13:31:23 +0900 Subject: [PATCH 02/12] =?UTF-8?q?=EA=B1=B4=EB=AC=BC=EB=93=B1=EB=A1=9D=20?= =?UTF-8?q?=EC=8B=9C=EB=8F=84=20=EB=B3=80=EA=B2=BD=EC=8B=9C=20=EC=8B=9C?= =?UTF-8?q?=EA=B5=B0=EA=B5=AC=20=EC=A0=84=EC=B2=B4=20=EC=84=B8=ED=8C=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/ui/modal/fcltReg/bdstRegModal/bdstRegModal.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/wr/components/ui/modal/fcltReg/bdstRegModal/bdstRegModal.tsx b/apps/wr/components/ui/modal/fcltReg/bdstRegModal/bdstRegModal.tsx index f60fb8620..315f9397f 100644 --- a/apps/wr/components/ui/modal/fcltReg/bdstRegModal/bdstRegModal.tsx +++ b/apps/wr/components/ui/modal/fcltReg/bdstRegModal/bdstRegModal.tsx @@ -45,7 +45,7 @@ export function BdstReg({ moType }: BdstRegProps) { const cityValue = String(val); // Ensure val is treated as a string const data = getCity(cityValue, code.sggCd); setSelectSgg(data); - + getSgg(data[0]?.val || ""); setObjSearch({ city: cityValue, sgg: '' }); }; @@ -111,6 +111,7 @@ export function BdstReg({ moType }: BdstRegProps) { selectClass={selectClass} selectArray={selectSgg || []} onSelectValue={getSgg} + value={objSearch.sgg || ""} > {" "} From 3f0c3126e9b685e19916ea47da3407428543b863 Mon Sep 17 00:00:00 2001 From: leedj312 Date: Tue, 24 Jun 2025 19:14:47 +0900 Subject: [PATCH 03/12] =?UTF-8?q?=ED=95=98=EC=88=98=EC=9E=AC=EC=9D=B4?= =?UTF-8?q?=EC=9A=A9=20=EC=8B=9C=EC=84=A4=20=ED=85=8C=EC=8A=A4=ED=8A=B8=20?= =?UTF-8?q?=EC=A4=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app/ruseFcltMng/fcltReg/pbnstReg/page.tsx | 120 ++- .../store/prfmncReg/pbnstPrfmncReg/index.tsx | 12 +- .../ruseFcltMng/fcltReg/pbnstReg/index.tsx | 91 +- .../ruseFcltMng/fcltReg/pbnstReg/type.tsx | 4 +- .../fcltReg/pbnstReg/buseReg/bugRegForm.tsx | 986 +++++++++--------- .../fcltReg/pbnstReg/mngReg/mngRegForm.tsx | 72 +- .../ui/form/fcltReg/rainReg/rainRegForm.tsx | 2 + .../fcltReg/pbnstRegModal/pbnstRegModal.tsx | 50 +- .../ruseMngTableForm/ruseMngTableForm.tsx | 7 +- 9 files changed, 677 insertions(+), 667 deletions(-) diff --git a/apps/wr/app/ruseFcltMng/fcltReg/pbnstReg/page.tsx b/apps/wr/app/ruseFcltMng/fcltReg/pbnstReg/page.tsx index 3c489837d..7638e6cb4 100644 --- a/apps/wr/app/ruseFcltMng/fcltReg/pbnstReg/page.tsx +++ b/apps/wr/app/ruseFcltMng/fcltReg/pbnstReg/page.tsx @@ -42,14 +42,12 @@ export default function PublicReuseFaciltyInsert() { searchFclts, pubHasuInit, pbnstRegClick, - pbnstMngData, pbnstRuseFcltUpdate, pubHasuSearch, pbnstRuseBizUpdate, } = useWrStore((state) => state); const { pubFacHeadList, pbnstHasuRes, pbnstRes } = pbnst; const [currentTab, setCurrentTab] = useState("mng"); - const [pbnstBiz, setPbnstBiz] = useState(); const [isRuseReg, setIsRuseReg] = useState<{ isModal: boolean; data: pubHasuType; @@ -61,18 +59,12 @@ export default function PublicReuseFaciltyInsert() { const [bdstTable, setbdstTable] = useState(); const [selectRow, setSelectRow] = useState(); - // const form = useForm>({ - // resolver: zodResolver(pbnstRegArrayZod), - // defaultValues: pbnstRegArrayZod.parse([]), - // mode: "onChange", - // }); - const form = useForm<{ items: z.infer[]; }>({ resolver: zodResolver(z.object({ items: pbnstRegArrayZod })), - defaultValues: { items: pbnstRegArrayZod.parse([]) }, - mode:"onChange" + // defaultValues: { items: pbnstRegArrayZod.parse([]) }, + mode: "onChange", }); const { fields: items, @@ -84,21 +76,31 @@ export default function PublicReuseFaciltyInsert() { }); useEffect(() => { if (!pbnst.isInit) { - pubHasuInit("1", "11"); + pubHasuInit("1", "0"); } }, [pbnst.isInit, pubHasuInit]); const onSubmit = async (valuse: { items: PbnstRegArrrayType }) => { - const data = writeRgtrAndMdfr(valuse.items); let bizs = [] as fcBizType[]; data.forEach((fclt) => { bizs = [...bizs, ...fclt.fcBizs]; }); + const pbnst =data.map((fclt) => { + return({ + pbnstRuseFcltPk: fclt.pbnstRuseFcltPk, + fcltCpct: fclt.fcltCpct, + ruseCpct: fclt.ruseCpct, + splyExtraCpct: fclt.splyExtraCpct, + rgtr: fclt.rgtr, + mdfr: fclt.mdfr, + fcFiles: fclt.fcFiles, + fcOpers: fclt.fcOpers, + }) + }) + await pbnstRuseFcltUpdate(pbnst as customPbnst[]); - await pbnstRuseFcltUpdate(data); - - await pbnstRuseBizUpdate(bizs); + await pbnstRuseBizUpdate(bizs); }; useEffect(() => { @@ -114,9 +116,8 @@ export default function PublicReuseFaciltyInsert() { const cellClick = (val: number | undefined) => { if (val === undefined) return; const selectRow = pbnstHasuRes?.[val]; - setSelectRow(pbnstHasuRes?.[val]) + setSelectRow(pbnstHasuRes?.[val]); if (selectRow) { - //setIsRuseReg({ ...isRuseReg, data: selectRow }); pbnstRegClick(selectRow); } }; @@ -126,8 +127,13 @@ export default function PublicReuseFaciltyInsert() { }; useEffect(() => { - if (pbnst.pbnstRes) { + if (pbnst.pbnstRes&& pbnst.pbnstRes?.length>0) { + console.log("pbnst.pbnstRes", pbnstRes); form.reset({ items: pbnstRegArrayZod.parse(pbnst.pbnstRes) }); + }else{ + + console.log("pbnst.pbnstRes is null", pbnstRes); + form.reset({ items: [] }); } }, [pbnst.pbnstRes]); useEffect(() => { @@ -137,39 +143,55 @@ export default function PublicReuseFaciltyInsert() { }, [indexMng]); useEffect(() => { - console.log("form errors:", form.formState.errors); - }, [form.formState.errors]); + console.log("form errors:", form.formState.errors); + }, [form.formState.errors]); + + const appendPbnstRuseFclt = useCallback(() => { + const selecTableRow = selectRow; - const appendPbnstRuseFclt = useCallback(() => { if (pbnstRes && pbnstRes.length > 0) { const lastPbnst = pbnstRes[pbnstRes.length - 1]; - console.log('lastPbnst.swtrmtFcltFk ', lastPbnst) - if(lastPbnst){ + if (lastPbnst && selecTableRow) { + append( pbnstRegZod.parse({ - pbnstRuseFcltPk: String(lastPbnst.pbnstRuseFcltPk) + String(pbnstRes.length + 1), + pbnstRuseFcltPk: + String(selecTableRow.bscFctCd) + String(pbnstRes.length + 1), ruseUtztnFcltNm: "", - fcBizs: [fcBizSchema.parse({pbnstRuseFcltFk:String(lastPbnst.pbnstRuseFcltPk) + String(pbnstRes.length + 1),cycl:1})] as fcBizType[], + fcBizs: [ + fcBizSchema.parse({ + pbnstRuseFcltFk: + String(lastPbnst.pbnstRuseFcltPk) + + String(pbnstRes.length + 1), + cycl: 1, + }), + ] as fcBizType[], }) ); - setIsRuseReg({ ...isRuseReg, isModal: true }) + setIsRuseReg({ ...isRuseReg, isModal: true }); } } else { - if(selectRow){ + if (selecTableRow) { append( - pbnstRegZod.parse({ - pbnstRuseFcltPk: String(selectRow.bscFctCd)+'1', - ruseUtztnFcltNm: "", - regDt: null, - mdfcnDt: null, - fcBizs: [fcBizSchema.parse({pbnstRuseFcltFk:String(selectRow.bscFctCd)+'1',cycl:1})] as fcBizType[], - }) - ); - setIsRuseReg({ ...isRuseReg, isModal: true }) + pbnstRegZod.parse({ + pbnstRuseFcltPk: String(selecTableRow.bscFctCd)+'1', + ruseUtztnFcltNm: "", + regDt: null, + mdfcnDt: null, + fcBizs: [fcBizSchema.parse({pbnstRuseFcltFk:String(selecTableRow.bscFctCd)+'1',cycl:1})] as fcBizType[], + }) + ) + setIsRuseReg({ ...isRuseReg, isModal: true }); } } - },[pbnstRegZod,pbnstRes,append,selectRow]) + }, [pbnstRegZod, pbnstRes, append, selectRow, form]); + useEffect(() => { + // console.log(" page getgetvaslue ", form.getValues()); + }, [form.getValues()]); + + + return ( <> @@ -192,8 +214,8 @@ export default function PublicReuseFaciltyInsert() { size={"sm"} onClick={(e) => { searchTxt && searchTxt?.length > 0 - ? pubHasuSearch("1", "11", searchTxt) - : pubHasuInit("1", "11"); + ? pubHasuSearch("1", "0", searchTxt) + : pubHasuInit("1", "0"); }} > 조회 @@ -202,13 +224,14 @@ export default function PublicReuseFaciltyInsert() { size={"sm"} className="" onClick={() => { - pbnstMngData([] as customPbnst[]); - if(!selectRow){ - toast.error("하수리시시설을 테이블을 선택하고 등록버튼을 눌러주세요") - return - }else{ - appendPbnstRuseFclt() - + // pbnstMngData([] as customPbnst[]); + if (!selectRow) { + toast.error( + "하수리시시설을 테이블을 선택하고 등록버튼을 눌러주세요" + ); + return; + } else { + appendPbnstRuseFclt(); } }} > @@ -260,6 +283,7 @@ export default function PublicReuseFaciltyInsert() { formType="update" form={form} setIndexMng={(index: number) => { + console.log("setIndexMng", index); setIndexMng(index); }} indexMng={indexMng} @@ -286,10 +310,10 @@ export default function PublicReuseFaciltyInsert() { data={isRuseReg.data || ({} as customPbnst)} > } - bodyClass="w-[68vw] max-w-none h-[90vh]" + bodyClass="w-[68vw] max-w-none h-[90vh]" open={isRuseReg.isModal} onOpenChange={(open) => { - remove(form.getValues("items").length - 1) + remove(form.getValues("items").length - 1); setIsRuseReg({ data: {} as pubHasuType, isModal: open }); }} /> diff --git a/apps/wr/app/store/prfmncReg/pbnstPrfmncReg/index.tsx b/apps/wr/app/store/prfmncReg/pbnstPrfmncReg/index.tsx index e72d6def6..37c010890 100644 --- a/apps/wr/app/store/prfmncReg/pbnstPrfmncReg/index.tsx +++ b/apps/wr/app/store/prfmncReg/pbnstPrfmncReg/index.tsx @@ -4,6 +4,7 @@ import type { pubHasuType } from "../../ruseFcltMng/fcltReg/pbnstReg/type"; import type { FcPrfType, PrfType } from "./type"; import type { TableUpperProps } from "../../common/type/header"; import { ToastFormUi } from "@/components/ui/toast/toastFromUi"; +import toast from "react-hot-toast"; const pbnstPrfmncHeadList = pbnstPrfmncHeadListExport; const monthHeadList = monthHeadListExport; @@ -94,18 +95,13 @@ export const pbnstPrfmncActionsExport: (set: any) => pbnstPrfmncActions = ( console.log('ressponse ', ressponse) if(ressponse.status === 200){ - ToastFormUi({ - body: "하수재이용 시설 실적 등록이 완료되었습니다. ", - title: "하수재이용 시설 실적 등록", - }); + + toast.success("하수재이용 시설 실적 등록이 완료되었습니다.") } }catch(e){ console.log(e) - ToastFormUi({ - body: "하수재이용 시설 실적 등록이 실패하였습니다. ", - title: "하수재이용 시설 실적 등록", - }); + toast.error("하수재이용 시설 실적 등록이 실패하였습니다.") } }, diff --git a/apps/wr/app/store/ruseFcltMng/fcltReg/pbnstReg/index.tsx b/apps/wr/app/store/ruseFcltMng/fcltReg/pbnstReg/index.tsx index 9fde9c092..fb799c26c 100644 --- a/apps/wr/app/store/ruseFcltMng/fcltReg/pbnstReg/index.tsx +++ b/apps/wr/app/store/ruseFcltMng/fcltReg/pbnstReg/index.tsx @@ -24,6 +24,7 @@ import { fcOrgwtsHeadListExport, } from "./headList"; import type { TableUpperProps } from "@/app/store/common/type/header"; +import toast from "react-hot-toast"; const selectLabel: SelectDataType[] = [{ text: "test", val: "1" }]; const pubFacHeadList = pubFacHeadListExport; @@ -62,9 +63,9 @@ type pubFacActions = { appendRuseFclt(array: customPbnst[]): void; fileDelete: (atflCd: string) => void; fileDownLoad: (atflCd: string) => void; - pbnstMngData: (data: customPbnst[]) => void; - pbnstBizData(data: fcBizType): void; - getBizCycle: (pbnstObj: customPbnst) => void; + //pbnstMngData: (data: customPbnst[]) => void; + //pbnstBizData(data: fcBizType): void; + // getBizCycle: (pbnstObj: customPbnst) => void; getpbnstInsertIndex: (data: pbnstInsertIndex) => void; pbnstRuseFcltUpdate: (ruseRes: customPbnst[]) => void; pbnstRuseBizUpdate: (ruseRes: fcBizType[]) => void; @@ -100,14 +101,20 @@ const checkWrRegList = async () => { const hasuListFetch = async (page: string, sggOrCity: string, searchTxt?:string) => { const checkWrRegListRes = await checkWrRegList(); -let url = `/prcsFclt/ruseInfo/${page ? page : 1}/10/A/${sggOrCity ? sggOrCity : "11"}/0/1/SW`; + + console.log(' checkWrRegListRes ', checkWrRegListRes) +let url = `/prcsFclt/ruseInfo/${page ? page : 1}/10/A/${sggOrCity? sggOrCity : "11"}/0/1/SW`; + + +const data = checkWrRegListRes.filter((item:string) => item !== "") + console.log(' checkWrRegListRes ' ) if(searchTxt){ url= url +`/${searchTxt}` } const rainRes = await postFectch( url, - checkWrRegListRes, + data, fetchType.COMMON ); @@ -200,7 +207,6 @@ export const pubFacActionsExport: (set: any) => pubFacActions = (set: any) => { pbnstRegClick: async (pubHasuRes: pubHasuType) => { try { const pbnstRes = await initFetch(pubHasuRes.bscFctCd); - console.log('pbnstRes ' , pbnstRes) return set((state: pubFacState) => ({ ...state, pbnst: { @@ -234,14 +240,19 @@ export const pubFacActionsExport: (set: any) => pubFacActions = (set: any) => { const response = await postFectch( `/reuseFc/pubFc`, - JSON.stringify( pbnstRes) + pbnstRes ); + if( response.status === 200) { + toast.success(`${pbnstRes.ruseUtztnFcltNm} 하수재이용 시설이 등록되었습니다.`); + } + const pbnstHasuRes = await hasuListFetch('1', '0'); + return set((state: pubFacState) => ({ ...state, pbnst: { ...state.pbnst, - pbnstRes: response.data, + pbnstRes: pbnstHasuRes, isInit: false, }, })); @@ -334,41 +345,41 @@ export const pubFacActionsExport: (set: any) => pubFacActions = (set: any) => { } }, - pbnstMngData: (data: customPbnst[]) => { - if (data.length > 0) { - } - return set((state: pubFacState) => { - state.pbnst.pbnstMngRegData = data; - state.pbnst.pbnstBizCycle = - data.length <= 0 - ? [{ text: "없음", val: "1" }] - : state.pbnst.pbnstBizCycle; - return state; - }); - }, + // pbnstMngData: (data: customPbnst[]) => { + // if (data.length > 0) { + // } + // return set((state: pubFacState) => { + // state.pbnst.pbnstMngRegData = data; + // state.pbnst.pbnstBizCycle = + // data.length <= 0 + // ? [{ text: "없음", val: "1" }] + // : state.pbnst.pbnstBizCycle; + // return state; + // }); + // }, - pbnstBizData: (data: fcBizType) => { - return set((state: pubFacState) => { - if (state.pbnst.pbnstMngRegData) { - const regData = state.pbnst.pbnstMngRegData.find( - (item) => data.pbnstRuseFcltFk === item.pbnstRuseFcltPk - ); - if (regData) { - const bizIdx = regData.fcBizs.findIndex( - (item) => item.pbnstRuseFcltBizPk == data.pbnstRuseFcltBizPk - ); + // pbnstBizData: (data: fcBizType) => { + // return set((state: pubFacState) => { + // if (state.pbnst.pbnstMngRegData) { + // const regData = state.pbnst.pbnstMngRegData.find( + // (item) => data.pbnstRuseFcltFk === item.pbnstRuseFcltPk + // ); + // if (regData) { + // const bizIdx = regData.fcBizs.findIndex( + // (item) => item.pbnstRuseFcltBizPk == data.pbnstRuseFcltBizPk + // ); - if (bizIdx >= 0) { - regData.fcBizs[bizIdx] = data; - const pbnstData = state.pbnst.pbnstMngRegData - state.pbnst.pbnstMngRegData= [...pbnstData] + // if (bizIdx >= 0) { + // regData.fcBizs[bizIdx] = data; + // const pbnstData = state.pbnst.pbnstMngRegData + // state.pbnst.pbnstMngRegData= [...pbnstData] - } - } - } - return state; - }); - }, + // } + // } + // } + // return state; + // }); + // }, getpbnstInsertIndex: async (data: pbnstInsertIndex) => { return set((state: pubFacState) => { state.pbnst.pbnsUpdateIndex = data; diff --git a/apps/wr/app/store/ruseFcltMng/fcltReg/pbnstReg/type.tsx b/apps/wr/app/store/ruseFcltMng/fcltReg/pbnstReg/type.tsx index 0c3bb452c..a34985810 100644 --- a/apps/wr/app/store/ruseFcltMng/fcltReg/pbnstReg/type.tsx +++ b/apps/wr/app/store/ruseFcltMng/fcltReg/pbnstReg/type.tsx @@ -57,7 +57,7 @@ export type PbnstDemandComType = { dmdAplyPswd: string | ''; splyCpct: number | 0; splyFmYn:string|'Y' - dmdInfoFk:string|'' +// dmdInfoFk:string|'' } const pubHasuZod = z.object({ @@ -129,7 +129,7 @@ const fcOrgwtSchema = z.object({ }); const dmdColist = z.object({ - dmdInfoFk: z.string().default(''), + dmdInfoPk: z.string().default(''), dmdCoNm: z.string().default(''), daddr: z.string(), useUsgCd: z.string().nullish(), diff --git a/apps/wr/components/ui/form/fcltReg/pbnstReg/buseReg/bugRegForm.tsx b/apps/wr/components/ui/form/fcltReg/pbnstReg/buseReg/bugRegForm.tsx index 645a2fa07..df63b3520 100644 --- a/apps/wr/components/ui/form/fcltReg/pbnstReg/buseReg/bugRegForm.tsx +++ b/apps/wr/components/ui/form/fcltReg/pbnstReg/buseReg/bugRegForm.tsx @@ -11,7 +11,6 @@ import { } from "@/app/store/ruseFcltMng/fcltReg/pbnstReg/headList"; import { fcBizSchema, - type customPbnst, type fcBizType, type PbnstRegArrrayType, type ppInstlType, @@ -25,20 +24,9 @@ import { import FcOrgwtsRegModal from "@/components/ui/modal/fcltReg/fcOrgwtsRegModal/fcOrgwtsRegModal"; import RuseMngTable from "@/components/ui/table/pbnstReg/ruseMngTable/ruseMngTable"; import { SelectBox } from "@common/business_components"; -import { - FormUi, - SearchInputSelect, - UiModal, - type SelectDataType, -} from "@common/business_components/ui"; +import { DatePicker, FormUi, UiModal } from "@common/business_components/ui"; import { Form, FormField } from "@common/business_components/ui/form"; -import { - Button, - DataTable, - DatePicker, - Input, - Label, -} from "@common/components"; +import { Button, DataTable, Input, Label } from "@common/components"; import { useEffect, useRef, useState } from "react"; import { useFieldArray, useForm, type UseFormReturn } from "react-hook-form"; import MngRegFormDetail from "../mngReg/mngRegFormDetail/mngRegFormDetail"; @@ -47,10 +35,9 @@ import SearchInputText from "@/components/ui/searchInput/searchInput"; import SdmInsertForm from "@common/business_components/ui/sdmInsertForm"; import type { DemandCompType } from "@common/business_components/ui/sdmInsertForm/form"; import RuseMngTableForm from "@/components/ui/table/pbnstReg/ruseMngTableForm/ruseMngTableForm"; +import type { SelectDataType } from "@common/business_components"; export function PbnstBuseForm({ - formType, - firstBizData, indexMng = 0, indexBiz = 0, setIndexBiz, @@ -68,14 +55,17 @@ export function PbnstBuseForm({ code, pbnst, demandCompList, - pbnstBizData, getpbnstInsertIndex, appendRuseFclt, - getBizCycle, getDemandCompList, regDemandCompany, } = useWrStore((state) => state); const { pbnstBizCycle, pbnstRes } = pbnst; + const { fields: fcBizs, append: appendBiz } = useFieldArray({ + control: form.control, + name: `items.${indexMng}.fcBizs`, + }); + const [bizCycle, setBizCycle] = useState("1"); const [ppiSelectList, setPpiSelectList] = useState<[{ name: string; val: SelectDataType[] }]>(); @@ -95,7 +85,6 @@ export function PbnstBuseForm({ data: DemandCompType; }>({ isMoal: false, data: {} as DemandCompType }); - useEffect(() => { const total = (form.getValues(`items.${indexMng}.fcBizs.${indexBiz}.gvsbs`) ?? 0) + @@ -106,43 +95,29 @@ export function PbnstBuseForm({ }, [ form.getValues(`items.${indexMng}.fcBizs.${indexBiz}.gvsbs`), form.getValues(`items.${indexMng}.fcBizs.${indexBiz}.lcep`), - form.getValues(`items.${indexMng}.fcBizs.${indexBiz}.cusrAlotm`) + form.getValues(`items.${indexMng}.fcBizs.${indexBiz}.cusrAlotm`), ]); - // const form = useForm({ - // resolver: zodResolver(fcBizSchema), - // defaultValues: - // formType === "reg" && - // pbnst.pbnstMngRegData && - // pbnst.pbnstMngRegData[0]?.fcBizs - // ? (pbnst.pbnstMngRegData[0].fcBizs[0] ?? {}) - // : formType === "update" && - // typeof pbnst.pbnsUpdateIndex.biz === "number" && - // pbnst.pbnsUpdateIndex.biz >= 0 && - // pbnst.pbnstRes - // ? pbnst.pbnstRes[pbnst.pbnsUpdateIndex.mng]?.fcBizs[ - // pbnst.pbnsUpdateIndex.biz - // ] - // : fcBizSchema.parse({}), - // mode: "onChange", - // }); - - + // fcBizs 데이터가 변경될 때마다 차수 선택 목록을 업데이트합니다. useEffect(() => { - if (form) { - const cycleLength = form.getValues(`items.${indexMng}.fcBizs`).length; - setSelectBizCycle( - Array.from({ length: cycleLength }, (_, index) => ({ - text: `${index + 1}차`, // ✅ index + 1 - val: index, // 이건 그대로 유지 (value로는 0부터 시작) - })) - ); + const cycleLength = fcBizs.length; + const newSelectBizCycle = Array.from( + { length: cycleLength }, + (_, index) => ({ + text: `${index + 1}차`, + val: index, + }) + ); + setSelectBizCycle(newSelectBizCycle); + + // 현재 차수 인덱스가 유효하지 않게 되면 마지막 인덱스로 조정합니다. + if (indexBiz >= cycleLength && cycleLength > 0) { + setIndexBiz(cycleLength - 1); } - }, [indexMng, form]); + }, [fcBizs, indexBiz, setIndexBiz]); // 2. Define a submit handler. function addRuseFcltObj() { const formRuse = form.getValues(`items.${indexMng}`); - const formBizs = form.getValues(`items.${indexMng}.fcBizs`); const pbnstBizCycle = formBizs.length; @@ -154,25 +129,13 @@ export function PbnstBuseForm({ pplInstls: undefined, fcDemands: undefined, }); - const index = pbnst.pbnsUpdateIndex.mng; appendBiz(newItem); - const cycleLength = form.getValues(`items.${indexMng}.fcBizs`).length; - setSelectBizCycle( - Array.from({ length: cycleLength }, (_, index) => ({ - text: `${index + 1}차`, // ✅ index + 1 - val: index, // 이건 그대로 유지 (value로는 0부터 시작) - })) - ); + setIndexBiz(pbnstBizCycle); // 새로 추가된 차수로 포커스 이동 } useEffect(() => { - console.log("form ", form.watch()); + //console.log("form ", form.watch()); }, [form.formState]); - const { fields: fcBizs, append: appendBiz } = useFieldArray({ - control: form.control, - name: `items.${indexMng}.fcBizs`, - }); - const { fields: fcDemands, append: appendDemand, @@ -186,7 +149,6 @@ export function PbnstBuseForm({ control: form.control, name: `items.${indexMng}.fcBizs.${indexBiz}.fcOrgwts`, }); - console.log(" fcOrgwtFiled ", fcOrgwtFiled); const { fields: pplInstls, append: appendPpl, @@ -202,10 +164,6 @@ export function PbnstBuseForm({ } }, [ppiYn, indexMng, indexBiz]); - useEffect(() => { - console.log("pbnst. bug pbnstMngRegData ", pbnst.pbnstMngRegData); - }, [pbnst.pbnstMngRegData]); - const plusHist = () => { if ( form.getValues(`items.${indexMng}.fcBizs.${indexBiz}.pbnstRuseFcltBizPk`) @@ -245,7 +203,7 @@ export function PbnstBuseForm({ form.getValues( `items.${indexMng}.fcBizs.${indexBiz}.pbnstRuseFcltFk` ) ?? "", - dmdInfoFk: "", + dmdInfoPk: "", //telno: "", }); }; @@ -278,9 +236,6 @@ export function PbnstBuseForm({ } }, [code]); - useEffect(() => { - console.log(" demandCompList ", demandCompList); - }, [demandCompList]); useEffect(() => { console.log("form errors:", form.formState.errors); }, [form.formState.errors]); @@ -295,441 +250,488 @@ export function PbnstBuseForm({ setSumCpct(sum); }, [form.formState, indexMng, indexBiz]); + // // 차수별 정보(fcBizs)가 하나도 없을 경우 플레이스홀더 UI를 보여줍니다. + // if (fcBizs.length === 0) { + // return ( + //
+ //

등록된 차수별 정보가 없습니다.

+ //

아래 버튼을 눌러 신규 차수 정보를 등록해주세요.

+ // + //
+ // ); + // } + + const pbnstBiz = form.watch(`items.${indexMng}.fcBizs`); return ( <> -
- {/* 차수별 등록 현황 폼 */} -
-
- -
-

-
-

등록차수

+ {pbnstBiz && pbnstBiz?.length > 0 ? ( +
+ {/* 차수별 등록 현황 폼 */} +
+ + +
+

+
+

등록차수

- { - setIndexBiz(Number(val)); - }} - > + { + setIndexBiz(Number(val)); + }} + > - -
-
- - - - - - - -

재이용 원수취수 현황

-
-
- -
- -
-

재이용 공급관로 설치 현황

-
- - setPpiYn(String(val))} - /> - - - {ppiYn === "Y" ? ( - <> +
+
+ + + + + + + +

재이용 원수취수 현황

+
+
+ - - - ) : ( - <> - )} -
-
- + +
+

재이용 공급관로 설치 현황

+
+ + setPpiYn(String(val))} + /> + + + {ppiYn === "Y" ? ( + <> + + + + ) : ( + <> + )} +
+
+ { + const pplSum = form.getValues( + `items.${indexMng}.fcBizs.${indexBiz}.pplInstls` + ); + if (!pplSum) return; + let sum = 0; + pplSum.forEach((item) => { + sum += Number(item.cpct) || 0; + }); + setSumCpct(sum); + }} + /> +
+ + { - const pplSum = form.getValues( - `items.${indexMng}.fcBizs.${indexBiz}.pplInstls` - ); - if (!pplSum) return; - let sum = 0; - pplSum.forEach((item) => { - sum += Number(item.cpct) || 0; - }); - setSumCpct(sum); - }} /> -
- - -
-

{"하수처리수 재이용수 수요처"}

-
- - -
- {( - form.getValues( - `items.${indexMng}.fcBizs.${indexBiz}.fcDemands` - ) || [] - ).map((field, index) => ( -
-
- ( - - { - f.onChange(val); - if (val && val.length > 2) { - getDemandCompList(val, 3); - } - }} - setRtnData={(valList: any) => { - if (valList) { - form.setValue( - `items.${indexMng}.fcBizs.${indexBiz}.fcDemands.${index}.dmdInfoFk`, - valList.dmdInfoPk - ); - form.setValue( - `items.${indexMng}.fcBizs.${indexBiz}.fcDemands.${index}.daddr`, - valList.daddr - ); - form.setValue( - `items.${indexMng}.fcBizs.${indexBiz}.fcDemands.${index}.useUsgCd`, - valList.useUsgCd - ); - form.setValue( - `items.${indexMng}.fcBizs.${indexBiz}.fcDemands.${index}.splyCpct`, - valList.splyCpct - ); - form.setValue( - `items.${indexMng}.fcBizs.${indexBiz}.fcDemands.${index}.dmdInfoFk`, - valList.dmdInfoPk?.toString() - ); - } - }} - searchList={demandCompList?.map((item) => { - return { - ...item, - searchNm: item.dmdCoNm, - searchPk: item.dmdInfoPk, - }; - })} - > - - )} - /> -
-
- ( - - f.onChange(e.target.value)} - value={f.value} - className={selectClass} - /> - - )} - /> -
-
- ( - - - - )} - /> -
-
- ( - - - f.onChange(date) - } - className={"rounded-lg !w-full"} - /> - - )} - /> -
-
- ( - - - f.onChange(date) - } - className={"rounded-lg !w-full"} - /> - - )} - /> -
-
- ( - - { - f.onChange(Number(e.target.value)); - }} - /> - - )} - /> -
-
- ( - - - f.onChange(val) - } - value={f.value} - /> - - )} - /> -
+
+

+ {"하수처리수 재이용수 수요처"} +

+
+ +
- ))} -
- - + {( + form.getValues( + `items.${indexMng}.fcBizs.${indexBiz}.fcDemands` + ) || [] + ).map((field, index) => ( +
+
+ ( + + { + f.onChange(val); + if (val && val.length > 2) { + getDemandCompList(val, 3); + } + }} + setRtnData={(valList: any) => { + if (valList) { + form.setValue( + `items.${indexMng}.fcBizs.${indexBiz}.fcDemands.${index}.daddr`, + valList.daddr + ); + form.setValue( + `items.${indexMng}.fcBizs.${indexBiz}.fcDemands.${index}.useUsgCd`, + valList.useUsgCd + ); + form.setValue( + `items.${indexMng}.fcBizs.${indexBiz}.fcDemands.${index}.splyCpct`, + valList.splyCpct + ); + form.setValue( + `items.${indexMng}.fcBizs.${indexBiz}.fcDemands.${index}.dmdInfoPk`, + valList.dmdInfoPk?.toString() + ); + } + }} + searchList={demandCompList?.map((item) => { + return { + ...item, + searchNm: item.dmdCoNm, + searchPk: item.dmdInfoPk, + }; + })} + > + + )} + /> +
+
+ ( + + f.onChange(e.target.value)} + value={f.value} + className={selectClass} + /> + + )} + /> +
+
+ ( + + + + )} + /> +
+
+ ( + + + f.onChange(date), + }} + selectClass={"rounded-lg !w-full"} + /> + + )} + /> +
+
+ ( + + + f.onChange(date) + } + field={{ + value: safeDate(f.value) || new Date(), + onChange: (date: Date | undefined) => + f.onChange(date), + }} + selectClass={"rounded-lg !w-full"} + /> + + )} + /> +
+
+ ( + + { + f.onChange(Number(e.target.value)); + }} + /> + + )} + /> +
+
+ ( + + + f.onChange(val) + } + value={f.value ?? code.yn[0]?.val} + /> + + )} + /> +
+
+ ))} +
+ + +
+ + setIsFcOrgwts(open)} + bodyClass={"w-[50vw] max-w-none h-[90vh]"} + body={ + { + setIsFcOrgwts(false); + }} + onRightSet={(val) => { + form.setValue( + `items.${indexMng}.fcBizs.${indexBiz}.fcOrgwts`, + val + ); + }} + > + } + > + + { + setIsDmdModal({ isMoal: false, data: {} as DemandCompType }); + }} + body={ + { + getDemandCompList(searchText, pageCnt); + }} + rtnInputData={(data) => { + regDemandCompany(data as DemandCompType); + setIsDmdModal({ + isMoal: false, + data: data as DemandCompType, + }); + }} + bodyClassNm={"w-full mx-auto bg-white rounded-lg shadow-md p-6"} + > + } + >
- - setIsFcOrgwts(open)} - bodyClass={"w-[50vw] max-w-none h-[90vh]"} - body={ - { - setIsFcOrgwts(false); - }} - onRightSet={(val) => { - form.setValue( - `items.${indexMng}.fcBizs.${indexBiz}.fcOrgwts`, - val - ); - }} - > - } - > - - { - setIsDmdModal({ isMoal: false, data: {} as DemandCompType }); - }} - body={ - { - getDemandCompList(searchText, pageCnt); - }} - rtnInputData={(data) => { - regDemandCompany(data as DemandCompType); - setIsDmdModal({ isMoal: false, data: data as DemandCompType }); - }} - bodyClassNm={"w-full mx-auto bg-white rounded-lg shadow-md p-6"} - > - } - > -
+ ) : ( +
+

등록된 차수별 정보가 없습니다.

+

+ 아래 버튼을 눌러 신규 차수 정보를 등록해주세요. +

+ +
+ )} ); } diff --git a/apps/wr/components/ui/form/fcltReg/pbnstReg/mngReg/mngRegForm.tsx b/apps/wr/components/ui/form/fcltReg/pbnstReg/mngReg/mngRegForm.tsx index 21dc3cf83..d07d24a23 100644 --- a/apps/wr/components/ui/form/fcltReg/pbnstReg/mngReg/mngRegForm.tsx +++ b/apps/wr/components/ui/form/fcltReg/pbnstReg/mngReg/mngRegForm.tsx @@ -37,7 +37,6 @@ export type FilesType = { export function PbnstMngForm({ form, formType, - firstFcltData, indexMng, setIndexMng, }: { @@ -51,12 +50,8 @@ export function PbnstMngForm({ code, pbnst, pbnstInsert, - pbnstMngData, fileDelete, fileDownLoad, - getBizCycle, - getpbnstInsertIndex, - appendRuseFclt, } = useWrStore((state) => state); const { pbnstRes } = pbnst; @@ -67,8 +62,6 @@ export function PbnstMngForm({ const [mngMtdCode, setMngMtdCode] = useState<{ name: string; val: SelectDataType[] }[]>(); - const [progress, setProgress] = useState(0); - const { fields: fcOpersField, append, @@ -221,12 +214,19 @@ export function PbnstMngForm({ }, [pbnst.pbnstMngRegData]); useEffect(() => { - if (pbnst.pbnstRes && pbnst.pbnstRes?.length <= 0) return; - const fcltNmList = pbnst.pbnstRes?.map((item, index) => ({ - text: item.ruseUtztnFcltNm, - val: String(index), - })); - if (fcltNmList) setFcltNm(fcltNmList); + if (pbnst.pbnstRes && pbnst.pbnstRes?.length >= 0) { + + const fcltNmList = pbnst.pbnstRes?.map((item, index) => ({ + text: item.ruseUtztnFcltNm, + val: String(index), + })); + + + console.log(' fcltNmList ', fcltNmList) + if (fcltNmList) setFcltNm(fcltNmList); + }else{ + setFcltNm(null); + } }, [pbnst.pbnstRes]); // 2. Define a submit handler. @@ -253,6 +253,16 @@ export function PbnstMngForm({ } }, [code]); + + useEffect(() =>{ + // console.log(' fcltNm ', watchedItem?.ruseUtztnFcltNm) + },[watchedItem]) + + + useEffect(() => { + console.log(" form indexMng ", indexMng); + }, [indexMng]); + return (
@@ -266,33 +276,29 @@ export function PbnstMngForm({ {formType === "update" ? ( - ( - - { - setIndexMng(Number(val)); - field.onChange(val); - }} - value={field.value ?? ""} - className={""} - selectClass={undefined} - /> - - )} - /> + + { + setIndexMng(Number(val)); + }} + value={String(indexMng)} + className={""} + selectClass={undefined} + /> + ) : ( ( subscription.unsubscribe(); }, [form]); diff --git a/apps/wr/components/ui/modal/fcltReg/pbnstRegModal/pbnstRegModal.tsx b/apps/wr/components/ui/modal/fcltReg/pbnstRegModal/pbnstRegModal.tsx index d7ecee90a..b930a36bb 100644 --- a/apps/wr/components/ui/modal/fcltReg/pbnstRegModal/pbnstRegModal.tsx +++ b/apps/wr/components/ui/modal/fcltReg/pbnstRegModal/pbnstRegModal.tsx @@ -26,7 +26,7 @@ export function PbnstRegModal({ data: pubHasuType; form: UseFormReturn<{ items: PbnstRegArrrayType }>; }) { - const { pbnst, pbnstInsert, pbnstMngData } = useWrStore((state) => { + const { pbnst, pbnstInsert } = useWrStore((state) => { return state; }); const [pbnstBdstForm, setPbnstBdstForm] = useState( @@ -57,48 +57,18 @@ export function PbnstRegModal({ useEffect(() => { if (data) { + const firstForm = form.getValues("items"); - - console.log('mngIndex ', firstForm.length) - setIndexMng(firstForm.length - 1) - // console.log(' firstForm ', firstForm) - // let regData; - // if (pbnstRes && pbnstRes?.length > 0) { - // regData = { - // swtrmtFcltFk: String(data.bscFctCd), - // pbnstRuseFcltPk: String(data.bscFctCd) + String(pbnstRes.length + 1), - // fcBizs: [ - // { - // pbnstRuseFcltFk: - // String(data.bscFctCd) + String(pbnstRes.length + 1), - // cycl: 1, - // } as unknown as fcBizType, - // ], - // }; - // //regData= pbnstRegZod.parse(regData) - // //setPbnstBdstForm(regData as unknown as customPbnst); - // // pbnstMngData([regData] as unknown as customPbnst[]) - // } else { - // regData = { - // swtrmtFcltFk: String(data.bscFctCd), - // pbnstRuseFcltPk: String(data.bscFctCd + "1"), - // fcBizs: [ - // { - // pbnstRuseFcltFk: String(data.bscFctCd + "1"), - // cycl: 1, - // } as unknown as fcBizType, - // ], - // }; - // //regData= pbnstRegZod.parse(regData) - // // setPbnstBdstForm(regData as unknown as customPbnst); - - // // pbnstMngData([regData] as unknown as customPbnst[]) - // } - // regData = pbnstRegZod.parse(regData); - // setPbnstBdstForm(regData as unknown as customPbnst); - } + setIndexMng(firstForm.length - 1) } }, [data, form]); + + + useEffect(() => { + console.log(' form.getValues() ' ,form.getValues()) + + }, [form.getValues()]); + return ( <>

diff --git a/apps/wr/components/ui/table/pbnstReg/ruseMngTableForm/ruseMngTableForm.tsx b/apps/wr/components/ui/table/pbnstReg/ruseMngTableForm/ruseMngTableForm.tsx index 11c183f1b..acb923687 100644 --- a/apps/wr/components/ui/table/pbnstReg/ruseMngTableForm/ruseMngTableForm.tsx +++ b/apps/wr/components/ui/table/pbnstReg/ruseMngTableForm/ruseMngTableForm.tsx @@ -21,8 +21,7 @@ import { TableHeader, TableRow, } from "@common/components/ui"; -import { read } from "fs"; -import React, { useEffect, useState } from "react"; +import React from "react"; type RuseMngTableProps = { tableData: any[]; @@ -39,8 +38,6 @@ type RuseMngTableProps = { const RuseMngTableForm = React.forwardRef( ({ tableData, headList, upHeadList, code, onTableSet, indexMng, form,formNm,indexBiz }, ref) => { - - console.log('tableData ', tableData) return ( <> @@ -119,6 +116,7 @@ const RuseMngTableForm = React.forwardRef( field.onChange(val); } }} + readOnly ={head.readonly ? true : false} // Disabled prop removed as SelectBox does not support it > ) : head.type === "date" ? ( @@ -133,6 +131,7 @@ const RuseMngTableForm = React.forwardRef( }, }} selectClass={"w-full"} + readOnly ={head.readonly ? true : false} /> ) : head.type === "checkbox" ? ( Date: Tue, 24 Jun 2025 20:01:33 +0900 Subject: [PATCH 04/12] =?UTF-8?q?=EC=9D=BC=EB=8B=A8=EA=B2=BD=EA=B8=B0?= =?UTF-8?q?=EB=8F=84=EB=A1=9C=20=EA=B3=A0=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app/ruseFcltMng/fcltReg/pbnstReg/page.tsx | 18 +++++++++++------- .../prfmncReg/pbnstPrfmncReg/page.tsx | 16 ++++++++++------ 2 files changed, 21 insertions(+), 13 deletions(-) diff --git a/apps/wr/app/ruseFcltMng/fcltReg/pbnstReg/page.tsx b/apps/wr/app/ruseFcltMng/fcltReg/pbnstReg/page.tsx index 7638e6cb4..441eabf25 100644 --- a/apps/wr/app/ruseFcltMng/fcltReg/pbnstReg/page.tsx +++ b/apps/wr/app/ruseFcltMng/fcltReg/pbnstReg/page.tsx @@ -58,6 +58,8 @@ export default function PublicReuseFaciltyInsert() { const [searchTxt, setSearchTxt] = useState(); const [bdstTable, setbdstTable] = useState(); const [selectRow, setSelectRow] = useState(); + const [pageNation, setPageNation] = useState(1); + const form = useForm<{ items: z.infer[]; @@ -76,7 +78,7 @@ export default function PublicReuseFaciltyInsert() { }); useEffect(() => { if (!pbnst.isInit) { - pubHasuInit("1", "0"); + pubHasuInit("1", "41"); } }, [pbnst.isInit, pubHasuInit]); @@ -190,7 +192,9 @@ export default function PublicReuseFaciltyInsert() { // console.log(" page getgetvaslue ", form.getValues()); }, [form.getValues()]); - +useEffect(() =>{ + pubHasuInit(String(pageNation), "41"); +},[pageNation,pubHasuInit]) return ( <> @@ -214,8 +218,8 @@ export default function PublicReuseFaciltyInsert() { size={"sm"} onClick={(e) => { searchTxt && searchTxt?.length > 0 - ? pubHasuSearch("1", "0", searchTxt) - : pubHasuInit("1", "0"); + ? pubHasuSearch(String(pageNation), "41", searchTxt) + : pubHasuInit(String(pageNation), "41"); }} > 조회 @@ -250,11 +254,11 @@ export default function PublicReuseFaciltyInsert() { {}} + onPageChange={setPageNation} children={undefined} /> diff --git a/apps/wr/app/ruseFcltMng/prfmncReg/pbnstPrfmncReg/page.tsx b/apps/wr/app/ruseFcltMng/prfmncReg/pbnstPrfmncReg/page.tsx index 0714c9306..6be50a8c5 100644 --- a/apps/wr/app/ruseFcltMng/prfmncReg/pbnstPrfmncReg/page.tsx +++ b/apps/wr/app/ruseFcltMng/prfmncReg/pbnstPrfmncReg/page.tsx @@ -51,6 +51,7 @@ export default function prfmncPrfmncReg() { }>({ isModal: false, data: {} as FcPrfType }); const [inputData, setInputData] = useState(); const [pbnstRuseFcltPk, setPbnstRuseFcltPk] = useState(); + const [pageNation , setPageNation] = useState(1); const [searchYear, setSearchYear] = useState( String(new Date().getFullYear()) @@ -73,9 +74,12 @@ export default function prfmncPrfmncReg() { pbnstRuseFcltPk ) as unknown as PrfType ); - prfmncHasuInit("1", "11"); + prfmncHasuInit(String(pageNation), "41"); } - }, [inputData, searchYear, pbnstRuseFcltPk,prfmncHasuInit]); + }, [inputData, searchYear, pbnstRuseFcltPk,prfmncHasuInit,pageNation]); + + + const cellClick = useCallback( (index: number | undefined, headId: string) => { @@ -146,7 +150,7 @@ export default function prfmncPrfmncReg() { useEffect(() => { if (!prfmnc.isInit) { - prfmncHasuInit("1", "11"); + prfmncHasuInit('1', "41"); } }, [prfmnc.isInit, prfmncHasuInit]); useEffect(() => { @@ -229,13 +233,13 @@ export default function prfmncPrfmncReg() { { cellClick(index, headId); }} - onPageChange={(page: number) => {}} + onPageChange={setPageNation} children={undefined} /> From efcd6a3e19dbc4f2ab1df8f3f42a8e4b8c5164e1 Mon Sep 17 00:00:00 2001 From: swcho Date: Wed, 25 Jun 2025 14:32:33 +0900 Subject: [PATCH 05/12] =?UTF-8?q?fix:=20button=20=ED=83=9C=EA=B7=B8?= =?UTF-8?q?=EC=97=90=20type=3D"button"=20=EC=82=AD=EC=A0=9C.=20(=EA=B0=90?= =?UTF-8?q?=EB=A6=AC=20=EC=A7=80=EC=A0=81=EC=82=AC=ED=95=AD.=20W3C=20Valid?= =?UTF-8?q?ator=20=EC=97=90=EB=9F=AC)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../business_components/src/ui/file-upload/lib/file_upload.tsx | 1 - packages/common/business_components/src/ui/map/Gis.js | 1 - packages/common/business_components/src/ui/map/GisContent.js | 1 - packages/common/business_components/src/ui/map/GisTab.js | 1 - 4 files changed, 4 deletions(-) diff --git a/packages/common/business_components/src/ui/file-upload/lib/file_upload.tsx b/packages/common/business_components/src/ui/file-upload/lib/file_upload.tsx index b73bcb886..a117accbb 100644 --- a/packages/common/business_components/src/ui/file-upload/lib/file_upload.tsx +++ b/packages/common/business_components/src/ui/file-upload/lib/file_upload.tsx @@ -308,7 +308,6 @@ export const FileUploaderItem = forwardRef< {children}