하수재이용실적 퍼블
This commit is contained in:
@@ -41,6 +41,13 @@ export default function Home() {
|
||||
<div>
|
||||
<h2 className="text-xl font-semibold mb-4">지도점검 결과</h2>
|
||||
<div className="grid grid-cols-12 gap-4">
|
||||
<div className="col-span-2">
|
||||
<Button className="w-full">
|
||||
<Link href="ruseFcltMng/prfmncReg/pbnstPrfmncReg">
|
||||
하수재이용실적 등록
|
||||
</Link>
|
||||
</Button>
|
||||
</div>
|
||||
<div className="col-span-2">
|
||||
<Button className="w-full">
|
||||
<Link href="ruseFcltMng/prfmncReg/chkgdnReg">
|
||||
|
||||
@@ -0,0 +1,127 @@
|
||||
"use client";
|
||||
|
||||
import { useWrStore } from "@/app/store";
|
||||
import type { pubHasuType } from "@/app/store/ruseFcltMng/fcltReg/pbnstReg/type";
|
||||
import { yearOptions } from "@/components/lib/func/commom";
|
||||
import { ContentsDiv, Title, SearchDiv, SearchFormLeft, SelectBox, SearchInput, SearchFormRight, ScrollArea, UiTable } from "@common/business_components/ui";
|
||||
import ListDiv from "@common/business_components/ui/list_div";
|
||||
import { Button, Label } from "@common/components/ui";
|
||||
import { useState, useEffect } from "react";
|
||||
|
||||
export default function prfmncPrfmncReg() {
|
||||
const { code, prfmnc, prfmncHasuInit, searchFclts, } = useWrStore((state) => state);
|
||||
const { pbnstPrfmncHeadList, monthHeadList,prfmncRes } = prfmnc;
|
||||
const [bdstTable, setbdstTable] = useState<pubHasuType[]>();
|
||||
const [searchTxt, setSearchTxt] = useState<string>();
|
||||
|
||||
const [searchYear, setSearchYear] = useState<string>(String(new Date().getFullYear()));
|
||||
useEffect(() => {
|
||||
if (!prfmnc.isInit) {
|
||||
prfmncHasuInit("1", "11");
|
||||
}
|
||||
}, [prfmnc.isInit, prfmncHasuInit]);
|
||||
useEffect(() => {
|
||||
console.log("prfmnc.prfmncRes", prfmncRes)
|
||||
},[prfmncRes]);
|
||||
|
||||
return (
|
||||
<>
|
||||
<ContentsDiv>
|
||||
<div className="grid grid-cols-4 gap-4">
|
||||
<div className="col-span-4">
|
||||
<Title title={"하수재이용 시설 등록"} />
|
||||
<SearchDiv>
|
||||
<SearchFormLeft>
|
||||
<div className="col-span-2 flex flex-row space-x-2">
|
||||
<Label className="w-48 mt-2 text-xl text-gray-600">{'실적등록년도'}</Label>
|
||||
<SelectBox
|
||||
className="w-full h-full text-2xl"
|
||||
label=""
|
||||
selectClass={""}
|
||||
selectArray={yearOptions}
|
||||
value={searchYear}
|
||||
onSelectValue={(val: string | number) =>
|
||||
setSearchYear(String(val))
|
||||
}
|
||||
/>
|
||||
</div>
|
||||
<div className="col-span-2 flex flex-row space-x-2">
|
||||
<Label className="w-28 mt-2 text-xl text-gray-600">{'시설명'}</Label>
|
||||
<SearchInput
|
||||
className={"w-full text-2xl"}
|
||||
label=""
|
||||
textValue={searchTxt || ""}
|
||||
setText={(e) => {
|
||||
setSearchTxt(e);
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
</SearchFormLeft>
|
||||
<SearchFormRight
|
||||
className="w-2/12 mx-5 flex flex-col items-center justify-center space-x-2 ">
|
||||
<div className="space-y">
|
||||
<div className="flex flex-row space-x-2">
|
||||
<Button
|
||||
size={"sm"}
|
||||
onClick={(e) => { }}
|
||||
>
|
||||
조회
|
||||
</Button>
|
||||
<Button
|
||||
size={"sm"}
|
||||
onClick={() => { }}
|
||||
>
|
||||
저장
|
||||
</Button>
|
||||
<Button
|
||||
size={"sm"}
|
||||
onClick={() => { }}
|
||||
>
|
||||
파일등록
|
||||
</Button>
|
||||
<Button color="green" size={"sm"} onClick={() => { }}>
|
||||
양식받기
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
</SearchFormRight>
|
||||
</SearchDiv>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="grid grid-cols-12 gap-4 h-full">
|
||||
<div className="col-span-4 h-full min-h-0">
|
||||
<ListDiv className="min-h-0">
|
||||
<ScrollArea className="h-[60vh]">
|
||||
<UiTable
|
||||
tableData={bdstTable || []}
|
||||
headlist={pbnstPrfmncHeadList}
|
||||
pageSize={100}
|
||||
total={10}
|
||||
headName={"하수재이용시설 목록"}
|
||||
cellClick={() => { }}
|
||||
onPageChange={(page: number) => { }}
|
||||
children={undefined}
|
||||
/>
|
||||
</ScrollArea>
|
||||
</ListDiv>
|
||||
</div>
|
||||
<ListDiv className="col-span-8 pr-6 ">
|
||||
<ScrollArea className="h-[60vh]">
|
||||
<UiTable
|
||||
tableData={[]}
|
||||
headlist={monthHeadList}
|
||||
pageSize={100}
|
||||
total={10}
|
||||
headName={"하수처리수재이용 실적(m3) 등록결과"}
|
||||
cellClick={() => { }}
|
||||
onPageChange={() => { }}
|
||||
children={undefined}
|
||||
/>
|
||||
</ScrollArea>
|
||||
</ListDiv>
|
||||
</div>
|
||||
</ContentsDiv>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
import type { TableUpperProps } from "../../ruseFcltMng/fcltReg/rainReg";
|
||||
|
||||
export const pbnstPrfmncHeadListExport: TableUpperProps[] = [
|
||||
{ id: "sido", title: "시도" },
|
||||
{ id: "gugun", title: "시군구" },
|
||||
{ id: "bscFctNm", title: "시설명" },
|
||||
{ id: "sisul", title: "재이용시설명" },
|
||||
{ id: "sisulCd", title: "재이용시설코드" },
|
||||
];
|
||||
|
||||
export const monthHeadListExport: TableUpperProps[] = [
|
||||
{ id: "gubun", title: "구분" },
|
||||
{ id: "total", title: "계" },
|
||||
{ id: "mon1", title: "1월" },
|
||||
{ id: "mon2", title: "2월" },
|
||||
{ id: "mon3", title: "3월" },
|
||||
{ id: "mon4", title: "4월" },
|
||||
{ id: "mon5", title: "5월" },
|
||||
{ id: "mon6", title: "6월" },
|
||||
{ id: "mon7", title: "7월" },
|
||||
{ id: "mon8", title: "8월" },
|
||||
{ id: "mon9", title: "9월" },
|
||||
{ id: "mon10", title: "10월" },
|
||||
{ id: "mon11", title: "11월" },
|
||||
{ id: "mon12", title: "12월" },
|
||||
];
|
||||
@@ -0,0 +1,77 @@
|
||||
import { fetchType, getFetch, postFectch } from "@/components/lib/api";
|
||||
import type { TableUpperProps } from "../../ruseFcltMng/fcltReg/rainReg";
|
||||
import {
|
||||
pbnstPrfmncHeadListExport,
|
||||
monthHeadListExport,
|
||||
} from "./headList";
|
||||
import type { pubHasuType } from "../../ruseFcltMng/fcltReg/pbnstReg/type";
|
||||
|
||||
const pbnstPrfmncHeadList = pbnstPrfmncHeadListExport;
|
||||
const monthHeadList = monthHeadListExport;
|
||||
|
||||
export type pbnstPrfmncState = {
|
||||
prfmnc: {
|
||||
isInit: boolean;
|
||||
pbnstPrfmncHeadList: TableUpperProps[];
|
||||
monthHeadList: TableUpperProps[];
|
||||
prfmncRes: pubHasuType[];
|
||||
}
|
||||
}
|
||||
|
||||
export const pbnstPrfmncStateExport: pbnstPrfmncState = {
|
||||
prfmnc: {
|
||||
isInit: false,
|
||||
pbnstPrfmncHeadList: pbnstPrfmncHeadList,
|
||||
monthHeadList: monthHeadList,
|
||||
prfmncRes: [],
|
||||
}
|
||||
}
|
||||
|
||||
export type pbnstPrfmncType = pbnstPrfmncState & pbnstPrfmncActions;
|
||||
|
||||
type pbnstPrfmncActions = {
|
||||
prfmncHasuInit: (page: string, sggOrCity: string) => void;
|
||||
}
|
||||
|
||||
const checkWrRegList = async () => {
|
||||
const wrRegList = await getFetch("wr", `/reuseFc/pubFc`);
|
||||
return wrRegList;
|
||||
};
|
||||
const hasuListFetch = async (page: string, sggOrCity: string) => {
|
||||
const checkWrRegListRes = await checkWrRegList();
|
||||
|
||||
const rainRes = await postFectch(
|
||||
`/prcsFclt/ruseInfo/${page ? page : 1}/10/A/${sggOrCity ? sggOrCity : "11"}/0/1/SW`,
|
||||
checkWrRegListRes,
|
||||
fetchType.COMMON
|
||||
);
|
||||
|
||||
const hasuList = rainRes.data.map((item: any) => {
|
||||
return {
|
||||
...item,
|
||||
ruse: item.ruse === false ? "N" : "Y",
|
||||
};
|
||||
});
|
||||
|
||||
return hasuList;
|
||||
};
|
||||
export const pbnstPrfmncActionsExport: (set: any) => pbnstPrfmncActions = (set: any) => {
|
||||
return {
|
||||
prfmncHasuInit: async (page: string, sggOrCity: string) => {
|
||||
try {
|
||||
const prfmncRes = await hasuListFetch(page, sggOrCity);
|
||||
console.log("prfmncRes", prfmncRes)
|
||||
return set((state: pbnstPrfmncState) => ({
|
||||
...state,
|
||||
prfmnc: {
|
||||
...state.prfmnc,
|
||||
prfmncRes: prfmncRes,
|
||||
isInit: false,
|
||||
},
|
||||
}));
|
||||
} catch (errorHasu) {
|
||||
console.log(errorHasu);
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
@@ -88,6 +88,7 @@ import { pbnstSttnActionsExport, pbnstSttnStateExport, type pbnstSttnState, type
|
||||
import { coSttnActionsExport, coSttnStateExport, type coSttnState, type coSttnType } from "./matDmd/coSttn"; // 옮겨야함
|
||||
import { ldrmntCoSttnActionsExport, ldrmntCoSttnStateExport, type ldrmntCoSttnState, type ldrmntCoSttnType } from "./matDmd/ldrmntCoSttn"; // 옮겨야함
|
||||
import { searchActions, type comFcltActions, type comFcltState } from "./common/searchCode";
|
||||
import { pbnstPrfmncActionsExport, pbnstPrfmncStateExport, type pbnstPrfmncState, type pbnstPrfmncType } from "./prfmncReg/pbnstPrfmncReg";
|
||||
|
||||
export type WrStore = comCodeType &
|
||||
pubFacType &
|
||||
@@ -106,7 +107,8 @@ export type WrStore = comCodeType &
|
||||
pbnstSttnType&
|
||||
comFcltActions&comFcltState&
|
||||
coSttnType& // 옮겨야함
|
||||
ldrmntCoSttnType // 옮겨야함
|
||||
ldrmntCoSttnType& // 옮겨야함
|
||||
pbnstPrfmncType
|
||||
;
|
||||
|
||||
export const StoreZus = (
|
||||
@@ -126,7 +128,8 @@ export const StoreZus = (
|
||||
rswtChkSttnState &
|
||||
pbnstSttnState&
|
||||
coSttnState& // 옮겨야함
|
||||
ldrmntCoSttnState // 옮겨야함
|
||||
ldrmntCoSttnState& // 옮겨야함
|
||||
pbnstPrfmncState
|
||||
= {
|
||||
...comCodeStateExport,
|
||||
...pubFacStateExport,
|
||||
@@ -145,6 +148,7 @@ export const StoreZus = (
|
||||
...pbnstSttnStateExport,
|
||||
...coSttnStateExport, // 옮겨야함
|
||||
...ldrmntCoSttnStateExport, // 옮겨야함
|
||||
...pbnstPrfmncStateExport,
|
||||
}
|
||||
) => {
|
||||
return createStore<WrStore>()((set) => {
|
||||
@@ -174,6 +178,7 @@ export const StoreZus = (
|
||||
...pbnstSttnActionsExport(set),
|
||||
...coSttnActionsExport(set), // 옮겨야함
|
||||
...ldrmntCoSttnActionsExport(set), // 옮겨야함
|
||||
...pbnstPrfmncActionsExport(set),
|
||||
};
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user