Merge commit '7e626b2566b8e31bd9afe03c934533d70ad032bc' into iipbs/wr/dev
iipbs_wr / build (push) Has been cancelled
iipbs_wr / build (push) Has been cancelled
This commit is contained in:
@@ -62,6 +62,13 @@ export default function Home() {
|
||||
</Link>
|
||||
</Button>
|
||||
</div>
|
||||
<div className="col-span-2">
|
||||
<Button className="w-full">
|
||||
<Link href="ruseFcltMng/fcltSttn/rainSttn">
|
||||
빗물재이용시설현황
|
||||
</Link>
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ import { headMakeColSpan } from "../rainReg/page";
|
||||
import ListDiv from "@common/business_components/ui/list_div";
|
||||
import { useEffect, useState } from "react";
|
||||
import { tableData } from "@/components/lib/func/commom";
|
||||
import { HtdflRegForm } from "@/components/ui/form/fcltReg/htdflReg/htdflRegForm";
|
||||
import HtdflRegForm from "@/components/ui/form/fcltReg/htdflReg/htdflRegForm";
|
||||
import type { chgBuilding } from "@/app/store/ruseFcltMng/fcltReg/rainReg";
|
||||
import BdstChgModal from "@/components/ui/modal/bdstChgModal/bdstChgModal";
|
||||
import { BdstReg } from "@/components/ui/modal/bdstRegModal/bdstRegModal";
|
||||
@@ -89,13 +89,15 @@ export default function Home() {
|
||||
/>
|
||||
</SearchFormLeft>
|
||||
<SearchFormRight>
|
||||
<Button className="mr-4 rounded-lg" onClick={()=>{initHtdfl(searchTxt||"")}}>조회</Button>
|
||||
<div className="flex flex-row space-x-2">
|
||||
<Button size={"sm"} onClick={()=>{initHtdfl(searchTxt||"")}}>조회</Button>
|
||||
<Button
|
||||
className="mr-4 rounded-lg"
|
||||
size={"sm"}
|
||||
onClick={() => setIsNewReg(!issNewReg)}
|
||||
>
|
||||
신규등록
|
||||
</Button>
|
||||
</div>
|
||||
</SearchFormRight>
|
||||
</SearchDiv>
|
||||
</div>
|
||||
|
||||
@@ -1,50 +1,62 @@
|
||||
"use client";
|
||||
import {
|
||||
ContentsDiv,
|
||||
ScrollArea,
|
||||
SearchDiv,
|
||||
SearchFormLeft,
|
||||
SearchFormRight,
|
||||
SearchInput,
|
||||
SelectBox,
|
||||
Title,
|
||||
UiTable,
|
||||
} from "@common/business_components";
|
||||
import { Button } from "@common/components";
|
||||
import { Button, Input } from "@common/components";
|
||||
import { useWrStore } from "../../../store";
|
||||
import { PbnstBuseForm } from "@/components/ui/form/fcltReg/pbnstReg/buseReg/component";
|
||||
import { Tabs, TabsList, TabsTrigger, TabsContent } from "@common/components";
|
||||
import { PbnstMngForm} from "@/components/ui/form/fcltReg/pbnstReg/mngReg/component";
|
||||
import { PbnstMngForm } from "@/components/ui/form/fcltReg/pbnstReg/mngReg/component";
|
||||
import { useEffect, useState } from "react";
|
||||
import type { ruseFcltType } from "@/app/store/ruseFcltMng/fcltReg/pbnstReg";
|
||||
|
||||
import type { customPbnst, ruseFcltType } from "@/app/store/ruseFcltMng/fcltReg/pbnstReg";
|
||||
import ListDiv from "@common/business_components/ui/list_div";
|
||||
import { tableData } from "@/components/lib/func/commom";
|
||||
|
||||
export default function PublicReuseFaciltyInsert() {
|
||||
const { pubFac , pubMng,mngMainValue} = useWrStore((state) => state);
|
||||
const { pubFacHeadList, publicReuseFacilityData } = pubFac;
|
||||
const { ruseFclt } = pubMng;
|
||||
const { code, pubFac, pubHasuInit } = useWrStore((state) => state);
|
||||
const { pubFacHeadList } = pubFac;
|
||||
|
||||
const [currentTab, setCurrentTab] = useState<string>('mng');
|
||||
|
||||
const {pbnstReg} = pubFac
|
||||
const [currentTab, setCurrentTab] = useState<string>("mng");
|
||||
const [fcltMng, setFcltMng] = useState<ruseFcltType[]>();
|
||||
const [searchTxt, setSearchTxt] = useState<string>();
|
||||
const [bdstTable, setbdstTable] = useState<customPbnst[]>();
|
||||
|
||||
|
||||
useEffect(() => {
|
||||
if (!pubFac.isInit) {
|
||||
pubHasuInit(undefined);
|
||||
}
|
||||
}, [pubFac.isInit, pubHasuInit]);
|
||||
|
||||
|
||||
useEffect(() => {
|
||||
if (code.sggCd.length > 0) {
|
||||
console.log("pbnstReg ", pbnstReg)
|
||||
console.log( " wd ", tableData(pbnstReg, { code }))
|
||||
setbdstTable(tableData(pbnstReg, { code }));
|
||||
}
|
||||
}, [code, pbnstReg]);
|
||||
|
||||
|
||||
const searchDiv = "하수재이용시설 ";
|
||||
const selectBox = [
|
||||
{ text: "서울하수처리시설", val: "1_hasu" },
|
||||
{ text: "서울1하수처리시설", val: "2_hasu" },
|
||||
{ text: "서울2하수처리시설", val: "3_hasu" },
|
||||
];
|
||||
const headName = () => {
|
||||
return <h1 className="pl-3 text-xl">○공공 하수처리시설 등록</h1>;
|
||||
};
|
||||
const onSelectValue = (val: string) => {
|
||||
console.log(val);
|
||||
};
|
||||
const cellClick = (val: number | undefined) => {
|
||||
if (val === undefined) return;
|
||||
let data;
|
||||
if (publicReuseFacilityData[val]) {
|
||||
data = ruseFclt.filter(
|
||||
(item) => item.swtrmtFcltFk === publicReuseFacilityData[val]?.swtrmtFcltFk
|
||||
);
|
||||
setFcltMng(data);
|
||||
}
|
||||
|
||||
setFcltMng([]);
|
||||
};
|
||||
const resetContents = () => {
|
||||
const resetContents = () => {
|
||||
setFcltMng([]); // 빈 배열로 설정하여 신규 모드로 전환
|
||||
};
|
||||
|
||||
@@ -54,67 +66,69 @@ const resetContents = () => {
|
||||
|
||||
return (
|
||||
<>
|
||||
<div className="grid grid-cols-2 gap-4 h-full">
|
||||
<div className="col-span-4 ">
|
||||
<h1 className="pl-3 text-xl"> 하수재이용시설 등록</h1>
|
||||
<div className="m-8">
|
||||
<ContentsDiv>
|
||||
<div className="grid grid-cols-4 gap-4 ">
|
||||
<div className="col-span-4 m-8">
|
||||
<Title title={"하수재이용시설 등록"} />
|
||||
<SearchDiv>
|
||||
<div className="w-4/5 grid grid-cols-12 gap-1 mx-4">
|
||||
<SelectBox
|
||||
className="col-span-4"
|
||||
label={searchDiv}
|
||||
selectArray={selectBox}
|
||||
onSelectValue={onSelectValue}
|
||||
selectClass={undefined}
|
||||
<SearchFormLeft>
|
||||
|
||||
<SearchInput
|
||||
className="col-span-3 my-7"
|
||||
label="건물명"
|
||||
textValue={searchTxt || ""}
|
||||
setText={(e) => {
|
||||
setSearchTxt(e);
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
<div className="w-1/5 flex items-center justify-end">
|
||||
</SearchFormLeft>
|
||||
<SearchFormRight>
|
||||
<Button className="mr-16 rounded-lg">조회</Button>
|
||||
</div>
|
||||
</SearchFormRight>
|
||||
</SearchDiv>
|
||||
</div>
|
||||
</div>
|
||||
<div className="col-span-1 pl-11 max-h-full">
|
||||
<UiTable
|
||||
tableData={publicReuseFacilityData}
|
||||
headlist={pubFacHeadList}
|
||||
pageSize={100}
|
||||
total={10}
|
||||
headName={headName()}
|
||||
children={undefined} cellClick={cellClick} />
|
||||
</div>
|
||||
<div className="col-span-1 pr-6 max-h-full overflow-y-scroll">
|
||||
|
||||
|
||||
|
||||
<Tabs defaultValue="mng" onValueChange={handleTabChange}>
|
||||
<div className="flex justify-between items-center">
|
||||
<TabsList>
|
||||
<TabsTrigger value="mng">시설정보</TabsTrigger>
|
||||
<TabsTrigger value="buse">차수별정보</TabsTrigger>
|
||||
</TabsList>
|
||||
<Button className="rounded-lg" onClick={resetContents}>
|
||||
신규등록
|
||||
</Button>
|
||||
</div>
|
||||
<TabsContent className="max-h-full" value="mng">
|
||||
<ScrollArea>
|
||||
<PbnstMngForm
|
||||
data={fcltMng || []}
|
||||
/>
|
||||
<div className="grid grid-cols-6 gap-4">
|
||||
<div className="col-span-4">
|
||||
<ScrollArea className="h-[60vh] rounded-md border p-2">
|
||||
<div className="min-h-[300px]">
|
||||
<UiTable
|
||||
tableData={bdstTable || []}
|
||||
headlist={pubFacHeadList}
|
||||
pageSize={100}
|
||||
total={10}
|
||||
headName={"공공 하수처리시설 등록"}
|
||||
cellClick={cellClick}
|
||||
onPageChange={(page: number) => { } } children={undefined} />
|
||||
</div>
|
||||
</ScrollArea>
|
||||
</TabsContent>
|
||||
<TabsContent value="buse">
|
||||
<ScrollArea>
|
||||
<PbnstBuseForm />
|
||||
</ScrollArea>
|
||||
|
||||
</TabsContent>
|
||||
</Tabs>
|
||||
|
||||
|
||||
</div>
|
||||
<ListDiv className="col-span-2 pr-6 max-h-full overflow-y-scrolh1l">
|
||||
<ScrollArea className="h-[60vh]">
|
||||
<Tabs defaultValue="mng" onValueChange={handleTabChange}>
|
||||
<div className="flex justify-between items-center">
|
||||
<TabsList>
|
||||
<TabsTrigger value="mng">시설정보</TabsTrigger>
|
||||
<TabsTrigger value="buse">차수별정보</TabsTrigger>
|
||||
</TabsList>
|
||||
<Button className="rounded-lg" onClick={resetContents}>
|
||||
신규등록
|
||||
</Button>
|
||||
</div>
|
||||
<TabsContent className="max-h-full" value="mng">
|
||||
<PbnstMngForm data={fcltMng || []} />
|
||||
</TabsContent>
|
||||
<TabsContent className="max-h-full" value="buse">
|
||||
<PbnstBuseForm />
|
||||
</TabsContent>
|
||||
</Tabs>
|
||||
</ScrollArea>
|
||||
</ListDiv>
|
||||
</div>
|
||||
</div>
|
||||
</ContentsDiv>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ import type {
|
||||
TableUpperProps,
|
||||
} from "@/app/store/ruseFcltMng/fcltReg/rainReg";
|
||||
import { tableData } from "@/components/lib/func/commom";
|
||||
import { RainRegForm } from "@/components/ui/form/fcltReg/rainReg/rainRegForm";
|
||||
import RainRegForm from "@/components/ui/form/fcltReg/rainReg/rainRegForm";
|
||||
import BdstChgModal from "@/components/ui/modal/bdstChgModal/bdstChgModal";
|
||||
import { BdstReg } from "@/components/ui/modal/bdstRegModal/bdstRegModal";
|
||||
import {
|
||||
@@ -123,9 +123,11 @@ export default function Home() {
|
||||
}}
|
||||
/>
|
||||
</SearchFormLeft>
|
||||
<SearchFormRight>
|
||||
<SearchFormRight >
|
||||
<div className="flex flex-row space-x-2">
|
||||
<Button
|
||||
className="mr-4 rounded-lg"
|
||||
className=""
|
||||
size={"sm"}
|
||||
onClick={(e) => {
|
||||
init(searchTxt || "");
|
||||
}}
|
||||
@@ -133,11 +135,13 @@ export default function Home() {
|
||||
조회
|
||||
</Button>
|
||||
<Button
|
||||
className="mr-4 rounded-lg"
|
||||
size={"sm"}
|
||||
className=""
|
||||
onClick={() => setIsNewReg(!issNewReg)}
|
||||
>
|
||||
신규등록
|
||||
</Button>
|
||||
</div>
|
||||
</SearchFormRight>
|
||||
</SearchDiv>
|
||||
</div>
|
||||
|
||||
@@ -18,7 +18,7 @@ import { headMakeColSpan } from "../rainReg/page";
|
||||
import { useEffect, useState } from "react";
|
||||
import type { customRswtBdst } from "@/app/store/ruseFcltMng/fcltReg/rswtReg";
|
||||
import { tableData } from "@/components/lib/func/commom";
|
||||
import { RswtrRegForm } from "@/components/ui/form/fcltReg/rswtrReg/RswtrRegForm";
|
||||
import RswtrRegForm from "@/components/ui/form/fcltReg/rswtrReg/rswtrRegForm";
|
||||
import BdstChgModal from "@/components/ui/modal/bdstChgModal/bdstChgModal";
|
||||
import type { chgBuilding } from "@/app/store/ruseFcltMng/fcltReg/rainReg";
|
||||
|
||||
@@ -88,8 +88,10 @@ export default function Home() {
|
||||
/>
|
||||
</SearchFormLeft>
|
||||
<SearchFormRight>
|
||||
<div className="flex flex-row space-x-2">
|
||||
<Button
|
||||
className="mr-4 rounded-lg"
|
||||
size={"sm"}
|
||||
className="mr-4 "
|
||||
onClick={(e) => {
|
||||
initRswt(searchTxt || "");
|
||||
}}
|
||||
@@ -97,11 +99,13 @@ export default function Home() {
|
||||
조회
|
||||
</Button>
|
||||
<Button
|
||||
className="mr-4 rounded-lg"
|
||||
size={"sm"}
|
||||
className="mr-4"
|
||||
onClick={() => setIsNewReg(!issNewReg)}
|
||||
>
|
||||
신규등록
|
||||
</Button>
|
||||
</div>
|
||||
</SearchFormRight>
|
||||
</SearchDiv>
|
||||
</div>
|
||||
|
||||
@@ -17,11 +17,10 @@ import HeadChModal from "@/components/ui/modal/headChModal/headChModal";
|
||||
import { useState } from "react";
|
||||
|
||||
export default function PbnstSttn() {
|
||||
const { code,pbnStt } = useWrStore((state) => state);
|
||||
|
||||
const { code, sttnCommon } = useWrStore((state) => state);
|
||||
|
||||
const [isChHead, setIsChHead] = useState(false);
|
||||
const nodeList = headMakeprfmnc(pbnStt.pbnSttHeadList, pbnStt.pbnSttHeadNm);
|
||||
const nodeList = headMakeprfmnc(sttnCommon.pbnSttHeadList, sttnCommon.pbnSttHeadNm);
|
||||
|
||||
return (
|
||||
<>
|
||||
@@ -81,17 +80,29 @@ export default function PbnstSttn() {
|
||||
/>
|
||||
</SearchFormLeft>
|
||||
<SearchFormRight>
|
||||
<Button className="mr-4 rounded-lg" onClick={(e) => {}}>
|
||||
조회
|
||||
</Button>
|
||||
<Button className="mr-4 rounded-lg" onClick={() => {}}>
|
||||
다운로드
|
||||
</Button>
|
||||
<Button className="mr-4 rounded-lg" onClick={() => {
|
||||
// setIsChHead(true)
|
||||
}}>
|
||||
조회항목설정
|
||||
</Button>
|
||||
<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>
|
||||
@@ -102,7 +113,7 @@ export default function PbnstSttn() {
|
||||
<UiTable
|
||||
headName={undefined}
|
||||
tableData={[]}
|
||||
headlist={pbnStt.pbnSttHeadList}
|
||||
headlist={sttnCommon.pbnSttHeadList}
|
||||
pageSize={0}
|
||||
total={0}
|
||||
cellClick={undefined}
|
||||
@@ -115,13 +126,14 @@ export default function PbnstSttn() {
|
||||
</ListDiv>
|
||||
</div>
|
||||
</div>
|
||||
<UiModal open ={isChHead} onOpenChange ={()=>{setIsChHead(!isChHead)}} bodyClass={""} body={<HeadChModal/>}/>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<UiModal
|
||||
open={isChHead}
|
||||
onOpenChange={() => {
|
||||
setIsChHead(!isChHead);
|
||||
}}
|
||||
bodyClass={""}
|
||||
body={<HeadChModal />}
|
||||
/>
|
||||
</ContentsDiv>
|
||||
</>
|
||||
);
|
||||
|
||||
@@ -0,0 +1,247 @@
|
||||
"use client";
|
||||
import { useWrStore } from "@/app/store";
|
||||
import {
|
||||
ContentsDiv,
|
||||
SearchDiv,
|
||||
SearchFormLeft,
|
||||
SearchFormRight,
|
||||
SelectBox,
|
||||
Title,
|
||||
UiModal,
|
||||
UiTable,
|
||||
} from "@common/business_components/ui";
|
||||
import ListDiv from "@common/business_components/ui/list_div";
|
||||
import { Button, TableHead, TableRow } from "@common/components/ui";
|
||||
import { useEffect, useState } from "react";
|
||||
import type {
|
||||
TableTripleProps,
|
||||
} from "@/app/store/ruseFcltMng/fcltReg/rainReg";
|
||||
import type { chHeadType } from "@/app/store/prfmncReg/chkgdnReg/rainChkgdn";
|
||||
import { tableData } from "@/components/lib/func/commom";
|
||||
import HeadChModal from "@/components/ui/modal/headChModal/headChModal";
|
||||
|
||||
|
||||
export const headMakeTriple = (
|
||||
upHeadList: TableTripleProps[],
|
||||
makeHeadNm: chHeadType[],
|
||||
rowCount: number = 2
|
||||
) => {
|
||||
return (
|
||||
<>
|
||||
{Array.from({ length: rowCount }).map((_, i) => (
|
||||
|
||||
|
||||
|
||||
<TableRow key={i}>
|
||||
|
||||
{
|
||||
upHeadList
|
||||
.filter((head: TableTripleProps) => head.visible == true)
|
||||
.map((head: TableTripleProps) =>
|
||||
!head.upSequnce[i] ? (
|
||||
<TableHead
|
||||
className={`border border-gray-600 px-2 py-1 `}
|
||||
rowSpan={2}
|
||||
key={head.id}
|
||||
>
|
||||
{head.title}
|
||||
</TableHead>
|
||||
) : head.upSequnce[i] === 1 ? (
|
||||
<TableHead
|
||||
className={`border border-gray-600 px-2 py-1 `}
|
||||
key={head.id}
|
||||
rowSpan={1}
|
||||
colSpan={
|
||||
makeHeadNm.find((ch) => ch.headNm === head.upName[i])
|
||||
?.length
|
||||
}
|
||||
>
|
||||
{makeHeadNm.find((ch) => ch.headNm === head.upName[i])?.text}
|
||||
</TableHead>
|
||||
) : null
|
||||
)}
|
||||
</TableRow>
|
||||
))}
|
||||
<TableRow>
|
||||
{upHeadList
|
||||
.map((head: TableTripleProps) =>
|
||||
makeHeadNm.find((ch) => ch.headNm === head?.upName[1] && head.visible ==true ) ? (
|
||||
<TableHead
|
||||
className={`border border-gray-600 px-2 py-1 `}
|
||||
key={head.id}
|
||||
>
|
||||
{head.title}
|
||||
</TableHead>
|
||||
) : null
|
||||
)}
|
||||
</TableRow>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
export default function RainSttn() {
|
||||
const { code, rain, init, sttnCommon } = useWrStore((state) => state);
|
||||
const { rainRes } = rain;
|
||||
|
||||
const [isChHead, setIsChHead] = useState(false);
|
||||
|
||||
const [bdstTable, setBdstTable] = useState<any[]>();
|
||||
const [tableHead, setTableHead] = useState<any[]>([]);
|
||||
let nodeList = headMakeTriple(
|
||||
sttnCommon.rainSttHeadList,
|
||||
sttnCommon.rainSttHeadNm
|
||||
);
|
||||
|
||||
useEffect(() => {
|
||||
if (!rain.isInit) {
|
||||
init(undefined);
|
||||
}
|
||||
}, [rain.isInit, init]);
|
||||
|
||||
useEffect(() => {
|
||||
if (code.sggCd.length > 0) {
|
||||
const data = tableData(rainRes, { code });
|
||||
// data 는 위 JSON 객체라고 가정
|
||||
|
||||
console.log("sttnCommon " , sttnCommon.rainSttHeadList)
|
||||
|
||||
const unVisibleHead = sttnCommon.rainSttHeadList.filter(
|
||||
(item: TableTripleProps) => item.visible === false
|
||||
);
|
||||
|
||||
console.log("unVisibleHead " , unVisibleHead)
|
||||
const chData = data
|
||||
.map((item:any) =>({
|
||||
...item,
|
||||
...item.reuseBuilding[0],
|
||||
...item.reuseBuilding[0].rainyObj
|
||||
})).filter((item:any) => item.rainyObj !== undefined)
|
||||
|
||||
console.log("chData " , chData)
|
||||
|
||||
|
||||
setBdstTable( chData);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
}, [code, rainRes,sttnCommon]);
|
||||
|
||||
|
||||
|
||||
return (
|
||||
<>
|
||||
<ContentsDiv>
|
||||
<div className="grid grid-cols-4 gap-4 ">
|
||||
<div className="col-span-4">
|
||||
<Title title={"빗물재이용 시설 현황"} />
|
||||
<SearchDiv>
|
||||
<SearchFormLeft>
|
||||
<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={""}
|
||||
/>
|
||||
<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={""}
|
||||
/>
|
||||
<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 className="grid grid-cols-6 gap-4 ">
|
||||
<div className="col-span-6">
|
||||
<ListDiv>
|
||||
<UiTable
|
||||
headName={[]}
|
||||
tableData={bdstTable || []}
|
||||
headlist={sttnCommon.rainSttHeadList}
|
||||
pageSize={0}
|
||||
total={0}
|
||||
cellClick={undefined}
|
||||
onPageChange={function (page: number): void {
|
||||
throw new Error("Function not implemented.");
|
||||
}}
|
||||
>
|
||||
{nodeList}
|
||||
</UiTable>
|
||||
</ListDiv>
|
||||
</div>
|
||||
</div>
|
||||
<UiModal
|
||||
open={isChHead}
|
||||
onOpenChange={() => {
|
||||
setIsChHead(!isChHead);
|
||||
}}
|
||||
bodyClass={""}
|
||||
body={<HeadChModal type={'rain'}/>}
|
||||
/>
|
||||
</ContentsDiv>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -33,40 +33,48 @@ export const headMakeprfmnc = (
|
||||
) => {
|
||||
return (
|
||||
<>
|
||||
|
||||
|
||||
|
||||
<TableRow>
|
||||
{upHeadList
|
||||
.filter((data) => data.visible !=false)
|
||||
.map((head: TableUpperProps) =>
|
||||
!head.upSequnce ? (
|
||||
<TableHead
|
||||
className={ `border border-gray-600 px-2 py-1 `}
|
||||
rowSpan={2} key={head.id}>
|
||||
{head.title}
|
||||
</TableHead>
|
||||
) : head.upSequnce === 1 ? (
|
||||
<TableHead
|
||||
className={ `border border-gray-600 px-2 py-1 `}
|
||||
key={head.id}
|
||||
rowSpan={1}
|
||||
colSpan={
|
||||
makeHeadNm.find((ch) => ch.headNm === head.upName)?.length
|
||||
}
|
||||
>
|
||||
{makeHeadNm.find((ch) => ch.headNm === head.upName)?.text}
|
||||
</TableHead>
|
||||
) : null
|
||||
)}
|
||||
.map((head: TableUpperProps) =>
|
||||
!head.upSequnce ? (
|
||||
<TableHead
|
||||
className={`border border-gray-600 px-2 py-1 `}
|
||||
rowSpan={2}
|
||||
key={head.id}
|
||||
>
|
||||
{head.title}
|
||||
</TableHead>
|
||||
) : head.upSequnce === 1 ? (
|
||||
<TableHead
|
||||
className={`border border-gray-600 px-2 py-1 `}
|
||||
key={head.id}
|
||||
rowSpan={1}
|
||||
colSpan={
|
||||
makeHeadNm.find((ch) => ch.headNm === head.upName)?.length
|
||||
}
|
||||
>
|
||||
{makeHeadNm.find((ch) => ch.headNm === head.upName)?.text}
|
||||
</TableHead>
|
||||
) : null
|
||||
)}
|
||||
</TableRow>
|
||||
|
||||
<TableRow>
|
||||
{upHeadList
|
||||
.filter((data) => data.visible !=false)
|
||||
.map((head: TableUpperProps) =>
|
||||
makeHeadNm.find((ch) => ch.headNm === head.upName) ? (
|
||||
<TableHead
|
||||
className={ `border border-gray-600 px-2 py-1 `}
|
||||
key={head.id}>{head.title}</TableHead>
|
||||
) : null
|
||||
)}
|
||||
.filter((data) => data.visible != false)
|
||||
.map((head: TableUpperProps) =>
|
||||
makeHeadNm.find((ch) => ch.headNm === head.upName) ? (
|
||||
<TableHead
|
||||
className={`border border-gray-600 px-2 py-1 `}
|
||||
key={head.id}
|
||||
>
|
||||
{head.title}
|
||||
</TableHead>
|
||||
) : null
|
||||
)}
|
||||
</TableRow>
|
||||
</>
|
||||
);
|
||||
@@ -76,8 +84,6 @@ export default function Page() {
|
||||
const [isDetail, setIsDetail] = useState(false);
|
||||
const [isExcel, setIsExcel] = useState(false);
|
||||
|
||||
|
||||
|
||||
const [testObj, setTestObj] = useState({});
|
||||
|
||||
const [selFcltDiv, setSelFcltDiv] = useState("RST");
|
||||
@@ -110,30 +116,39 @@ export default function Page() {
|
||||
/>
|
||||
</SearchFormLeft>
|
||||
<SearchFormRight>
|
||||
<Button
|
||||
className="mr-4 rounded-lg"
|
||||
onClick={(e) => {
|
||||
cellClick()
|
||||
setIsDetail(!isDetail);
|
||||
}}
|
||||
>
|
||||
조회
|
||||
</Button>
|
||||
<Button className="mr-4 rounded-lg" onClick={() => {}}>
|
||||
삭제
|
||||
</Button>
|
||||
<Button className="mr-4 rounded-lg" onClick={() => {}}>
|
||||
저장
|
||||
</Button>
|
||||
<Button className="mr-4 rounded-lg" onClick={() => {}}>
|
||||
결과등록
|
||||
</Button>
|
||||
<Button className="mr-4 rounded-lg"
|
||||
<div className="space-y">
|
||||
<div className="flex flex-row space-x-2">
|
||||
<Button
|
||||
size={"sm"}
|
||||
onClick={(e) => {
|
||||
cellClick();
|
||||
setIsDetail(!isDetail);
|
||||
}}
|
||||
>
|
||||
조회
|
||||
</Button>
|
||||
<Button size={"sm"} onClick={() => {}}>
|
||||
삭제
|
||||
</Button>
|
||||
<Button size={"sm"} onClick={() => {}}>
|
||||
저장
|
||||
</Button>
|
||||
</div>
|
||||
<div className="flex flex-row space-x-2 pt-3">
|
||||
<Button size={"sm"} onClick={() => {}}>
|
||||
결과등록
|
||||
</Button>
|
||||
<Button
|
||||
color="green"
|
||||
size={"sm"}
|
||||
onClick={() => {
|
||||
setIsExcel(!isDetail);
|
||||
}}>
|
||||
양식받기
|
||||
</Button>
|
||||
}}
|
||||
>
|
||||
양식받기
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
</SearchFormRight>
|
||||
</SearchDiv>
|
||||
</div>
|
||||
@@ -153,11 +168,12 @@ export default function Page() {
|
||||
body={<ChkgdModal type={selFcltDiv} obj={testObj}></ChkgdModal>}
|
||||
/>
|
||||
|
||||
<UiModal open={isExcel}
|
||||
<UiModal
|
||||
open={isExcel}
|
||||
onOpenChange={setIsExcel}
|
||||
bodyClass={"w-[40vw] max-w-none"}
|
||||
body={<ChkgdExcel type={selFcltDiv}></ChkgdExcel>}
|
||||
/>
|
||||
body={<ChkgdExcel type={selFcltDiv}></ChkgdExcel>}
|
||||
/>
|
||||
</ContentsDiv>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
import { getFectch } from "@/components/lib/api";
|
||||
import { getFetch } from "@/components/lib/api";
|
||||
|
||||
// Description: 공통코드
|
||||
export type selectArray = {
|
||||
text: string;
|
||||
val: string | number;
|
||||
adstDliStrCd?: string
|
||||
};
|
||||
|
||||
export const yn :selectArray[]=[
|
||||
@@ -100,6 +101,16 @@ export type comCodeState = {
|
||||
bdstUsgCd: selectArray[];
|
||||
cityCd: selectArray[];
|
||||
sggCd: selectArray[];
|
||||
|
||||
rvbsnCd:selectArray[];
|
||||
mdmbsnCd:selectArray[];
|
||||
lgbsnCd:selectArray[];
|
||||
lclgvrnmntCd:selectArray[];
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
orgwtKndCd:selectArray[];
|
||||
yn:selectArray[];
|
||||
};
|
||||
@@ -108,7 +119,7 @@ export type comCodeState = {
|
||||
export type comCodeType = comCodeState & comCodeActions;
|
||||
|
||||
export const getSggCd = async (set: any) => {
|
||||
const sgg = await getFectch("common", "/addr/sgg");
|
||||
const sgg = await getFetch("common", "/addr/sgg");
|
||||
const sggCd = sgg.map((item: any) => ({
|
||||
val: Number(item.adstDstrCd),
|
||||
text: item.gugun,
|
||||
@@ -121,7 +132,7 @@ export const getSggCd = async (set: any) => {
|
||||
}));
|
||||
};
|
||||
export const getCityCd = async (set: any) => {
|
||||
const city = await getFectch("common", "/addr/city");
|
||||
const city = await getFetch("common", "/addr/city");
|
||||
const cityCd = city.map((item: any) => ({
|
||||
val: Number(item.adstDstrCd),
|
||||
text: item.sido,
|
||||
@@ -135,6 +146,92 @@ export const getCityCd = async (set: any) => {
|
||||
}));
|
||||
};
|
||||
|
||||
// 권역 API 호출 함수 추가
|
||||
export const getRegionCd = async (set: any) => {
|
||||
try{
|
||||
const rvbsn = await getFetch("common", "/addr/sarea");
|
||||
const rvbsnCd = rvbsn.map((item: any) => ({
|
||||
val: Number(item.rvbsnCd),
|
||||
text: item.rvbsn,
|
||||
}));
|
||||
rvbsnCd.unshift({val:0,text:'전체'})
|
||||
set((state: comCodeState) => ({
|
||||
code: {
|
||||
...state.code,
|
||||
rvbsnCd: rvbsnCd,
|
||||
},
|
||||
}));
|
||||
}catch(error){
|
||||
console.error('권역 데이터를 가져오는데 실패했습니다:', error);
|
||||
}
|
||||
};
|
||||
|
||||
// 중권역 API 호출 함수 추가
|
||||
export const getMiddleRegionCd = async (set: any) => {
|
||||
try{
|
||||
const mdmbsn = await getFetch("common", "/addr/midArea");
|
||||
const mdmbsnCd = mdmbsn.map((item: any) => ({
|
||||
val: Number(item.rvbsnCd),
|
||||
text: item.mdmbsn,
|
||||
}));
|
||||
mdmbsnCd.unshift({val:0,text:'전체'})
|
||||
set((state: comCodeState) => ({
|
||||
code: {
|
||||
...state.code,
|
||||
mdmbsnCd: mdmbsnCd,
|
||||
},
|
||||
}));
|
||||
}catch(error){
|
||||
console.error('중권역 데이터를 가져오는데 실패했습니다:', error);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
// 단위유역 API 호출 함수 추가
|
||||
export const getUnitWaterShedCd =async (set: any) => {
|
||||
try{
|
||||
const lgbsn = await getFetch("common", "/addr/largeArea");
|
||||
const lgbsnCd = lgbsn.map((item: any) => ({
|
||||
val: Number(item.rvbsnCd),
|
||||
text: item.lgbsn,
|
||||
}));
|
||||
lgbsnCd.unshift({val:0,text:'전체'})
|
||||
set((state: comCodeState) => ({
|
||||
code: {
|
||||
...state.code,
|
||||
lgbsnCd: lgbsnCd,
|
||||
},
|
||||
}));
|
||||
}catch(error){
|
||||
console.error('대영역 데이터를 가져오는데 실패했습니다:', error);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
// 환경청 데이터
|
||||
export const getEnvPartCd =async (set: any) => {
|
||||
try{
|
||||
const lclgvrnmnt = await getFetch('common', '/addr/govArea');
|
||||
const lclgvrnmntCd = lclgvrnmnt.map((item: any) => ({
|
||||
val: Number(item.lclgvrnmntCd),
|
||||
text: item.lclgvrnmntNm,
|
||||
adstDliStrCd:item.adstDliStrCd
|
||||
}));
|
||||
lclgvrnmntCd.unshift({val:0,text:'전체' ,adstDliStrCd:''})
|
||||
set((state: comCodeState) => ({
|
||||
code: {
|
||||
...state.code,
|
||||
lclgvrnmntCd: lclgvrnmntCd,
|
||||
},
|
||||
}));
|
||||
}catch(error){
|
||||
console.error('환경청 데이터를 가져오는데 실패했습니다:', error);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
export const comCodeStateExport: comCodeState = {
|
||||
code: {
|
||||
isInit: false,
|
||||
@@ -144,6 +241,10 @@ export const comCodeStateExport: comCodeState = {
|
||||
orgwtKndCd:orgwtKndCd,
|
||||
cityCd: [],
|
||||
sggCd: [],
|
||||
rvbsnCd:[],
|
||||
mdmbsnCd:[],
|
||||
lgbsnCd:[],
|
||||
lclgvrnmntCd:[],
|
||||
yn:yn
|
||||
},
|
||||
};
|
||||
@@ -158,14 +259,14 @@ export type comCodeActions = {
|
||||
export const codeActionExport: (set: any) => comCodeActions = (set: any) => {
|
||||
return {
|
||||
codeInit: async () => {
|
||||
const sgg = await getFectch("common", "/addr/sgg");
|
||||
const sgg = await getFetch("common", "/addr/sgg");
|
||||
|
||||
const sggCd = sgg.map((item: any) => ({
|
||||
val: Number(item.adstDstrCd),
|
||||
text: item.gugun,
|
||||
}));
|
||||
|
||||
const city = await getFectch("common", "/addr/city");
|
||||
const city = await getFetch("common", "/addr/city");
|
||||
const cityCd = city.map((item: any) => ({
|
||||
val: Number(item.adstDstrCd),
|
||||
text: item.sido,
|
||||
|
||||
@@ -25,6 +25,7 @@ export type chHeadType={
|
||||
headNm: string;
|
||||
text: string;
|
||||
length: number;
|
||||
rows?: number;
|
||||
}
|
||||
|
||||
export const rainHeadNm:chHeadType[] = [
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { getFectch } from "@/components/lib/api";
|
||||
import { TEST_UUID, type bdstAll, type customRainBdst } from "../rainReg";
|
||||
import { getFetch } from "@/components/lib/api";
|
||||
import { TEST_UUID, type customRainBdst } from "../rainReg";
|
||||
import type { TableProps } from "../pbnstReg";
|
||||
import type { customHtdflBdst } from "../htdflReg";
|
||||
import type { customRswtBdst } from "../rswtReg";
|
||||
@@ -32,7 +32,7 @@ type TableUpperProps = {
|
||||
|
||||
|
||||
|
||||
const bdstBase: bdstAll[] = [];
|
||||
const bdstBase:any[] = [];
|
||||
|
||||
|
||||
const isRainBdst = (data: any): data is customRainBdst=> {
|
||||
@@ -164,7 +164,7 @@ type bdstActions = {
|
||||
|
||||
|
||||
const findBdstInfo = async(sggCd:string, searchTxt:string ,flg:string)=>{
|
||||
return await getFectch('wr', `/reuseFc/building/${flg}/${sggCd}`+(searchTxt?`/${searchTxt}`:'' ))
|
||||
return await getFetch('wr', `/reuseFc/building/${flg}/${sggCd}`+(searchTxt?`/${searchTxt}`:'' ))
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { getFectch, postFectch, putFectch } from "@/components/lib/api";
|
||||
import { getFetch, postFectch, putFectch } from "@/components/lib/api";
|
||||
import { upHeadList, type bdstAll, type chgBuilding, type TableUpperProps } from "../rainReg";
|
||||
|
||||
import { z } from "zod";
|
||||
@@ -25,20 +25,21 @@ export const hdtflZod = z.object({
|
||||
instlCst: z.number().nullish().default(0),
|
||||
operMngCd: z.string().nullish().default(""),
|
||||
anlOperCst: z.number().default(0),
|
||||
instlCstSprtYn: z.string().default(""),
|
||||
instlCstSprtYn: z.enum(["Y", "N"]),
|
||||
instlCstSprtAmt: z.number().nullish().default(0),
|
||||
grntchBdstCertYn: z.string().default(""),
|
||||
grntchBdstCertYr: z
|
||||
.string()
|
||||
.nullish(),
|
||||
grntchBdstCertYn: z.enum(["Y", "N"]),
|
||||
grntchBdstCertYr: z .string().default("")
|
||||
.refine((year) =>year.length ===0 || /^\d{4}$/.test(year),{
|
||||
message:'4자리 연도만 입력하세요'
|
||||
}),
|
||||
grntchBdstCertNo: z.string().nullish().default(""),
|
||||
grntchBdstCertGrd: z.string().nullish().default(""),
|
||||
crgRdctYn: z.string().default(""),
|
||||
crgRdctYn: z.enum(["Y", "N"]),
|
||||
crgRdctBss: z.string().nullish().default(""),
|
||||
crgRdctAmt: z.number().nullish().default(0),
|
||||
ruseFcltFlg: z.string().nullish().default(""),
|
||||
bdstUsgCd: z.number().default(0),
|
||||
lawTrgtYn: z.string().default(""),
|
||||
lawTrgtYn: z.enum(["Y", "N"]),
|
||||
rgtr:z.string().nullish().default(null),
|
||||
mdfr:z.string().nullish().default(null),
|
||||
// htdflObj 매핑
|
||||
@@ -92,67 +93,9 @@ export const hdtflZod = z.object({
|
||||
.default([]),
|
||||
});
|
||||
|
||||
export type customHtdflBdst = Omit<bdstAll, 'reuseBuilding'> & {
|
||||
reuseBuilding: htdflReuseBuilding[];
|
||||
};
|
||||
export type customHtdflBdst = z.infer<typeof hdtflZod>
|
||||
//export type customHtdflBdst = z.infer<typeof hdtflZod>;
|
||||
|
||||
//export type customHtdflBdst = z.infer<typeof hdtflZod>;
|
||||
|
||||
// 타입을 조드로 만들어가 하는ㅓㄹ로 테트
|
||||
export type htdflReuseBuilding = {
|
||||
bdstRuseFcltPk: number | undefined;
|
||||
bdstInfoFk: number | undefined;
|
||||
instlCmptnDt: Date | undefined;
|
||||
instlCst: number | undefined;
|
||||
operMngCd: string;
|
||||
anlOperCst: number | undefined;
|
||||
instlCstSprtYn: string | undefined;
|
||||
instlCstSprtAmt: number | undefined;
|
||||
grntchBdstCertYn?: string | undefined;
|
||||
grntchBdstCertYr: string | undefined;
|
||||
grntchBdstCertNo: string | undefined;
|
||||
grntchBdstCertGrd: string | undefined;
|
||||
crgRdctYn: string;
|
||||
crgRdctBss: string | undefined;
|
||||
crgRdctAmt: number | undefined;
|
||||
ruseFcltFlg: string;
|
||||
bdstUsgCd: number | undefined;
|
||||
lawTrgtYn: string;
|
||||
htdflObj: htdflObj;
|
||||
rgtr?:string;
|
||||
mdfr?:string;
|
||||
};
|
||||
|
||||
export type htdflObj = {
|
||||
htdflFcltPk?: number;
|
||||
bdstRuseFcltFk?: number;
|
||||
etgtType?: string;
|
||||
fclCpct?: number | undefined;
|
||||
plwtYn?: string;
|
||||
orgwtWtritSpt: number | undefined;
|
||||
orgwtOcrnProcs: string;
|
||||
wtritEntrcTp: number | undefined;
|
||||
amtgnr: number | undefined;
|
||||
prcsProcsYn: string;
|
||||
prcsFcltCpct: number | undefined;
|
||||
fmYn: string;
|
||||
utztnCpct: number | undefined;
|
||||
utztnUsg: string;
|
||||
grssClfg: number | undefined;
|
||||
combResdch: number | undefined;
|
||||
trbt: number | undefined;
|
||||
bod: number | undefined;
|
||||
smll: number | undefined;
|
||||
crmty: number | undefined;
|
||||
tn: number | undefined;
|
||||
tph: number | undefined;
|
||||
ph: number | undefined;
|
||||
clIonQnt: number | undefined;
|
||||
cdtnv: number | undefined;
|
||||
emsnExitTp: number | undefined;
|
||||
rgtr?:string;
|
||||
mdfr?:string;
|
||||
};
|
||||
|
||||
export type htdflFacState = {
|
||||
htdfl: {
|
||||
@@ -180,7 +123,7 @@ export const htdflFacStateExport: htdflFacState = {
|
||||
};
|
||||
|
||||
const initFetch = async (txt: string | undefined) => {
|
||||
const htdflRes = await getFectch(
|
||||
const htdflRes = await getFetch(
|
||||
"wr",
|
||||
`/drain/facilityList/1/20/0` + (txt ? `/${txt}` : "")
|
||||
);
|
||||
|
||||
@@ -1,10 +1,31 @@
|
||||
import { z } from "zod";
|
||||
import type { TableUpperProps } from "../rainReg";
|
||||
import { getFetch } from "@/components/lib/api";
|
||||
|
||||
|
||||
export const pbnstZod = z.object({
|
||||
bscFctCd:z.string(),
|
||||
sido:z.string().default(""),
|
||||
gugun: z.string().default(""),
|
||||
bscFctNm:z.string().default(""),
|
||||
efflWqltStndrdNm:z.string().default(""),
|
||||
fctCpc:z.number().default(0)
|
||||
|
||||
})
|
||||
|
||||
|
||||
export type customPbnst = z.infer<typeof pbnstZod>
|
||||
|
||||
|
||||
export const pbnstReg =[] as customPbnst[];
|
||||
export type TableProps = {
|
||||
id: string;
|
||||
title: string;
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
export type selectLabel = {
|
||||
text: string;
|
||||
val: string;
|
||||
@@ -45,22 +66,15 @@ const selectLabel: selectLabel[] = [{ text: "test", val: "1" }];
|
||||
|
||||
const pubFacHeadList: TableProps[] = [
|
||||
{ id: "sido", title: "시도" },
|
||||
{ id: "sigungo", title: "시군구" },
|
||||
{ id: "facilityName", title: "시설명" },
|
||||
{ id: "location", title: "위치" },
|
||||
{ id: "locationgubun", title: "지역구분" },
|
||||
{ id: "facilityCapacity", title: "시설용량" },
|
||||
{ id: "gugun", title: "시군구" },
|
||||
{ id: "bscFctNm", title: "시설명" },
|
||||
{ id: "addr", title: "위치" },
|
||||
{ id: "efflWqltStndrdNm", title: "지역구분" },
|
||||
{ id: "fctCpc", title: "시설용량" },
|
||||
{ id: "yn", title: "재이용여부" },
|
||||
{ id: "authoDay", title: "등록여부" },
|
||||
];
|
||||
|
||||
const ruseFclt: ruseFcltType[] = [
|
||||
{ swtrmtFcltFk: "a", fcltCpct: 1000000, swtrmtCpct: 1000000 ,pbnstRuseFcltPk:'aa',fcltNm:'하수1',ruseCpct: 1, splyExtraCpct: 2 },
|
||||
{ swtrmtFcltFk: "a", fcltCpct: 1300000, swtrmtCpct: 1300000 ,pbnstRuseFcltPk:'ab',fcltNm:'하수2',ruseCpct: 3, splyExtraCpct: 4 },
|
||||
|
||||
{ swtrmtFcltFk: "b", fcltCpct: 2000000, swtrmtCpct: 2000000 ,pbnstRuseFcltPk:'bb',fcltNm:'재이용1',ruseCpct: 1, splyExtraCpct: 2 },
|
||||
{ swtrmtFcltFk: "b", fcltCpct: 2300000, swtrmtCpct: 2300000 ,pbnstRuseFcltPk:'ba',fcltNm:'재이용2' ,ruseCpct: 3, splyExtraCpct: 4 },
|
||||
];
|
||||
const pubMngUpHeadList: TableUpperProps[] = [
|
||||
{ id: "mng", title: "운영방식" },
|
||||
{ id: "subCo", title: "대행업체" },
|
||||
@@ -68,126 +82,20 @@ const pubMngUpHeadList: TableUpperProps[] = [
|
||||
{ id: "endDay", title: "종료일", upName: "upChangeRe", upSequnce: 2 },
|
||||
];
|
||||
const date = new Date();
|
||||
const fcltOperInfo: fcltOperInfoType[] = [
|
||||
{
|
||||
mng: "자체운영",
|
||||
subCo: "-",
|
||||
startDay: "2024-11-11",
|
||||
endDay: "2024-11-20",
|
||||
pbnstRuseFcltPk: "aa",
|
||||
},
|
||||
{
|
||||
mng: "자체운영",
|
||||
subCo: "한국수자원공사",
|
||||
startDay: "2022-11-11",
|
||||
endDay: "2024-09-13",
|
||||
pbnstRuseFcltPk: "aa",
|
||||
},
|
||||
{
|
||||
mng: "자체운영",
|
||||
subCo: "스타벅스",
|
||||
startDay: "2023-11-11",
|
||||
endDay: "2024-02-19",
|
||||
pbnstRuseFcltPk: "bb",
|
||||
},
|
||||
];
|
||||
const publicReuseFacilityData: publicReuseFacilityType[] = [
|
||||
{
|
||||
sido: "서울",
|
||||
sigungo: "강남구",
|
||||
facilityName: "난지",
|
||||
location: "경기도 고양시 덕양구 대차로 4가",
|
||||
locationgubun: "500",
|
||||
facilityCapacity: "800,000",
|
||||
reuse: "Y",
|
||||
register: "Y",
|
||||
swtrmtFcltFk: "a",
|
||||
},
|
||||
{
|
||||
sido: "서울",
|
||||
sigungo: "강남구",
|
||||
facilityName: "여의도 중앙",
|
||||
location: "경기도 고양시 덕양구 대차로 4가",
|
||||
locationgubun: "500",
|
||||
facilityCapacity: "800,000",
|
||||
reuse: "Y",
|
||||
register: "Y",
|
||||
swtrmtFcltFk: "b",
|
||||
},
|
||||
{
|
||||
sido: "서울",
|
||||
sigungo: "강남구",
|
||||
facilityName: "너의 마음속",
|
||||
location: "경기도 고양시 덕양구 대차로 4가",
|
||||
locationgubun: "500",
|
||||
facilityCapacity: "800,000",
|
||||
yn: "Y",
|
||||
authoDay: "2012",
|
||||
area: "123",
|
||||
swtrmtFcltFk: "c",
|
||||
},
|
||||
];
|
||||
|
||||
const erctUswtrCd: selectLabel[] = [
|
||||
{ text: "처리장연계", val: "1_erct" },
|
||||
{ text: "자체/연계", val: "2_erct" },
|
||||
{ text: "자체처리", val: "3_erct" },
|
||||
];
|
||||
|
||||
|
||||
const cyclCd: selectLabel[] = [
|
||||
{ text: "1차", val: "1_cyc" },
|
||||
{ text: "2차", val: "2_cyc" },
|
||||
];
|
||||
const seCd: selectLabel[] = [
|
||||
{ text: "신규", val: "1_Se" },
|
||||
{ text: "진행", val: "2_Se" },
|
||||
];
|
||||
const buseCd: selectLabel[] = [
|
||||
{ text: "재정", val: "1_bus" },
|
||||
{ text: "만루", val: "2_bus" },
|
||||
];
|
||||
const rprcsCd: selectLabel[] = [
|
||||
{ text: "물리적처리", val: "1_rprc" },
|
||||
{ text: "생물학적처리", val: "2_rprc" },
|
||||
];
|
||||
const buseMet: selectLabel[] = [
|
||||
{ text: "재정", val: "1_busemet" },
|
||||
{ text: "민간투자", val: "2_busemet" },
|
||||
{ text: "자체", val: "3_busemet" },
|
||||
];
|
||||
const rprcLoCd: selectLabel[] = [
|
||||
{ text: "내부", val: "1_rprc" },
|
||||
{ text: "외부", val: "2_rprc" },
|
||||
];
|
||||
|
||||
export type pubFacState = {
|
||||
pubFac: {
|
||||
isInit: boolean;
|
||||
pubFacHeadList: TableProps[];
|
||||
pubMngUpHeadList: TableUpperProps[];
|
||||
publicReuseFacilityData: publicReuseFacilityType[];
|
||||
selectLabel: selectLabel[];
|
||||
erctUswtrCd: selectLabel[];
|
||||
cyclCd: selectLabel[];
|
||||
seCd: selectLabel[];
|
||||
buseCd: selectLabel[];
|
||||
rprcsCd: selectLabel[];
|
||||
buseMet: selectLabel[];
|
||||
rprcLoCd: selectLabel[];
|
||||
|
||||
ruseFclt:ruseFcltType[];
|
||||
};
|
||||
pubMng:{
|
||||
//isInit:boolean;
|
||||
fcltOperInfo: fcltOperInfoType[];
|
||||
ruseFclt:ruseFcltType[];
|
||||
pbnstReg:customPbnst[];
|
||||
}
|
||||
};
|
||||
type pubFacActions = {
|
||||
decrementList: () => void;
|
||||
mngMainValue:(swtrmtFcltFk:string)=> void;
|
||||
mngTableValue:(swtrmtFcltFk:string)=> void;
|
||||
pubHasuInit: (txt:string|undefined) => void;
|
||||
};
|
||||
|
||||
export type pubFacType = pubFacState & pubFacActions;
|
||||
@@ -197,62 +105,39 @@ export const pubFacStateExport: pubFacState = {
|
||||
isInit: false,
|
||||
pubFacHeadList: pubFacHeadList,
|
||||
pubMngUpHeadList: pubMngUpHeadList,
|
||||
publicReuseFacilityData: publicReuseFacilityData,
|
||||
selectLabel: selectLabel,
|
||||
erctUswtrCd: erctUswtrCd,
|
||||
cyclCd: cyclCd,
|
||||
seCd: seCd,
|
||||
buseCd: buseCd,
|
||||
rprcsCd: rprcsCd,
|
||||
buseMet: buseMet,
|
||||
rprcLoCd: rprcLoCd,
|
||||
ruseFclt:ruseFclt,
|
||||
pbnstReg:pbnstReg,
|
||||
},
|
||||
pubMng:{
|
||||
// isInit: false,
|
||||
fcltOperInfo: fcltOperInfo,
|
||||
ruseFclt:ruseFclt
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
const initFetch = async (txt:string|undefined) => {
|
||||
|
||||
const rainRes =await getFetch("common", `/prcsFclt/info/1/20/'A'/41220` +(txt? `/${txt}`:'')+'/0'+'/1' );
|
||||
|
||||
return rainRes
|
||||
};
|
||||
export const pubFacActionsExport: (set: any) => pubFacActions = (set: any) => {
|
||||
return {
|
||||
decrementList: () =>
|
||||
set((state: pubFacState) => {
|
||||
return {
|
||||
pubFac: {
|
||||
pubFacheadList: state.pubFac.pubFacHeadList,
|
||||
publicReuseFacilityUper: state.pubFac.publicReuseFacilityData.slice(
|
||||
0,
|
||||
state.pubFac.publicReuseFacilityData.length - 1
|
||||
),
|
||||
},
|
||||
};
|
||||
}),
|
||||
mngMainValue:(swtrmtFcltFk:string)=>
|
||||
set((state:pubFacState)=>{
|
||||
return{
|
||||
|
||||
pubMng:{
|
||||
...state.pubMng,
|
||||
ruseFclt:state.pubMng.ruseFclt.filter((item)=>
|
||||
|
||||
item.swtrmtFcltFk===swtrmtFcltFk
|
||||
|
||||
)
|
||||
|
||||
pubHasuInit: async(txt:string |undefined)=>{
|
||||
try{
|
||||
const pbnstReg = await initFetch(txt)
|
||||
return set((state:pubFacState)=>({
|
||||
...state,
|
||||
pubFac:{
|
||||
...state.pubFac,
|
||||
pbnstReg:pbnstReg,
|
||||
isInit: false,
|
||||
}
|
||||
}
|
||||
}),
|
||||
mngTableValue:(pbnstRuseFcltPk:string)=>
|
||||
set((state:pubFacState)=>{
|
||||
return{
|
||||
pubMng:{
|
||||
...state.pubMng,
|
||||
fcltOperInfo:state.pubMng.fcltOperInfo.filter((item)=>item.pbnstRuseFcltPk===pbnstRuseFcltPk)
|
||||
}
|
||||
}
|
||||
})
|
||||
}))
|
||||
|
||||
}catch(errorHasu){
|
||||
console.log(errorHasu)
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
@@ -1,18 +1,11 @@
|
||||
import type { selectArray } from "@/app/store/common/code";
|
||||
import { getFectch, postFectch, putFectch } from "@/components/lib/api";
|
||||
import { FormItem } from "@common/business_components/ui";
|
||||
import { zodResolver } from "@hookform/resolvers/zod";
|
||||
import type { UUID } from "crypto";
|
||||
import { useForm } from "react-hook-form";
|
||||
import { getFetch, postFectch, putFectch } from "@/components/lib/api";
|
||||
import { z } from "zod";
|
||||
import type { customHtdflBdst } from "../htdflReg";
|
||||
import type { customRswtBdst } from "../rswtReg";
|
||||
import { makeMdfr, makeRstr } from "../bdstReg";
|
||||
|
||||
|
||||
export const TEST_UUID= '2d4b151d-1828-41e0-91d9-4cd28ea1cc7e'
|
||||
|
||||
|
||||
export const rainZod = z.object({
|
||||
bdstInfoPk: z.number().optional(),
|
||||
ctpvCd: z.number().default(0),
|
||||
@@ -24,8 +17,7 @@ export const rainZod = z.object({
|
||||
archArea: z.number().default(0),
|
||||
archChgArea: z.number().default(0),
|
||||
rgtr:z.string().nullish(),
|
||||
mdfr:z.string().optional(),
|
||||
|
||||
mdfr:z.string().nullish(),
|
||||
reuseBuilding: z.array(
|
||||
z.object({
|
||||
bdstRuseFcltPk: z.number().nullish(),
|
||||
@@ -36,34 +28,34 @@ export const rainZod = z.object({
|
||||
anlOperCst: z.number().default(0),
|
||||
instlCstSprtYn: z.string().default(""),
|
||||
instlCstSprtAmt: z.number().nullish(),
|
||||
grntchBdstCertYn: z.string().default(""),
|
||||
grntchBdstCertYr: z.string()
|
||||
.max(4, "4자리 연도를 입력하세요")
|
||||
.regex(/^\d{4}$/, "4자리 연도를 입력하세요")
|
||||
.default(""),
|
||||
grntchBdstCertYn: z.enum(["Y", "N"]).nullish(),
|
||||
grntchBdstCertYr: z.string().default("")
|
||||
.refine((year)=> year.length===0 || /^\d{4}$/.test(year),{
|
||||
message:'4자리 연도만 입력하세요'
|
||||
}),
|
||||
grntchBdstCertNo: z.string().default(""),
|
||||
grntchBdstCertGrd: z.string().default(""),
|
||||
crgRdctYn: z.string().default("").nullish(),
|
||||
crgRdctBss: z.string().default("").nullish(),
|
||||
crgRdctAmt: z.number().default(0),
|
||||
crgRdctYn: z.enum(["Y", "N"]), // 안쓰는 값
|
||||
crgRdctBss: z.string().default("").nullish(), /// 안쓰는 값
|
||||
crgRdctAmt: z.number().default(0), // 안쓰는 값
|
||||
ruseFcltFlg: z.string().default(""),
|
||||
bdstUsgCd: z.number().default(0),
|
||||
lawTrgtYn: z.string().default(""),
|
||||
lawTrgtYn: z.enum(["Y", "N"]),
|
||||
rgtr:z.string().nullish(),
|
||||
mdfr:z.string().optional(),
|
||||
mdfr:z.string().nullish(),
|
||||
|
||||
rainyObj: z.object({
|
||||
bdstReuseFcltFk: z.number().nullish(),
|
||||
pntfColKnd: z.string().default(""),
|
||||
pntfColArea: z.number().default(0),
|
||||
dtfcltCpct: z.number().default(0),
|
||||
filtrTrtmfctYn: z.enum(["Y", "N"]).nullish(),
|
||||
filtrTrtmfctCpct: z.number().nullish().default(0),
|
||||
filtrTrtmfctYn: z.string().default(""),
|
||||
filtrTrtmfctPrs: z.string().default(""),
|
||||
annRnwtQty: z.number().default(0),
|
||||
oilqMeasMthd: z.string().default("").nullish(),
|
||||
rgtr:z.string().nullish(),
|
||||
mdfr:z.string().optional(),
|
||||
mdfr:z.string().nullish(),
|
||||
|
||||
|
||||
}).default({})
|
||||
@@ -95,59 +87,8 @@ export type chgBuilding={
|
||||
}
|
||||
|
||||
|
||||
export type bdstAll = {
|
||||
bdstInfoPk?: number;
|
||||
ctpvCd: number;
|
||||
sggCd: number;
|
||||
bdstNm: string;
|
||||
daddr: string;
|
||||
frstArchPrmsnDt: Date;
|
||||
archArea: number;
|
||||
archChgArea: number;
|
||||
rgtr?:string|null;
|
||||
mdfr?:string|null;
|
||||
reuseBuilding: rainReuseBuilding[];
|
||||
chgBuilding:chgBuilding[]
|
||||
};
|
||||
export type customRainBdst = z.infer<typeof rainZod>
|
||||
|
||||
export type customRainBdst = Omit<bdstAll, 'reuseBuilding'> & {
|
||||
reuseBuilding: rainReuseBuilding[];
|
||||
};
|
||||
|
||||
|
||||
export type rainReuseBuilding = {
|
||||
lawTrgtYn: string|undefined;
|
||||
bdstUsgCd: number|undefined;
|
||||
bdstRuseFcltPk?: number|null;
|
||||
bdstInfoFk: number|undefined;
|
||||
operMngCd?: number;
|
||||
anlOperCst: number;
|
||||
instlCmptnDt: Date|undefined;
|
||||
instlCst: number;
|
||||
//archChgPrmsnDt: string;
|
||||
instlCstSprtYn: string|undefined;
|
||||
instlCstSprtAmt?: number|undefined;
|
||||
grntchBdstCertYn: string|undefined;
|
||||
grntchBdstCertNo: string|undefined;
|
||||
grntchBdstCertGrd: string|undefined;
|
||||
grntchBdstCertYr: string|undefined;
|
||||
rgtr?:string|null;
|
||||
mdfr?:string|null;
|
||||
rainyObj: rainyObj | null |undefined;
|
||||
};
|
||||
export type rainyObj = {
|
||||
bdstReuseFcltFk?: number|undefined;
|
||||
pntfColKnd?: string | undefined;
|
||||
pntfColArea?: number | undefined;
|
||||
dtfcltCpct?: number;
|
||||
filtrTrtmfctCpct?: number | undefined;
|
||||
filtrTrtmfctYn?: string | undefined;
|
||||
filtrTrtmfctPrs?: string | undefined;
|
||||
annRnwtQty?: number;
|
||||
oilqMeasMthd?: string | undefined;
|
||||
rgtr?:string|null,
|
||||
mdfr?:string|null,
|
||||
};
|
||||
|
||||
export type TableUpperProps = {
|
||||
id: string;
|
||||
@@ -158,6 +99,15 @@ export type TableUpperProps = {
|
||||
visible?:boolean;
|
||||
};
|
||||
|
||||
export type TableTripleProps = {
|
||||
id: string;
|
||||
title: string;
|
||||
upName: string[];
|
||||
upSequnce: number[];
|
||||
edit?:boolean;
|
||||
visible?:boolean;
|
||||
};
|
||||
|
||||
|
||||
export const upHeadList: TableUpperProps[] = [
|
||||
{ id: "cityText", title: "시도" },
|
||||
@@ -177,62 +127,6 @@ export const upHeadList: TableUpperProps[] = [
|
||||
const rainRes: customRainBdst[] = [];
|
||||
|
||||
|
||||
const regRainForm:customRainBdst = {
|
||||
ctpvCd: 0,
|
||||
sggCd: 0,
|
||||
bdstNm: "",
|
||||
daddr: "",
|
||||
frstArchPrmsnDt:new Date(),
|
||||
archArea: 0,
|
||||
archChgArea: 0,
|
||||
bdstInfoPk: 0,
|
||||
rgtr:"",
|
||||
mdfr:"",
|
||||
reuseBuilding: [{
|
||||
rainyObj: {
|
||||
bdstReuseFcltFk: 0,
|
||||
pntfColKnd: undefined,
|
||||
pntfColArea: undefined,
|
||||
dtfcltCpct: 0,
|
||||
filtrTrtmfctCpct: undefined,
|
||||
filtrTrtmfctYn: undefined,
|
||||
filtrTrtmfctPrs: undefined,
|
||||
annRnwtQty: 0,
|
||||
oilqMeasMthd: undefined,
|
||||
rgtr:"",
|
||||
mdfr:"",
|
||||
},
|
||||
lawTrgtYn: undefined,
|
||||
bdstUsgCd: undefined,
|
||||
bdstRuseFcltPk: 0,
|
||||
bdstInfoFk: 0,
|
||||
operMngCd: 0,
|
||||
anlOperCst: 0,
|
||||
instlCmptnDt: undefined,
|
||||
instlCst: 0,
|
||||
// archChgPrmsnDt: "",
|
||||
instlCstSprtYn: undefined,
|
||||
instlCstSprtAmt: undefined,
|
||||
grntchBdstCertYn: undefined,
|
||||
grntchBdstCertNo: undefined,
|
||||
grntchBdstCertGrd: undefined,
|
||||
grntchBdstCertYr: undefined,
|
||||
rgtr:"",
|
||||
mdfr:"",
|
||||
}],
|
||||
//추가됨
|
||||
chgBuilding:[{
|
||||
bdstInfoFk: 0,
|
||||
archChgPrmsnDt: new Date(),
|
||||
archChgArea: "-",
|
||||
bdstChgNm: "",
|
||||
rgtr:"",
|
||||
mdfr:"",
|
||||
|
||||
}]
|
||||
};
|
||||
|
||||
|
||||
export const selectClass = "w-full h-full text-2xl";
|
||||
const selectYN = [
|
||||
{ text: "Y", val: "1" },
|
||||
@@ -244,7 +138,7 @@ export type rainFacState = {
|
||||
upHeadList: TableUpperProps[];
|
||||
selectYN: selectArray[];
|
||||
rainRes: customRainBdst[];
|
||||
regRainForm:customRainBdst,
|
||||
// regRainForm:customRainBdst,
|
||||
|
||||
};
|
||||
};
|
||||
@@ -263,7 +157,7 @@ export const rainFacStateExport: rainFacState = {
|
||||
rainRes: rainRes,
|
||||
upHeadList: upHeadList,
|
||||
selectYN: selectYN,
|
||||
regRainForm:regRainForm,
|
||||
//regRainForm:regRainForm,
|
||||
|
||||
},
|
||||
};
|
||||
@@ -273,7 +167,7 @@ export const rainFacStateExport: rainFacState = {
|
||||
|
||||
const initFetch = async (txt:string|undefined) => {
|
||||
|
||||
const rainRes =await getFectch("wr", `/reuseFc/rainyInfoList/1/20/41` +(txt? `/${txt}`:''));
|
||||
const rainRes =await getFetch("wr", `/reuseFc/rainyInfoList/1/20/41` +(txt? `/${txt}`:''));
|
||||
const chRainRes = rainRes.map((item: customRainBdst) => {
|
||||
return {
|
||||
...item,
|
||||
@@ -311,7 +205,7 @@ export const rainFacActionsExport: (set: any) => rainFacSActions = (
|
||||
rainSearTxt: async(txt:string) =>{
|
||||
try{
|
||||
|
||||
const rainRes = await getFectch('wr' , `/reuseFc/rainyInfoList/1/20/41` +(txt? `/${txt}`:''))
|
||||
const rainRes = await getFetch('wr' , `/reuseFc/rainyInfoList/1/20/41` +(txt? `/${txt}`:''))
|
||||
set((state: rainFacState) => {
|
||||
return {
|
||||
rain: {
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { getFectch, postFectch, putFectch } from "@/components/lib/api";
|
||||
import { upHeadList, type bdstAll, type chgBuilding, type TableUpperProps } from "../rainReg";
|
||||
import { rswtBdstType } from "@/app/store/common/code";
|
||||
import { getFetch, postFectch, putFectch } from "@/components/lib/api";
|
||||
import { upHeadList, type chgBuilding, type TableUpperProps } from "../rainReg";
|
||||
|
||||
import { z } from "zod";
|
||||
import { makeMdfr, makeRstr } from "../bdstReg";
|
||||
@@ -28,19 +27,20 @@ export const rswtZod = z.object({
|
||||
operMngCd: z.string().nullish().default(""),
|
||||
|
||||
anlOperCst: z.number().default(0),
|
||||
instlCstSprtYn: z.string().default(""),
|
||||
instlCstSprtYn: z.enum(["Y", "N"]),
|
||||
instlCstSprtAmt: z.number().default(0),
|
||||
|
||||
grntchBdstCertYn: z.string().default("N"),
|
||||
grntchBdstCertYr: z.string().max(4, "4자리 연도를 입력하세요")
|
||||
.regex(/^\d{4}$/, "4자리 연도를 입력하세요")
|
||||
.default(""),
|
||||
grntchBdstCertNo: z.string().nullish().default(""),
|
||||
grntchBdstCertGrd: z.string().nullish().default(""),
|
||||
grntchBdstCertYn: z.enum(["Y", "N"]),
|
||||
grntchBdstCertYr: z.string().default("")
|
||||
.refine((year)=> year.length===0 ||/^\d{4}$/.test(year),{
|
||||
message:'4자리 연도만 입력하세요'
|
||||
}),
|
||||
grntchBdstCertNo: z.string().default(""),
|
||||
grntchBdstCertGrd: z.string().default(""),
|
||||
|
||||
crgRdctYn: z.string().default(""),
|
||||
crgRdctBss: z.string().default(""),
|
||||
crgRdctAmt: z.number().default(0),
|
||||
crgRdctYn: z.enum(["Y", "N"]), // 안쓰는 값
|
||||
crgRdctBss: z.string().default("").nullish(), /// 안쓰는 값
|
||||
crgRdctAmt: z.number().default(0), // 안쓰는 값
|
||||
ruseFcltFlg: z.string().default(""),
|
||||
bdstUsgCd: z.number().default(0),
|
||||
lawTrgtYn: z.string().default(""),
|
||||
@@ -55,10 +55,10 @@ export const rswtZod = z.object({
|
||||
filtrTrtmfctProcs: z.string().default(""),
|
||||
filtrTrtmfctUsgCd: z.string().default(""),
|
||||
rswtrUsqty: z.number().default(0),
|
||||
altUswtrUtztnYn: z.string().default(""),
|
||||
altUswtrKndCd: z.string().default(""),
|
||||
altUswtrUtztnQnt: z.number().default(0),
|
||||
altUswtrIdntyMthdCd: z.string().default(""),
|
||||
altUswtrUtztnYn: z.enum(["Y", "N"]).nullish(),//안쓰는값
|
||||
altUswtrKndCd: z.string().default(""),//안쓰는값
|
||||
altUswtrUtztnQnt: z.number().default(0),//안쓰는값
|
||||
altUswtrIdntyMthdCd: z.string().default(""),//안쓰는값
|
||||
rgtr:z.string().nullish().default(null),
|
||||
mdfr:z.string().nullish().default(null),
|
||||
}).default({})
|
||||
@@ -81,48 +81,7 @@ export const rswtZod = z.object({
|
||||
});
|
||||
|
||||
|
||||
|
||||
export type customRswtBdst = Omit<bdstAll, 'reuseBuilding'> & {
|
||||
reuseBuilding: rswtReuseBuilding[];
|
||||
};
|
||||
|
||||
|
||||
|
||||
export type rswtReuseBuilding = {
|
||||
bdstRuseFcltPk: number;
|
||||
bdstInfoFk: number;
|
||||
instlCmptnDt: Date | undefined;
|
||||
instlCst: number | undefined;
|
||||
operMngCd: number;
|
||||
lawTrgtYn: string | undefined;
|
||||
anlOperCst: number;
|
||||
instlCstSprtYn: string | undefined;
|
||||
instlCstSprtAmt: number | undefined;
|
||||
bdstUsgCd: number | undefined;
|
||||
grntchBdstCertYn: string ;
|
||||
grntchBdstCertNo?: string | undefined;
|
||||
grntchBdstCertGrd?: string | undefined;
|
||||
grntchBdstCertYr?: string | undefined;
|
||||
rgtr?:string;
|
||||
mdfr?:string;
|
||||
rswtrObj: rswtrObj | null;
|
||||
};
|
||||
export type rswtrObj = {
|
||||
bdstRuseFcltFk?: number | undefined;
|
||||
wtrUsqty?: number | undefined;
|
||||
oblgTrgtWtrUsqty?: number ;
|
||||
orgwtKndCd?: string | undefined;
|
||||
filtrTrtmfctProcs?: string | undefined;
|
||||
filtrTrtmfctUsgCd?: string | undefined;
|
||||
rswtrUsqty?: number;
|
||||
altUswtrUtztnYn?: string;
|
||||
altUswtrKndCd?: string;
|
||||
altUswtrUtztnQnt?: number;
|
||||
|
||||
altUswtrIdntyMthdCd?: string;
|
||||
rgtr?:string;
|
||||
mdfr?:string;
|
||||
}
|
||||
export type customRswtBdst = z.infer<typeof rswtZod>
|
||||
|
||||
const rswtRes: customRswtBdst[] = [];
|
||||
|
||||
@@ -150,7 +109,7 @@ export const rswtFacStateExport: rswtFacState = {
|
||||
};
|
||||
|
||||
const initFetch = async (txt: string | undefined) => {
|
||||
const rswtRes =await getFectch(
|
||||
const rswtRes =await getFetch(
|
||||
"wr",
|
||||
`/reuseFc/waterreuseFc/1/20/41` + (txt ? `/${txt}` : "")
|
||||
);
|
||||
|
||||
@@ -1,82 +0,0 @@
|
||||
import type { chHeadType } from "@/app/store/prfmncReg/chkgdnReg/rainChkgdn";
|
||||
import type { TableUpperProps } from "../../fcltReg/rainReg";
|
||||
import { z } from "zod";
|
||||
|
||||
export const pbnSttHeadNm: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 pbnSttHeadList:TableUpperProps[] = [
|
||||
{ id: "a", title: "권역" ,upName:"catchment" ,upSequnce:1,visible:false},
|
||||
{ id: "aaa", title: "단위유역" ,upName:"catchment" ,upSequnce:2 ,visible:false},
|
||||
{ id: "aaaa", title: "중권역" ,upName:"catchment" ,upSequnce:3,visible:false},
|
||||
{ id: "operMngCd", title: "환경청" ,visible:false },
|
||||
{ id: "cityText", title: "시도" ,upName:"adminDiv" ,upSequnce:1,visible:false},
|
||||
{ id: "sggText", title: "시군구" ,upName:"adminDiv" ,upSequnce:2,visible:false},
|
||||
{ id: "bdnstNm", title: "시설명" ,visible:false },
|
||||
{ id: "locDiv", title: "지역구분" ,visible:false },
|
||||
{ id: "phone" , title: "전화번호" ,visible:false },
|
||||
|
||||
{ id: "fcltQuantity", title: "시설용량(톤/일)" ,visible:false},
|
||||
{ id: "rusNm", title: "재이용시설명" ,visible:false},
|
||||
|
||||
|
||||
{ id: "fcltCpct", title: "시설용량(m³/일)", upName: "rusSup", upSequnce: 1 ,visible:false},
|
||||
{ id: "trbt", title: "하수처리량(m³/일)", upName: "rusSup", upSequnce: 2 ,visible:false},
|
||||
{ id: "ruseCpct", title: "재이용량(m³/일)", upName: "rusSup", upSequnce: 3 ,visible:false},
|
||||
|
||||
{ id: "total", title: "합계", upName: "yearResult", upSequnce: 1 ,visible:false},
|
||||
{ id: "ithlWtr", title: "장내용수", upName: "yearResult", upSequnce: 2 ,visible:false},
|
||||
{ id: "othlWtr", title: "장외용수", upName: "yearResult", upSequnce: 3 ,visible:false},
|
||||
|
||||
{ id: "mngMeth", title: "운영방식", upName: "mngInfo", upSequnce: 1 ,visible:false},
|
||||
{ id: "rprtvBzenty", title: "대행업체", upName: "mngInfo", upSequnce: 2 ,visible:false},
|
||||
{ id: "firstDay", title: "시작일", upName: "mngInfo", upSequnce: 3 ,visible:false },
|
||||
{ id: "LastDay", title: "종료일", upName: "mngInfo", upSequnce: 4 ,visible:false},
|
||||
|
||||
];
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
export type pbnstSttnState = {
|
||||
pbnStt: {
|
||||
pbnSttHeadList:TableUpperProps[],
|
||||
pbnSttHeadNm:chHeadType[]
|
||||
|
||||
};
|
||||
};
|
||||
type pbnSttActions = {
|
||||
};
|
||||
|
||||
export type pbnSttType = pbnstSttnState & pbnSttActions;
|
||||
|
||||
export const pbnSttStateExport: pbnstSttnState = {
|
||||
pbnStt: {
|
||||
pbnSttHeadList:pbnSttHeadList,
|
||||
pbnSttHeadNm:pbnSttHeadNm
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
|
||||
export const pbnSttActionsExport: (set: any) => pbnSttActions = (
|
||||
set: any
|
||||
) => {
|
||||
return {
|
||||
|
||||
pbnSttnInit: async(sggCd:string, searchTxt:string ,flg:string ) =>{
|
||||
|
||||
},
|
||||
|
||||
};
|
||||
};
|
||||
|
||||
@@ -0,0 +1,406 @@
|
||||
import type { chHeadType } from "@/app/store/prfmncReg/chkgdnReg/rainChkgdn";
|
||||
import {
|
||||
upHeadList,
|
||||
type TableTripleProps,
|
||||
type TableUpperProps,
|
||||
} from "../../fcltReg/rainReg";
|
||||
|
||||
export const pbnSttHeadNm: 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 pbnSttHeadList: TableUpperProps[] = [
|
||||
{ id: "a", title: "권역", upName: "catchment", upSequnce: 1, visible: true },
|
||||
{
|
||||
id: "aaa",
|
||||
title: "단위유역",
|
||||
upName: "catchment",
|
||||
upSequnce: 2,
|
||||
visible: true,
|
||||
},
|
||||
{
|
||||
id: "aaaa",
|
||||
title: "중권역",
|
||||
upName: "catchment",
|
||||
upSequnce: 3,
|
||||
visible: false,
|
||||
},
|
||||
{ id: "operMngCd", title: "환경청", visible: true },
|
||||
{
|
||||
id: "cityText",
|
||||
title: "시도",
|
||||
upName: "adminDiv",
|
||||
upSequnce: 1,
|
||||
visible: false,
|
||||
},
|
||||
{
|
||||
id: "sggText",
|
||||
title: "시군구",
|
||||
upName: "adminDiv",
|
||||
upSequnce: 2,
|
||||
visible: true,
|
||||
},
|
||||
{ id: "bdnstNm", title: "시설명", visible: true },
|
||||
{ id: "locDiv", title: "지역구분", visible: true },
|
||||
{ id: "phone", title: "전화번호", visible: true },
|
||||
|
||||
{ id: "fcltQuantity", title: "시설용량(톤/일)", visible: true },
|
||||
{ id: "rusNm", title: "재이용시설명", visible: true },
|
||||
|
||||
{
|
||||
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,
|
||||
},
|
||||
];
|
||||
export const rainSttHeadNm: chHeadType[] = [
|
||||
{ headNm: "bdnstInfo", text: "1.건축물정보", length: 9 },
|
||||
{ headNm: "rainFcltInfo", text: "2.빗물이용시설정보", length: 7 },
|
||||
{ headNm: "fcltMngInfo", text: "3.시설운영및 이용정보", length: 2 },
|
||||
{ headNm: "insenInfo", text: "4.인센티브 정보", length: 9 },
|
||||
|
||||
{ headNm: "adminDiv", text: "행정구역", length: 2 },
|
||||
{ headNm: "pntfCol", text: "집수면", length: 2 },
|
||||
{ headNm: "filtrTrtmfct", text: "여과등 처리시설", length: 3 },
|
||||
{ headNm: "instlCstSprt", text: "설치비지원", length: 2 },
|
||||
|
||||
{ headNm: "crgRdct", text: "요금감면", length: 3 },
|
||||
{ headNm: "grntchBdstCert", text: "녹색건축물인증여부", length: 4 },
|
||||
];
|
||||
|
||||
// id는 다확인해야함
|
||||
export const rainSttHeadList: TableTripleProps[] = [
|
||||
{
|
||||
id: "ctpvCd",
|
||||
title: "시도",
|
||||
visible: true,
|
||||
upName: ["bdnstInfo", "adminDiv"],
|
||||
upSequnce: [1, 1],
|
||||
},
|
||||
{
|
||||
id: "sggCd",
|
||||
title: "시군구",
|
||||
visible: true,
|
||||
upName: ["bdnstInfo", "adminDiv"],
|
||||
upSequnce: [2, 2],
|
||||
},
|
||||
{
|
||||
id: "bdstNm",
|
||||
title: "건축물명",
|
||||
visible: true,
|
||||
upName: ["bdnstInfo"],
|
||||
upSequnce: [3],
|
||||
},
|
||||
{
|
||||
id: "daddr",
|
||||
title: "주소",
|
||||
visible: true,
|
||||
upName: ["bdnstInfo"],
|
||||
upSequnce: [4],
|
||||
},
|
||||
{
|
||||
id: "bdstUsgCd",
|
||||
title: "건축물용도코드",
|
||||
visible: true,
|
||||
upName: ["bdnstInfo"],
|
||||
upSequnce: [5],
|
||||
},
|
||||
{
|
||||
id: "frstArchPrmsnDt",
|
||||
title: "최초건축허가일시",
|
||||
visible: true,
|
||||
upName: ["bdnstInfo"],
|
||||
upSequnce: [6],
|
||||
},
|
||||
{
|
||||
id: "archArea",
|
||||
title: "건축면적",
|
||||
visible: true,
|
||||
upName: ["bdnstInfo"],
|
||||
upSequnce: [7],
|
||||
},
|
||||
{
|
||||
id: "lawTrgtYn",
|
||||
title: "법적의무대상여부",
|
||||
visible: true,
|
||||
upName: ["bdnstInfo"],
|
||||
upSequnce: [8],
|
||||
},
|
||||
{
|
||||
id: "instlCmptnDt",
|
||||
title: "설치완료일시",
|
||||
visible: true,
|
||||
upName: ["bdnstInfo"],
|
||||
upSequnce: [9],
|
||||
},
|
||||
|
||||
{
|
||||
id: "instlCst",
|
||||
title: "설치비용",
|
||||
visible: true,
|
||||
upName: ["rainFcltInfo"],
|
||||
upSequnce: [1],
|
||||
},
|
||||
{
|
||||
id: "pntfColKnd",
|
||||
title: "접수지점종류",
|
||||
visible: true,
|
||||
upName: ["rainFcltInfo", "pntfCol"],
|
||||
upSequnce: [2, 1],
|
||||
},
|
||||
{
|
||||
id: "pntfColArea",
|
||||
title: "접수지점면적",
|
||||
visible: true,
|
||||
upName: ["rainFcltInfo", "pntfCol"],
|
||||
upSequnce: [3, 2],
|
||||
},
|
||||
{
|
||||
id: "filtrTrtmfctYn",
|
||||
title: "여과처리시설유무",
|
||||
visible: true,
|
||||
upName: ["rainFcltInfo", "filtrTrtmfct"],
|
||||
upSequnce: [4, 1],
|
||||
},
|
||||
{
|
||||
id: "filtrTrtmfctCpct",
|
||||
title: "여과처리시설용량",
|
||||
visible: true,
|
||||
upName: ["rainFcltInfo", "filtrTrtmfct"],
|
||||
upSequnce: [5, 2],
|
||||
},
|
||||
{
|
||||
id: "filtrTrtmfctPrs",
|
||||
title: "여과처리시설처리공정",
|
||||
visible: true,
|
||||
upName: ["rainFcltInfo", "filtrTrtmfct"],
|
||||
upSequnce: [6, 3],
|
||||
},
|
||||
{
|
||||
id: "dtfcltCpct",
|
||||
title: "저류조용량",
|
||||
visible: true,
|
||||
upName: ["rainFcltInfo"],
|
||||
upSequnce: [7],
|
||||
},
|
||||
|
||||
{
|
||||
id: "operMngCd",
|
||||
title: "운영관리코드",
|
||||
visible: true,
|
||||
upName: ["fcltMngInfo"],
|
||||
upSequnce: [1],
|
||||
},
|
||||
{
|
||||
id: "annRnwtQty",
|
||||
title: "연간빗물운영량",
|
||||
visible: true,
|
||||
upName: ["fcltMngInfo"],
|
||||
upSequnce: [2],
|
||||
},
|
||||
|
||||
{
|
||||
id: "instlCstSprtYn",
|
||||
title: "설치지원비용여부",
|
||||
visible: true,
|
||||
upName: ["insenInfo", "instlCstSprt"],
|
||||
upSequnce: [1, 1],
|
||||
},
|
||||
{
|
||||
id: "instlCstSprtAmt",
|
||||
title: "설치지원비용",
|
||||
visible: true,
|
||||
upName: ["insenInfo", "instlCstSprt"],
|
||||
upSequnce: [2, 2],
|
||||
},
|
||||
{
|
||||
id: "crgRdctYn",
|
||||
title: "감면여부",
|
||||
visible: true,
|
||||
upName: ["insenInfo", "crgRdct"],
|
||||
upSequnce: [3, 1],
|
||||
}, // 확인필요
|
||||
{
|
||||
id: "crgRdctBss",
|
||||
title: "감면근거",
|
||||
visible: true,
|
||||
upName: ["insenInfo", "crgRdct"],
|
||||
upSequnce: [4, 2],
|
||||
}, // 확인필요
|
||||
{
|
||||
id: "crgRdctAmt",
|
||||
title: "감면금액",
|
||||
visible: true,
|
||||
upName: ["insenInfo", "crgRdct"],
|
||||
upSequnce: [5, 3],
|
||||
}, // 확인필요
|
||||
{
|
||||
id: "grntchBdstCertYn",
|
||||
title: "녹색건축물인증여부",
|
||||
visible: true,
|
||||
upName: ["insenInfo", "grntchBdstCert"],
|
||||
upSequnce: [6, 1],
|
||||
},
|
||||
{
|
||||
id: "grntchBdstCertYr",
|
||||
title: "녹색건축물인증년도",
|
||||
visible: true,
|
||||
upName: ["insenInfo", "grntchBdstCert"],
|
||||
upSequnce: [7, 2],
|
||||
},
|
||||
{
|
||||
id: "grntchBdstCertNo",
|
||||
title: "녹색건축물인증번호",
|
||||
visible: true,
|
||||
upName: ["insenInfo", "grntchBdstCert"],
|
||||
upSequnce: [8, 3],
|
||||
},
|
||||
{
|
||||
id: "grntchBdstCertGrd",
|
||||
title: "녹색건축물인증등급",
|
||||
visible: true,
|
||||
upName: ["insenInfo", "grntchBdstCert"],
|
||||
upSequnce: [9, 4],
|
||||
},
|
||||
];
|
||||
|
||||
export type sttnState = {
|
||||
sttnCommon: {
|
||||
pbnSttHeadList: TableUpperProps[];
|
||||
pbnSttHeadNm: chHeadType[];
|
||||
rainSttHeadList: TableTripleProps[];
|
||||
rainSttHeadNm: chHeadType[];
|
||||
};
|
||||
};
|
||||
type sttnActions = {
|
||||
chSttnHead: (checkList: string[], type: string) => void;
|
||||
pbnSttnInit: (sggCd: string, searchTxt: string, flg: string) => void;
|
||||
|
||||
};
|
||||
|
||||
export type sttnType = sttnState & sttnActions;
|
||||
|
||||
export const sttnStateExport: sttnState = {
|
||||
sttnCommon: {
|
||||
pbnSttHeadList: pbnSttHeadList,
|
||||
pbnSttHeadNm: pbnSttHeadNm,
|
||||
rainSttHeadList: rainSttHeadList,
|
||||
rainSttHeadNm: rainSttHeadNm,
|
||||
},
|
||||
};
|
||||
|
||||
export const sttnActionsExport: (set: any) => sttnActions = (set: any) => {
|
||||
return {
|
||||
pbnSttnInit: async (sggCd: string, searchTxt: string, flg: string) => {},
|
||||
|
||||
chSttnHead: async (checkList: string[], type: string) => {
|
||||
const headList =
|
||||
type === "pbn"
|
||||
? pbnSttHeadList
|
||||
: type === "rain"
|
||||
? rainSttHeadList
|
||||
: null;
|
||||
|
||||
let chNm = type === "pbn" ? pbnSttHeadNm : rainSttHeadNm;
|
||||
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: sttnState) => ({
|
||||
sttnCommon: {
|
||||
...state.sttnCommon,
|
||||
pbnSttHeadList: type === "pbn" ? headList : state.sttnCommon.pbnSttHeadList,
|
||||
rainSttHeadList: type === "rain" ? headList : state.sttnCommon.rainSttHeadList,
|
||||
rainSttHeadNm: type === "rain" ? chNm : state.sttnCommon.rainSttHeadNm,
|
||||
pbnSttHeadNm: type === "rain" ? chNm : state.sttnCommon.pbnSttHeadNm,
|
||||
},
|
||||
}));
|
||||
},
|
||||
};
|
||||
};
|
||||
@@ -29,11 +29,11 @@ import {
|
||||
type htdflFacState,
|
||||
type htdflFacType,
|
||||
} from "./ruseFcltMng/fcltReg/htdflReg";
|
||||
import { codeActionExport, comCodeStateExport, getCityCd, getSggCd, type comCodeState, type comCodeType } from "./common/code";
|
||||
import { codeActionExport, comCodeStateExport, getCityCd, getEnvPartCd, getMiddleRegionCd, getRegionCd, getSggCd, getUnitWaterShedCd, type comCodeState, type comCodeType } from "./common/code";
|
||||
import { bdstActionsExport, bdstStateExport, type bdstFulType, type bdstState } from "./ruseFcltMng/fcltReg/bdstReg";
|
||||
import { rainChkgdnActionsExport, rainChkgdnStateExport, type rainChkgdnState, type rainChkgdnType } from "./prfmncReg/chkgdnReg/rainChkgdn";
|
||||
import { rswtChkgdnActionsExport, rswtChkgdnStateExport, type rswtChkgdnState, type rswtChkgdnType } from "./prfmncReg/chkgdnReg/rswrtChkgdn";
|
||||
import { pbnSttActionsExport, pbnSttStateExport, type pbnstSttnState, type pbnSttType } from "./ruseFcltMng/fcltSttn/pbnstSttn";
|
||||
import { sttnActionsExport, sttnStateExport, type sttnState, type sttnType } from "./ruseFcltMng/fcltSttn/sttn";
|
||||
|
||||
export type WrStore = comCodeType&
|
||||
pubFacType &
|
||||
@@ -44,7 +44,7 @@ export type WrStore = comCodeType&
|
||||
bdstFulType&
|
||||
rainChkgdnType&
|
||||
rswtChkgdnType&
|
||||
pbnSttType
|
||||
sttnType
|
||||
;
|
||||
|
||||
export const StoreZus = (
|
||||
@@ -57,7 +57,7 @@ export const StoreZus = (
|
||||
bdstState &
|
||||
rainChkgdnState&
|
||||
rswtChkgdnState&
|
||||
pbnstSttnState
|
||||
sttnState
|
||||
= {
|
||||
...comCodeStateExport,
|
||||
...pubFacStateExport,
|
||||
@@ -68,12 +68,16 @@ export const StoreZus = (
|
||||
...bdstStateExport,
|
||||
...rainChkgdnStateExport,
|
||||
...rswtChkgdnStateExport,
|
||||
...pbnSttStateExport
|
||||
...sttnStateExport
|
||||
}
|
||||
) => {
|
||||
return createStore<WrStore>()((set) => {
|
||||
getSggCd(set),
|
||||
getCityCd(set)
|
||||
getCityCd(set),
|
||||
getRegionCd(set),
|
||||
getMiddleRegionCd(set),
|
||||
getUnitWaterShedCd(set),
|
||||
getEnvPartCd(set)
|
||||
return {
|
||||
...initState,
|
||||
...pubFacActionsExport(set),
|
||||
@@ -85,7 +89,7 @@ export const StoreZus = (
|
||||
...bdstActionsExport(set),
|
||||
...rainChkgdnActionsExport(set),
|
||||
...rswtChkgdnActionsExport(set),
|
||||
...pbnSttActionsExport(set)
|
||||
...sttnActionsExport(set)
|
||||
};
|
||||
});
|
||||
};
|
||||
|
||||
@@ -4,7 +4,7 @@ import { DEV_URL_FO, DEV_URL_WR } from "../config/";
|
||||
|
||||
|
||||
|
||||
export const getFectch = async( type:string , url: string) => {
|
||||
export const getFetch = async( type:string , url: string) => {
|
||||
const div = type === 'common' ? DEV_URL_FO : DEV_URL_WR
|
||||
const response = await fetch( div+url , {
|
||||
method: "GET",
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import type { comCodeState, selectArray } from "@/app/store/common/code";
|
||||
import type { bdstAll } from "@/app/store/ruseFcltMng/fcltReg/rainReg";
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { useWrStore } from "@/app/store";
|
||||
import type { selectArray } from "@/app/store/common/code";
|
||||
import { selectClass, type bdstAll } from "@/app/store/ruseFcltMng/fcltReg/rainReg";
|
||||
import { selectClass } from "@/app/store/ruseFcltMng/fcltReg/rainReg";
|
||||
import { getCity } from "@/components/lib/func/commom";
|
||||
import type { objSearchType } from "@/components/ui/modal/bdstRegModal/bdstRegModal";
|
||||
import { FormField, FormUi, DatePicker, SelectBox } from "@common/business_components";
|
||||
|
||||
@@ -19,7 +19,7 @@ import {
|
||||
import { useEffect } from "react";
|
||||
import BdstReg from "../bdstReg/bdstReg";
|
||||
|
||||
export function HtdflRegForm({
|
||||
export default function HtdflRegForm({
|
||||
htdflForm,
|
||||
isModal,
|
||||
}: {
|
||||
@@ -35,7 +35,7 @@ export function HtdflRegForm({
|
||||
defaultValues: defaultValues,
|
||||
});
|
||||
|
||||
function onSubmit(values: z.infer<typeof hdtflZod>) {
|
||||
const onSubmit=(values: z.infer<typeof hdtflZod>)=> {
|
||||
if (isModal) {
|
||||
htdflReg(values);
|
||||
} else {
|
||||
@@ -47,7 +47,7 @@ export function HtdflRegForm({
|
||||
console.log(val);
|
||||
};
|
||||
|
||||
function cleanHtdflData(raw: any): z.infer<typeof hdtflZod> {
|
||||
const cleanHtdflData=(raw: any): z.infer<typeof hdtflZod> =>{
|
||||
return {
|
||||
...raw,
|
||||
frstArchPrmsnDt: new Date(raw?.frstArchPrmsnDt || null),
|
||||
@@ -71,6 +71,10 @@ export function HtdflRegForm({
|
||||
})),
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
useEffect(() => {
|
||||
console.log("form errors:", form.formState.errors);
|
||||
}, [form.formState.errors]);
|
||||
@@ -87,7 +91,7 @@ export function HtdflRegForm({
|
||||
<div>
|
||||
<div className="grid grid-cols-12">
|
||||
<h1 className="pl-3 text-xl col-span-10">○온배수 시설 정보</h1>
|
||||
<Button type="submit" className="mr-4 rounded-lg col-span-2">
|
||||
<Button size={"sm"} type="submit" className="col-start-12 col-span-1">
|
||||
저장
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
@@ -16,24 +16,9 @@ const formSchema = z.object({
|
||||
facilityName: z.string().min(2).max(50),
|
||||
});
|
||||
|
||||
|
||||
const headMakeColSpan = (upHeadList: TableUpperProps[]) => {
|
||||
return (<>
|
||||
<TableRow>{
|
||||
upHeadList.map((head: TableUpperProps) =>
|
||||
(!head.upSequnce ? <TableHead rowSpan={2} key={head.id}>{head.title}</TableHead> :
|
||||
head.upName === 'upChangeRe' && head.upSequnce === 1 ? <TableHead key={head.id} rowSpan={1} colSpan={2}>{'운영대행기간'}</TableHead> : null))}
|
||||
</TableRow>
|
||||
<TableRow>
|
||||
{upHeadList.map((head: TableUpperProps) =>
|
||||
(head.upName === 'upChangeRe' ? <TableHead key={head.id}>{head.title}</TableHead> : null))}
|
||||
</TableRow>
|
||||
</>)
|
||||
}
|
||||
export function PbnstBuseForm() {
|
||||
const { pubFac } = useWrStore((state) => state);
|
||||
const { pubMngUpHeadList, erctUswtrCd,cyclCd,seCd,buseCd,rprcsCd,buseMet,rprcLoCd} = pubFac;
|
||||
const nodeList = headMakeColSpan(pubMngUpHeadList);
|
||||
const { code ,pubFac } = useWrStore((state) => state);
|
||||
const { pubMngUpHeadList} = pubFac;
|
||||
|
||||
|
||||
const form = useForm<z.infer<typeof formSchema>>({
|
||||
@@ -79,7 +64,7 @@ const nodeList = headMakeColSpan(pubMngUpHeadList);
|
||||
name="name_1486273033"
|
||||
render={({ field }) => (
|
||||
<FormUi label=''>
|
||||
<SelectBox label='' selectArray={cyclCd} className={""} selectClass={selectClass} onSelectValue={onSelectValue } {...field}></SelectBox>
|
||||
<SelectBox label='' selectArray={code.yn} className={""} selectClass={selectClass} onSelectValue={() =>{} } {...field}></SelectBox>
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
@@ -103,7 +88,7 @@ const nodeList = headMakeColSpan(pubMngUpHeadList);
|
||||
name="name_8928357542"
|
||||
render={({ field }) => (
|
||||
<FormUi label="구분">
|
||||
<SelectBox selectArray={seCd} className={""} label={""} selectClass={selectClass} onSelectValue={onSelectValue} />
|
||||
<SelectBox selectArray={code.yn} className={""} label={""} selectClass={selectClass} onSelectValue={()=>{} } />
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
@@ -115,7 +100,7 @@ const nodeList = headMakeColSpan(pubMngUpHeadList);
|
||||
name="name_9484942814"
|
||||
render={({ field }) => (
|
||||
<FormUi label="사업방식">
|
||||
<SelectBox selectArray={buseMet} className={""} label={""} selectClass={selectClass} onSelectValue={onSelectValue}/>
|
||||
<SelectBox selectArray={code.yn} className={""} label={""} selectClass={selectClass} onSelectValue={()=>{} }/>
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
@@ -276,7 +261,7 @@ const nodeList = headMakeColSpan(pubMngUpHeadList);
|
||||
name="name_5139286452"
|
||||
render={({ field }) => (
|
||||
<FormUi label="재처리방식">
|
||||
<SelectBox selectArray={rprcsCd} className={""} label={""} selectClass={selectClass} onSelectValue={onSelectValue }/>
|
||||
<SelectBox selectArray={code.yn} className={""} label={""} selectClass={selectClass} onSelectValue={() =>{} }/>
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
@@ -288,7 +273,7 @@ const nodeList = headMakeColSpan(pubMngUpHeadList);
|
||||
name="name_7233630277"
|
||||
render={({ field }) => (
|
||||
<FormUi label="위치(처리장 내외)">
|
||||
<SelectBox selectArray={rprcLoCd} className={""} label={""} selectClass={selectClass} onSelectValue={onSelectValue}/>
|
||||
<SelectBox selectArray={code.yn} className={""} label={""} selectClass={selectClass} onSelectValue={()=>{} }/>
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
@@ -355,7 +340,7 @@ const nodeList = headMakeColSpan(pubMngUpHeadList);
|
||||
name="name_5139286452"
|
||||
render={({ field }) => (
|
||||
<FormUi label="눙축수처리방식">
|
||||
<SelectBox selectArray={erctUswtrCd} className={""} label={""} selectClass={selectClass} onSelectValue={onSelectValue}/>
|
||||
<SelectBox selectArray={code.yn} className={""} label={""} selectClass={selectClass} onSelectValue={() =>{}}/>
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
|
||||
@@ -18,7 +18,6 @@ import {
|
||||
type TableUpperProps,
|
||||
} from "@/app/store/ruseFcltMng/fcltReg/rainReg";
|
||||
import type { fcltOperInfoType, ruseFcltType } from "@/app/store/ruseFcltMng/fcltReg/pbnstReg";
|
||||
import { PbnstMngModal } from "@/components/ui/modal/pbnstMng/component";
|
||||
|
||||
const formSchema = z.object({
|
||||
fcltNm: z.string().min(2).max(50),
|
||||
@@ -33,9 +32,8 @@ const formSchema = z.object({
|
||||
|
||||
|
||||
export function PbnstMngForm({ data }: { data: ruseFcltType[] }) {
|
||||
const { pubFac, pubMng } = useWrStore((state) => state);
|
||||
const { pubFac } = useWrStore((state) => state);
|
||||
const { pubMngUpHeadList, isInit } = pubFac;
|
||||
const { fcltOperInfo } = pubMng;
|
||||
const [ruseOperData, setRuseOperData] = useState<fcltOperInfoType[]>();
|
||||
const [files, setFiles] = useState(null);
|
||||
const [isModalOpen, setIsModalOpen] = useState(false);
|
||||
@@ -58,11 +56,7 @@ export function PbnstMngForm({ data }: { data: ruseFcltType[] }) {
|
||||
const selectOptions = data?.map((item) => ({text: item.fcltNm, val: item.pbnstRuseFcltPk})) || [{text:'없음', val:'1'}];
|
||||
|
||||
const onSelectValue = (val: string) => {
|
||||
const selectedData = data?.find((item) => item.pbnstRuseFcltPk === val);
|
||||
if (selectedData) {
|
||||
form.reset(selectedData);
|
||||
setRuseOperData(fcltOperInfo.filter((item) => item.pbnstRuseFcltPk === val));
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -128,7 +122,7 @@ export function PbnstMngForm({ data }: { data: ruseFcltType[] }) {
|
||||
selectArray={selectOptions}
|
||||
className={""}
|
||||
selectClass={selectClass}
|
||||
onSelectValue={onSelectValue}
|
||||
onSelectValue={()=>{}}
|
||||
{...field}
|
||||
/>
|
||||
)}
|
||||
@@ -177,13 +171,14 @@ export function PbnstMngForm({ data }: { data: ruseFcltType[] }) {
|
||||
</div>
|
||||
<div className="h-[200px] overflow-y-auto">
|
||||
<UiTable
|
||||
tableData={ruseOperData?ruseOperData:[]}
|
||||
tableData={[]}
|
||||
headlist={pubMngUpHeadList}
|
||||
pageSize={100}
|
||||
total={-1}
|
||||
headName={""}
|
||||
cellClick={() => {}}
|
||||
>
|
||||
cellClick={() => { } } onPageChange={function (page: number): void {
|
||||
throw new Error("Function not implemented.");
|
||||
} } >
|
||||
{nodeList}
|
||||
</UiTable>
|
||||
</div>
|
||||
|
||||
@@ -12,11 +12,11 @@ import { Form, FormField, SelectBox } from "@common/business_components/ui";
|
||||
import { Button, Input } from "@common/components/ui";
|
||||
import { zodResolver } from "@hookform/resolvers/zod";
|
||||
import { useEffect, useState } from "react";
|
||||
import { useForm, type UseFormReturn } from "react-hook-form";
|
||||
import { useForm, useWatch, type UseFormReturn } from "react-hook-form";
|
||||
import { z } from "zod";
|
||||
import BdstReg from "../bdstReg/bdstReg";
|
||||
|
||||
export function RainRegForm({
|
||||
export default function RainRegForm({
|
||||
rainForm,
|
||||
isModal,
|
||||
}: {
|
||||
@@ -25,7 +25,6 @@ export function RainRegForm({
|
||||
}) {
|
||||
const { code, rainReg, rainUpdate, rain } = useWrStore((state) => state);
|
||||
const { rainFcltCd } = code;
|
||||
|
||||
const defaultValues: z.infer<typeof rainZod> = rainZod.parse({});
|
||||
|
||||
const form = useForm<z.infer<typeof rainZod>>({
|
||||
@@ -33,11 +32,13 @@ export function RainRegForm({
|
||||
defaultValues: defaultValues,
|
||||
});
|
||||
|
||||
const [grntchBdstCertYn, instlCstSprtYn, filtrTrtmfctYn] = form.watch([
|
||||
"reuseBuilding.0.grntchBdstCertYn",
|
||||
"reuseBuilding.0.instlCstSprtYn",
|
||||
"reuseBuilding.0.rainyObj.filtrTrtmfctYn",
|
||||
]);
|
||||
|
||||
|
||||
|
||||
|
||||
function cleanRainData(raw: any): z.infer<typeof rainZod> {
|
||||
const cleanRainData =(raw: any): z.infer<typeof rainZod> =>{
|
||||
return {
|
||||
...raw,
|
||||
frstArchPrmsnDt: new Date(raw?.frstArchPrmsnDt||null),
|
||||
@@ -56,7 +57,19 @@ export function RainRegForm({
|
||||
};
|
||||
}
|
||||
|
||||
useEffect(() =>{
|
||||
if(grntchBdstCertYn ==='N'){
|
||||
form.setValue('reuseBuilding.0.grntchBdstCertYr' ,"" )
|
||||
form.setValue('reuseBuilding.0.grntchBdstCertNo' ,"" )
|
||||
form.setValue('reuseBuilding.0.grntchBdstCertGrd' ,"" )
|
||||
|
||||
}else if(instlCstSprtYn ==='N'){
|
||||
form.setValue('reuseBuilding.0.instlCstSprtAmt' ,0 )
|
||||
}else if(filtrTrtmfctYn ==='N'){
|
||||
form.setValue('reuseBuilding.0.rainyObj.filtrTrtmfctCpct' ,0 )
|
||||
form.setValue('reuseBuilding.0.rainyObj.filtrTrtmfctPrs' ,"" )
|
||||
}
|
||||
},[grntchBdstCertYn,instlCstSprtYn ,filtrTrtmfctYn])
|
||||
|
||||
|
||||
// form 값이 변경될 때마다 로그 출력
|
||||
@@ -65,23 +78,21 @@ export function RainRegForm({
|
||||
return () => subscription.unsubscribe();
|
||||
}, [form]);
|
||||
|
||||
|
||||
|
||||
|
||||
function onSubmit(values: z.infer<typeof rainZod>) {
|
||||
|
||||
if (isModal) {
|
||||
|
||||
rainReg(values);
|
||||
} else {
|
||||
rainUpdate(values);
|
||||
}
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
console.log("form errors:", form.formState.errors);
|
||||
}, [form.formState.errors]);
|
||||
|
||||
|
||||
|
||||
|
||||
const onSubmit =(values: z.infer<typeof rainZod>)=> {
|
||||
if (isModal) {
|
||||
rainReg(values);
|
||||
} else {
|
||||
rainUpdate(values);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
useEffect(() => {
|
||||
if(rainZod)
|
||||
@@ -89,6 +100,9 @@ export function RainRegForm({
|
||||
}, [rainForm]);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return (
|
||||
<div className="">
|
||||
<Form {...form}>
|
||||
@@ -147,7 +161,7 @@ export function RainRegForm({
|
||||
<Input
|
||||
className=""
|
||||
placeholder="1,000,000"
|
||||
type=""
|
||||
type="number"
|
||||
value={field.value ?? 0}
|
||||
onChange={(e) => {
|
||||
field.onChange(e.target.value === "" ? "" : Number(e.target.value));
|
||||
@@ -195,7 +209,7 @@ export function RainRegForm({
|
||||
<Input
|
||||
className=""
|
||||
placeholder="1,000,000"
|
||||
type=""
|
||||
type="number"
|
||||
value={field.value ?? 0}
|
||||
onChange={(e) => field.onChange(Number(e.target.value))}
|
||||
/>
|
||||
@@ -236,9 +250,10 @@ export function RainRegForm({
|
||||
<Input
|
||||
className=""
|
||||
placeholder="1,000,000"
|
||||
type=""
|
||||
type="number"
|
||||
value={field.value ?? 0}
|
||||
onChange={(e) => field.onChange(Number(e.target.value))}
|
||||
readOnly={filtrTrtmfctYn!=='Y'}
|
||||
|
||||
/>
|
||||
</FormUi>
|
||||
@@ -257,6 +272,7 @@ export function RainRegForm({
|
||||
type=""
|
||||
value={field.value ?? ""}
|
||||
onChange={field.onChange}
|
||||
readOnly={filtrTrtmfctYn!=='Y'}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
@@ -285,6 +301,7 @@ export function RainRegForm({
|
||||
selectArray={code.yn}
|
||||
onSelectValue={field.onChange}
|
||||
value={field.value ?? code.yn[0]?.val}
|
||||
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
@@ -299,12 +316,13 @@ export function RainRegForm({
|
||||
<Input
|
||||
className=""
|
||||
placeholder="1,000,000"
|
||||
type=""
|
||||
type="number"
|
||||
onChange={(e) => {
|
||||
const value = e.target.value;
|
||||
field.onChange(value === "" ? "" : Number(value));
|
||||
}}
|
||||
value={field.value ?? 0}
|
||||
readOnly={instlCstSprtYn!=='Y'}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
@@ -341,7 +359,9 @@ export function RainRegForm({
|
||||
render={({ field }) => (
|
||||
<FormUi label="인증년도">
|
||||
<Input className="" placeholder="2024" type="" value={field.value ?? ""}
|
||||
onChange={field.onChange} />
|
||||
onChange={field.onChange}
|
||||
|
||||
readOnly={grntchBdstCertYn!=='Y'}/>
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
@@ -358,6 +378,7 @@ export function RainRegForm({
|
||||
type=""
|
||||
value={field.value ?? ""}
|
||||
onChange={field.onChange}
|
||||
readOnly={grntchBdstCertYn!=='Y'}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
@@ -370,7 +391,9 @@ export function RainRegForm({
|
||||
render={({ field }) => (
|
||||
<FormUi label="인증등급">
|
||||
<Input className="" placeholder="A" type="" value={field.value ?? ""}
|
||||
onChange={field.onChange}/>
|
||||
onChange={field.onChange}
|
||||
readOnly={grntchBdstCertYn!=='Y'}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
|
||||
@@ -9,8 +9,8 @@ import {
|
||||
} from "@common/business_components/ui";
|
||||
import { Button, Input } from "@common/components/ui";
|
||||
import { zodResolver } from "@hookform/resolvers/zod";
|
||||
import { useFieldArray, useForm } from "react-hook-form";
|
||||
import { number, z } from "zod";
|
||||
import { useForm } from "react-hook-form";
|
||||
import { z } from "zod";
|
||||
import { useWrStore } from "@/app/store";
|
||||
import { selectClass } from "@/app/store/ruseFcltMng/fcltReg/rainReg";
|
||||
import {
|
||||
@@ -20,7 +20,7 @@ import {
|
||||
import { useEffect } from "react";
|
||||
import BdstReg from "../bdstReg/bdstReg";
|
||||
|
||||
export function RswtrRegForm({
|
||||
export default function RswtrRegForm({
|
||||
rswtForm,
|
||||
isModal,
|
||||
}: {
|
||||
@@ -39,29 +39,20 @@ export function RswtrRegForm({
|
||||
|
||||
})
|
||||
|
||||
// 2. Define a submit handler.
|
||||
async function onSubmit(values: z.infer<typeof rswtZod>) {
|
||||
// Do something with the form values.
|
||||
// ✅ This will be type-safe and validated.
|
||||
console.log(values);
|
||||
|
||||
const [grntchBdstCertYn, instlCstSprtYn,filtrTrtmfctProcs] = form.watch([
|
||||
"reuseBuilding.0.grntchBdstCertYn",
|
||||
"reuseBuilding.0.instlCstSprtYn",
|
||||
"reuseBuilding.0.rswtrObj.filtrTrtmfctProcs",
|
||||
]);
|
||||
|
||||
const onSubmit =(values: z.infer<typeof rswtZod>) => {
|
||||
if (isModal) {
|
||||
// regRainForm.bdstInfoPk = null;
|
||||
await rswtReg(values);
|
||||
rswtReg(values);
|
||||
} else {
|
||||
rswtUpdate(values);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
const onSelectValue = (val: string | number) => {
|
||||
console.log(val);
|
||||
|
||||
};
|
||||
|
||||
|
||||
function cleanRswtData(raw: any): z.infer<typeof rswtZod> {
|
||||
const cleanRswtData = (raw: any): z.infer<typeof rswtZod> =>{
|
||||
return {
|
||||
...raw,
|
||||
frstArchPrmsnDt: new Date(raw?.frstArchPrmsnDt||null),
|
||||
@@ -81,9 +72,29 @@ export function RswtrRegForm({
|
||||
}
|
||||
|
||||
|
||||
useEffect(() => {
|
||||
console.log("form errors:", form.formState.errors);
|
||||
}, [form.formState.errors]);
|
||||
|
||||
|
||||
|
||||
useEffect(() =>{
|
||||
|
||||
console.log("filtrTrtmfctProcs ", filtrTrtmfctProcs)
|
||||
if(grntchBdstCertYn ==='N'){
|
||||
form.setValue('reuseBuilding.0.grntchBdstCertYr' ,"" )
|
||||
form.setValue('reuseBuilding.0.grntchBdstCertNo' ,"" )
|
||||
form.setValue('reuseBuilding.0.grntchBdstCertGrd' ,"" )
|
||||
}else if(instlCstSprtYn ==='N'){
|
||||
form.setValue('reuseBuilding.0.instlCstSprtAmt' ,0 )
|
||||
}
|
||||
},[grntchBdstCertYn,instlCstSprtYn,filtrTrtmfctProcs ])
|
||||
|
||||
|
||||
|
||||
|
||||
useEffect(() => {
|
||||
if(rswtZod)
|
||||
console.log("rswtForm", rswtForm);
|
||||
form.reset( cleanRswtData(rswtForm))
|
||||
}, [rswtForm]);
|
||||
|
||||
@@ -98,7 +109,7 @@ useEffect(() => {
|
||||
<h1 className="pl-3 text-xl col-span-10">
|
||||
○ 중수도 시설 정보
|
||||
</h1>
|
||||
<Button type="submit" className="mr-4 rounded-lg col-span-2">
|
||||
<Button size={"sm"} type="submit" className="col-start-12 col-span-1">
|
||||
저장
|
||||
</Button>
|
||||
</div>
|
||||
@@ -151,7 +162,7 @@ useEffect(() => {
|
||||
<Input
|
||||
className=""
|
||||
placeholder="1,000,000"
|
||||
type="text"
|
||||
type="number"
|
||||
value={field.value ?? ""}
|
||||
onChange={(e) => field.onChange(Number(e.target.value))}
|
||||
/>
|
||||
@@ -170,7 +181,7 @@ useEffect(() => {
|
||||
<Input
|
||||
className=""
|
||||
placeholder="1,000,000"
|
||||
type=""
|
||||
type="number"
|
||||
value={field.value ?? 0}
|
||||
onChange={(e) => field.onChange(Number(e.target.value))}
|
||||
/>
|
||||
@@ -188,7 +199,7 @@ useEffect(() => {
|
||||
<Input
|
||||
className=""
|
||||
placeholder="1,000,000"
|
||||
type="text"
|
||||
type="number"
|
||||
value={field.value ?? 0}
|
||||
onChange={(e) => field.onChange(Number(e.target.value))}
|
||||
/>
|
||||
@@ -277,11 +288,12 @@ useEffect(() => {
|
||||
<Input
|
||||
className=""
|
||||
placeholder="1,000,000"
|
||||
type=""
|
||||
value={field.value ?? ""}
|
||||
type="number"
|
||||
value={field.value ?? 0}
|
||||
onChange={(e) => {
|
||||
field.onChange(Number(e.target.value));
|
||||
}}
|
||||
readOnly={instlCstSprtYn!=='Y'}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
@@ -320,10 +332,11 @@ useEffect(() => {
|
||||
<Input
|
||||
className=""
|
||||
placeholder="2024"
|
||||
type=""
|
||||
type="text"
|
||||
{...field}
|
||||
value={field.value ?? ""}
|
||||
onChange={field.onChange}
|
||||
readOnly={grntchBdstCertYn!=='Y'}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
@@ -341,6 +354,8 @@ useEffect(() => {
|
||||
type=""
|
||||
value={field.value ?? ""}
|
||||
onChange={field.onChange}
|
||||
readOnly={grntchBdstCertYn!=='Y'}
|
||||
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
@@ -358,6 +373,8 @@ useEffect(() => {
|
||||
type=""
|
||||
value={field.value ?? ""}
|
||||
onChange={field.onChange}
|
||||
readOnly={grntchBdstCertYn!=='Y'}
|
||||
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
|
||||
@@ -8,13 +8,13 @@ import {
|
||||
import { ScrollArea, SelectBox, UiTable } from "@common/business_components";
|
||||
import { Button, Input, Label } from "@common/components";
|
||||
import { useEffect, useState } from "react";
|
||||
import { RainRegForm } from "../../form/fcltReg/rainReg/rainRegForm";
|
||||
import RainRegForm from "../../form/fcltReg/rainReg/rainRegForm";
|
||||
import { type selectArray } from "@/app/store/common/code";
|
||||
import { getCity, tableData } from "@/components/lib/func/commom";
|
||||
import type { customRswtBdst } from "@/app/store/ruseFcltMng/fcltReg/rswtReg";
|
||||
import { HtdflRegForm } from "../../form/fcltReg/htdflReg/htdflRegForm";
|
||||
import HtdflRegForm from "../../form/fcltReg/htdflReg/htdflRegForm";
|
||||
import type { customHtdflBdst } from "@/app/store/ruseFcltMng/fcltReg/htdflReg";
|
||||
import {RswtrRegForm} from "../../form/fcltReg/rswtrReg/rswtrRegForm";
|
||||
import RswtrRegForm from "../../form/fcltReg/rswtrReg/rswtrRegForm";
|
||||
|
||||
export type objSearchType = {
|
||||
sgg: string|number;
|
||||
@@ -144,7 +144,7 @@ export function BdstReg<T extends MoType>({ moType }: BdstRegProps<T>) {
|
||||
{ moType === 'RNB'?
|
||||
<RainRegForm rainForm={rainBdstForm as customRainBdst} isModal={true} />
|
||||
:moType==='RST'
|
||||
? <RswtrRegForm rswtForm={rainBdstForm as customRswtBdst} isModal={true} />
|
||||
? <RswtrRegForm rswtForm={rainBdstForm as customRswtBdst} isModal={true}></RswtrRegForm>
|
||||
:<HtdflRegForm htdflForm={rainBdstForm as unknown as customHtdflBdst} isModal={true}></HtdflRegForm>
|
||||
}
|
||||
|
||||
|
||||
@@ -1,36 +1,43 @@
|
||||
import { useWrStore } from "@/app/store";
|
||||
import { pbnSttHeadList } from "@/app/store/ruseFcltMng/fcltSttn/pbnstSttn";
|
||||
import type { TableProps } from "@/app/store/ruseFcltMng/fcltReg/pbnstReg";
|
||||
import type { TableTripleProps } from "@/app/store/ruseFcltMng/fcltReg/rainReg";
|
||||
import { Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage } from "@common/business_components/ui";
|
||||
import { Button, Checkbox } from "@common/components/ui";
|
||||
import { zodResolver } from "@hookform/resolvers/zod";
|
||||
import { useEffect } from "react";
|
||||
import { useForm } from "react-hook-form";
|
||||
import { z } from "zod";
|
||||
|
||||
export default function HeadChModal() {
|
||||
const { pbnStt } = useWrStore((state) => state);
|
||||
export default function HeadChModal({type }:{type: string }) {
|
||||
const { sttnCommon ,chSttnHead} = useWrStore((state) => state);
|
||||
|
||||
|
||||
|
||||
const items = pbnSttHeadList.map(item => ({id:item.id, label:item.title}));
|
||||
|
||||
const { rainSttHeadList,pbnSttHeadList } =sttnCommon;
|
||||
let items = rainSttHeadList.map(item => ({id:item.id, label:item.title}));
|
||||
|
||||
|
||||
|
||||
const FormSchema = z.object({
|
||||
items: z.array(z.string()).refine((value) => value.some((item) => item), {
|
||||
message: "You have to select at least one item.",
|
||||
data: z.array(z.string()).refine((value) => value.some((item) => item), {
|
||||
message: "최소한 하나를 선택해주시길 바랍니다.",
|
||||
|
||||
}),
|
||||
})
|
||||
|
||||
const form = useForm<z.infer<typeof FormSchema>>({
|
||||
resolver: zodResolver(FormSchema),
|
||||
})
|
||||
defaultValues: {
|
||||
data: [],
|
||||
},
|
||||
})
|
||||
|
||||
|
||||
|
||||
|
||||
const onSubmit = (val : z.infer<typeof FormSchema>) =>{
|
||||
|
||||
console.log(val)
|
||||
if(val?.data.length > 0)
|
||||
chSttnHead(val?.data, 'rain')
|
||||
|
||||
}
|
||||
|
||||
return (
|
||||
@@ -40,21 +47,20 @@ export default function HeadChModal() {
|
||||
<form onSubmit={form.handleSubmit(onSubmit)} className="space-y-8">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="items"
|
||||
name="data"
|
||||
render={() => (
|
||||
<FormItem>
|
||||
<div className="mb-4">
|
||||
<FormLabel className="text-base">Sidebar</FormLabel>
|
||||
<FormDescription>
|
||||
Select the items you want to display in the sidebar.
|
||||
</FormDescription>
|
||||
<FormLabel className="text-2xl"> 조회항목 설정</FormLabel>
|
||||
|
||||
</div>
|
||||
{items.map((item) => (
|
||||
<FormField
|
||||
key={item.id}
|
||||
control={form.control}
|
||||
name="items"
|
||||
render={({ field }) => {
|
||||
name="data"
|
||||
render={({ field }) =>
|
||||
{
|
||||
return (
|
||||
<FormItem
|
||||
key={item.id}
|
||||
@@ -63,7 +69,9 @@ export default function HeadChModal() {
|
||||
<FormControl>
|
||||
<Checkbox
|
||||
checked={field.value?.includes(item.id)}
|
||||
onCheckedChange={(checked) => {
|
||||
onCheckedChange={(checked) =>
|
||||
|
||||
{
|
||||
return checked
|
||||
? field.onChange([...field.value, item.id])
|
||||
: field.onChange(
|
||||
@@ -71,10 +79,12 @@ export default function HeadChModal() {
|
||||
(value) => value !== item.id
|
||||
)
|
||||
);
|
||||
}}
|
||||
}
|
||||
|
||||
}
|
||||
/>
|
||||
</FormControl>
|
||||
<FormLabel className="text-sm font-normal">
|
||||
<FormLabel className="text-xl">
|
||||
{item.label}
|
||||
</FormLabel>
|
||||
</FormItem>
|
||||
@@ -86,7 +96,7 @@ export default function HeadChModal() {
|
||||
</FormItem>
|
||||
)}
|
||||
/>
|
||||
<Button type="submit">Submit</Button>
|
||||
<Button type="submit">항목 표출 변경</Button>
|
||||
</form>
|
||||
</Form>
|
||||
</div>
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { Button, Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTrigger } from "@common/components";
|
||||
import { useState } from "react";
|
||||
import { Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader } from "@common/components";
|
||||
|
||||
type ModalType = {
|
||||
bodyClass: string;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
function SearchDiv ({children}:{ children: React.ReactNode; }) {
|
||||
return (
|
||||
<div className="flex card card-border !mt-6">
|
||||
{children}
|
||||
{children}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -1,11 +1,275 @@
|
||||
import React from 'react'
|
||||
import React, { useState } from 'react';
|
||||
import type { SelectDataType } from '../search_input_select';
|
||||
import { SelectBox } from '../select';
|
||||
|
||||
function SearchFormLeft(props: {children: React.ReactNode}) {
|
||||
/**
|
||||
* 검색 폼 왼쪽 컴포넌트 타입
|
||||
*
|
||||
* @param isShowPart 구분 조회 여부
|
||||
* @param children 자식 컴포넌트
|
||||
* @param selectSidoData 시도 데이터
|
||||
* @param selectSigunData 시군구 데이터
|
||||
* @param selectRegionData 유역 데이터
|
||||
* @param selectUnitWaterShedData 단위유역 데이터
|
||||
* @param selectMiddleRegionData 중권역 데이터
|
||||
* @param selectEnvPartData 환경청 데이터
|
||||
* @param selectEnvPartSidoData 환경청 시도 데이터
|
||||
* @param selectEnvPartSigunData 환경청 시군구 데이터
|
||||
* @param setRtnPartValue 부분 값 변경 핸들러
|
||||
*/
|
||||
type SearchFormLeftProps = {
|
||||
isShowPart?: boolean | undefined;
|
||||
children: React.ReactNode;
|
||||
selectSidoData?: SelectDataType[] | [];
|
||||
selectSigunData?: SelectDataType[] | [];
|
||||
selectRegionData?: SelectDataType[] | [];
|
||||
selectUnitWaterShedData?: SelectDataType[] | [];
|
||||
selectMiddleRegionData?: SelectDataType[] | [];
|
||||
selectEnvPartData?: EnvPartSelectDataType[] | [];
|
||||
selectEnvPartSidoData?: SelectDataType[] | [];
|
||||
selectEnvPartSigunData?: SelectDataType[] | [];
|
||||
|
||||
setRtnPartValue?: (value: string) => void;
|
||||
setRtnSidoValue?: (value: string) => void;
|
||||
setRtnSigunValue?: (value: string) => void;
|
||||
setRtnRegionValue?: (value: string) => void;
|
||||
setRtnUnitWaterShedValue?: (value: string) => void;
|
||||
setRtnMiddleRegionValue?: (value: string) => void;
|
||||
setRtnEnvPartValue?: (value: string) => void;
|
||||
setRtnEnvPartSidoValue?: (value: string) => void;
|
||||
setRtnEnvPartSigunValue?: (value: string) => void;
|
||||
}
|
||||
|
||||
type EnvPartSelectDataType = SelectDataType & {
|
||||
adstDliStrCd: string,
|
||||
}
|
||||
|
||||
const selectPartData:SelectDataType[] = [
|
||||
{ text: "행정별", val: '0' },
|
||||
{ text: "유역별", val: '01' },
|
||||
{ text: "환경청별", val: '02' },
|
||||
];
|
||||
|
||||
function SearchFormLeft({ isShowPart = false, children, selectSidoData = [], selectSigunData = [], selectRegionData = [], selectUnitWaterShedData = [], selectMiddleRegionData = [], selectEnvPartData = [], setRtnPartValue, setRtnSidoValue, setRtnSigunValue, setRtnRegionValue, setRtnUnitWaterShedValue, setRtnMiddleRegionValue, setRtnEnvPartValue, setRtnEnvPartSidoValue, setRtnEnvPartSigunValue }: SearchFormLeftProps) {
|
||||
const [partValue, setPartValue] = useState<string>('0');
|
||||
const [showPart, setShowPart] = useState<string>('');
|
||||
const [sidoValue, setSidoValue] = useState<string>('0');
|
||||
const [sigunValue, setSigunValue] = useState<string>('0');
|
||||
const [regionValue, setRegionValue] = useState<string>('0');
|
||||
const [unitWaterShedValue, setUnitWaterShedValue] = useState<string>('0');
|
||||
const [middleRegionValue, setMiddleRegionValue] = useState<string>('0');
|
||||
const [envPartValue, setEnvPartValue] = useState<string>('0');
|
||||
const [envPartSidoValue, setEnvPartSidoValue] = useState<string>('0');
|
||||
const [envPartSigunValue, setEnvPartSigunValue] = useState<string>('0');
|
||||
|
||||
const [filteredSigunData, setFilteredSigunData] = useState<SelectDataType[]>([{ text: "전체", val: '0' }]);
|
||||
const [filteredUnitWaterShedData, setFilteredUnitWaterShedData] = useState<SelectDataType[]>([{ text: "전체", val: '0' }]);
|
||||
const [filteredMiddleRegionData, setFilteredMiddleRegionData] = useState<SelectDataType[]>([{ text: "전체", val: '0' }]);
|
||||
|
||||
const [filteredEnvPartData, setFilteredEnvPartData] = useState<EnvPartSelectDataType[]>([{ text: "전체", val: '0', adstDliStrCd:'' }]);
|
||||
const [filteredEnvPartSidoData, setFilteredEnvPartSidoData] = useState<EnvPartSelectDataType[]>([{ text: "전체", val: '0', adstDliStrCd:'' }]);
|
||||
const [filteredEnvPartSigunData, setFilteredEnvPartSigunData] = useState<SelectDataType[]>([{ text: "전체", val: '0' }]);
|
||||
|
||||
const [filteredEnvPartSigunDataSelected, setFilteredEnvPartSigunDataSelected] = useState<SelectDataType[]>([]);
|
||||
|
||||
// 시군구 세팅
|
||||
const initializeSigunData = (sidoCd: string) => {
|
||||
if (sidoCd === '0') {
|
||||
setSigunValue('0');
|
||||
setFilteredSigunData([{ text: "전체", val: '0' }]);
|
||||
} else {
|
||||
const newFilteredData = [
|
||||
{ text: "전체", val: '0' },
|
||||
...selectSigunData.filter((item: SelectDataType) => item.val.substring(0, 2) === sidoCd)
|
||||
];
|
||||
setSigunValue('0');
|
||||
setFilteredSigunData(newFilteredData);
|
||||
}
|
||||
}
|
||||
|
||||
// 단위유역 세팅
|
||||
const initializeUnitWaterShedData = (regionCd: string) => {
|
||||
if(regionCd === '0') {
|
||||
setUnitWaterShedValue('0');
|
||||
setFilteredUnitWaterShedData([{ text: "전체", val: '0' }]);
|
||||
} else {
|
||||
const newFilteredData = [
|
||||
{ text: "전체", val: '0' },
|
||||
...selectUnitWaterShedData.filter((item: SelectDataType) => item.val.substring(0, 1) === regionCd)
|
||||
];
|
||||
setUnitWaterShedValue('0');
|
||||
setFilteredUnitWaterShedData(newFilteredData);
|
||||
}
|
||||
}
|
||||
|
||||
// 중권역 세팅
|
||||
const initializeMiddleRegionData = (unitWaterShedCd: string) => {
|
||||
if(unitWaterShedCd === '0') {
|
||||
setMiddleRegionValue('0');
|
||||
setFilteredMiddleRegionData([{ text: "전체", val: '0' }]);
|
||||
} else {
|
||||
const newFilteredData = [
|
||||
{ text: "전체", val: '0' },
|
||||
...selectMiddleRegionData.filter((item: SelectDataType) => item.val.substring(0, 2) === unitWaterShedCd)
|
||||
];
|
||||
setMiddleRegionValue('0');
|
||||
setFilteredMiddleRegionData(newFilteredData);
|
||||
}
|
||||
}
|
||||
|
||||
// 환경청 세팅 - 시도
|
||||
const initializeCityDataByEnvPartSido = (envPartCd: string) => {
|
||||
const foundEnvPart = selectEnvPartData.find((item: EnvPartSelectDataType) => item.val === envPartCd);
|
||||
const cityArray = foundEnvPart?.adstDliStrCd.toString().split('|').join('').split(',');
|
||||
|
||||
// 시군구 데이터
|
||||
const envSigunData = selectSigunData.filter((item: SelectDataType) => cityArray?.includes(item.val));
|
||||
|
||||
// 환경청 시도 데이터
|
||||
const sidoArray = [...new Set(envSigunData.map((item: SelectDataType) => item.val.substring(0, 2)))];
|
||||
const envSidoData = selectSidoData.filter((item: SelectDataType) => sidoArray?.includes(item.val));
|
||||
setFilteredEnvPartSigunDataSelected(envSigunData);
|
||||
|
||||
setFilteredEnvPartSidoData([
|
||||
{ text: "전체", val: '0', adstDliStrCd:'' },
|
||||
...envSidoData.map((item: SelectDataType) => ({ text: item.text, val: item.val, adstDliStrCd:'' }))
|
||||
]);
|
||||
}
|
||||
|
||||
// 환경청 세팅 - 시군구
|
||||
const initializeCityDataByEnvPartSigun = (sidoCd: string) => {
|
||||
const envSigunData = filteredEnvPartSigunDataSelected.filter((item: SelectDataType) => item.val.substring(0, 2) === sidoCd);
|
||||
setFilteredEnvPartSigunData([
|
||||
{ text: "전체", val: '0'},
|
||||
...envSigunData.map((item: SelectDataType) => ({ text: item.text, val: item.val }))
|
||||
]);
|
||||
}
|
||||
|
||||
const onSelectValue = (val: string, type: string) => {
|
||||
switch(type) {
|
||||
case 'part':
|
||||
setPartValue(val);
|
||||
if (setRtnPartValue) {
|
||||
setRtnPartValue(val);
|
||||
}
|
||||
// 구분
|
||||
if(val == '01') {
|
||||
setShowPart('01');
|
||||
initializeMiddleRegionData('0');
|
||||
initializeUnitWaterShedData('0');
|
||||
} else if(val == '02') {
|
||||
setShowPart('02');
|
||||
setFilteredEnvPartData([
|
||||
{ text: "전체", val: '0', adstDliStrCd:'' },
|
||||
...selectEnvPartData.filter((item: EnvPartSelectDataType) => item.val !== null && item.adstDliStrCd !== '')
|
||||
]);
|
||||
setEnvPartValue('0');
|
||||
initializeCityDataByEnvPartSido('0');
|
||||
} else {
|
||||
setShowPart('0');
|
||||
initializeSigunData('0');
|
||||
onSelectValue(selectSigunData[0]?.val || '0', 'sigun');
|
||||
}
|
||||
|
||||
// 다른 selectbox 전체로 초기화
|
||||
onSelectValue(selectSidoData[0]?.val || '0', 'sido');
|
||||
onSelectValue(selectSigunData[0]?.val || '0', 'sigun');
|
||||
break;
|
||||
case 'sido':
|
||||
setSidoValue(val);
|
||||
if (setRtnSidoValue) {
|
||||
setRtnSidoValue(val);
|
||||
}
|
||||
initializeSigunData(val);
|
||||
onSelectValue(selectSigunData[0]?.val || '0', 'sigun');
|
||||
break;
|
||||
case 'sigun':
|
||||
if (setRtnSigunValue) {
|
||||
setRtnSigunValue(val);
|
||||
}
|
||||
setSigunValue(val);
|
||||
break;
|
||||
|
||||
// 유역 세팅
|
||||
case 'region' :
|
||||
setRegionValue(val);
|
||||
if (setRtnRegionValue) {
|
||||
setRtnRegionValue(val);
|
||||
}
|
||||
initializeUnitWaterShedData(val);
|
||||
onSelectValue(selectUnitWaterShedData[0]?.val || '0', 'unitWaterShed');
|
||||
break;
|
||||
case 'unitWaterShed' :
|
||||
setUnitWaterShedValue(val);
|
||||
if (setRtnUnitWaterShedValue) {
|
||||
setRtnUnitWaterShedValue(val);
|
||||
}
|
||||
initializeMiddleRegionData(val);
|
||||
onSelectValue(selectMiddleRegionData[0]?.val || '0', 'middleRegion');
|
||||
break;
|
||||
case 'middleRegion' :
|
||||
setMiddleRegionValue(val);
|
||||
if (setRtnMiddleRegionValue) {
|
||||
setRtnMiddleRegionValue(val);
|
||||
}
|
||||
break;
|
||||
|
||||
// 환경청 세팅
|
||||
case 'envPart' :
|
||||
setEnvPartValue(val);
|
||||
if (setRtnEnvPartValue) {
|
||||
setRtnEnvPartValue(val);
|
||||
}
|
||||
initializeCityDataByEnvPartSido(val);
|
||||
onSelectValue(filteredEnvPartSidoData[0]?.val || '0', 'envPartSido');
|
||||
break;
|
||||
case 'envPartSido' :
|
||||
setEnvPartSidoValue(val);
|
||||
if (setRtnEnvPartSidoValue) {
|
||||
setRtnEnvPartSidoValue(val);
|
||||
}
|
||||
initializeCityDataByEnvPartSigun(val);
|
||||
onSelectValue(filteredEnvPartSigunData[0]?.val || '0', 'envPartSigun');
|
||||
break;
|
||||
case 'envPartSigun' :
|
||||
setEnvPartSigunValue(val);
|
||||
if (setRtnEnvPartSigunValue) {
|
||||
setRtnEnvPartSigunValue(val);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="grid grid-cols-12 gap-4 w-4/5 mx-4">
|
||||
{props.children}
|
||||
isShowPart ? (
|
||||
<div className="grid grid-cols-12 gap-5 w-11/12 m-4">
|
||||
<SelectBox className="col-span-3" label={'구분'} selectArray={selectPartData} onSelectValue={(val) => onSelectValue(val.toString(), 'part')} value={partValue} selectClass={undefined}/>
|
||||
{showPart === '01' ? (
|
||||
<>
|
||||
<SelectBox className="col-span-3" label={'유역'} selectArray={selectRegionData} onSelectValue={(val) => onSelectValue(val.toString(), 'region')} value={regionValue} selectClass={undefined}/>
|
||||
<SelectBox className="col-span-3" label={'단위유역'} selectArray={filteredUnitWaterShedData} onSelectValue={(val) => onSelectValue(val.toString(), 'unitWaterShed')} value={unitWaterShedValue} selectClass={undefined}/>
|
||||
<SelectBox className="col-span-3" label={'중권역'} selectArray={filteredMiddleRegionData} onSelectValue={(val) => onSelectValue(val.toString(), 'middleRegion')} value={middleRegionValue} selectClass={undefined}/>
|
||||
</>
|
||||
) : showPart === '02' ? (
|
||||
<>
|
||||
<SelectBox className="col-span-3" label={'환경청'} selectArray={filteredEnvPartData} onSelectValue={(val) => onSelectValue(val.toString(), 'envPart')} value={envPartValue} selectClass={undefined}/>
|
||||
<SelectBox className="col-span-3" label={'시도'} selectArray={filteredEnvPartSidoData} onSelectValue={(val) => onSelectValue(val.toString(), 'envPartSido')} value={envPartSidoValue} selectClass={undefined}/>
|
||||
<SelectBox className="col-span-3" label={'시군구'} selectArray={filteredEnvPartSigunData} onSelectValue={(val) => onSelectValue(val.toString(), 'envPartSigun')} value={envPartSigunValue} selectClass={undefined}/>
|
||||
</>
|
||||
) : (
|
||||
<>
|
||||
<SelectBox className="col-span-3" label={'시도'} selectArray={selectSidoData} onSelectValue={(val) => onSelectValue(val.toString(), 'sido')} value={sidoValue} selectClass={undefined}/>
|
||||
<SelectBox className="col-span-3" label={'시군구'} selectArray={filteredSigunData} onSelectValue={(val) => onSelectValue(val.toString(), 'sigun')} value={sigunValue} selectClass={undefined}/>
|
||||
</>
|
||||
)}
|
||||
{children}
|
||||
</div>
|
||||
) : (
|
||||
<div className="grid grid-cols-12 gap-5 w-11/12 m-4">
|
||||
{children}
|
||||
</div>
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
export { SearchFormLeft };
|
||||
export { SearchFormLeft };
|
||||
|
||||
@@ -0,0 +1,325 @@
|
||||
## SearchFormLeft 모듈
|
||||
#### 검색영역 좌측 모듈로 행정별, 유역별, 환경청을 선택했을 때 검색 영역을 세팅해주고 childnode를 붙여서 출력해주는 모듈
|
||||
#### 1. 컴포넌트 호출방법
|
||||
```js
|
||||
import { SearchFormLeft } from "@common/business_components";
|
||||
.....
|
||||
<SearchFormLeft
|
||||
isShowPart={true}
|
||||
selectSidoData={selectSidoData}
|
||||
selectSigunData={selectSigunData}
|
||||
selectRegionData={selectRegionData}
|
||||
selectUnitWaterShedData={selectUnitWaterShedData}
|
||||
selectMiddleRegionData={selectMiddleRegionData}
|
||||
selectEnvPartData={selectEnvPartData}
|
||||
selectEnvPartSidoData={selectEnvPartSidoData}
|
||||
selectEnvPartSigunData={selectEnvPartSigunData}
|
||||
setRtnPartValue={(value) => {
|
||||
setPartValue(value);
|
||||
}}
|
||||
setRtnSidoValue={(value) => {
|
||||
setSidoValue(value);
|
||||
}}
|
||||
setRtnSigunValue={(value) => {
|
||||
setSigunValue(value);
|
||||
}}
|
||||
setRtnRegionValue={(value) => {
|
||||
setRegionValue(value);
|
||||
}}
|
||||
setRtnUnitWaterShedValue={(value) => {
|
||||
setUntitWaterShedValue(value);
|
||||
}}
|
||||
setRtnMiddleRegionValue={(value) => {
|
||||
setMiddleRegionValue(value);
|
||||
}}
|
||||
setRtnEnvPartValue={(value) => {
|
||||
setEnvPartValue(value);
|
||||
}}
|
||||
setRtnEnvPartSidoValue={(value) => {
|
||||
setEnvPartSidoValue(value);
|
||||
}}
|
||||
setRtnEnvPartSigunValue={(value) => {
|
||||
setEnvPartSigunValue(value);
|
||||
}}
|
||||
>
|
||||
```
|
||||
  ㆍisShowPart : 검색단에서 구분(행정별,유역별,환경청별) 세팅 여부(보일 경우 : Y, 아닐경우 : N 혹은 미첨부)
|
||||
|
||||
  ㆍselectSidoData : 전체 시도 데이터
|
||||
|
||||
  ㆍselectSigunData : 전체 시군구구 데이터
|
||||
|
||||
  ㆍselectRegionData : 전체 유역역 데이터
|
||||
|
||||
  ㆍselectUnitWaterShedData : 전체 단위유역 데이터
|
||||
|
||||
  ㆍselectMiddleRegionData : 전체 중권역 데이터
|
||||
|
||||
  ㆍselectEnvPartData : 환경청 전체 데이터
|
||||
|
||||
  ㆍsetRtnPartValue : 선택한 구분 set함수(조회시 페이지에서 사용)
|
||||
|
||||
  ㆍsetRtnSidoValue : 선택한 시도 set함수(조회시 페이지에서 사용)
|
||||
|
||||
  ㆍsetRtnSigunValue : 선택한 시군구 set함수(조회시 페이지에서 사용)
|
||||
|
||||
  ㆍsetRtnRegionValue : 선택한 유역 set함수(조회시 페이지에서 사용)
|
||||
|
||||
  ㆍsetRtnUnitWaterShedValue : 선택한 단위유역 set함수(조회시 페이지에서 사용)
|
||||
|
||||
  ㆍsetRtnMiddleRegionValue : 선택한 중유역 set함수(조회시 페이지에서 사용)
|
||||
|
||||
  ㆍsetRtnEnvPartValue : 선택한 환경청 set함수(조회시 페이지에서 사용)
|
||||
|
||||
  ㆍsetRtnEnvPartSidoValue : 선택한 환경청의 시도 set함수(조회시 페이지에서 사용)
|
||||
|
||||
  ㆍsetRtnEnvPartSidoValue : 선택한 환경청 시도의 시군구 set함수(조회시 페이지에서 사용)
|
||||
|
||||
#### 2. 세팅방법
|
||||
```js
|
||||
/**
|
||||
* store - index.js
|
||||
* ※ 업무파트별로 common/폴더에 스토어를 만들어놓는걸 추천!
|
||||
* ※ fetch 구문은 각자가 개발 후 return 된 데이터 타입만 맞추면 된다.
|
||||
*/
|
||||
|
||||
// 시도 API 호출 함수 추가
|
||||
const fetchSidoData = async (): Promise<SelectDataType[]> => {
|
||||
try {
|
||||
const res = await getFetch('fo', '/addr/city', null);
|
||||
const data = res.data;
|
||||
selectSidoData = [
|
||||
{ text: "전체", val: '0'},
|
||||
...data.map((item: sidoDataType) => ({
|
||||
text: item.sido || '',
|
||||
val: String(item.adstDstrCd) || ''
|
||||
}))
|
||||
];
|
||||
return selectSidoData;
|
||||
} catch (error) {
|
||||
console.error('시도 데이터를 가져오는데 실패했습니다:', error);
|
||||
return selectSidoData;
|
||||
}
|
||||
};
|
||||
|
||||
// 시군구 API 호출 함수 추가
|
||||
const fetchSigunData = async (): Promise<SelectDataType[]> => {
|
||||
try {
|
||||
const res = await getFetch('fo', '/addr/sgg', null);
|
||||
const data = res.data;
|
||||
selectSigunData = [
|
||||
{ text: "전체", val: '0' },
|
||||
...data
|
||||
.map((item: sigunDataType) => ({
|
||||
text: item.gugun || '',
|
||||
val: String(item.adstDstrCd) || ''
|
||||
}))
|
||||
];
|
||||
return selectSigunData;
|
||||
} catch (error) {
|
||||
console.error('시군구 데이터를 가져오는데 실패했습니다:', error);
|
||||
return selectSigunData;
|
||||
}
|
||||
};
|
||||
|
||||
// 권역 API 호출 함수 추가
|
||||
const fetchRegionData = async (): Promise<SelectDataType[]> => {
|
||||
try {
|
||||
const res = await getFetch('fo', '/addr/sarea', null);
|
||||
const data = res.data;
|
||||
return [
|
||||
{ text: "전체", val: '0'},
|
||||
...data.map((item: regionDataType) => ({
|
||||
text: item.rvbsn || '',
|
||||
val: String(item.rvbsnCd) || ''
|
||||
}))
|
||||
];
|
||||
} catch (error) {
|
||||
console.error('권역 데이터를 가져오는데 실패했습니다:', error);
|
||||
return selectRegionData;
|
||||
}
|
||||
};
|
||||
|
||||
// 중권역 API 호출 함수 추가
|
||||
const fetchMiddleRegionData = async (): Promise<SelectDataType[]> => {
|
||||
try {
|
||||
const res = await getFetch('fo', '/addr/midArea', null);
|
||||
const data = res.data;
|
||||
return [
|
||||
{ text: "전체", val: '0' },
|
||||
...data
|
||||
.map((item: middleRegionDataType) => ({
|
||||
text: item.mdmbsn || '',
|
||||
val: String(item.rvbsnCd) || ''
|
||||
}))
|
||||
];
|
||||
} catch (error) {
|
||||
console.error('중권역 데이터를 가져오는데 실패했습니다:', error);
|
||||
return selectMiddleRegionData;
|
||||
}
|
||||
};
|
||||
|
||||
// 단위유역 API 호출 함수 추가
|
||||
const fetchUnitWaterShedData = async (): Promise<SelectDataType[]> => {
|
||||
try {
|
||||
const res = await getFetch('fo', '/addr/largeArea', null);
|
||||
const data = res.data;
|
||||
return [
|
||||
{ text: "전체", val: '0' },
|
||||
...data
|
||||
.map((item: unitWaterShedDataType) => ({
|
||||
text: item.lgbsn || '',
|
||||
val: String(item.rvbsnCd) || ''
|
||||
}))
|
||||
];
|
||||
} catch (error) {
|
||||
console.error('단위유역 데이터를 가져오는데 실패했습니다:', error);
|
||||
return selectUnitWaterShedData;
|
||||
}
|
||||
};
|
||||
|
||||
// 환경청 데이터
|
||||
const fetchEnvPartData = async (): Promise<envPartSelectDataType[]> => {
|
||||
try {
|
||||
const res = await getFetch('fo', '/addr/govArea', null);
|
||||
const data = res.data;
|
||||
selectEnvPartData = [
|
||||
{ text: "전체", val: '0', adstDliStrCd: '' },
|
||||
...data
|
||||
.map((item: envPartDataType) => ({
|
||||
text: item.lclgvrnmntNm || '',
|
||||
val: String(item.lclgvrnmntCd) || '',
|
||||
adstDliStrCd: item.adstDliStrCd || ''
|
||||
}))
|
||||
];
|
||||
return selectEnvPartData;
|
||||
} catch (error) {
|
||||
console.error('환경청 데이터를 가져오는데 실패했습니다:', error);
|
||||
return selectEnvPartData;
|
||||
}
|
||||
};
|
||||
|
||||
.......
|
||||
|
||||
// 타입 및 state 반환
|
||||
export type CommonType = {
|
||||
Common: {
|
||||
isInit: boolean;
|
||||
selectSidoData: SelectDataType[];
|
||||
selectSigunData: SelectDataType[];
|
||||
selectPartData: SelectDataType[];
|
||||
selectUpdownData: SelectDataType[];
|
||||
selectOperationData: SelectDataType[];
|
||||
selectFacilityPartData: SelectDataType[];
|
||||
selectSearchYear: SelectDataType[];
|
||||
selectUnitWaterShedData: SelectDataType[];
|
||||
selectRegionData: SelectDataType[];
|
||||
selectMiddleRegionData: SelectDataType[];
|
||||
selectEnvPartSidoData: SelectDataType[];
|
||||
selectEnvPartSigunData: SelectDataType[];
|
||||
selectFlowTerm: SelectDataType[];
|
||||
selectFlowPanel: SelectDataType[];
|
||||
selectEnvPartData: envPartSelectDataType[];
|
||||
}
|
||||
}
|
||||
|
||||
export const commonState:CommonType = {
|
||||
Common: {
|
||||
isInit: false,
|
||||
selectSidoData: selectSidoData,
|
||||
selectSigunData: selectSigunData,
|
||||
selectPartData: selectPartData,
|
||||
selectUpdownData: selectUpdownData,
|
||||
selectOperationData: selectOperationData,
|
||||
selectFacilityPartData: selectFacilityPartData,
|
||||
selectSearchYear: selectSearchYear,
|
||||
selectRegionData: selectRegionData,
|
||||
selectUnitWaterShedData: selectUnitWaterShedData,
|
||||
selectMiddleRegionData: selectMiddleRegionData,
|
||||
selectEnvPartSidoData : selectEnvPartSidoData,
|
||||
selectEnvPartSigunData : selectEnvPartSigunData,
|
||||
selectFlowTerm: selectFlowTerm,
|
||||
selectFlowPanel: selectFlowPanel,
|
||||
selectEnvPartData : selectEnvPartData,
|
||||
}
|
||||
}
|
||||
|
||||
.....
|
||||
|
||||
// action export
|
||||
export type CommonAction = {
|
||||
initializeCommonData: () => Promise<void>;
|
||||
}
|
||||
|
||||
.......
|
||||
|
||||
// reducer 세팅
|
||||
export const CommonReducer:(set:any)=>CommonAction=(set: any) => {
|
||||
return {
|
||||
// 시도 변경 이벤트
|
||||
initializeCommonData: async () => {
|
||||
const promiseSet = await Promise.all([fetchSidoData(), fetchSigunData(), fetchRegionData(), fetchUnitWaterShedData(), fetchMiddleRegionData(), fetchEnvPartData()]);
|
||||
const [sidoData, sggData, regionData, unitData, midData, envData] = promiseSet;
|
||||
set((state: CommonType) => ({
|
||||
Common: {
|
||||
...state.Common,
|
||||
selectSidoData: sidoData,
|
||||
selectSigunData: sggData,
|
||||
selectRegionData: regionData,
|
||||
selectMiddleRegionData: midData,
|
||||
selectUnitWaterShedData: unitData,
|
||||
selectEnvPartData: envData
|
||||
}
|
||||
})
|
||||
)},
|
||||
}
|
||||
}
|
||||
```
|
||||
```js
|
||||
/**
|
||||
* page.tsx
|
||||
*/
|
||||
|
||||
.......
|
||||
|
||||
// store에서 액션 호출 (각 페이지 유형별로 세팅)
|
||||
const {
|
||||
....
|
||||
,initializeCommonData
|
||||
....
|
||||
} = useFoStore((state) => state);
|
||||
|
||||
.......
|
||||
|
||||
// 데이터 반환
|
||||
const {
|
||||
isInit,
|
||||
selectPartData,
|
||||
selectUpdownData,
|
||||
selectOperationData,
|
||||
selectFacilityPartData,
|
||||
selectSidoData,
|
||||
selectSigunData,
|
||||
selectRegionData,
|
||||
selectUnitWaterShedData,
|
||||
selectMiddleRegionData,
|
||||
selectEnvPartData,
|
||||
} = Common;
|
||||
|
||||
.......
|
||||
|
||||
// 페이지 내에서 사용할 수 있게 state 설정
|
||||
const [partValue, setPartValue] = useState<string>("0");
|
||||
const [sidoValue, setSidoValue] = useState<string>("0");
|
||||
const [sigunValue, setSigunValue] = useState<string>("0");
|
||||
const [regionValue, setRegionValue] = useState<string>("0");
|
||||
const [untitWaterShedValue, setUntitWaterShedValue] = useState<string>("0");
|
||||
const [middleRegionValue, setMiddleRegionValue] = useState<string>("0");
|
||||
const [envPartValue, setEnvPartValue] = useState<string>("0");
|
||||
const [envPartSidoValue, setEnvPartSidoValue] = useState<string>("0");
|
||||
const [envPartSigunValue, setEnvPartSigunValue] = useState<string>("0");
|
||||
|
||||
<!-- 컴포넌트 호출 -->
|
||||
```
|
||||
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import React from 'react'
|
||||
import React from 'react';
|
||||
|
||||
function SearchFormRight(props: {children: React.ReactNode}) {
|
||||
return (
|
||||
<div className="w-1/5 mx-5 flex items-center justify-end space-x-2">
|
||||
<div className="w-1/12 mx-5 flex flex-col items-center justify-center space-x-2">
|
||||
{props.children}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
export { SearchFormRight };
|
||||
export { SearchFormRight };
|
||||
|
||||
@@ -21,9 +21,9 @@ const SearchInput = React.forwardRef<HTMLInputElement, {className:string, label:
|
||||
|
||||
return (
|
||||
<div className={className+" flex items-center"} >
|
||||
{label && <Label className="w-20 text-base text-gray-600">{label}</Label>}
|
||||
<Input className="flex-1 ml-8 w-3/4 h-10 border rounded" value={textValue} onChange={changeText} onKeyUp={keyUp}></Input>
|
||||
{label && <Label className="w-20 text-xl text-gray-600">{label}</Label>}
|
||||
<Input className="!text-lg flex-1 w-3/4 h-14 border rounded" value={textValue} onChange={changeText} onKeyUp={keyUp}></Input>
|
||||
</div>
|
||||
)
|
||||
});
|
||||
export { SearchInput };
|
||||
export { SearchInput };
|
||||
|
||||
@@ -24,12 +24,12 @@ const SearchInputSelect = React.forwardRef<HTMLInputElement, {className:string,
|
||||
|
||||
return (
|
||||
<div className={className+" flex items-center"} >
|
||||
{label && <Label className="w-20 text-base text-gray-600">{label}</Label>}
|
||||
{label && <Label className="w-20 text-xl text-gray-600">{label}</Label>}
|
||||
<div className="flex w-full items-center">
|
||||
<Input className="w-2/3 text-lg h-10 p-2 border rounded" value={textValue} onChange={changeText} />
|
||||
<Input className="w-2/3 text-xl h-14 p-2 border rounded" value={textValue} onChange={changeText} />
|
||||
<Select onValueChange={onSelectValue} value={selectValue}>
|
||||
<SelectTrigger className="ml-2 w-1/3 text-lg" >
|
||||
<SelectValue placeholder={selectData?.[0]?.text ?? ""} />
|
||||
<SelectTrigger className="ml-2 w-1/3" >
|
||||
<SelectValue placeholder={selectData?.[0]?.text ?? ""} />
|
||||
</SelectTrigger>
|
||||
{/* <SelectContent ref={refs ? (refs as unknown as RefType)?.selectValue : null}> */}
|
||||
<SelectContent >
|
||||
@@ -42,4 +42,4 @@ const SearchInputSelect = React.forwardRef<HTMLInputElement, {className:string,
|
||||
</div>
|
||||
)
|
||||
});
|
||||
export { SearchInputSelect };
|
||||
export { SearchInputSelect };
|
||||
|
||||
@@ -23,7 +23,7 @@ const SelectBox = React.forwardRef<
|
||||
|
||||
return (
|
||||
<div className={className+" flex items-center"} ref={ref}>
|
||||
{label && <Label className="w-20 text-base text-gray-600">{label}</Label>}
|
||||
{label && <Label className="w-20 text-xl text-gray-600">{label}</Label>}
|
||||
<Select onValueChange={onSelectValue} value={value !== undefined ? String(value) : undefined}>
|
||||
<SelectTrigger className={selectClass?selectClass:"flex-1 p-2 border rounded"}>
|
||||
<SelectValue placeholder={placeHolder} />
|
||||
@@ -38,4 +38,4 @@ const SelectBox = React.forwardRef<
|
||||
)
|
||||
})
|
||||
|
||||
export { SelectBox };
|
||||
export { SelectBox };
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import * as React from "react"
|
||||
import * as SelectPrimitive from "@radix-ui/react-select"
|
||||
import { Check, ChevronDown, ChevronUp } from "lucide-react"
|
||||
import * as React from "react"
|
||||
|
||||
import { cn } from "../../../lib/utils"
|
||||
|
||||
@@ -17,7 +17,7 @@ const SelectTrigger = React.forwardRef<
|
||||
<SelectPrimitive.Trigger
|
||||
ref={ref}
|
||||
className={cn(
|
||||
"flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background data-[placeholder]:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",
|
||||
"flex h-13 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-xl ring-offset-background data-[placeholder]:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",
|
||||
className
|
||||
)}
|
||||
{...props}
|
||||
@@ -103,7 +103,7 @@ const SelectLabel = React.forwardRef<
|
||||
>(({ className, ...props }, ref) => (
|
||||
<SelectPrimitive.Label
|
||||
ref={ref}
|
||||
className={cn("py-1.5 pl-8 pr-2 text-sm font-semibold", className)}
|
||||
className={cn("py-1.5 pl-8 pr-2 text-lg font-semibold", className)}
|
||||
{...props}
|
||||
/>
|
||||
))
|
||||
@@ -116,7 +116,7 @@ const SelectItem = React.forwardRef<
|
||||
<SelectPrimitive.Item
|
||||
ref={ref}
|
||||
className={cn(
|
||||
"relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
||||
"relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-lg outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
||||
className
|
||||
)}
|
||||
{...props}
|
||||
@@ -145,14 +145,6 @@ const SelectSeparator = React.forwardRef<
|
||||
SelectSeparator.displayName = SelectPrimitive.Separator.displayName
|
||||
|
||||
export {
|
||||
Select,
|
||||
SelectGroup,
|
||||
SelectValue,
|
||||
SelectTrigger,
|
||||
SelectContent,
|
||||
SelectLabel,
|
||||
SelectItem,
|
||||
SelectSeparator,
|
||||
SelectScrollUpButton,
|
||||
SelectScrollDownButton,
|
||||
Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue
|
||||
}
|
||||
|
||||
|
||||
@@ -51,7 +51,7 @@ export function UiTable({ tableData, headlist, pageSize, total, children, headNa
|
||||
</div> : <></>}
|
||||
<div className={`card !m-[1.2rem] !p-0r ${className}`}>
|
||||
<Table variant="secondary">
|
||||
<TableHeader >
|
||||
<TableHeader className="font-bold">
|
||||
{children ? <>{children}</> : <TableRow>
|
||||
{headlist?.map((head) => (
|
||||
<TableHead key={head.id}>{head.title}</TableHead>
|
||||
|
||||
Reference in New Issue
Block a user