하수재이용실적 현황 화면 퍼블리싱

This commit is contained in:
jyha00
2025-06-05 18:08:47 +09:00
parent ca369c3acb
commit 36f1d50162
7 changed files with 275 additions and 4 deletions
+7
View File
@@ -48,6 +48,13 @@ export default function Home() {
</Link>
</Button>
</div>
<div className="col-span-2">
<Button className="w-full">
<Link href="ruseFcltMng/prfmncSttn/pbnstPrfmncSttn">
하수재이용실적 현황
</Link>
</Button>
</div>
<div className="col-span-2">
<Button className="w-full">
<Link href="ruseFcltMng/prfmncReg/chkgdnReg">
@@ -0,0 +1,126 @@
"use client";
import { useWrStore } from "@/app/store";
import { btnClass } from "@/app/store/common/code";
import { yearOptions } from "@/components/lib/func/commom";
import { ContentsDiv, SearchBaseForm, SearchDiv, SearchFormLeft, SearchInput, SelectBox, Title, UiTable } from "@common/business_components/ui";
import ListDiv from "@common/business_components/ui/list_div";
import { Button, DatePicker, Label } from "@common/components/ui";
import { useEffect, useState } from "react";
export default function PbnstPrfmncSttn() {
const { code, tableHeadMaker, pbnstPrfmncSttn, pbnstPrfmncSearch } = useWrStore((state) => state);
const { pbnstPrfHeadList } = pbnstPrfmncSttn;
const [isChHead, setIsChHead] = useState(false);
const [fromDate, setFromDate] = useState<string>(String(new Date().getFullYear()));
const [toDate, setToDate] = useState<string>(String(new Date().getFullYear()));
return (
<>
<ContentsDiv>
<div className="grid grid-cols-4 gap-4 ">
<div className="col-span-4">
<Title title={"하수재이용실적 현황"} />
<SearchBaseForm
selectSidoData={code.cityCd}
selectSigunData={code.sggCd}
selectRegionData={code.rvbsnCd}
selectUnitWaterShedData={code.lgbsnCd}
selectMiddleRegionData={code.mdmbsnCd}
selectEnvPartData={code.lclgvrnmntCd}
rightChildren={
<Button
className={btnClass}
onClick={() => {
setIsChHead(true);
}}
>
조회항목설정
</Button>
}
leftChildren={
<div className="col-span-5">
<div className="flex flex-row">
<div className="flex flex-row items-center">
<Label className="text-xl text-gray-600">하수 재이용년도</Label>
<SelectBox
className="h-full text-2xl"
label=""
selectClass={""}
selectArray={yearOptions}
value={fromDate}
onSelectValue={(val: string | number) =>
setFromDate(String(val))
}
/>
<SelectBox
className="h-full text-2xl"
label=""
selectClass={""}
selectArray={yearOptions}
value={toDate}
onSelectValue={(val: string | number) =>
setToDate(String(val))
}
/>
</div>
<SearchInput
className={"text-2xl"}
label="시설명"
textValue={""}
setText={(e) => {
}}
/>
<SelectBox
className="h-full text-2xl"
label="재이용시설명"
selectClass={""}
selectArray={[]}
value={""}
onSelectValue={() => { }}
/>
</div>
</div>
}
queryClick={function (): void {
if (fromDate && toDate) {
const fromNum = Number(fromDate)
const toNum = Number(toDate)
if (fromNum > toNum) {
alert("시작년도가 종료년도 이후로 설정할 수 없습니다.")
} else {
if (toNum - fromNum > 5) {
alert("최대 5년까지 선택 가능합니다.")
} else {
tableHeadMaker(fromNum, toNum)
}
}
}
}}
excelClick={() => { }}
initClick={function (): void { }}
btnClass={btnClass}
/>
</div>
</div>
<div className="grid grid-cols-6 gap-4 ">
<div className="col-span-6">
<ListDiv>
<UiTable
headName={[]}
tableData={[]}
headlist={pbnstPrfHeadList}
pageSize={20}
total={10000}
cellClick={() => { }}
onPageChange={() => { }}
/>
</ListDiv>
</div>
</div>
</ContentsDiv>
</>
)
}
+2 -1
View File
@@ -16,7 +16,8 @@ export type TableUpperProps = {
upSequnce?: number;
edit?:boolean;
visible?:boolean;
rowSpan?: true;
rowSpan?: number;
colSpan?: number;
type?: string;
};
@@ -0,0 +1,59 @@
import type { TableUpperProps } from "../../ruseFcltMng/fcltReg/rainReg";
export const pbnstPrfmncSttnHeadListExport: TableUpperProps[] = [
{
id: "number",
title: "No",
rowSpan: 2,
row:0
},
{
id: "sido",
title: "시도",
rowSpan: 2,
row:0
},
{
id: "gugun",
title: "시군구",
rowSpan: 2,
row:0
},
{
id: "bscFctNm",
title: "시설명",
rowSpan: 2,
row:0
},
{
id: "ruseUtztnFcltNm",
title: "재이용시설명",
rowSpan: 2,
row:0
},
]
export const pbnstYearHeadListExport: TableUpperProps[] = [
{
id: "year",
title: "년도",
colSpan: 3,
row:0
},
{
id: "total",
title: "계",
row:1
},
{
id: "jangnae",
title: "장내용수",
row:1
},
{
id: "jangoi",
title: "장외용수",
row:1
},
]
@@ -0,0 +1,71 @@
import { fetchType, getFetch } from "@/components/lib/api";
import type { TableUpperProps } from "../../common/type/headder";
import { pbnstPrfmncSttnHeadListExport, pbnstYearHeadListExport } from "./headList";
type pbnstPrfmncSttnActions = {
tableHeadMaker: (startYear: number, endYear: number) => void;
pbnstPrfmncSearch: () => void;
}
export type pbnstPrfmncSttnState = {
pbnstPrfmncSttn: {
pbnstPrfHeadList: TableUpperProps[];
}
}
export type pbnstPrfmncSttnType = pbnstPrfmncSttnState & pbnstPrfmncSttnActions;
export const pbnstPrfmncSttnExport: pbnstPrfmncSttnState = {
pbnstPrfmncSttn: {
pbnstPrfHeadList: [...pbnstPrfmncSttnHeadListExport]
}
}
export const pbnstPrfmncSttnActionsExport: (set: any) => pbnstPrfmncSttnActions = (
set: any
) => {
return {
tableHeadMaker: (startYear: number, endYear: number) => {
let yearHeader: TableUpperProps[] = [...pbnstPrfmncSttnHeadListExport];
for (let i = startYear; i <= endYear; i++) {
const yearHead = JSON.parse(JSON.stringify(pbnstYearHeadListExport));
if (yearHead){
yearHead.forEach((item: { id: number; }) => (item.id = i + item.id))
if(yearHead[0])
yearHead[0].title = i + "년도"
}
yearHeader = [...yearHeader, ...yearHead]
}
set((state: pbnstPrfmncSttnState) => {
return {
...state,
pbnstPrfmncSttn: {
pbnstPrfHeadList: [ ...yearHeader]
},
};
});
},
pbnstPrfmncSearch: async () => {
try {
const pbnstPrfmncRes = await getFetch(
fetchType.WR,
`/reuseFc/pubDetailList/`
);
set((state: pbnstPrfmncSttnState) => {
return {
...state,
pbnstPrfmncSttn: {
...state.pbnstPrfmncSttn,
pbnstPrfmncRes: pbnstPrfmncRes,
isInit: false,
},
};
});
} catch (erTxt) {
console.log("error", erTxt);
}
},
}
}
@@ -89,9 +89,11 @@ export type TableUpperProps = {
upSequnce?: number;
edit?:boolean;
visible?:boolean;
rowSpan?: true;
rowSpan?: number;
type?: string;
selectData ?:string;
colSpan?:number;
row?:number;
};
export const upHeadList: TableUpperProps[] = [
+7 -2
View File
@@ -91,6 +91,7 @@ import { searchActions, type comFcltActions, type comFcltState } from "./common/
import { pbnstPrfmncActionsExport, pbnstPrfmncStateExport, type pbnstPrfmncState, type pbnstPrfmncType } from "./prfmncReg/pbnstPrfmncReg";
import { coRvwActionsExport, coRvwStateExport, type coRvwState, type coRvwType } from "./matDmd/coMatRvw";
import { ruseHstryActionsExport, ruseHstryStateExport, type ruseHstryState, type ruseHstryType } from "./matDmd/ruseRvwHstry";
import { pbnstPrfmncSttnActionsExport, pbnstPrfmncSttnExport, type pbnstPrfmncSttnState, type pbnstPrfmncSttnType } from "./prfmncSttn/pbnstPrfmncSttn";
export type WrStore = comCodeType &
pubFacType &
@@ -112,7 +113,8 @@ export type WrStore = comCodeType &
ldrmntCoSttnType& // 옮겨야함
pbnstPrfmncType&
coRvwType&
ruseHstryType
ruseHstryType&
pbnstPrfmncSttnType
;
export const StoreZus = (
@@ -135,7 +137,8 @@ export const StoreZus = (
ldrmntCoSttnState& // 옮겨야함
pbnstPrfmncState&
coRvwState&
ruseHstryState
ruseHstryState&
pbnstPrfmncSttnState
= {
...comCodeStateExport,
...pubFacStateExport,
@@ -157,6 +160,7 @@ export const StoreZus = (
...pbnstPrfmncStateExport,
...coRvwStateExport,
...ruseHstryStateExport,
...pbnstPrfmncSttnExport
}
) => {
return createStore<WrStore>()((set) => {
@@ -189,6 +193,7 @@ export const StoreZus = (
...pbnstPrfmncActionsExport(set),
...coRvwActionsExport(set),
...ruseHstryActionsExport(set),
...pbnstPrfmncSttnActionsExport(set)
};
});
};