From e15b922b2e1147750cb562da47ea9ae0169b8716 Mon Sep 17 00:00:00 2001 From: truthwing Date: Fri, 25 Apr 2025 14:43:42 +0900 Subject: [PATCH] =?UTF-8?q?=EC=97=91=EC=85=80=20=EB=B3=80=ED=99=98=20TODO?= =?UTF-8?q?=20=EC=9E=91=EC=84=B1=20=EC=99=84=EB=A3=8C.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ruseFcltMng/fcltSttn/rainSttn/page.tsx | 14 ++++-- .../store/ruseFcltMng/fcltSttn/sttn/excel.tsx | 46 +++++++++++++++++++ .../store/ruseFcltMng/fcltSttn/sttn/index.tsx | 11 +++-- 3 files changed, 62 insertions(+), 9 deletions(-) create mode 100644 apps/wr/app/store/ruseFcltMng/fcltSttn/sttn/excel.tsx diff --git a/apps/wr/app/ruseFcltMng/fcltSttn/rainSttn/page.tsx b/apps/wr/app/ruseFcltMng/fcltSttn/rainSttn/page.tsx index 77bce97e8..6d4563efd 100644 --- a/apps/wr/app/ruseFcltMng/fcltSttn/rainSttn/page.tsx +++ b/apps/wr/app/ruseFcltMng/fcltSttn/rainSttn/page.tsx @@ -19,7 +19,7 @@ import { useCallback, useEffect, useRef, useState } from "react"; import { headMakeTriple } from "./TableHead"; export default function RainSttn() { - const { code, rain, init, sttnCommon, excelExportAction } = useWrStore((state) => state); + const { code, rain, init, sttnCommon, excelRainSttn } = useWrStore((state) => state); const { rainRes } = rain; const [isChHead, setIsChHead] = useState(false); @@ -40,7 +40,6 @@ export default function RainSttn() { if (code.sggCd.length > 0) { const data = tableData(rainRes, { code }); // data 는 위 JSON 객체라고 가정 - // TODO: 이게 뭐하는 작업이지? const unVisibleHead = sttnCommon.rainSttHeadList.filter( (item: TableTripleProps) => item.visible === false ); @@ -57,10 +56,15 @@ export default function RainSttn() { setBdstTable(chData); } }, [code, rainRes, sttnCommon.rainSttHeadList]); - + useEffect(() => { + if(sttnCommon.excelList.length>0){ + // TODO: API 호출후 받은 데이터로 엑셀 변환. + } + }, [sttnCommon.excelList]); const excelClick = useCallback(() => { - excelExportAction(code.cityCd, code.sggCd); - },[code.cityCd, code.sggCd, excelExportAction]); + //TODO: 엑셀 버튼 클릭시 API 호출 후 데이터를 excelRainSttn호출하여 변환된 데이터 effect 이벤트 동작.excelRainSttn(code.cityCd, code.sggCd); + //FIXME: 현재 API 호출하는 함수 액션이 존재하지 않음. + },[code.cityCd, code.sggCd, excelRainSttn]); return ( <> diff --git a/apps/wr/app/store/ruseFcltMng/fcltSttn/sttn/excel.tsx b/apps/wr/app/store/ruseFcltMng/fcltSttn/sttn/excel.tsx new file mode 100644 index 000000000..1c8157d1d --- /dev/null +++ b/apps/wr/app/store/ruseFcltMng/fcltSttn/sttn/excel.tsx @@ -0,0 +1,46 @@ +export type ExcelSttnRainType={ + "1.건축물정보": { + "행정구역":{"시도": string, "시군구": string}, + "건축물명": string, + "주소": string, + "건축물용도코드": string, + "최초건축허가일": string, + "건축면적": string, + "법적의무대상": string, + "설치완료일시": string, + }, + "2.빗물이용시설정보":{ + "설치비용": string, + "집수면":{ + "집수지점종류": string, + "집수지점면적": string, + }, + "여과등 처리시설":{ + "여과처리시설유무": string, + "여과처리시설용량": string, + "여과처리시설처리공정": string, + } + "저류조용량": string, + }, + "3.시설운영및 이용정보":{ + "운영관리코드": string, + "연간빗물운영량": string + }, + "4.인센티브 정보":{ + "설치비지원":{ + "설치지원비용여부": string, + "설치지원비용": string, + }, + "요금감면":{ + "감면여부": string, + "감면근거": string, + "감면금액": string, + }, + "녹색건축물인증여부":{ + "녹색건축물인증여부": string, + "녹색건축물인증년도": string, + "녹색건축물인증번호": string, + "녹색건축물인증등급": string, + } + } +} \ No newline at end of file diff --git a/apps/wr/app/store/ruseFcltMng/fcltSttn/sttn/index.tsx b/apps/wr/app/store/ruseFcltMng/fcltSttn/sttn/index.tsx index 2df547da9..db4a66553 100644 --- a/apps/wr/app/store/ruseFcltMng/fcltSttn/sttn/index.tsx +++ b/apps/wr/app/store/ruseFcltMng/fcltSttn/sttn/index.tsx @@ -1,9 +1,9 @@ import type { chHeadType } from "@/app/store/prfmncReg/chkgdnReg/rainChkgdn"; -import { type ExcelExportType } from "../../../prfmncReg/chkgdnReg/rainChkgdn/excel"; import { type TableTripleProps, type TableUpperProps } from "../../fcltReg/rainReg"; +import type { ExcelSttnRainType } from "./excel"; const pbnSttHeadNm: chHeadType[] = [ { headNm: "catchment", text: "유역", length: 3 }, @@ -215,14 +215,14 @@ const rainSttHeadList: TableTripleProps[] = [ }, { id: "pntfColKnd", - title: "접수지점종류", + title: "집수지점종류", visible: true, upName: ["rainFcltInfo", "pntfCol"], upSequnce: [2, 1], }, { id: "pntfColArea", - title: "접수지점면적", + title: "집수지점면적", visible: true, upName: ["rainFcltInfo", "pntfCol"], upSequnce: [3, 2], @@ -342,7 +342,7 @@ export type sttnState = { pbnSttHeadNm: chHeadType[]; rainSttHeadList: TableTripleProps[]; rainSttHeadNm: chHeadType[]; - excelList:ExcelExportType[] + excelList:ExcelSttnRainType[] }; }; type sttnActions = { @@ -365,6 +365,9 @@ export const sttnStateExport: sttnState = { export const sttnActionsExport: (set: any) => sttnActions = (set: any) => { return { pbnSttnInit: async (sggCd: string, searchTxt: string, flg: string) => {}, + excelRainSttn: async (data: JSON[]) => { + //TODO: 엑셀 데이터 array 생성해서 return 필요. ExcelSttnRainType[]으로 생성해서 던져주면 됨. + }, chSttnHead: async (checkList: string[], type: string) => { const headList = type === "pbn"