From b39969f7e60819a97dd5a5ef0407fa5cf473ffcc Mon Sep 17 00:00:00 2001 From: truthwing Date: Thu, 19 Jun 2025 13:38:57 +0900 Subject: [PATCH] =?UTF-8?q?=EC=A4=91=EC=88=98=EB=8F=84=20=EC=A0=95?= =?UTF-8?q?=EB=B3=B4=20headlist=EC=97=90=20=ED=82=A4=EA=B0=92=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80.=20API=20=ED=98=B8=EC=B6=9C=20=EB=B6=80=EB=B6=84=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/wr/app/stats/rswtStat/page.tsx | 33 ++++++++----------- apps/wr/app/store/stats/rswtStat/headList.tsx | 28 ++++++++-------- apps/wr/app/store/stats/rswtStat/index.tsx | 16 ++++++++- 3 files changed, 43 insertions(+), 34 deletions(-) diff --git a/apps/wr/app/stats/rswtStat/page.tsx b/apps/wr/app/stats/rswtStat/page.tsx index d1a0f6353..de96b29ea 100644 --- a/apps/wr/app/stats/rswtStat/page.tsx +++ b/apps/wr/app/stats/rswtStat/page.tsx @@ -1,33 +1,25 @@ -'use client' - +"use client"; import { useWrStore } from "@/app/store"; import { yearOptions } from "@/components/lib/func/commom"; -import { - ContentsDiv, - SearchDiv, - SearchFormLeft, - SelectBox, - Title, - UiTable +import { + ContentsDiv, + SearchDiv, + SelectBox, + Title, + UiTable } from "@common/business_components/ui"; import ListDiv from "@common/business_components/ui/list_div"; import { Button } from "@common/components/ui"; import { useState } from "react"; export default function RswtStat() { - const { code, rswtStat } = useWrStore((state) => state); + const { code, rswtStat, searchRswtStatList } = useWrStore((state) => state); const [pageNation, setPageNation] = useState(1); const [searchYear, setSearchYear] = useState( String(new Date().getFullYear()) ); - const testData = [1,2,3] - testData.map((item) => { - console.log('test ',item); - }) - - return ( - <> + return ( <>
@@ -48,7 +40,10 @@ export default function RswtStat() { @@ -89,4 +84,4 @@ export default function RswtStat() { ); -} \ No newline at end of file +} diff --git a/apps/wr/app/store/stats/rswtStat/headList.tsx b/apps/wr/app/store/stats/rswtStat/headList.tsx index 2c8aebec9..2ed9f6bad 100644 --- a/apps/wr/app/store/stats/rswtStat/headList.tsx +++ b/apps/wr/app/store/stats/rswtStat/headList.tsx @@ -2,13 +2,13 @@ import type { TableUpperProps } from "../../common/type/header"; export const rswtStatHeadListExport :TableUpperProps[]=[ { - id: "시도", + id: "ctpvCd", title: "시도", row:0, rowSpan:2 }, { - id: "개소", + id: "ctpvCnt", title: "개소", row:0, rowSpan:2 @@ -20,17 +20,17 @@ export const rswtStatHeadListExport :TableUpperProps[]=[ colSpan:2 }, { - id: "건축연면적(m³)", + id: "archArea", title: "건축연면적(m³)", row:1, }, { - id: "처리용량", + id: "filtrTrtmfctCpct", title: "처리용량(m³)", row:1, }, { - id: "물사용량", + id: "wtrUsqty", title: "물사용량(m³/년)", row:0, rowSpan:2 @@ -42,13 +42,13 @@ export const rswtStatHeadListExport :TableUpperProps[]=[ rowSpan:2 }, { - id: "중수도이용량", + id: "rswtrUsqty", title: "중수도이용량(m³/년)", row:0, rowSpan:2 }, { - id: "대체수이용량", + id: "altUswtrUtztnQnt", title: "대체수이용량(m³/년)", row:0, rowSpan:2 @@ -61,37 +61,37 @@ export const rswtStatHeadListExport :TableUpperProps[]=[ colSpan:6 }, { - id: "조경용수", + id: "lndwtr", title: "조경용수", row:1, }, { - id: "청소화장실용수", + id: "cleanToilUswtr", title: "청소화장실용수", row:1, }, { - id: "농업용수", + id: "farmUswtr", title: "농업용수", row:1, }, { - id: "공업용수", + id: "indstUswtr", title: "공업용수", row:1, }, { - id: "친수용수", + id: "hydUswtr", title: "친수용수", row:1, }, { - id: "기타", + id: "ithlEtcUswtr", title: "기타", row:1, }, { - id: "연간운영비", + id: "anlOperCst", title: "연간운영비(백만원/년)", row:0, rowSpan:2 diff --git a/apps/wr/app/store/stats/rswtStat/index.tsx b/apps/wr/app/store/stats/rswtStat/index.tsx index 652917bc3..b4d58a448 100644 --- a/apps/wr/app/store/stats/rswtStat/index.tsx +++ b/apps/wr/app/store/stats/rswtStat/index.tsx @@ -1,13 +1,16 @@ +import { fetchType, getFetch } from "@/components/lib/api"; import type { TableUpperProps } from "../../common/type/header"; import { rswtStatHeadListExport } from "./headList"; type rswtStatActions = { + searchRswtStatList: (year: string) => void; } export type rswtStatState = { rswtStat: { rswtStatHeadList:TableUpperProps[] + rswtStatList: never[]; // Replace with actual type when available } } @@ -23,6 +26,17 @@ export const rswtStatActionsExport: (set: any) => rswtStatActions = ( set: any ) => { return { - + searchRswtStatList: async (year: string) => { + const res = await getFetch(fetchType.WR,`/reuseChk/reuseWater/stat/${year}`) + console.log('res', res); + const rswtStatList: never[] = []; + set((state: rswtStatState) => ({ + rswtStat: { + ...state.rswtStat, + rswtStatList, + // rswtStatHeadList + } + })); + } } } \ No newline at end of file