하수재이용시설현황 화면 구현, 버튼 기능 추가해야됨
This commit is contained in:
@@ -100,6 +100,16 @@ export default function Home() {
|
|||||||
<Link href="matMng/matDmd/coReg">수요처 등록</Link>
|
<Link href="matMng/matDmd/coReg">수요처 등록</Link>
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
|
<div className="col-span-2">
|
||||||
|
<Button className="w-full">
|
||||||
|
<Link href="matMng/matDmd/coSttn">수요처 관리</Link>
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
|
<div className="col-span-2">
|
||||||
|
<Button className="w-full">
|
||||||
|
<Link href="matMng/matDmd/ldrmntCoSttn">잠재수요처 관리</Link>
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -65,20 +65,6 @@ export default function HtdflSttn() {
|
|||||||
bdstTable !== undefined
|
bdstTable !== undefined
|
||||||
) {
|
) {
|
||||||
setDetailModal({ isOpen: true, data: bdstTable[index] });
|
setDetailModal({ isOpen: true, data: bdstTable[index] });
|
||||||
} else if (
|
|
||||||
headId === "chBuildingYn" &&
|
|
||||||
index !== undefined &&
|
|
||||||
bdstTable !== undefined
|
|
||||||
) {
|
|
||||||
if (
|
|
||||||
bdstTable[index] &&
|
|
||||||
bdstTable[index]?.chgBuilding[0]?.bdstChgNm !== null
|
|
||||||
) {
|
|
||||||
setBdstChgProps({
|
|
||||||
isOpen: true,
|
|
||||||
chBuilding: bdstTable[index].chgBuilding,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@@ -106,6 +92,7 @@ export default function HtdflSttn() {
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (htdflSttnRes.length > 0 && code.cityCd.length > 0) {
|
if (htdflSttnRes.length > 0 && code.cityCd.length > 0) {
|
||||||
|
console.log("htdflSttnRes", htdflSttnRes);
|
||||||
const data = tableData(htdflSttnRes, { code });
|
const data = tableData(htdflSttnRes, { code });
|
||||||
const chData = data
|
const chData = data
|
||||||
.map((item: any) => ({
|
.map((item: any) => ({
|
||||||
@@ -205,16 +192,6 @@ export default function HtdflSttn() {
|
|||||||
bodyClass={"w-[40vw] max-w-none max-h-[calc(100%-70px)]"}
|
bodyClass={"w-[40vw] max-w-none max-h-[calc(100%-70px)]"}
|
||||||
body={<SttnDetailModal type={"HTB"} formObj={detailModal.data} />}
|
body={<SttnDetailModal type={"HTB"} formObj={detailModal.data} />}
|
||||||
/>
|
/>
|
||||||
<UiModal
|
|
||||||
bodyClass={""}
|
|
||||||
open={bdstChgProps.isOpen}
|
|
||||||
body={
|
|
||||||
<BdstChgModal chgBuilding={bdstChgProps.chBuilding}></BdstChgModal>
|
|
||||||
}
|
|
||||||
onOpenChange={(open) => {
|
|
||||||
setBdstChgProps({ ...bdstChgProps, isOpen: open });
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
</ContentsDiv>
|
</ContentsDiv>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,26 +1,36 @@
|
|||||||
"use client";
|
"use client";
|
||||||
import { useWrStore } from "@/app/store";
|
import { useWrStore } from "@/app/store";
|
||||||
|
import { btnClass } from "@/app/store/common/code";
|
||||||
import {
|
import {
|
||||||
ContentsDiv,
|
ContentsDiv,
|
||||||
SearchDiv,
|
SearchBaseForm,
|
||||||
SearchFormLeft,
|
|
||||||
SearchFormRight,
|
|
||||||
SelectBox,
|
|
||||||
Title,
|
Title,
|
||||||
UiModal,
|
UiModal,
|
||||||
UiTable,
|
UiTable,
|
||||||
|
type ReturnType,
|
||||||
} from "@common/business_components/ui";
|
} from "@common/business_components/ui";
|
||||||
import ListDiv from "@common/business_components/ui/list_div";
|
import ListDiv from "@common/business_components/ui/list_div";
|
||||||
import { Button } from "@common/components/ui";
|
import { Button } from "@common/components/ui";
|
||||||
import HeadChModal from "@/components/ui/modal/sttn/headChModal/headChModal";
|
import HeadChModal from "@/components/ui/modal/sttn/headChModal/headChModal";
|
||||||
import { useState } from "react";
|
import { useCallback, useEffect, useRef, useState } from "react";
|
||||||
import { headMakeprfmnc } from "../../prfmncReg/chkgdnReg/TableHead";
|
import { HeadMakeColSpan } from "@common/business_components/ui/table/HeadMakeColSpan";
|
||||||
|
import type { customPbnst } from "@/app/store/ruseFcltMng/fcltReg/pbnstReg";
|
||||||
|
|
||||||
export default function PbnstSttn() {
|
export default function PbnstSttn() {
|
||||||
const { code, rainSttn } = useWrStore((state) => state);
|
const { code, pbnstSttn } = useWrStore(
|
||||||
|
(state) => state
|
||||||
|
);
|
||||||
|
|
||||||
|
const ref = useRef<ReturnType>({} as ReturnType);
|
||||||
|
|
||||||
|
const [pageNation, setPageNation] = useState(1);
|
||||||
const [isChHead, setIsChHead] = useState(false);
|
const [isChHead, setIsChHead] = useState(false);
|
||||||
const nodeList = headMakeprfmnc(rainSttn.pbnSttHeadList, rainSttn.pbnSttHeadNm);
|
const [bdstTable, setBdstTable] = useState<customPbnst[]>();
|
||||||
|
// const nodeList = headMakeprfmnc(pbnstSttn.pbnSttHeadList, pbnstSttn.pbnSttHeadNm);
|
||||||
|
|
||||||
|
const excelClick = useCallback(() => {
|
||||||
|
// if (codeData) pbnstSttnSearch(1, "10000", codeData);
|
||||||
|
}, []);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
@@ -28,101 +38,56 @@ export default function PbnstSttn() {
|
|||||||
<div className="grid grid-cols-4 gap-4 ">
|
<div className="grid grid-cols-4 gap-4 ">
|
||||||
<div className="col-span-4">
|
<div className="col-span-4">
|
||||||
<Title title={"하수재이용 시설 현황"} />
|
<Title title={"하수재이용 시설 현황"} />
|
||||||
<SearchDiv>
|
<SearchBaseForm
|
||||||
<SearchFormLeft>
|
selectSidoData={code.cityCd}
|
||||||
<SelectBox
|
selectSigunData={code.sggCd}
|
||||||
className={"col-span-2 w-full h-full text-2xl"}
|
selectRegionData={code.rvbsnCd}
|
||||||
label={"권역"}
|
selectUnitWaterShedData={code.lgbsnCd}
|
||||||
selectClass={""}
|
selectMiddleRegionData={code.mdmbsnCd}
|
||||||
selectArray={code.yn}
|
selectEnvPartData={code.lclgvrnmntCd}
|
||||||
onSelectValue={() => {}}
|
rightChildren={
|
||||||
value={""}
|
<Button
|
||||||
/>
|
className={btnClass}
|
||||||
<SelectBox
|
onClick={() => {
|
||||||
className={"col-span-2 w-full h-full text-2xl"}
|
setIsChHead(true);
|
||||||
label={"단위유역"}
|
}}
|
||||||
selectClass={""}
|
>
|
||||||
selectArray={code.yn}
|
조회항목설정
|
||||||
onSelectValue={() => {}}
|
</Button>
|
||||||
value={""}
|
}
|
||||||
/>
|
leftChildren={undefined}
|
||||||
<SelectBox
|
queryClick={function (returnType: ReturnType): void {
|
||||||
className={"col-span-2 w-full h-full text-2xl"}
|
// '{partValue: 'A', sidoValue: '0', sigunValue: '0', regionValue: '0', unitWaterShedValue: '0', …}'
|
||||||
label={"중권역"}
|
let con;
|
||||||
selectClass={""}
|
if (returnType.sigunValue != "0") {
|
||||||
selectArray={code.yn}
|
con = returnType.sigunValue;
|
||||||
onSelectValue={() => {}}
|
} else {
|
||||||
value={""}
|
con = returnType.sidoValue;
|
||||||
/>
|
}
|
||||||
<SelectBox
|
// pbnstSttnSearch(1, "20", con);
|
||||||
className={"col-span-2 w-full h-full text-2xl"}
|
}}
|
||||||
label={"환경청"}
|
excelClick={excelClick}
|
||||||
selectClass={""}
|
initClick={function (): void {}}
|
||||||
selectArray={code.yn}
|
btnClass={btnClass}
|
||||||
onSelectValue={() => {}}
|
ref={ref}
|
||||||
value={""}
|
/>
|
||||||
/>
|
|
||||||
<SelectBox
|
|
||||||
className={"col-span-2 w-full h-full text-2xl"}
|
|
||||||
label={"시도"}
|
|
||||||
selectClass={""}
|
|
||||||
selectArray={code.yn}
|
|
||||||
onSelectValue={() => {}}
|
|
||||||
value={""}
|
|
||||||
/>
|
|
||||||
<SelectBox
|
|
||||||
className={"col-span-2 w-full h-full text-2xl"}
|
|
||||||
label={"시군구"}
|
|
||||||
selectClass={""}
|
|
||||||
selectArray={code.yn}
|
|
||||||
onSelectValue={() => {}}
|
|
||||||
value={""}
|
|
||||||
/>
|
|
||||||
</SearchFormLeft>
|
|
||||||
<SearchFormRight>
|
|
||||||
<div className="space-y">
|
|
||||||
{/* 첫 줄: 버튼 3개 */}
|
|
||||||
<div className="flex flex-row space-x-2">
|
|
||||||
<Button size={"sm"} onClick={(e) => {}}>
|
|
||||||
조회
|
|
||||||
</Button>
|
|
||||||
<Button size={"sm"} onClick={() => {}}>
|
|
||||||
다운로드
|
|
||||||
</Button>
|
|
||||||
</div>
|
|
||||||
<div className="flex flex-row space-x-2 pt-3">
|
|
||||||
|
|
||||||
<Button
|
|
||||||
size={"sm"}
|
|
||||||
color="green"
|
|
||||||
onClick={() => {
|
|
||||||
setIsChHead(true);
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
조회항목설정
|
|
||||||
</Button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</SearchFormRight>
|
|
||||||
</SearchDiv>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="grid grid-cols-6 gap-4 ">
|
<div className="grid grid-cols-6 gap-4 ">
|
||||||
<div className="col-span-6">
|
<div className="col-span-6">
|
||||||
<ListDiv>
|
<ListDiv>
|
||||||
<UiTable
|
<UiTable
|
||||||
headName={undefined}
|
headName={[]}
|
||||||
tableData={[]}
|
tableData={bdstTable || []}
|
||||||
headlist={rainSttn.pbnSttHeadList}
|
children={
|
||||||
pageSize={0}
|
<HeadMakeColSpan upHeadList={pbnstSttn.pbnstSttNodeList} />
|
||||||
total={0}
|
}
|
||||||
cellClick={undefined}
|
headlist={pbnstSttn.pbnstSttHeadList}
|
||||||
onPageChange={function (page: number): void {
|
pageSize={20}
|
||||||
throw new Error("Function not implemented.");
|
total={100000}
|
||||||
}}
|
cellClick={(index: number | undefined,headId:string)=>{cellClick(index ?? undefined,headId)} }
|
||||||
>
|
onPageChange={setPageNation}
|
||||||
{nodeList}
|
></UiTable>
|
||||||
</UiTable>
|
|
||||||
</ListDiv>
|
</ListDiv>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -132,7 +97,15 @@ export default function PbnstSttn() {
|
|||||||
setIsChHead(!isChHead);
|
setIsChHead(!isChHead);
|
||||||
}}
|
}}
|
||||||
bodyClass={""}
|
bodyClass={""}
|
||||||
body={<HeadChModal headList={[]} type={""} />}
|
body={
|
||||||
|
<HeadChModal
|
||||||
|
type={"PBN"}
|
||||||
|
headList={pbnstSttn.pbnstSttHeadList.map((item) => ({
|
||||||
|
...item,
|
||||||
|
visible: item.visible ?? false,
|
||||||
|
}))}
|
||||||
|
/>
|
||||||
|
}
|
||||||
/>
|
/>
|
||||||
</ContentsDiv>
|
</ContentsDiv>
|
||||||
</>
|
</>
|
||||||
|
|||||||
@@ -1,44 +1,28 @@
|
|||||||
import type { chHeadType } from "@/app/store/prfmncReg/chkgdnReg/rainChkgdn";
|
import type { sttnHeadListType } from "../rainSttn/headList";
|
||||||
import type { TableUpperProps } from "../../fcltReg/rainReg";
|
import type { CommonTableProps } from "@/app/store/common/type/headder";
|
||||||
|
import { z } from "zod";
|
||||||
|
|
||||||
export const pbnSttHeadNmExport: chHeadType[] = [
|
export const pbnSttHeadListExport: z.infer<typeof sttnHeadListType> = [
|
||||||
{ headNm: "catchment", text: "유역", length: 3 },
|
{ id: "a", title: "권역", visible: true },
|
||||||
{ headNm: "adminDiv", text: "행정구역", length: 2 },
|
|
||||||
{ headNm: "rusSup", text: "재이용수공급가능량", length: 3 },
|
|
||||||
{ headNm: "yearResult", text: "연간실적정보(m³)", length: 3 },
|
|
||||||
{ headNm: "mngInfo", text: "운영정보", length: 4 },
|
|
||||||
];
|
|
||||||
|
|
||||||
// id는 다확인해야함
|
|
||||||
export const pbnSttHeadListExport: TableUpperProps[] = [
|
|
||||||
{ id: "a", title: "권역", upName: "catchment", upSequnce: 1, visible: true },
|
|
||||||
{
|
{
|
||||||
id: "aaa",
|
id: "aaa",
|
||||||
title: "단위유역",
|
title: "단위유역",
|
||||||
upName: "catchment",
|
|
||||||
upSequnce: 2,
|
|
||||||
visible: true,
|
visible: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: "aaaa",
|
id: "aaaa",
|
||||||
title: "중권역",
|
title: "중권역",
|
||||||
upName: "catchment",
|
visible: true,
|
||||||
upSequnce: 3,
|
|
||||||
visible: false,
|
|
||||||
},
|
},
|
||||||
{ id: "operMngCd", title: "환경청", visible: true },
|
{ id: "operMngCd", title: "환경청", visible: true },
|
||||||
{
|
{
|
||||||
id: "cityText",
|
id: "cityText",
|
||||||
title: "시도",
|
title: "시도",
|
||||||
upName: "adminDiv",
|
visible: true,
|
||||||
upSequnce: 1,
|
|
||||||
visible: false,
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: "sggText",
|
id: "sggText",
|
||||||
title: "시군구",
|
title: "시군구",
|
||||||
upName: "adminDiv",
|
|
||||||
upSequnce: 2,
|
|
||||||
visible: true,
|
visible: true,
|
||||||
},
|
},
|
||||||
{ id: "bdnstNm", title: "시설명", visible: true },
|
{ id: "bdnstNm", title: "시설명", visible: true },
|
||||||
@@ -51,119 +35,280 @@ export const pbnSttHeadListExport: TableUpperProps[] = [
|
|||||||
{
|
{
|
||||||
id: "fcltCpct",
|
id: "fcltCpct",
|
||||||
title: "시설용량(m³/일)",
|
title: "시설용량(m³/일)",
|
||||||
upName: "rusSup",
|
|
||||||
upSequnce: 1,
|
|
||||||
visible: true,
|
visible: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: "trbt",
|
id: "trbt",
|
||||||
title: "하수처리량(m³/일)",
|
title: "하수처리량(m³/일)",
|
||||||
upName: "rusSup",
|
|
||||||
upSequnce: 2,
|
|
||||||
visible: true,
|
visible: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: "ruseCpct",
|
id: "ruseCpct",
|
||||||
title: "재이용량(m³/일)",
|
title: "재이용량(m³/일)",
|
||||||
upName: "rusSup",
|
|
||||||
upSequnce: 3,
|
|
||||||
visible: true,
|
visible: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
id: "total",
|
id: "total",
|
||||||
title: "합계",
|
title: "합계",
|
||||||
upName: "yearResult",
|
|
||||||
upSequnce: 1,
|
|
||||||
visible: true,
|
visible: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: "ithlWtr",
|
id: "ithlWtr",
|
||||||
title: "장내용수",
|
title: "장내용수",
|
||||||
upName: "yearResult",
|
|
||||||
upSequnce: 2,
|
|
||||||
visible: true,
|
visible: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: "othlWtr",
|
id: "othlWtr",
|
||||||
title: "장외용수",
|
title: "장외용수",
|
||||||
upName: "yearResult",
|
|
||||||
upSequnce: 3,
|
|
||||||
visible: true,
|
visible: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
id: "mngMeth",
|
id: "mngMeth",
|
||||||
title: "운영방식",
|
title: "운영방식",
|
||||||
upName: "mngInfo",
|
|
||||||
upSequnce: 1,
|
|
||||||
visible: true,
|
visible: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: "rprtvBzenty",
|
id: "rprtvBzenty",
|
||||||
title: "대행업체",
|
title: "대행업체",
|
||||||
upName: "mngInfo",
|
|
||||||
upSequnce: 2,
|
|
||||||
visible: true,
|
visible: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: "firstDay",
|
id: "firstDay",
|
||||||
title: "시작일",
|
title: "시작일",
|
||||||
upName: "mngInfo",
|
|
||||||
upSequnce: 3,
|
|
||||||
visible: true,
|
visible: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: "LastDay",
|
id: "LastDay",
|
||||||
title: "종료일",
|
title: "종료일",
|
||||||
upName: "mngInfo",
|
|
||||||
upSequnce: 4,
|
|
||||||
visible: true,
|
visible: true,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
|
// id는 다확인해야함
|
||||||
|
export const pbnstSttNodeListExport: CommonTableProps[] = [
|
||||||
|
{
|
||||||
// 참고용 지워야함.
|
id: "catchment",
|
||||||
// rainChSttnHead: async (checkList: string[], type: string) => {
|
title: "유역",
|
||||||
// const headList =
|
visible: true,
|
||||||
// type === "pbn"
|
row: 1,
|
||||||
// ? pbnSttHeadList
|
rowSpan: 1,
|
||||||
// : type === "rain"
|
colSpan: 3,
|
||||||
// ? rainSttHeadList
|
},
|
||||||
// : null;
|
{
|
||||||
|
id: "operMngCd",
|
||||||
// let chNm = type === "pbn" ? pbnSttHeadNm : rainSttNodeList;
|
title: "환경청",
|
||||||
// headList?.forEach((item) => {
|
visible: true,
|
||||||
// if (checkList.find((ch) => ch === item.id)) {
|
row: 1,
|
||||||
// item.visible = false;
|
rowSpan: 2,
|
||||||
// if (item.upName) {
|
colSpan: 1,
|
||||||
// const upNames = Array.isArray(item.upName)
|
},
|
||||||
// ? item.upName
|
{
|
||||||
// : [item.upName];
|
id: "adminDiv",
|
||||||
// upNames?.forEach((up) => {
|
title: "행정구역",
|
||||||
// chNm.find((ch) => {
|
visible: true,
|
||||||
// if (ch.headNm === up) {
|
row: 1,
|
||||||
// ch.length = ch.length - 1;
|
rowSpan: 1,
|
||||||
// }
|
colSpan: 2,
|
||||||
// });
|
},
|
||||||
// });
|
{
|
||||||
// }
|
id: "bdnstNm",
|
||||||
// }
|
title: "시설명",
|
||||||
// });
|
visible: true,
|
||||||
// set((state: rainSttnState) => ({
|
row: 1,
|
||||||
// sttnCommon: {
|
rowSpan: 2,
|
||||||
// ...state.sttnCommon,
|
colSpan: 1,
|
||||||
// pbnSttHeadList:
|
},
|
||||||
// type === "pbn" ? headList : state.sttnCommon.pbnSttHeadList,
|
{
|
||||||
// rainSttHeadList:
|
id: "locDiv",
|
||||||
// type === "rain" ? headList : state.sttnCommon.rainSttHeadList,
|
title: "지역구분",
|
||||||
// rainSttNodeList:
|
visible: true,
|
||||||
// type === "rain" ? chNm : state.sttnCommon.rainSttNodeList,
|
row: 1,
|
||||||
// pbnSttHeadNm: type === "rain" ? chNm : state.sttnCommon.pbnSttHeadNm,
|
rowSpan: 2,
|
||||||
// },
|
colSpan: 1,
|
||||||
// }));
|
},
|
||||||
// },
|
{
|
||||||
// };
|
id: "phone",
|
||||||
// };
|
title: "전화번호",
|
||||||
|
visible: true,
|
||||||
|
row: 1,
|
||||||
|
rowSpan: 2,
|
||||||
|
colSpan: 1,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "fcltQuantity",
|
||||||
|
title: "시설용량(톤/일)",
|
||||||
|
visible: true,
|
||||||
|
row: 1,
|
||||||
|
rowSpan: 2,
|
||||||
|
colSpan: 1,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "rusNm",
|
||||||
|
title: "재이용시설명",
|
||||||
|
visible: true,
|
||||||
|
row: 1,
|
||||||
|
rowSpan: 2,
|
||||||
|
colSpan: 1,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "rusSup",
|
||||||
|
title: "재이용수공급가능량",
|
||||||
|
visible: true,
|
||||||
|
row: 1,
|
||||||
|
rowSpan: 1,
|
||||||
|
colSpan: 3,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "yearResult",
|
||||||
|
title: "연간실적정보(m³)",
|
||||||
|
visible: true,
|
||||||
|
row: 1,
|
||||||
|
rowSpan: 1,
|
||||||
|
colSpan: 3,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "mngInfo",
|
||||||
|
title: "운영정보",
|
||||||
|
visible: true,
|
||||||
|
row: 1,
|
||||||
|
rowSpan: 1,
|
||||||
|
colSpan: 4,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "a",
|
||||||
|
title: "권역",
|
||||||
|
upName: "catchment",
|
||||||
|
visible: true,
|
||||||
|
row: 2,
|
||||||
|
rowSpan: 1,
|
||||||
|
colSpan: 1,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "aaa",
|
||||||
|
title: "단위유역",
|
||||||
|
upName: "catchment",
|
||||||
|
visible: true,
|
||||||
|
row: 2,
|
||||||
|
rowSpan: 1,
|
||||||
|
colSpan: 1,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "aaaa",
|
||||||
|
title: "중권역",
|
||||||
|
upName: "catchment",
|
||||||
|
visible: true,
|
||||||
|
row: 2,
|
||||||
|
rowSpan: 1,
|
||||||
|
colSpan: 1,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "cityText",
|
||||||
|
title: "시도",
|
||||||
|
upName: "adminDiv",
|
||||||
|
visible: true,
|
||||||
|
row: 2,
|
||||||
|
rowSpan: 1,
|
||||||
|
colSpan: 1,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "sggText",
|
||||||
|
title: "시군구",
|
||||||
|
upName: "adminDiv",
|
||||||
|
visible: true,
|
||||||
|
row: 2,
|
||||||
|
rowSpan: 1,
|
||||||
|
colSpan: 1,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "fcltCpct",
|
||||||
|
title: "시설용량(m³/일)",
|
||||||
|
upName: "rusSup",
|
||||||
|
visible: true,
|
||||||
|
row: 2,
|
||||||
|
rowSpan: 1,
|
||||||
|
colSpan: 1,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "trbt",
|
||||||
|
title: "하수처리량(m³/일)",
|
||||||
|
upName: "rusSup",
|
||||||
|
visible: true,
|
||||||
|
row: 2,
|
||||||
|
rowSpan: 1,
|
||||||
|
colSpan: 1,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "ruseCpct",
|
||||||
|
title: "재이용량(m³/일)",
|
||||||
|
upName: "rusSup",
|
||||||
|
visible: true,
|
||||||
|
row: 2,
|
||||||
|
rowSpan: 1,
|
||||||
|
colSpan: 1,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "total",
|
||||||
|
title: "합계",
|
||||||
|
upName: "yearResult",
|
||||||
|
visible: true,
|
||||||
|
row: 2,
|
||||||
|
rowSpan: 1,
|
||||||
|
colSpan: 1,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "ithlWtr",
|
||||||
|
title: "장내용수",
|
||||||
|
upName: "yearResult",
|
||||||
|
visible: true,
|
||||||
|
row: 2,
|
||||||
|
rowSpan: 1,
|
||||||
|
colSpan: 1,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "othlWtr",
|
||||||
|
title: "장외용수",
|
||||||
|
upName: "yearResult",
|
||||||
|
visible: true,
|
||||||
|
row: 2,
|
||||||
|
rowSpan: 1,
|
||||||
|
colSpan: 1,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "mngMeth",
|
||||||
|
title: "운영방식",
|
||||||
|
upName: "mngInfo",
|
||||||
|
visible: true,
|
||||||
|
row: 2,
|
||||||
|
rowSpan: 1,
|
||||||
|
colSpan: 1,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "rprtvBzenty",
|
||||||
|
title: "대행업체",
|
||||||
|
upName: "mngInfo",
|
||||||
|
visible: true,
|
||||||
|
row: 2,
|
||||||
|
rowSpan: 1,
|
||||||
|
colSpan: 1,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "firstDay",
|
||||||
|
title: "시작일",
|
||||||
|
upName: "mngInfo",
|
||||||
|
visible: true,
|
||||||
|
row: 2,
|
||||||
|
rowSpan: 1,
|
||||||
|
colSpan: 1,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "LastDay",
|
||||||
|
title: "종료일",
|
||||||
|
upName: "mngInfo",
|
||||||
|
visible: true,
|
||||||
|
row: 2,
|
||||||
|
rowSpan: 1,
|
||||||
|
colSpan: 1,
|
||||||
|
}
|
||||||
|
];
|
||||||
@@ -0,0 +1,63 @@
|
|||||||
|
import type { CommonTableProps } from "@/app/store/common/type/headder";
|
||||||
|
import type { customPbnst } from "../../fcltReg/pbnstReg";
|
||||||
|
import type { z } from "zod";
|
||||||
|
import {
|
||||||
|
pbnSttHeadListExport,
|
||||||
|
pbnstSttNodeListExport
|
||||||
|
} from "./headList";
|
||||||
|
import { fetchType, getFetch } from "@/components/lib/api";
|
||||||
|
import { controlHeadView } from "../rainSttn";
|
||||||
|
import type { sttnHeadListType } from "../rainSttn/headList";
|
||||||
|
|
||||||
|
const pbnstSttHeadList = pbnSttHeadListExport;
|
||||||
|
const pbnstSttNodeList = pbnstSttNodeListExport;
|
||||||
|
|
||||||
|
export type pbnstSttnState = {
|
||||||
|
pbnstSttn: {
|
||||||
|
pbnstSttnRes: customPbnst[];
|
||||||
|
pbnstSttHeadList: CommonTableProps[];
|
||||||
|
pbnstSttNodeList: CommonTableProps[];
|
||||||
|
excelList: [];
|
||||||
|
isInit: boolean;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
type pbnstSttnActions = {
|
||||||
|
pbnstChSttnHead: (
|
||||||
|
headList: z.infer<typeof sttnHeadListType>,
|
||||||
|
) => void;
|
||||||
|
};
|
||||||
|
|
||||||
|
export type pbnstSttnType = pbnstSttnState & pbnstSttnActions;
|
||||||
|
|
||||||
|
export const pbnstSttnStateExport: pbnstSttnState = {
|
||||||
|
pbnstSttn: {
|
||||||
|
pbnstSttHeadList: pbnstSttHeadList,
|
||||||
|
pbnstSttNodeList: pbnstSttNodeList,
|
||||||
|
pbnstSttnRes:[],
|
||||||
|
excelList:[],
|
||||||
|
isInit: false,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
export const pbnstSttnActionsExport: (set: any) => pbnstSttnActions = (
|
||||||
|
set: any
|
||||||
|
) => {
|
||||||
|
return {
|
||||||
|
pbnstChSttnHead: async (
|
||||||
|
headList: z.infer<typeof sttnHeadListType>
|
||||||
|
): Promise<void> => {
|
||||||
|
|
||||||
|
console.log('head ', headList)
|
||||||
|
const changeNodeList= controlHeadView(headList,pbnstSttNodeList)
|
||||||
|
|
||||||
|
return set((state: pbnstSttnState) => ({
|
||||||
|
pbnstSttn: {
|
||||||
|
...state.pbnstSttn,
|
||||||
|
pbnstSttHeadList: headList,
|
||||||
|
pbnstSttNodeList: changeNodeList,
|
||||||
|
},
|
||||||
|
}));
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -36,6 +36,9 @@ import {
|
|||||||
import { rainSttnActionsExport, rainSttnStateExport, type rainSttnState, type rainSttnType } from "./ruseFcltMng/fcltSttn/rainSttn";
|
import { rainSttnActionsExport, rainSttnStateExport, type rainSttnState, type rainSttnType } from "./ruseFcltMng/fcltSttn/rainSttn";
|
||||||
import { rswtSttnActionsExport, rswtSttnStateExport, type rswtSttnState, type rswtSttnType } from "./ruseFcltMng/fcltSttn/rswtSttn";
|
import { rswtSttnActionsExport, rswtSttnStateExport, type rswtSttnState, type rswtSttnType } from "./ruseFcltMng/fcltSttn/rswtSttn";
|
||||||
import { htdflSttnActionsExport, htdflSttnStateExport, type htdflSttnState, type htdflSttnType } from "./ruseFcltMng/fcltSttn/htdflSttn";
|
import { htdflSttnActionsExport, htdflSttnStateExport, type htdflSttnState, type htdflSttnType } from "./ruseFcltMng/fcltSttn/htdflSttn";
|
||||||
|
import { pbnstSttnActionsExport, pbnstSttnStateExport, type pbnstSttnState, type pbnstSttnType } from "./ruseFcltMng/fcltSttn/pbnstSttn";
|
||||||
|
import { coSttnActionsExport, coSttnStateExport, type coSttnState, type coSttnType } from "./matDmd/coSttn"; // 옮겨야함
|
||||||
|
import { ldrmntCoSttnActionsExport, ldrmntCoSttnStateExport, type ldrmntCoSttnState, type ldrmntCoSttnType } from "./matDmd/ldrmntCoSttn"; // 옮겨야함
|
||||||
|
|
||||||
export type WrStore = comCodeType&
|
export type WrStore = comCodeType&
|
||||||
pubFacType &
|
pubFacType &
|
||||||
@@ -48,7 +51,10 @@ export type WrStore = comCodeType&
|
|||||||
rswtChkgdnType&
|
rswtChkgdnType&
|
||||||
rainSttnType&
|
rainSttnType&
|
||||||
rswtSttnType&
|
rswtSttnType&
|
||||||
htdflSttnType
|
htdflSttnType&
|
||||||
|
pbnstSttnType&
|
||||||
|
coSttnType& // 옮겨야함
|
||||||
|
ldrmntCoSttnType // 옮겨야함
|
||||||
;
|
;
|
||||||
|
|
||||||
export const StoreZus = (
|
export const StoreZus = (
|
||||||
@@ -63,7 +69,10 @@ export const StoreZus = (
|
|||||||
rswtChkgdnState&
|
rswtChkgdnState&
|
||||||
rainSttnState&
|
rainSttnState&
|
||||||
rswtSttnState&
|
rswtSttnState&
|
||||||
htdflSttnState
|
htdflSttnState&
|
||||||
|
pbnstSttnState&
|
||||||
|
coSttnState& // 옮겨야함
|
||||||
|
ldrmntCoSttnState // 옮겨야함
|
||||||
|
|
||||||
= {
|
= {
|
||||||
...comCodeStateExport,
|
...comCodeStateExport,
|
||||||
@@ -77,7 +86,10 @@ export const StoreZus = (
|
|||||||
...rswtChkgdnStateExport,
|
...rswtChkgdnStateExport,
|
||||||
...rainSttnStateExport,
|
...rainSttnStateExport,
|
||||||
...rswtSttnStateExport,
|
...rswtSttnStateExport,
|
||||||
...htdflSttnStateExport
|
...htdflSttnStateExport,
|
||||||
|
...pbnstSttnStateExport,
|
||||||
|
...coSttnStateExport, // 옮겨야함
|
||||||
|
...ldrmntCoSttnStateExport, // 옮겨야함
|
||||||
}
|
}
|
||||||
) => {
|
) => {
|
||||||
return createStore<WrStore>()((set) => {
|
return createStore<WrStore>()((set) => {
|
||||||
@@ -100,7 +112,10 @@ export const StoreZus = (
|
|||||||
...rswtChkgdnActionsExport(set),
|
...rswtChkgdnActionsExport(set),
|
||||||
...rainSttnActionsExport(set),
|
...rainSttnActionsExport(set),
|
||||||
...rswtSttnActionsExport(set),
|
...rswtSttnActionsExport(set),
|
||||||
...htdflSttnActionsExport(set)
|
...htdflSttnActionsExport(set),
|
||||||
|
...pbnstSttnActionsExport(set),
|
||||||
|
...coSttnActionsExport(set), // 옮겨야함
|
||||||
|
...ldrmntCoSttnActionsExport(set), // 옮겨야함
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import { useForm } from "react-hook-form";
|
|||||||
import { z } from "zod";
|
import { z } from "zod";
|
||||||
|
|
||||||
export default function HeadChModal({headList, type }:{headList : z.infer<typeof sttnHeadListType> ,type:string }) {
|
export default function HeadChModal({headList, type }:{headList : z.infer<typeof sttnHeadListType> ,type:string }) {
|
||||||
const { rainChSttnHead , rswtChSttnHead, htdflChSttnHead} = useWrStore((state) => state);
|
const { rainChSttnHead , rswtChSttnHead, htdflChSttnHead, pbnstChSttnHead} = useWrStore((state) => state);
|
||||||
|
|
||||||
|
|
||||||
let items = headList.map(item => ({id:item.id, title:item.title, val:item.visible }));
|
let items = headList.map(item => ({id:item.id, title:item.title, val:item.visible }));
|
||||||
@@ -28,12 +28,13 @@ export default function HeadChModal({headList, type }:{headList : z.infer<typeo
|
|||||||
|
|
||||||
const onSubmit = (valueList : z.infer<typeof sttnHeadListType> ) =>{
|
const onSubmit = (valueList : z.infer<typeof sttnHeadListType> ) =>{
|
||||||
if(type==='RNB'){
|
if(type==='RNB'){
|
||||||
|
|
||||||
rainChSttnHead(valueList)
|
rainChSttnHead(valueList)
|
||||||
}else if(type=== 'RST'){
|
}else if(type=== 'RST'){
|
||||||
rswtChSttnHead(valueList)
|
rswtChSttnHead(valueList)
|
||||||
}else if(type === 'HTB'){
|
}else if(type === 'HTB'){
|
||||||
htdflChSttnHead(valueList)
|
htdflChSttnHead(valueList)
|
||||||
|
}else if(type === 'PBN'){
|
||||||
|
pbnstChSttnHead(valueList)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user