하수재이용시설현황 화면 구현, 버튼 기능 추가해야됨
This commit is contained in:
@@ -1,44 +1,28 @@
|
||||
import type { chHeadType } from "@/app/store/prfmncReg/chkgdnReg/rainChkgdn";
|
||||
import type { TableUpperProps } from "../../fcltReg/rainReg";
|
||||
import type { sttnHeadListType } from "../rainSttn/headList";
|
||||
import type { CommonTableProps } from "@/app/store/common/type/headder";
|
||||
import { z } from "zod";
|
||||
|
||||
export const pbnSttHeadNmExport: chHeadType[] = [
|
||||
{ headNm: "catchment", text: "유역", length: 3 },
|
||||
{ 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 },
|
||||
export const pbnSttHeadListExport: z.infer<typeof sttnHeadListType> = [
|
||||
{ id: "a", title: "권역", visible: true },
|
||||
{
|
||||
id: "aaa",
|
||||
title: "단위유역",
|
||||
upName: "catchment",
|
||||
upSequnce: 2,
|
||||
visible: true,
|
||||
},
|
||||
{
|
||||
id: "aaaa",
|
||||
title: "중권역",
|
||||
upName: "catchment",
|
||||
upSequnce: 3,
|
||||
visible: false,
|
||||
visible: true,
|
||||
},
|
||||
{ id: "operMngCd", title: "환경청", visible: true },
|
||||
{
|
||||
id: "cityText",
|
||||
title: "시도",
|
||||
upName: "adminDiv",
|
||||
upSequnce: 1,
|
||||
visible: false,
|
||||
visible: true,
|
||||
},
|
||||
{
|
||||
id: "sggText",
|
||||
title: "시군구",
|
||||
upName: "adminDiv",
|
||||
upSequnce: 2,
|
||||
visible: true,
|
||||
},
|
||||
{ id: "bdnstNm", title: "시설명", visible: true },
|
||||
@@ -51,119 +35,280 @@ export const pbnSttHeadListExport: TableUpperProps[] = [
|
||||
{
|
||||
id: "fcltCpct",
|
||||
title: "시설용량(m³/일)",
|
||||
upName: "rusSup",
|
||||
upSequnce: 1,
|
||||
visible: true,
|
||||
},
|
||||
{
|
||||
id: "trbt",
|
||||
title: "하수처리량(m³/일)",
|
||||
upName: "rusSup",
|
||||
upSequnce: 2,
|
||||
visible: true,
|
||||
},
|
||||
{
|
||||
id: "ruseCpct",
|
||||
title: "재이용량(m³/일)",
|
||||
upName: "rusSup",
|
||||
upSequnce: 3,
|
||||
visible: true,
|
||||
},
|
||||
|
||||
{
|
||||
id: "total",
|
||||
title: "합계",
|
||||
upName: "yearResult",
|
||||
upSequnce: 1,
|
||||
visible: true,
|
||||
},
|
||||
{
|
||||
id: "ithlWtr",
|
||||
title: "장내용수",
|
||||
upName: "yearResult",
|
||||
upSequnce: 2,
|
||||
visible: true,
|
||||
},
|
||||
{
|
||||
id: "othlWtr",
|
||||
title: "장외용수",
|
||||
upName: "yearResult",
|
||||
upSequnce: 3,
|
||||
visible: true,
|
||||
},
|
||||
|
||||
{
|
||||
id: "mngMeth",
|
||||
title: "운영방식",
|
||||
upName: "mngInfo",
|
||||
upSequnce: 1,
|
||||
visible: true,
|
||||
},
|
||||
{
|
||||
id: "rprtvBzenty",
|
||||
title: "대행업체",
|
||||
upName: "mngInfo",
|
||||
upSequnce: 2,
|
||||
visible: true,
|
||||
},
|
||||
{
|
||||
id: "firstDay",
|
||||
title: "시작일",
|
||||
upName: "mngInfo",
|
||||
upSequnce: 3,
|
||||
visible: true,
|
||||
},
|
||||
{
|
||||
id: "LastDay",
|
||||
title: "종료일",
|
||||
upName: "mngInfo",
|
||||
upSequnce: 4,
|
||||
visible: true,
|
||||
},
|
||||
];
|
||||
|
||||
|
||||
|
||||
|
||||
// 참고용 지워야함.
|
||||
// rainChSttnHead: async (checkList: string[], type: string) => {
|
||||
// const headList =
|
||||
// type === "pbn"
|
||||
// ? pbnSttHeadList
|
||||
// : type === "rain"
|
||||
// ? rainSttHeadList
|
||||
// : null;
|
||||
|
||||
// let chNm = type === "pbn" ? pbnSttHeadNm : rainSttNodeList;
|
||||
// headList?.forEach((item) => {
|
||||
// if (checkList.find((ch) => ch === item.id)) {
|
||||
// item.visible = false;
|
||||
// if (item.upName) {
|
||||
// const upNames = Array.isArray(item.upName)
|
||||
// ? item.upName
|
||||
// : [item.upName];
|
||||
// upNames?.forEach((up) => {
|
||||
// chNm.find((ch) => {
|
||||
// if (ch.headNm === up) {
|
||||
// ch.length = ch.length - 1;
|
||||
// }
|
||||
// });
|
||||
// });
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
// set((state: rainSttnState) => ({
|
||||
// sttnCommon: {
|
||||
// ...state.sttnCommon,
|
||||
// pbnSttHeadList:
|
||||
// type === "pbn" ? headList : state.sttnCommon.pbnSttHeadList,
|
||||
// rainSttHeadList:
|
||||
// type === "rain" ? headList : state.sttnCommon.rainSttHeadList,
|
||||
// rainSttNodeList:
|
||||
// type === "rain" ? chNm : state.sttnCommon.rainSttNodeList,
|
||||
// pbnSttHeadNm: type === "rain" ? chNm : state.sttnCommon.pbnSttHeadNm,
|
||||
// },
|
||||
// }));
|
||||
// },
|
||||
// };
|
||||
// };
|
||||
// id는 다확인해야함
|
||||
export const pbnstSttNodeListExport: CommonTableProps[] = [
|
||||
{
|
||||
id: "catchment",
|
||||
title: "유역",
|
||||
visible: true,
|
||||
row: 1,
|
||||
rowSpan: 1,
|
||||
colSpan: 3,
|
||||
},
|
||||
{
|
||||
id: "operMngCd",
|
||||
title: "환경청",
|
||||
visible: true,
|
||||
row: 1,
|
||||
rowSpan: 2,
|
||||
colSpan: 1,
|
||||
},
|
||||
{
|
||||
id: "adminDiv",
|
||||
title: "행정구역",
|
||||
visible: true,
|
||||
row: 1,
|
||||
rowSpan: 1,
|
||||
colSpan: 2,
|
||||
},
|
||||
{
|
||||
id: "bdnstNm",
|
||||
title: "시설명",
|
||||
visible: true,
|
||||
row: 1,
|
||||
rowSpan: 2,
|
||||
colSpan: 1,
|
||||
},
|
||||
{
|
||||
id: "locDiv",
|
||||
title: "지역구분",
|
||||
visible: true,
|
||||
row: 1,
|
||||
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 { rswtSttnActionsExport, rswtSttnStateExport, type rswtSttnState, type rswtSttnType } from "./ruseFcltMng/fcltSttn/rswtSttn";
|
||||
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&
|
||||
pubFacType &
|
||||
@@ -48,7 +51,10 @@ export type WrStore = comCodeType&
|
||||
rswtChkgdnType&
|
||||
rainSttnType&
|
||||
rswtSttnType&
|
||||
htdflSttnType
|
||||
htdflSttnType&
|
||||
pbnstSttnType&
|
||||
coSttnType& // 옮겨야함
|
||||
ldrmntCoSttnType // 옮겨야함
|
||||
;
|
||||
|
||||
export const StoreZus = (
|
||||
@@ -63,7 +69,10 @@ export const StoreZus = (
|
||||
rswtChkgdnState&
|
||||
rainSttnState&
|
||||
rswtSttnState&
|
||||
htdflSttnState
|
||||
htdflSttnState&
|
||||
pbnstSttnState&
|
||||
coSttnState& // 옮겨야함
|
||||
ldrmntCoSttnState // 옮겨야함
|
||||
|
||||
= {
|
||||
...comCodeStateExport,
|
||||
@@ -77,7 +86,10 @@ export const StoreZus = (
|
||||
...rswtChkgdnStateExport,
|
||||
...rainSttnStateExport,
|
||||
...rswtSttnStateExport,
|
||||
...htdflSttnStateExport
|
||||
...htdflSttnStateExport,
|
||||
...pbnstSttnStateExport,
|
||||
...coSttnStateExport, // 옮겨야함
|
||||
...ldrmntCoSttnStateExport, // 옮겨야함
|
||||
}
|
||||
) => {
|
||||
return createStore<WrStore>()((set) => {
|
||||
@@ -100,7 +112,10 @@ export const StoreZus = (
|
||||
...rswtChkgdnActionsExport(set),
|
||||
...rainSttnActionsExport(set),
|
||||
...rswtSttnActionsExport(set),
|
||||
...htdflSttnActionsExport(set)
|
||||
...htdflSttnActionsExport(set),
|
||||
...pbnstSttnActionsExport(set),
|
||||
...coSttnActionsExport(set), // 옮겨야함
|
||||
...ldrmntCoSttnActionsExport(set), // 옮겨야함
|
||||
};
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user