From c8c0756e4bf5ffd5c943d78aaf0474e628aec883 Mon Sep 17 00:00:00 2001 From: leedj312 Date: Thu, 5 Jun 2025 18:07:23 +0900 Subject: [PATCH] =?UTF-8?q?=ED=95=98=EC=88=98=EC=9E=AC=EC=9D=B4=EC=9A=A9?= =?UTF-8?q?=20=EC=8B=A4=EC=A0=81=20=EB=93=B1=EB=A1=9D=20=ED=85=8C=EC=8A=A4?= =?UTF-8?q?=ED=8A=B8=20=EC=99=84=EB=A3=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../prfmncReg/pbnstPrfmncReg/page.tsx | 72 ++++++---- .../store/prfmncReg/pbnstPrfmncReg/excel.tsx | 19 ++- .../prfmncReg/pbnstPrfmncReg/headList.tsx | 29 ++-- .../store/prfmncReg/pbnstPrfmncReg/index.tsx | 135 ++++++++++-------- .../store/prfmncReg/pbnstPrfmncReg/type.tsx | 47 ++++++ .../pbnPrfExcelModal/pbnPrfExcelModal.tsx | 72 ++++------ 6 files changed, 228 insertions(+), 146 deletions(-) create mode 100644 apps/wr/app/store/prfmncReg/pbnstPrfmncReg/type.tsx diff --git a/apps/wr/app/ruseFcltMng/prfmncReg/pbnstPrfmncReg/page.tsx b/apps/wr/app/ruseFcltMng/prfmncReg/pbnstPrfmncReg/page.tsx index c5dce841b..f640c8d2d 100644 --- a/apps/wr/app/ruseFcltMng/prfmncReg/pbnstPrfmncReg/page.tsx +++ b/apps/wr/app/ruseFcltMng/prfmncReg/pbnstPrfmncReg/page.tsx @@ -1,5 +1,6 @@ "use client"; import { useWrStore } from "@/app/store"; +import type { FcPrfType } from "@/app/store/prfmncReg/pbnstPrfmncReg/type"; import type { pubHasuType } from "@/app/store/ruseFcltMng/fcltReg/pbnstReg/type"; import { excelDownload, yearOptions } from "@/components/lib/func/commom"; import PbnPrfExcelModal from "@/components/ui/modal/chkgd/pbnPrfExcelModal/pbnPrfExcelModal"; @@ -22,38 +23,42 @@ import { set } from "react-hook-form"; import { Toaster } from "react-hot-toast"; export default function prfmncPrfmncReg() { - const { code, prfmnc, prfmncHasuInit, } = useWrStore( - (state) => state - ); + const { code, prfmnc, prfmncHasuInit } = useWrStore((state) => state); const { pbnstPrfmncHeadList, monthHeadList, prfmncRes } = prfmnc; - const [bdstTable, setbdstTable] = useState(); + const [bdstTable, setbdstTable] = useState(); const [searchTxt, setSearchTxt] = useState(); - const [isExcelOpen, setIsExcelOPen] = useState(false); + const [isExcelOpen, setIsExcelOPen] = useState<{isModal:boolean, data:FcPrfType}>({isModal:false, data:{} as FcPrfType }); const [searchYear, setSearchYear] = useState( String(new Date().getFullYear()) ); + const excelClick = useCallback(() => { + excelDownload( + [[]], + "하수재이용실적", + "sample_pbnstPrfmncReg.xlsx", + "A1:O1" + ); + }, [prfmnc.excelList]); - const excelClick = useCallback(() => { - console.log("dd") - excelDownload( - [[]], - "하수재이용실적", - "sample_pbnstPrfmncReg.xlsx", - "A1:O1" - ); - }, [prfmnc.excelList]) - useEffect(() => { - if (!prfmnc.isInit) { - prfmncHasuInit("1", "11"); - } - }, [prfmnc.isInit, prfmncHasuInit]); - useEffect(() => { - setbdstTable(prfmncRes) - console.log("prfmnc.prfmncRes", prfmncRes) - }, [prfmncRes]); + + const cellClick = useCallback((index:number|undefined, headId:string) => { + + if(index !== undefined) + setIsExcelOPen({isModal:false, data:prfmncRes[index] || {} as FcPrfType}) + + }, [prfmncRes]); + + useEffect(() => { + if (!prfmnc.isInit) { + prfmncHasuInit("1", "11"); + } + }, [prfmnc.isInit, prfmncHasuInit]); + useEffect(() => { + setbdstTable(prfmncRes); + }, [prfmncRes]); return ( <> @@ -101,7 +106,12 @@ export default function prfmncPrfmncReg() { -