지도점검 및 기타 수정사항 반영
This commit is contained in:
@@ -1,12 +1,11 @@
|
||||
"use client";
|
||||
import { useWrStore } from "@/app/store";
|
||||
import type {
|
||||
chgBuilding,
|
||||
customRainBdst,
|
||||
TableUpperProps,
|
||||
import {
|
||||
type chgBuilding,
|
||||
type customRainBdst,
|
||||
} 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 {
|
||||
@@ -21,19 +20,17 @@ import {
|
||||
UiTable,
|
||||
} from "@common/business_components";
|
||||
import ListDiv from "@common/business_components/ui/list_div";
|
||||
import { Button, TableHead, TableRow } from "@common/components";
|
||||
import { Button } from "@common/components";
|
||||
import { useEffect, useState } from "react";
|
||||
import { headMakeColSpan } from "./TableHead";
|
||||
|
||||
|
||||
export default function Home() {
|
||||
const { rain, code, init } = useWrStore((state) => {
|
||||
const { rain, code, initRain, rainSearch, getRainData } = useWrStore((state) => {
|
||||
return state;
|
||||
});
|
||||
const { rainRes } = rain;
|
||||
const [rainForm, setRainForm] = useState<customRainBdst>();
|
||||
const [issNewReg, setIsNewReg] = useState<boolean>(false);
|
||||
|
||||
const [pageNation, setPageNation] = useState(1);
|
||||
const [bdstTable, setbdstTable] = useState<customRainBdst[]>();
|
||||
const [searchTxt, setSearchTxt] = useState<string>();
|
||||
const [bdstChgProps, setBdstChgProps] = useState<{
|
||||
@@ -41,16 +38,24 @@ export default function Home() {
|
||||
chgBuilding: chgBuilding[];
|
||||
}>({ isOpen: false, chgBuilding: [] });
|
||||
|
||||
const nodeList = headMakeColSpan(rain.upHeadList);
|
||||
useEffect(() => {
|
||||
if (!rain.isInit) {
|
||||
init(undefined);
|
||||
initRain('41');
|
||||
}
|
||||
}, [rain.isInit, init]);
|
||||
}, [rain.isInit, initRain]);
|
||||
|
||||
useEffect(() => {
|
||||
if (code.sggCd.length > 0) {
|
||||
setbdstTable(tableData(rainRes, { code }));
|
||||
const rainData = tableData(rainRes, { code }).map(
|
||||
(item: customRainBdst) => {
|
||||
return {
|
||||
...item,
|
||||
bdstChgYn: item.chgBuilding.length > 0 ? "Y" : "N",
|
||||
};
|
||||
}
|
||||
);
|
||||
|
||||
setbdstTable(rainData);
|
||||
}
|
||||
}, [code, rainRes]);
|
||||
const cellClick: (val: number | undefined, headId: string) => void = (
|
||||
@@ -76,8 +81,9 @@ export default function Home() {
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
console.log("rainForm", rainForm);
|
||||
}, [rainForm]);
|
||||
console.log("getPageNation", pageNation);
|
||||
getRainData(pageNation, "41");
|
||||
}, [pageNation]);
|
||||
|
||||
return (
|
||||
<>
|
||||
@@ -88,7 +94,7 @@ export default function Home() {
|
||||
<SearchDiv>
|
||||
<SearchFormLeft>
|
||||
<SearchInput
|
||||
className="col-span-3 my-7"
|
||||
className={" col-span-3 my-7 !text-3xl"}
|
||||
label="건물명"
|
||||
textValue={searchTxt || ""}
|
||||
setText={(e) => {
|
||||
@@ -96,24 +102,24 @@ export default function Home() {
|
||||
}}
|
||||
/>
|
||||
</SearchFormLeft>
|
||||
<SearchFormRight >
|
||||
<SearchFormRight>
|
||||
<div className="flex flex-row space-x-2">
|
||||
<Button
|
||||
className=""
|
||||
size={"sm"}
|
||||
onClick={(e) => {
|
||||
init(searchTxt || "");
|
||||
}}
|
||||
>
|
||||
조회
|
||||
</Button>
|
||||
<Button
|
||||
size={"sm"}
|
||||
className=""
|
||||
onClick={() => setIsNewReg(!issNewReg)}
|
||||
>
|
||||
신규등록
|
||||
</Button>
|
||||
<Button
|
||||
className=""
|
||||
size={"sm"}
|
||||
onClick={(e) => {
|
||||
rainSearch(searchTxt || "", pageNation, "41");
|
||||
}}
|
||||
>
|
||||
조회
|
||||
</Button>
|
||||
<Button
|
||||
size={"sm"}
|
||||
className=""
|
||||
onClick={() => setIsNewReg(!issNewReg)}
|
||||
>
|
||||
신규등록
|
||||
</Button>
|
||||
</div>
|
||||
</SearchFormRight>
|
||||
</SearchDiv>
|
||||
@@ -121,19 +127,19 @@ export default function Home() {
|
||||
</div>
|
||||
<div className="h-screen grid grid-cols-6 gap-4 !overflow-y-scroll">
|
||||
<div className="col-span-4 h-full min-h-0">
|
||||
<ListDiv className="h-full min-h-0">
|
||||
<ListDiv className="h-full min-h-0">
|
||||
<ScrollArea className="h-[60vh]">
|
||||
<UiTable
|
||||
tableData={bdstTable || []}
|
||||
headlist={rain.upHeadList}
|
||||
pageSize={100}
|
||||
total={10}
|
||||
pageSize={20}
|
||||
total={10000}
|
||||
headName={"○건축물 목록"}
|
||||
cellClick={(val, headId) => {
|
||||
cellClick(val, headId);
|
||||
}}
|
||||
onPageChange={setPageNation}
|
||||
>
|
||||
{nodeList}
|
||||
</UiTable>
|
||||
</ScrollArea>
|
||||
</ListDiv>
|
||||
@@ -149,7 +155,7 @@ export default function Home() {
|
||||
</div>
|
||||
<UiModal
|
||||
body={<BdstReg moType="RNB"></BdstReg>}
|
||||
bodyClass="w-[90vw] max-w-none"
|
||||
bodyClass="w-[30vw] max-w-none"
|
||||
open={issNewReg}
|
||||
onOpenChange={(open) => {
|
||||
setIsNewReg(open);
|
||||
|
||||
@@ -23,28 +23,37 @@ import type { chgBuilding } from "@/app/store/ruseFcltMng/fcltReg/rainReg";
|
||||
import { headMakeColSpan } from "../rainReg/TableHead";
|
||||
|
||||
export default function Home() {
|
||||
const { code, rswt, initRswt } = useWrStore((state) => state);
|
||||
const nodeList = headMakeColSpan(rswt.upHeadList);
|
||||
const { code, rswt, initRswt ,rswtBdstSearch,getRswtBdstData} = useWrStore((state) => state);
|
||||
const [rswtForm, setRswtForm] = useState<customRswtBdst>();
|
||||
const [searchTxt, setSearchTxt] = useState<string>();
|
||||
const [issNewReg, setIsNewReg] = useState<boolean>(false);
|
||||
const [pageNation, setPageNation] = useState(1);
|
||||
|
||||
const [bdstTable, setbdstTable] = useState<customRswtBdst[]>();
|
||||
const [bdstChgProps, setBdstChgProps] = useState<{
|
||||
isOpen: boolean;
|
||||
chgBuilding: chgBuilding[];
|
||||
}>({ isOpen: false, chgBuilding: [] });
|
||||
|
||||
const { rswtRes } = rswt;
|
||||
|
||||
useEffect(() => {
|
||||
if (!rswt.isInit) {
|
||||
initRswt(undefined);
|
||||
initRswt('41');
|
||||
}
|
||||
}, [rswt.isInit, initRswt]);
|
||||
useEffect(() => {
|
||||
if (code.sggCd.length > 0) {
|
||||
setbdstTable(tableData(rswtRes, { code }));
|
||||
const rswtData = tableData(rswtRes, { code }).map(
|
||||
(item: customRswtBdst) => {
|
||||
return {
|
||||
...item,
|
||||
bdstChgYn: item.chgBuilding.length > 0 ? "Y" : "N",
|
||||
bdstUsgCd: item.reuseBuilding[0]?.bdstUsgCd
|
||||
};
|
||||
}
|
||||
);
|
||||
console.log(rswtData)
|
||||
setbdstTable(rswtData);
|
||||
}
|
||||
}, [code, rswtRes]);
|
||||
const cellClick: (val: number | undefined, headId: string) => void = (
|
||||
@@ -69,6 +78,10 @@ export default function Home() {
|
||||
const bdstChgModal = (chgBuilding: chgBuilding[]) => {
|
||||
setBdstChgProps({ isOpen: true, chgBuilding: chgBuilding });
|
||||
};
|
||||
useEffect(() => {
|
||||
getRswtBdstData(pageNation, "41");
|
||||
}, [pageNation]);
|
||||
|
||||
|
||||
return (
|
||||
<>
|
||||
@@ -93,7 +106,7 @@ export default function Home() {
|
||||
size={"sm"}
|
||||
className="mr-4 "
|
||||
onClick={(e) => {
|
||||
initRswt(searchTxt || "");
|
||||
rswtBdstSearch(searchTxt || "",pageNation,'41');
|
||||
}}
|
||||
>
|
||||
조회
|
||||
@@ -117,12 +130,12 @@ export default function Home() {
|
||||
<UiTable
|
||||
tableData={bdstTable || []}
|
||||
headlist={rswt.upHeadList}
|
||||
pageSize={100}
|
||||
total={10}
|
||||
pageSize={20}
|
||||
total={10000}
|
||||
headName={"○건축물 목록"}
|
||||
cellClick={cellClick}
|
||||
>
|
||||
{nodeList}
|
||||
cellClick={cellClick}
|
||||
onPageChange={setPageNation}
|
||||
>
|
||||
</UiTable>
|
||||
</ListDiv>
|
||||
</div>
|
||||
|
||||
@@ -1,57 +0,0 @@
|
||||
import type { chHeadType } from "@/app/store/prfmncReg/chkgdnReg/rainChkgdn";
|
||||
import type { TableTripleProps } from "@/app/store/ruseFcltMng/fcltReg/rainReg";
|
||||
import { TableHead, TableRow } from "@common/components/ui";
|
||||
|
||||
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>
|
||||
</>
|
||||
);
|
||||
};
|
||||
@@ -15,7 +15,8 @@ import {
|
||||
import ListDiv from "@common/business_components/ui/list_div";
|
||||
import { Button } from "@common/components/ui";
|
||||
import { useCallback, useEffect, useRef, useState } from "react";
|
||||
import { headMakeTriple } from "./TableHead";
|
||||
import type { customRainBdst } from "@/app/store/ruseFcltMng/fcltReg/rainReg";
|
||||
import { HeadMakeColSpan } from "@common/business_components/ui/table/HeadMakeColSpan";
|
||||
|
||||
export default function RainSttn() {
|
||||
const { code, rainSttn, rainSttnSearch } =
|
||||
@@ -23,11 +24,7 @@ export default function RainSttn() {
|
||||
const { rainSttnRes } = rainSttn;
|
||||
const [isChHead, setIsChHead] = useState(false);
|
||||
const ref = useRef<ReturnType>({} as ReturnType);
|
||||
const [bdstTable, setBdstTable] = useState<any[]>();
|
||||
// const nodeList = headMakeTriple(
|
||||
// rainSttn.rainSttHeadList,
|
||||
// rainSttn.rainSttHeadNm
|
||||
// );
|
||||
const [bdstTable, setBdstTable] = useState<customRainBdst[]>();
|
||||
|
||||
useEffect(() => {
|
||||
if (!rainSttn.isInit) {
|
||||
@@ -41,22 +38,43 @@ export default function RainSttn() {
|
||||
}
|
||||
}, [rainSttn.isInit, rainSttnSearch]);
|
||||
|
||||
|
||||
useEffect(() => {
|
||||
|
||||
if (rainSttnRes.length > 0) {
|
||||
if (rainSttnRes.length > 0 && code.cityCd.length>0) {
|
||||
const data = tableData(rainSttnRes, { code });
|
||||
|
||||
const chData = data
|
||||
.map((item: any) => ({
|
||||
|
||||
...item,
|
||||
...item.reuseBuilding[0],
|
||||
...item.reuseBuilding[0].rainyObj,
|
||||
// cityText:item.cityText,
|
||||
// sggText:item.sggText,
|
||||
// bdstNm: item.bdstNm,
|
||||
// daddr:item.daddr,
|
||||
// bdstUsgCd:item.bdstUsgCd,
|
||||
// frstArchPrmsnDt:item.frstArchPrmsnDt,
|
||||
// archArea:item.archArea,
|
||||
// lawTrgtYn:item.lawTrgtYn,
|
||||
// instlCmptnDt:item.instlCmptnDt,
|
||||
// instlCst:item.instlCst,
|
||||
|
||||
|
||||
|
||||
|
||||
}))
|
||||
.filter((item: any) => item.rainyObj !== undefined);
|
||||
|
||||
setBdstTable(chData);
|
||||
}
|
||||
}, [code, rainSttnRes, rainSttn.rainSttHeadList]);
|
||||
|
||||
|
||||
useEffect(() =>{
|
||||
console.log(rainSttn.rainSttNodeList)
|
||||
},[rainSttn.rainSttNodeList])
|
||||
|
||||
useEffect(() => {
|
||||
if(rainSttn.excelList.length>0){
|
||||
|
||||
@@ -122,6 +140,7 @@ export default function RainSttn() {
|
||||
<UiTable
|
||||
headName={[]}
|
||||
tableData={bdstTable || []}
|
||||
children={<HeadMakeColSpan upHeadList={rainSttn.rainSttNodeList}/>}
|
||||
headlist={rainSttn.rainSttHeadList}
|
||||
pageSize={0}
|
||||
total={0}
|
||||
@@ -130,7 +149,6 @@ export default function RainSttn() {
|
||||
throw new Error("Function not implemented.");
|
||||
}}
|
||||
>
|
||||
{/* {nodeList} */}
|
||||
</UiTable>
|
||||
</ListDiv>
|
||||
</div>
|
||||
|
||||
@@ -7,6 +7,7 @@ import {
|
||||
} from "@/app/store/prfmncReg/chkgdnReg/rainChkgdn";
|
||||
import { excelDownload } from "@/components/lib/func/commom";
|
||||
import ChkgdExcel from "@/components/ui/modal/chkgdExcel/chkgdExcel";
|
||||
import ChkgdModal from "@/components/ui/modal/chkgdModal/chkgdModal";
|
||||
import RainChkgdTable from "@/components/ui/table/chkgdTable/rainChkgd/rainChkgdTable";
|
||||
import RainChkgdTableModal from "@/components/ui/table/chkgdTable/rainChkgd/rainChkgdTableModal";
|
||||
import RswtChkgdTable from "@/components/ui/table/chkgdTable/rswtChkgd/rswtChkgdTable";
|
||||
@@ -23,16 +24,18 @@ import {
|
||||
import ListDiv from "@common/business_components/ui/list_div";
|
||||
import { Button } from "@common/components/ui";
|
||||
import { useCallback, useEffect, useState } from "react";
|
||||
import { Toaster } from "react-hot-toast";
|
||||
|
||||
//-----------------------
|
||||
export default function Page() {
|
||||
|
||||
const { code, rainChkgdn, rainChkInit,rainChkDetilUpdate, rainChkExcelDownload } = useWrStore((state) => {
|
||||
const { code, rainChkgdn, rainChkInit,rainChkDetilUpdate, rainChkDelete , rainChkExcelDownload } = useWrStore((state) => {
|
||||
return state;
|
||||
});
|
||||
const [isRegExcel, setIsRegExcel] = useState(false);
|
||||
const [searchTxt, setSearchTxt] = useState<string>();
|
||||
const [updateRainDetail, setUpdateRainDetail] = useState<rainChkZodType[]>([]);
|
||||
const [deleteIdx, setDeleteIdx ] = useState<number[]> ([]);
|
||||
const [selFcltDiv, setSelFcltDiv] = useState("RNB");
|
||||
const [isModal, setIsModal] = useState({
|
||||
open: false,
|
||||
@@ -40,19 +43,19 @@ export default function Page() {
|
||||
});
|
||||
const cellClick = () => {
|
||||
if(searchTxt)
|
||||
rainChkInit(searchTxt,'41')
|
||||
rainChkInit(searchTxt,'0')
|
||||
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
if (!rainChkgdn.isInit) {
|
||||
rainChkInit('2024','0');
|
||||
setIsModal({data:{}, open:rainChkgdn.isModalClose })
|
||||
setIsRegExcel(false)
|
||||
}
|
||||
}, [rainChkgdn.isInit, rainChkInit]);
|
||||
|
||||
|
||||
|
||||
|
||||
useEffect(() => {
|
||||
excelDownload(rainChkgdn.excelList ,'빗물이용시설 지도점검','sample_rainy.xlsx', 'A1:AN1');
|
||||
}, [rainChkgdn.excelList]);
|
||||
@@ -60,10 +63,22 @@ export default function Page() {
|
||||
const excelClick= useCallback(()=>{
|
||||
rainChkExcelDownload(code.cityCd, code.sggCd);
|
||||
}, [rainChkExcelDownload, code.cityCd, code.sggCd]);
|
||||
|
||||
|
||||
|
||||
const handleClick = useCallback((data:any) => {
|
||||
if(data) setIsModal({ open: true, data: data });
|
||||
}, [isModal]);
|
||||
|
||||
const clickDelete=(data:number[])=>{
|
||||
if(data.length>0){
|
||||
data.forEach((data) =>{
|
||||
rainChkDelete( String(data) )
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return (
|
||||
<ContentsDiv>
|
||||
<div className="grid grid-cols-4 gap-4 ">
|
||||
@@ -97,7 +112,7 @@ export default function Page() {
|
||||
>
|
||||
조회
|
||||
</Button>
|
||||
<Button size={"sm"} onClick={() => {}}>
|
||||
<Button size={"sm"} onClick={() => { clickDelete(deleteIdx) }}>
|
||||
삭제
|
||||
</Button>
|
||||
<Button size={"sm"} onClick={() => { rainChkDetilUpdate( updateRainDetail as rainChkZodType[]) }}>
|
||||
@@ -124,18 +139,25 @@ export default function Page() {
|
||||
<div className="grid grid-cols-6 gap-4 ">
|
||||
<div className="col-span-6">
|
||||
<ListDiv>
|
||||
{selFcltDiv === "RNB" ? <RainChkgdTable detailUp={setUpdateRainDetail} handleClick={handleClick} /> : <RswtChkgdTable />}
|
||||
{selFcltDiv === "RNB" ? <RainChkgdTable deleteData={setDeleteIdx} detailUp={setUpdateRainDetail} handleClick={handleClick} /> : <RswtChkgdTable />}
|
||||
</ListDiv>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<RainChkgdTableModal isModal={isModal} setIsModal={setIsModal}/>
|
||||
<UiModal
|
||||
open={isModal.open}
|
||||
onOpenChange={() => {
|
||||
setIsModal({ open: !open, data: {} });
|
||||
}}
|
||||
bodyClass={"w-[80vw] max-w-none"}
|
||||
body={<ChkgdModal type={"RNB"} obj={isModal.data} />}
|
||||
></UiModal>
|
||||
<UiModal
|
||||
open={isRegExcel}
|
||||
onOpenChange={setIsRegExcel}
|
||||
bodyClass={"w-[40vw] max-w-none"}
|
||||
body={<ChkgdExcel type={selFcltDiv}></ChkgdExcel>}
|
||||
/>
|
||||
<Toaster position="top-center" />
|
||||
</ContentsDiv>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -12,6 +12,7 @@ export const btnClass= "p-4 m-2 text-white rounded-sm text-lg font-medium "
|
||||
|
||||
//공통 건축물 용도
|
||||
const bdstUsgCd: SelectDataType[] = [
|
||||
{ val: '-1', text: "확인불가" },
|
||||
{ val: '1', text: "운동장" },
|
||||
{ val: '2', text: "체육관" },
|
||||
{ val: '3', text: "공공업무시설" },
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
export type CommonTableProps = {
|
||||
id: string;
|
||||
title: string;
|
||||
upName?: string;
|
||||
upSequnce?: number;
|
||||
row?: number;
|
||||
rowSpan?: number;
|
||||
colSpan?: number;
|
||||
visible?: boolean;
|
||||
};
|
||||
|
||||
export type TableUpperProps = {
|
||||
id: string;
|
||||
title: string;
|
||||
upName?: string;
|
||||
upSequnce?: number;
|
||||
edit?:boolean;
|
||||
visible?:boolean;
|
||||
rowSpan?: true;
|
||||
type?: string;
|
||||
};
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ import {
|
||||
TEST_UUID,
|
||||
type TableUpperProps,
|
||||
} from "@/app/store/ruseFcltMng/fcltReg/rainReg";
|
||||
import { fetchType, getFetch, postFectch, putFectch } from "@/components/lib/api";
|
||||
import { deleteFectch, fetchType, getFetch, postFectch, putFectch } from "@/components/lib/api";
|
||||
import type { SelectDataType } from "@common/business_components/ui";
|
||||
import { z } from "zod";
|
||||
import { buildingToExcelType, excelToRainChkData } from "./excel";
|
||||
@@ -302,6 +302,7 @@ export type rainChkgdnState = {
|
||||
splHeadList: TableUpperProps[];
|
||||
rswtDetailHeadList: TableUpperProps[];
|
||||
isInit: boolean;
|
||||
isModalClose:boolean;
|
||||
excelList:[];
|
||||
};
|
||||
};
|
||||
@@ -312,6 +313,7 @@ type rainChkgdnActions = {
|
||||
rainChkGuidUpdate(rainChk: rainChkZodType): Promise<void>;
|
||||
rainChkExcelDownload(sidoCode: SelectDataType[],sggCode: SelectDataType[]): Promise<void>
|
||||
rainChkExcelDataUPload(excelData:rainChkZodType[]) : Promise<void>
|
||||
rainChkDelete(chkgdnPk:string) :Promise<void>
|
||||
};
|
||||
|
||||
export type rainChkgdnType = rainChkgdnState & rainChkgdnActions;
|
||||
@@ -325,6 +327,7 @@ export const rainChkgdnStateExport: rainChkgdnState = {
|
||||
ruseHeadList: ruseHeadList,
|
||||
rswtDetailHeadList: rswtDetailHeadList,
|
||||
isInit: false,
|
||||
isModalClose:false,
|
||||
excelList:[]
|
||||
},
|
||||
};
|
||||
@@ -379,7 +382,7 @@ export const rainChkgdnActionsExport: (set: any) => rainChkgdnActions = (
|
||||
try{
|
||||
const res = await postFectch("/reuseChk/rainyExcel", excelData);
|
||||
if (res.ok) {
|
||||
ToastFormUi({body:"엑셀 데이터 업로드가 성공하였습니다. " ,title:'엑셀등록'})
|
||||
ToastFormUi({body:"지도점검 등록이 완료되었습니다. " ,title:'지도점검 등록'})
|
||||
}
|
||||
const rainChkRes = await initFetch('2024', '0');
|
||||
return set((state: rainChkgdnState) => ({
|
||||
@@ -391,7 +394,7 @@ export const rainChkgdnActionsExport: (set: any) => rainChkgdnActions = (
|
||||
}));
|
||||
}catch(error){
|
||||
console.log(error);
|
||||
ToastFormUi({body:"엑셀 데이터 업로드를 실패하였습니다. " ,title:'엑셀등록'})
|
||||
ToastFormUi({body:"지도점검 등록이 실패되었습니다." ,title:'지도점검 등록'})
|
||||
}
|
||||
},
|
||||
rainChkInit: async (searchTxt: string, sggCd: string) => {
|
||||
@@ -415,11 +418,9 @@ export const rainChkgdnActionsExport: (set: any) => rainChkgdnActions = (
|
||||
|
||||
const res = await postFectch("/reuseChk/rainyExcel", rainChk);
|
||||
if (res.ok) {
|
||||
alert(" 수정이 완료되었습니다.");
|
||||
ToastFormUi({body:"지도점검 보급수 및 밋물이용량 수정이 완료되었습니다. " ,title:'지도점검 수정'})
|
||||
}
|
||||
|
||||
const rainChkRes = await initFetch('2024', '0');
|
||||
|
||||
return set((state: rainChkgdnState) => ({
|
||||
...state,
|
||||
rainChkgdn: {
|
||||
@@ -433,13 +434,11 @@ export const rainChkgdnActionsExport: (set: any) => rainChkgdnActions = (
|
||||
}
|
||||
},
|
||||
rainChkGuidUpdate: async (rainChk: rainChkZodType) => {
|
||||
|
||||
try{
|
||||
|
||||
//const chData = await makeMdfrChk(rainChk, "guideDetails", "rainDetil");
|
||||
const res = await putFectch("/reuseChk/rainy", rainChk);
|
||||
if (res.ok) {
|
||||
alert(" 수정이 완료되었습니다.");
|
||||
ToastFormUi({body:"지도점검 수질 및 과태료 수정이 완료되었습니다. " ,title:'지도점검 수정'})
|
||||
}
|
||||
const rainChkRes = await initFetch('2024', '0');
|
||||
return set((state: rainChkgdnState) => ({
|
||||
@@ -454,6 +453,30 @@ export const rainChkgdnActionsExport: (set: any) => rainChkgdnActions = (
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
rainChkDelete: async (chkgdnPk:string) =>{
|
||||
try{
|
||||
const res = await deleteFectch(`/reuseChk/rainy/${chkgdnPk}`,'');
|
||||
|
||||
if(res.ok){
|
||||
ToastFormUi({body:"삭제가 완료되었습니다. " ,title:'지도점검 삭제'})
|
||||
}
|
||||
const rainChkRes = await initFetch('2024', '0');
|
||||
return set((state: rainChkgdnState) => ({
|
||||
...state,
|
||||
rainChkgdn: {
|
||||
...state.rainChkgdn,
|
||||
rainChk: rainChkRes,
|
||||
},
|
||||
}));
|
||||
|
||||
|
||||
}catch(error){
|
||||
ToastFormUi({body:"삭제를 실패했습니다.. " ,title:'지도점검 삭제'})
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,11 +1,8 @@
|
||||
import { getFetch, postFectch, putFectch } from "@/components/lib/api";
|
||||
import { z } from "zod";
|
||||
import { makeMdfr, makeRstr } from "../bdstReg";
|
||||
import type { SelectDataType } from "@common/business_components/ui";
|
||||
|
||||
|
||||
export const TEST_UUID= '2d4b151d-1828-41e0-91d9-4cd28ea1cc7e'
|
||||
|
||||
export const rainZod = z.object({
|
||||
bdstInfoPk: z.number().optional(),
|
||||
ctpvCd: z.number().default(0),
|
||||
@@ -23,11 +20,11 @@ export const rainZod = z.object({
|
||||
bdstRuseFcltPk: z.number().nullish(),
|
||||
bdstInfoFk:z.number().nullish(),
|
||||
instlCmptnDt: z.coerce.date().default(() => new Date()),
|
||||
instlCst: z.number().default(0),
|
||||
instlCst: z.number().nullish(),
|
||||
operMngCd: z.string().optional().default(""),
|
||||
anlOperCst: z.number().default(0),
|
||||
instlCstSprtYn: z.string().default(""),
|
||||
instlCstSprtAmt: z.number().nullish(),
|
||||
instlCstSprtAmt: z.number().nullish(),
|
||||
grntchBdstCertYn: z.enum(["Y", "N"]).nullish(),
|
||||
grntchBdstCertYr: z.string().default("")
|
||||
.refine((year)=> year.length===0 || /^\d{4}$/.test(year),{
|
||||
@@ -35,7 +32,7 @@ export const rainZod = z.object({
|
||||
}),
|
||||
grntchBdstCertNo: z.string().default(""),
|
||||
grntchBdstCertGrd: z.string().default(""),
|
||||
crgRdctYn: z.enum(["Y", "N"]), // 안쓰는 값
|
||||
crgRdctYn: z.enum(["Y", "N"]).nullish(), // 안쓰는 값
|
||||
crgRdctBss: z.string().default("").nullish(), /// 안쓰는 값
|
||||
crgRdctAmt: z.number().default(0), // 안쓰는 값
|
||||
ruseFcltFlg: z.string().default(""),
|
||||
@@ -75,8 +72,6 @@ export const rainZod = z.object({
|
||||
).default([])
|
||||
});
|
||||
|
||||
|
||||
|
||||
export type chgBuilding={
|
||||
bdstInfoFk?: number|null,
|
||||
archChgPrmsnDt?: Date,
|
||||
@@ -85,11 +80,7 @@ export type chgBuilding={
|
||||
rgtr?:string|null;
|
||||
mdfr?:string|null;
|
||||
}
|
||||
|
||||
|
||||
export type customRainBdst = z.infer<typeof rainZod>
|
||||
|
||||
|
||||
export type TableUpperProps = {
|
||||
id: string;
|
||||
title: string;
|
||||
@@ -101,58 +92,38 @@ export type TableUpperProps = {
|
||||
type?: string;
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
export type TableTripleProps = {
|
||||
id: string;
|
||||
title: string;
|
||||
upName: string[];
|
||||
upSequnce: number[];
|
||||
edit?:boolean;
|
||||
visible?:boolean;
|
||||
};
|
||||
|
||||
|
||||
export const upHeadList: TableUpperProps[] = [
|
||||
{ id: "cityText", title: "시도" },
|
||||
{ id: "sggText", title: "시군구" },
|
||||
{ id: "bdstNm", title: "시설명" },
|
||||
{ id: "daddr", title: "위치" },
|
||||
{ id: "bdsgUsgText", title: "건축물용도" },
|
||||
// { id: "bdstUsgCd", title: "건축물용도" },
|
||||
{ id: "frstArchPrmsnDt", title: "최초건축허가일" },
|
||||
{ id: "archArea", title: "건축면적" },
|
||||
{ id: "lawTrgtYn", title: "법적의무대상여부" },
|
||||
{ id: "bdstChgYn", title: "건축물변경여부" },
|
||||
// { id: "archChgPrmsnDt", title: "허가일", upName: "upChangeRe", upSequnce: 2 },
|
||||
// { id: "archChgArea", title: "면적", upName: "upChangeRe", upSequnce: 3 },
|
||||
];
|
||||
|
||||
const rainRes: customRainBdst[] = [];
|
||||
|
||||
|
||||
export const selectClass = "w-full h-full !text-2xl";
|
||||
const selectYN = [
|
||||
{ text: "Y", val: "1" },
|
||||
{ text: "N", val: "2" },
|
||||
];
|
||||
|
||||
export type rainFacState = {
|
||||
rain: {
|
||||
isInit: boolean;
|
||||
upHeadList: TableUpperProps[];
|
||||
selectYN: SelectDataType[];
|
||||
rainRes: customRainBdst[];
|
||||
// regRainForm:customRainBdst,
|
||||
|
||||
};
|
||||
};
|
||||
type rainFacSActions = {
|
||||
init: (txt:string|undefined) => void;
|
||||
rainSearTxt: (txt:string) => void;
|
||||
rainReg: (data: customRainBdst) => void;
|
||||
rainUpdate: (data: customRainBdst) => void;
|
||||
initRain: (code:string|number) => void;
|
||||
getRainData:(pageNation:number, code:string|number) =>void;
|
||||
rainSearch: (txt:string,pageNation:number,code:string|number) => void;
|
||||
rainBdstReg: (data: customRainBdst, code:string|number) => void;
|
||||
rainBdstUpdate: (data: customRainBdst, code:string|number) => void;
|
||||
};
|
||||
|
||||
export type rainFacType = rainFacState & rainFacSActions;
|
||||
@@ -162,37 +133,42 @@ export const rainFacStateExport: rainFacState = {
|
||||
isInit: false,
|
||||
rainRes: rainRes,
|
||||
upHeadList: upHeadList,
|
||||
selectYN: selectYN,
|
||||
//regRainForm:regRainForm,
|
||||
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
const initFetch = async (txt:string|undefined) => {
|
||||
|
||||
const rainRes =await getFetch("wr", `/reuseFc/rainyInfoList/1/20/41` +(txt? `/${txt}`:''));
|
||||
const chRainRes = rainRes.map((item: customRainBdst) => {
|
||||
return {
|
||||
...item,
|
||||
bdstChgYn: item.chgBuilding.length > 0 ? "Y" : "N",
|
||||
} })
|
||||
return chRainRes;
|
||||
|
||||
|
||||
const initFetch = async (code:string|number) => {
|
||||
const rainRes =await getFetch("wr", `/reuseFc/rainyInfoList/1/20/${code}`);
|
||||
return rainRes;
|
||||
};
|
||||
export const rainFacActionsExport: (set: any) => rainFacSActions = (
|
||||
set: any
|
||||
) => {
|
||||
return {
|
||||
init: async (txt:string|undefined) => {
|
||||
getRainData: async(pageNation:number, code:string|number) =>{
|
||||
try{
|
||||
const rainRes =await getFetch("wr", `/reuseFc/rainyInfoList/${pageNation}/20/${code}`);
|
||||
|
||||
|
||||
// 여기서 상태 업데이트
|
||||
return set((state: rainFacState) => ({
|
||||
...state,
|
||||
rain: {
|
||||
...state.rain,
|
||||
rainRes: rainRes,
|
||||
isInit: false,
|
||||
},
|
||||
}));
|
||||
|
||||
}catch(e){
|
||||
console.log(e)
|
||||
|
||||
}
|
||||
},
|
||||
|
||||
initRain: async (code:string|number) => {
|
||||
try {
|
||||
// 파라이터 수정 통합관리자 =0, 시관리자=시코드, 시군구 관리자= 시군구 코드 를 세번째 파라미터로 지정 / 건축물 서치가 있을경우 4번째 파라미터로 던지기 즉 1/20/42(서울시)/영현빌딩 이런식으로)
|
||||
const rainRes = await initFetch(txt);
|
||||
|
||||
|
||||
const rainRes = await initFetch(code);
|
||||
// 여기서 상태 업데이트
|
||||
return set((state: rainFacState) => ({
|
||||
...state,
|
||||
@@ -204,14 +180,12 @@ export const rainFacActionsExport: (set: any) => rainFacSActions = (
|
||||
}));
|
||||
} catch (error) {
|
||||
console.log("error", error);
|
||||
} finally {
|
||||
console.log("finally");
|
||||
}
|
||||
}
|
||||
},
|
||||
rainSearTxt: async(txt:string) =>{
|
||||
rainSearch: async(txt:string,pageNation:number) =>{
|
||||
try{
|
||||
|
||||
const rainRes = await getFetch('wr' , `/reuseFc/rainyInfoList/1/20/41` +(txt? `/${txt}`:''))
|
||||
const rainRes = await getFetch('wr' , `/reuseFc/rainyInfoList/${pageNation}/20/41` +(txt? `/${txt}`:''))
|
||||
set((state: rainFacState) => {
|
||||
return {
|
||||
rain: {
|
||||
@@ -225,7 +199,7 @@ export const rainFacActionsExport: (set: any) => rainFacSActions = (
|
||||
console.log("error", erTxt)
|
||||
}
|
||||
},
|
||||
rainReg: async (data: customRainBdst) => {
|
||||
rainBdstReg: async (data: customRainBdst,code:string|number) => {
|
||||
try {
|
||||
|
||||
const test =await makeRstr(data);
|
||||
@@ -252,7 +226,7 @@ export const rainFacActionsExport: (set: any) => rainFacSActions = (
|
||||
alert("등록이 완료되었습니다.");
|
||||
}
|
||||
}
|
||||
const rainRes = await initFetch(undefined);
|
||||
const rainRes = await initFetch(code);
|
||||
set((state: rainFacState) => ({
|
||||
...state,
|
||||
rain: {
|
||||
@@ -267,18 +241,15 @@ export const rainFacActionsExport: (set: any) => rainFacSActions = (
|
||||
} finally {
|
||||
}
|
||||
},
|
||||
rainUpdate: async (data: customRainBdst) => {
|
||||
rainBdstUpdate: async (data: customRainBdst,code:string|number) => {
|
||||
try {
|
||||
|
||||
|
||||
const chData =await makeMdfr(data);
|
||||
const res = await putFectch("/reuseFc/rainyInfo", chData);
|
||||
console.log('rainUpdate', res);
|
||||
if(res.ok){
|
||||
alert(" 수정이 완료되었습니다.")
|
||||
}
|
||||
|
||||
const rainRes = await initFetch(undefined);
|
||||
const rainRes = await initFetch(code);
|
||||
set((state: rainFacState) => ({
|
||||
...state,
|
||||
rain: {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { getFetch, postFectch, putFectch } from "@/components/lib/api";
|
||||
import { upHeadList, type chgBuilding, type TableUpperProps } from "../rainReg";
|
||||
import { upHeadList, type chgBuilding, type TableUpperProps } from "../rainReg";
|
||||
|
||||
import { z } from "zod";
|
||||
import { makeMdfr, makeRstr } from "../bdstReg";
|
||||
@@ -15,73 +15,77 @@ export const rswtZod = z.object({
|
||||
|
||||
archArea: z.number().default(0),
|
||||
archChgArea: z.number().default(0),
|
||||
rgtr:z.string().nullish().default(null),
|
||||
mdfr:z.string().nullish().default(null),
|
||||
rgtr: z.string().nullish().default(null),
|
||||
mdfr: z.string().nullish().default(null),
|
||||
|
||||
reuseBuilding: z.array(
|
||||
z.object({
|
||||
bdstRuseFcltPk: z.number().nullish(),
|
||||
bdstInfoFk: z.number().nullish(),
|
||||
instlCmptnDt: z.coerce.date().default(() => new Date()),
|
||||
instlCst: z.number().default(0),
|
||||
operMngCd: z.string().nullish().default(""),
|
||||
reuseBuilding: z
|
||||
.array(
|
||||
z.object({
|
||||
bdstRuseFcltPk: z.number().nullish(),
|
||||
bdstInfoFk: z.number().nullish(),
|
||||
instlCmptnDt: z.coerce.date().default(() => new Date()),
|
||||
instlCst: z.number().default(0),
|
||||
operMngCd: z.string().nullish().default(""),
|
||||
|
||||
anlOperCst: z.number().default(0),
|
||||
instlCstSprtYn: z.enum(["Y", "N"]),
|
||||
instlCstSprtAmt: z.number().default(0),
|
||||
anlOperCst: z.number().default(0),
|
||||
instlCstSprtYn: z.enum(["Y", "N"]),
|
||||
instlCstSprtAmt: z.number().default(0),
|
||||
|
||||
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.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(""),
|
||||
rgtr:z.string().nullish().default(null),
|
||||
mdfr:z.string().nullish().default(null),
|
||||
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(""),
|
||||
|
||||
rswtrObj: z.object({
|
||||
bdstRuseFcltFk: z.number().nullish(),
|
||||
wtrUsqty: z.number().default(0),
|
||||
oblgTrgtWtrUsqty: z.number().nullish().default(0),
|
||||
orgwtKndCd: z.string().default(""),
|
||||
filtrTrtmfctProcs: z.string().default(""),
|
||||
filtrTrtmfctUsgCd: z.string().default(""),
|
||||
rswtrUsqty: z.number().default(0),
|
||||
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({})
|
||||
})
|
||||
).default([]),
|
||||
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(""),
|
||||
rgtr: z.string().nullish().default(null),
|
||||
mdfr: z.string().nullish().default(null),
|
||||
|
||||
rswtrObj: z
|
||||
.object({
|
||||
bdstRuseFcltFk: z.number().nullish(),
|
||||
wtrUsqty: z.number().default(0),
|
||||
oblgTrgtWtrUsqty: z.number().nullish().default(0),
|
||||
orgwtKndCd: z.string().default(""),
|
||||
filtrTrtmfctProcs: z.string().default(""),
|
||||
filtrTrtmfctUsgCd: z.string().default(""),
|
||||
rswtrUsqty: z.number().default(0),
|
||||
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({}),
|
||||
})
|
||||
)
|
||||
.default([]),
|
||||
|
||||
chgBuilding: z
|
||||
.array(
|
||||
z.object({
|
||||
bdstInfoFk: z.number().nullish(),
|
||||
archChgPrmsnDt: z.coerce.date() ,
|
||||
archChgArea: z.string().default("-"),
|
||||
bdstChgNm: z.string().default(""),
|
||||
rgtr:z.string().nullish().default(null),
|
||||
mdfr:z.string().nullish().default(null),
|
||||
})
|
||||
)
|
||||
.default([]),
|
||||
|
||||
.array(
|
||||
z.object({
|
||||
bdstInfoFk: z.number().nullish(),
|
||||
archChgPrmsnDt: z.coerce.date(),
|
||||
archChgArea: z.string().default("-"),
|
||||
bdstChgNm: z.string().default(""),
|
||||
rgtr: z.string().nullish().default(null),
|
||||
mdfr: z.string().nullish().default(null),
|
||||
})
|
||||
)
|
||||
.default([]),
|
||||
});
|
||||
|
||||
|
||||
export type customRswtBdst = z.infer<typeof rswtZod>
|
||||
export type customRswtBdst = z.infer<typeof rswtZod>;
|
||||
|
||||
const rswtRes: customRswtBdst[] = [];
|
||||
|
||||
@@ -93,9 +97,11 @@ export type rswtFacState = {
|
||||
};
|
||||
};
|
||||
type rswtFacSActions = {
|
||||
initRswt: (txt: string | undefined) => void;
|
||||
rswtUpdate: (data: customRswtBdst) => void;
|
||||
rswtReg: (data: customRswtBdst) => void;
|
||||
initRswt: (code:string|number) => void;
|
||||
rswtBdstUpdate: (data: customRswtBdst,code:string|number) => void;
|
||||
getRswtBdstData:(pageNation:number, code:string|number) =>void;
|
||||
rswtBdstSearch:(txt:string,pageNation:number, code:string|number) =>void;
|
||||
rswtBdstReg: (data: customRswtBdst,code:string|number) => void;
|
||||
};
|
||||
|
||||
export type rswtFacType = rswtFacState & rswtFacSActions;
|
||||
@@ -108,25 +114,58 @@ export const rswtFacStateExport: rswtFacState = {
|
||||
},
|
||||
};
|
||||
|
||||
const initFetch = async (txt: string | undefined) => {
|
||||
const rswtRes =await getFetch(
|
||||
const initFetch = async (code:string|number) => {
|
||||
const rswtRes = await getFetch(
|
||||
"wr",
|
||||
`/reuseFc/waterreuseFc/1/20/41` + (txt ? `/${txt}` : "")
|
||||
);
|
||||
const chRswtRes = rswtRes.map((item: customRswtBdst) => {
|
||||
return {
|
||||
...item,
|
||||
bdstChgYn: item.chgBuilding.length > 0 ? "Y" : "N",
|
||||
} })
|
||||
return chRswtRes;
|
||||
`/reuseFc/waterreuseFc/1/20/${code}`)
|
||||
|
||||
return rswtRes;
|
||||
};
|
||||
export const rswtFacActionsExport: (set: any) => rswtFacSActions = (
|
||||
set: any
|
||||
) => {
|
||||
return {
|
||||
initRswt: async (txt: string | undefined) => {
|
||||
rswtBdstSearch: async(txt:string,pageNation:number,code:string|number) =>{
|
||||
try{
|
||||
|
||||
const rswtRes = await getFetch('wr' , `/reuseFc/rainyInfoList/${pageNation}/20/${code}` +(txt? `/${txt}`:''))
|
||||
set((state: rswtFacState) => {
|
||||
return {
|
||||
...state,
|
||||
rswt: {
|
||||
...state.rswt,
|
||||
rswtRes: rswtRes,
|
||||
isInit: false,
|
||||
},
|
||||
};
|
||||
})}
|
||||
catch(erTxt){
|
||||
console.log("error", erTxt)
|
||||
}
|
||||
},
|
||||
getRswtBdstData: async (pageNation: number, code: string | number) => {
|
||||
try {
|
||||
const rswtRes = await initFetch(txt);
|
||||
const rswtRes = await getFetch(
|
||||
"wr",
|
||||
`/reuseFc/waterreuseFc/${pageNation}/20/${code}`
|
||||
);
|
||||
console.log(pageNation)
|
||||
// 여기서 상태 업데이트
|
||||
return set((state: rswtFacState) => ({
|
||||
...state,
|
||||
rswt: {
|
||||
...state.rswt,
|
||||
rswtRes: rswtRes,
|
||||
isInit: false,
|
||||
},
|
||||
}));
|
||||
} catch (e) {
|
||||
console.log(e);
|
||||
}
|
||||
},
|
||||
initRswt: async (code: string | number) => {
|
||||
try {
|
||||
const rswtRes = await initFetch(code);
|
||||
return set((state: rswtFacState) => ({
|
||||
...state,
|
||||
rswt: {
|
||||
@@ -139,71 +178,72 @@ export const rswtFacActionsExport: (set: any) => rswtFacSActions = (
|
||||
console.log(error);
|
||||
}
|
||||
},
|
||||
rswtUpdate: async (data: customRswtBdst) => {
|
||||
try {
|
||||
const chData=await makeMdfr(data)
|
||||
const res = await putFectch("/reuseFc/waterreuseFc", chData);
|
||||
if (res.ok) {
|
||||
alert("등록이 완료되었습니다.");
|
||||
}
|
||||
const rswtRes = await initFetch(undefined);
|
||||
set((state: rswtFacState) => ({
|
||||
...state,
|
||||
rain: {
|
||||
...state.rswt,
|
||||
rswtRes: rswtRes,
|
||||
isInit: false,
|
||||
},
|
||||
}));
|
||||
} catch (errorUpdate) {
|
||||
alert("업데이트 오류입니다. " + (errorUpdate instanceof Error ? errorUpdate.message : ""));
|
||||
} finally {
|
||||
}
|
||||
rswtBdstUpdate: async (data: customRswtBdst, code:string|number) => {
|
||||
try {
|
||||
const chData = await makeMdfr(data);
|
||||
const res = await putFectch("/reuseFc/waterreuseFc", chData);
|
||||
if (res.ok) {
|
||||
alert("등록이 완료되었습니다.");
|
||||
}
|
||||
const rswtRes = await initFetch(code);
|
||||
set((state: rswtFacState) => ({
|
||||
...state,
|
||||
rain: {
|
||||
...state.rswt,
|
||||
rswtRes: rswtRes,
|
||||
isInit: false,
|
||||
},
|
||||
}));
|
||||
} catch (errorUpdate) {
|
||||
alert(
|
||||
"업데이트 오류입니다. " +
|
||||
(errorUpdate instanceof Error ? errorUpdate.message : "")
|
||||
);
|
||||
} finally {
|
||||
}
|
||||
},
|
||||
rswtReg: async (data: customRswtBdst) => {
|
||||
try {
|
||||
const chData=await makeRstr(data)
|
||||
const res = await postFectch("/reuseFc/waterreuseFc", chData);
|
||||
if(res.ok){
|
||||
if(data.chgBuilding.length > 0){
|
||||
await res
|
||||
.json()
|
||||
.then((resData: any) => {
|
||||
const chPK = resData?.data?.bdstInfoPk;
|
||||
const makeCh = resData.data.chgBuilding.map(
|
||||
(item: chgBuilding) => ({
|
||||
...item,
|
||||
bdstInfoFk: chPK,
|
||||
})
|
||||
);
|
||||
const chch = postFectch("/reuseFc/chgBuilding", makeCh);
|
||||
return chch;
|
||||
rswtBdstReg: async (data: customRswtBdst,code:string|number) => {
|
||||
try {
|
||||
const chData = await makeRstr(data);
|
||||
const res = await postFectch("/reuseFc/waterreuseFc", chData);
|
||||
if (res.ok) {
|
||||
if (data.chgBuilding.length > 0) {
|
||||
await res
|
||||
.json()
|
||||
.then((resData: any) => {
|
||||
const chPK = resData?.data?.bdstInfoPk;
|
||||
const makeCh = resData.data.chgBuilding.map(
|
||||
(item: chgBuilding) => ({
|
||||
...item,
|
||||
bdstInfoFk: chPK,
|
||||
})
|
||||
.then((chch: any) => {
|
||||
if (chch.ok) {
|
||||
alert("등록이 완료되었습니다.");
|
||||
}
|
||||
});
|
||||
}else{
|
||||
alert("등록이 완료되었습니다.");
|
||||
|
||||
}
|
||||
}
|
||||
const rainRes = await initFetch(undefined);
|
||||
set((state: rswtFacState) => ({
|
||||
...state,
|
||||
rain: {
|
||||
...state.rswt,
|
||||
rswtRes: rswtRes,
|
||||
isInit: false,
|
||||
},
|
||||
}));
|
||||
} catch (e) {
|
||||
console.log("e", e);
|
||||
alert("등록 오류입니다.");
|
||||
} finally {
|
||||
);
|
||||
const chch = postFectch("/reuseFc/chgBuilding", makeCh);
|
||||
return chch;
|
||||
})
|
||||
.then((chch: any) => {
|
||||
if (chch.ok) {
|
||||
alert("등록이 완료되었습니다.");
|
||||
}
|
||||
});
|
||||
} else {
|
||||
alert("등록이 완료되었습니다.");
|
||||
}
|
||||
},
|
||||
|
||||
}
|
||||
const rainRes = await initFetch(code);
|
||||
set((state: rswtFacState) => ({
|
||||
...state,
|
||||
rain: {
|
||||
...state.rswt,
|
||||
rswtRes: rswtRes,
|
||||
isInit: false,
|
||||
},
|
||||
}));
|
||||
} catch (e) {
|
||||
console.log("e", e);
|
||||
alert("등록 오류입니다.");
|
||||
} finally {
|
||||
}
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
@@ -134,7 +134,7 @@ export const pbnSttHeadListExport: TableUpperProps[] = [
|
||||
// ? rainSttHeadList
|
||||
// : null;
|
||||
|
||||
// let chNm = type === "pbn" ? pbnSttHeadNm : rainSttHeadNm;
|
||||
// let chNm = type === "pbn" ? pbnSttHeadNm : rainSttNodeList;
|
||||
// headList?.forEach((item) => {
|
||||
// if (checkList.find((ch) => ch === item.id)) {
|
||||
// item.visible = false;
|
||||
@@ -159,8 +159,8 @@ export const pbnSttHeadListExport: TableUpperProps[] = [
|
||||
// type === "pbn" ? headList : state.sttnCommon.pbnSttHeadList,
|
||||
// rainSttHeadList:
|
||||
// type === "rain" ? headList : state.sttnCommon.rainSttHeadList,
|
||||
// rainSttHeadNm:
|
||||
// type === "rain" ? chNm : state.sttnCommon.rainSttHeadNm,
|
||||
// rainSttNodeList:
|
||||
// type === "rain" ? chNm : state.sttnCommon.rainSttNodeList,
|
||||
// pbnSttHeadNm: type === "rain" ? chNm : state.sttnCommon.pbnSttHeadNm,
|
||||
// },
|
||||
// }));
|
||||
|
||||
@@ -1,19 +1,140 @@
|
||||
import type { chHeadType } from "@/app/store/prfmncReg/chkgdnReg/rainChkgdn";
|
||||
import type { TableTripleProps, TableUpperProps } from "../../fcltReg/rainReg";
|
||||
import { z } from "zod";
|
||||
|
||||
|
||||
export const rainSttnHeadListType = z.array(
|
||||
z.object({
|
||||
id: z.string(),
|
||||
title: z.string(),
|
||||
visible: z.boolean(),
|
||||
})
|
||||
);
|
||||
|
||||
|
||||
export const rainSttHeadListExport: z.infer<typeof rainSttnHeadListType> = [
|
||||
|
||||
{
|
||||
id: "cityText",
|
||||
title: "시도",
|
||||
visible: true,
|
||||
},
|
||||
{
|
||||
id: "sggText",
|
||||
title: "시군구",
|
||||
visible: true,
|
||||
},
|
||||
{
|
||||
id: "bdstNm",
|
||||
title: "건축물명",
|
||||
visible: true,
|
||||
},
|
||||
{
|
||||
id: "daddr",
|
||||
title: "주소",
|
||||
visible: true,
|
||||
},
|
||||
{
|
||||
id: "bdstUsgCd",
|
||||
title: "건축물용도코드",
|
||||
visible: true,
|
||||
},
|
||||
{
|
||||
id: "frstArchPrmsnDt",
|
||||
title: "최초건축허가일시",
|
||||
visible: true,
|
||||
},
|
||||
{
|
||||
id: "archArea",
|
||||
title: "건축면적",
|
||||
visible: true,
|
||||
},
|
||||
{
|
||||
id: "lawTrgtYn",
|
||||
title: "법적의무대상여부",
|
||||
visible: true,
|
||||
},
|
||||
{
|
||||
id: "instlCmptnDt",
|
||||
title: "설치완료일시",
|
||||
visible: true,
|
||||
},
|
||||
|
||||
{
|
||||
id: "instlCst",
|
||||
title: "설치비용",
|
||||
visible: true,
|
||||
},
|
||||
|
||||
|
||||
{
|
||||
id: "pntfColKnd",
|
||||
title: "집수지점종류",
|
||||
visible: true,
|
||||
},
|
||||
{
|
||||
id: "pntfColArea",
|
||||
title: "집수지점면적",
|
||||
visible: true,
|
||||
},
|
||||
|
||||
{
|
||||
id: "dtfcltCpct",
|
||||
title: "저류조용량",
|
||||
visible: true,
|
||||
},
|
||||
{
|
||||
id: "filtrTrtmfctYn",
|
||||
title: "여과처리시설유무",
|
||||
visible: true,
|
||||
},
|
||||
{
|
||||
id: "filtrTrtmfctCpct",
|
||||
title: "여과처리시설용량",
|
||||
visible: true,
|
||||
},
|
||||
{
|
||||
id: "filtrTrtmfctPrs",
|
||||
title: "여과처리시설처리공정",
|
||||
visible: true,
|
||||
},
|
||||
|
||||
|
||||
{
|
||||
id: "instlCstSprtYn",
|
||||
title: "설치지원비용여부",
|
||||
visible: true,
|
||||
},
|
||||
{
|
||||
id: "instlCstSprtAmt",
|
||||
title: "설치지원비용",
|
||||
visible: true,
|
||||
},
|
||||
|
||||
{
|
||||
id: "grntchBdstCertYn",
|
||||
title: "녹색건축물인증여부",
|
||||
visible: true,
|
||||
},
|
||||
{
|
||||
id: "grntchBdstCertYr",
|
||||
title: "녹색건축물인증년도",
|
||||
visible: true,
|
||||
},
|
||||
{
|
||||
id: "grntchBdstCertNo",
|
||||
title: "녹색건축물인증번호",
|
||||
visible: true,
|
||||
},
|
||||
{
|
||||
id: "grntchBdstCertGrd",
|
||||
title: "녹색건축물인증등급",
|
||||
visible: true,
|
||||
},
|
||||
|
||||
];
|
||||
|
||||
export type TableUpperPropsTest = {
|
||||
id: string;
|
||||
title: string;
|
||||
upName?: string;
|
||||
upSequnce?: number;
|
||||
row?: number;
|
||||
rowSpan?: number;
|
||||
colSpan?: number;
|
||||
visible?: boolean;
|
||||
};
|
||||
|
||||
// id는 다확인해야함
|
||||
export const rainSttHeadListExportTest: TableUpperPropsTest[] = [
|
||||
export const rainSttNodeListExport: CommonTableProps[] = [
|
||||
{
|
||||
id: "bdnstInfo",
|
||||
title: "1.건축물정보",
|
||||
@@ -28,401 +149,272 @@ export const rainSttHeadListExportTest: TableUpperPropsTest[] = [
|
||||
visible: true,
|
||||
row: 1,
|
||||
rowSpan: 1,
|
||||
colSpan: 6,
|
||||
colSpan: 7,
|
||||
},
|
||||
{ id: "insenInfo",
|
||||
title: "3.인센티브 정보",
|
||||
{
|
||||
id: "insenInfo",
|
||||
title: "3.인센티브 정보",
|
||||
visible: true,
|
||||
row: 1,
|
||||
rowSpan: 1,
|
||||
colSpan: 7
|
||||
colSpan: 6,
|
||||
},
|
||||
{
|
||||
id: "adminDiv",
|
||||
title: "행정구역",
|
||||
visible: true,
|
||||
row: 2,
|
||||
upName:'bdnstInfo',
|
||||
rowSpan: 1,
|
||||
colSpan: 2,
|
||||
},
|
||||
|
||||
|
||||
|
||||
// 3번째줄 시작
|
||||
{
|
||||
id: "cityText",
|
||||
title: "시도",
|
||||
visible: true,
|
||||
upName:'adminDiv',
|
||||
row: 3,
|
||||
rowSpan: 1,
|
||||
colSpan: 1,
|
||||
},
|
||||
{
|
||||
id: "sggText",
|
||||
title: "시군구",
|
||||
visible: true,
|
||||
upName:'adminDiv',
|
||||
row: 3,
|
||||
rowSpan: 1,
|
||||
colSpan: 1,
|
||||
},
|
||||
|
||||
// 2번째 줄
|
||||
{ id: "adminDiv",
|
||||
title: "행정구역",
|
||||
visible: true,
|
||||
row: 2,
|
||||
rowSpan: 1,
|
||||
colSpan: 2 },
|
||||
|
||||
// 1번째 줄 건축물정보 아래의 행으로 만들 헤더
|
||||
{
|
||||
id: "bdstNm",
|
||||
title: "건축물명",
|
||||
visible: true,
|
||||
row: 2,
|
||||
rowSpan: 2,
|
||||
colSpan: 1 },
|
||||
{
|
||||
id: "daddr",
|
||||
title: "주소",
|
||||
visible: true,
|
||||
row: 2,
|
||||
rowSpan: 2,
|
||||
colSpan: 1 },
|
||||
{
|
||||
id: "bdstUsgCd",
|
||||
title: "건축물용도코드",
|
||||
row: 2,
|
||||
rowSpan: 2,
|
||||
colSpan: 1 },
|
||||
{
|
||||
id: "frstArchPrmsnDt",
|
||||
title: "최초건축허가일시",
|
||||
visible: true,
|
||||
row: 2,
|
||||
rowSpan: 2,
|
||||
colSpan: 1 },
|
||||
{
|
||||
id: "archArea",
|
||||
title: "건축면적",
|
||||
visible: true,
|
||||
row: 2,
|
||||
rowSpan: 2,
|
||||
colSpan: 1 },
|
||||
{
|
||||
id: "lawTrgtYn",
|
||||
title: "법적의무대상여부",
|
||||
visible: true,
|
||||
row: 2,
|
||||
rowSpan: 2,
|
||||
colSpan: 1 },
|
||||
{
|
||||
id: "instlCmptnDt",
|
||||
title: "설치완료일시",
|
||||
visible: true,
|
||||
row: 2,
|
||||
rowSpan: 2,
|
||||
colSpan: 1 },
|
||||
|
||||
|
||||
{
|
||||
id: "instlCst",
|
||||
title: "설치비용",
|
||||
visible: true,
|
||||
row: 2,
|
||||
rowSpan: 1,
|
||||
colSpan: 2
|
||||
},
|
||||
|
||||
{ id: "pntfCol",
|
||||
title: "집수면",
|
||||
visible: true,
|
||||
row: 2,
|
||||
rowSpan: 1,
|
||||
colSpan: 2
|
||||
},
|
||||
{ id: "filtrTrtmfct",
|
||||
title: "여과등 처리시설",
|
||||
visible: true,
|
||||
row: 2,
|
||||
rowSpan: 1,
|
||||
colSpan: 3
|
||||
},
|
||||
{
|
||||
id: "dtfcltCpct",
|
||||
title: "저류조용량",
|
||||
visible: true,
|
||||
row: 2,
|
||||
rowSpan: 2,
|
||||
colSpan: 1
|
||||
},
|
||||
|
||||
|
||||
{ id: "instlCstSprt",
|
||||
title: "설치비지원",
|
||||
visible: true,
|
||||
row: 2,
|
||||
rowSpan: 1,
|
||||
colSpan: 2
|
||||
},
|
||||
{ id: "grntchBdstCert",
|
||||
title: "녹색건축물인증여부",
|
||||
visible: true,
|
||||
row: 2,
|
||||
rowSpan: 1,
|
||||
colSpan: 4
|
||||
},
|
||||
|
||||
// 3번째줄 시작
|
||||
{
|
||||
id: "cityText",
|
||||
title: "시도",
|
||||
visible: true,
|
||||
row: 3,
|
||||
rowSpan: 1,
|
||||
colSpan: 1
|
||||
},
|
||||
{
|
||||
id: "sggText",
|
||||
title: "시군구",
|
||||
visible: true,
|
||||
row: 3,
|
||||
rowSpan: 1,
|
||||
colSpan: 1
|
||||
},
|
||||
|
||||
|
||||
|
||||
{
|
||||
id: "pntfColKnd",
|
||||
title: "집수지점종류",
|
||||
visible: true,
|
||||
row: 3,
|
||||
rowSpan: 1,
|
||||
colSpan: 1
|
||||
},
|
||||
{
|
||||
id: "pntfColArea",
|
||||
title: "집수지점면적",
|
||||
visible: true,
|
||||
row: 3,
|
||||
rowSpan: 1,
|
||||
colSpan: 1
|
||||
},
|
||||
{
|
||||
id: "filtrTrtmfctYn",
|
||||
title: "여과처리시설유무",
|
||||
visible: true,
|
||||
row: 3,
|
||||
rowSpan: 1,
|
||||
colSpan: 1
|
||||
},
|
||||
{
|
||||
id: "filtrTrtmfctCpct",
|
||||
title: "여과처리시설용량",
|
||||
visible: true,
|
||||
row: 3,
|
||||
rowSpan: 1,
|
||||
colSpan: 1
|
||||
},
|
||||
{
|
||||
id: "filtrTrtmfctPrs",
|
||||
title: "여과처리시설처리공정",
|
||||
visible: true,
|
||||
row: 3,
|
||||
rowSpan: 1,
|
||||
colSpan: 1
|
||||
},
|
||||
|
||||
|
||||
{
|
||||
id: "instlCstSprtYn",
|
||||
title: "설치지원비용여부",
|
||||
visible: true,
|
||||
row: 3,
|
||||
rowSpan: 1,
|
||||
colSpan: 1
|
||||
},
|
||||
{
|
||||
id: "instlCstSprtAmt",
|
||||
title: "설치지원비용",
|
||||
visible: true,
|
||||
row: 3,
|
||||
rowSpan: 1,
|
||||
colSpan: 1
|
||||
},
|
||||
|
||||
{
|
||||
id: "grntchBdstCertYn",
|
||||
title: "녹색건축물인증여부",
|
||||
visible: true,
|
||||
row: 3,
|
||||
rowSpan: 1,
|
||||
colSpan: 1
|
||||
},
|
||||
{
|
||||
id: "grntchBdstCertYr",
|
||||
title: "녹색건축물인증년도",
|
||||
visible: true,
|
||||
row: 3,
|
||||
rowSpan: 1,
|
||||
colSpan: 1
|
||||
},
|
||||
{
|
||||
id: "grntchBdstCertNo",
|
||||
title: "녹색건축물인증번호",
|
||||
visible: true,
|
||||
row: 3,
|
||||
rowSpan: 1,
|
||||
colSpan: 1
|
||||
},
|
||||
{
|
||||
id: "grntchBdstCertGrd",
|
||||
title: "녹색건축물인증등급",
|
||||
visible: true,
|
||||
row: 3,
|
||||
rowSpan: 1,
|
||||
colSpan: 1
|
||||
},
|
||||
];
|
||||
|
||||
export const rainSttHeadNmExport: chHeadType[] = [
|
||||
{ headNm: "bdnstInfo", text: "1.건축물정보", length: 9 },
|
||||
{ headNm: "rainFcltInfo", text: "2.빗물이용시설정보", length: 7 },
|
||||
{ headNm: "insenInfo", text: "3.인센티브 정보", length: 9 },
|
||||
|
||||
|
||||
];
|
||||
|
||||
// id는 다확인해야함
|
||||
export const rainSttHeadListExport: TableTripleProps[] = [
|
||||
{
|
||||
id: "cityText",
|
||||
title: "시도",
|
||||
visible: true,
|
||||
upName: ["bdnstInfo", "adminDiv"],
|
||||
upSequnce: [1, 1],
|
||||
},
|
||||
{
|
||||
id: "sggText",
|
||||
title: "시군구",
|
||||
visible: true,
|
||||
upName: ["bdnstInfo", "adminDiv"],
|
||||
upSequnce: [2, 2],
|
||||
},
|
||||
// 1번째 줄 건축물정보 아래의 행으로 만들 헤더
|
||||
{
|
||||
id: "bdstNm",
|
||||
title: "건축물명",
|
||||
visible: true,
|
||||
upName: ["bdnstInfo"],
|
||||
upSequnce: [3],
|
||||
upName:'bdnstInfo',
|
||||
row: 2,
|
||||
rowSpan: 2,
|
||||
colSpan: 1,
|
||||
},
|
||||
{
|
||||
id: "daddr",
|
||||
title: "주소",
|
||||
visible: true,
|
||||
upName: ["bdnstInfo"],
|
||||
upSequnce: [4],
|
||||
upName:'bdnstInfo',
|
||||
row: 2,
|
||||
rowSpan: 2,
|
||||
colSpan: 1,
|
||||
},
|
||||
{
|
||||
id: "bdstUsgCd",
|
||||
title: "건축물용도코드",
|
||||
upName:'bdnstInfo',
|
||||
visible: true,
|
||||
upName: ["bdnstInfo"],
|
||||
upSequnce: [5],
|
||||
row: 2,
|
||||
rowSpan: 2,
|
||||
colSpan: 1,
|
||||
},
|
||||
{
|
||||
id: "frstArchPrmsnDt",
|
||||
title: "최초건축허가일시",
|
||||
upName:'bdnstInfo',
|
||||
visible: true,
|
||||
upName: ["bdnstInfo"],
|
||||
upSequnce: [6],
|
||||
row: 2,
|
||||
rowSpan: 2,
|
||||
colSpan: 1,
|
||||
},
|
||||
{
|
||||
id: "archArea",
|
||||
title: "건축면적",
|
||||
upName:'bdnstInfo',
|
||||
visible: true,
|
||||
upName: ["bdnstInfo"],
|
||||
upSequnce: [7],
|
||||
row: 2,
|
||||
rowSpan: 2,
|
||||
colSpan: 1,
|
||||
},
|
||||
{
|
||||
id: "lawTrgtYn",
|
||||
title: "법적의무대상여부",
|
||||
upName:'bdnstInfo',
|
||||
visible: true,
|
||||
upName: ["bdnstInfo"],
|
||||
upSequnce: [8],
|
||||
row: 2,
|
||||
rowSpan: 2,
|
||||
colSpan: 1,
|
||||
},
|
||||
{
|
||||
id: "instlCmptnDt",
|
||||
title: "설치완료일시",
|
||||
upName:'bdnstInfo',
|
||||
visible: true,
|
||||
upName: ["bdnstInfo"],
|
||||
upSequnce: [9],
|
||||
row: 2,
|
||||
rowSpan: 2,
|
||||
colSpan: 1,
|
||||
},
|
||||
|
||||
{
|
||||
id: "instlCst",
|
||||
title: "설치비용",
|
||||
upName:'rainFcltInfo',
|
||||
visible: true,
|
||||
upName: ["rainFcltInfo"],
|
||||
upSequnce: [1],
|
||||
row: 2,
|
||||
rowSpan: 2,
|
||||
colSpan: 1,
|
||||
},
|
||||
|
||||
{
|
||||
id: "pntfCol",
|
||||
title: "집수면",
|
||||
upName:'rainFcltInfo',
|
||||
visible: true,
|
||||
row: 2,
|
||||
rowSpan: 1,
|
||||
colSpan: 2,
|
||||
},
|
||||
|
||||
{
|
||||
id: "pntfColKnd",
|
||||
title: "집수지점종류",
|
||||
upName:'pntfCol',
|
||||
visible: true,
|
||||
upName: ["rainFcltInfo", "pntfCol"],
|
||||
upSequnce: [2, 1],
|
||||
row: 3,
|
||||
rowSpan: 1,
|
||||
colSpan: 1,
|
||||
},
|
||||
{
|
||||
id: "pntfColArea",
|
||||
title: "집수지점면적",
|
||||
upName:'pntfCol',
|
||||
visible: true,
|
||||
upName: ["rainFcltInfo", "pntfCol"],
|
||||
upSequnce: [3, 2],
|
||||
row: 3,
|
||||
rowSpan: 1,
|
||||
colSpan: 1,
|
||||
},
|
||||
|
||||
{
|
||||
id: "dtfcltCpct",
|
||||
title: "저류조용량",
|
||||
upName:'rainFcltInfo',
|
||||
visible: true,
|
||||
row: 2,
|
||||
rowSpan: 2,
|
||||
colSpan: 1,
|
||||
},
|
||||
{
|
||||
id: "filtrTrtmfctYn",
|
||||
title: "여과처리시설유무",
|
||||
upName:'filtrTrtmfct',
|
||||
visible: true,
|
||||
upName: ["rainFcltInfo", "filtrTrtmfct"],
|
||||
upSequnce: [4, 1],
|
||||
row: 3,
|
||||
rowSpan: 1,
|
||||
colSpan: 1,
|
||||
},
|
||||
{
|
||||
id: "filtrTrtmfctCpct",
|
||||
title: "여과처리시설용량",
|
||||
upName:'filtrTrtmfct',
|
||||
visible: true,
|
||||
upName: ["rainFcltInfo", "filtrTrtmfct"],
|
||||
upSequnce: [5, 2],
|
||||
row: 3,
|
||||
rowSpan: 1,
|
||||
colSpan: 1,
|
||||
},
|
||||
{
|
||||
id: "filtrTrtmfctPrs",
|
||||
title: "여과처리시설처리공정",
|
||||
upName:'filtrTrtmfct',
|
||||
visible: true,
|
||||
upName: ["rainFcltInfo", "filtrTrtmfct"],
|
||||
upSequnce: [6, 3],
|
||||
},
|
||||
{
|
||||
id: "dtfcltCpct",
|
||||
title: "저류조용량",
|
||||
visible: true,
|
||||
upName: ["rainFcltInfo"],
|
||||
upSequnce: [7],
|
||||
row: 3,
|
||||
rowSpan: 1,
|
||||
colSpan: 1,
|
||||
},
|
||||
|
||||
{
|
||||
id: "filtrTrtmfct",
|
||||
title: "여과등 처리시설",
|
||||
visible: true,
|
||||
upName:'insenInfo',
|
||||
row: 2,
|
||||
rowSpan: 1,
|
||||
colSpan: 3,
|
||||
},
|
||||
{
|
||||
id: "instlCstSprtYn",
|
||||
title: "설치지원비용여부",
|
||||
upName:'instlCstSprt',
|
||||
visible: true,
|
||||
upName: ["insenInfo", "instlCstSprt"],
|
||||
upSequnce: [1, 1],
|
||||
row: 3,
|
||||
rowSpan: 1,
|
||||
colSpan: 1,
|
||||
},
|
||||
{
|
||||
id: "instlCstSprtAmt",
|
||||
title: "설치지원비용",
|
||||
upName:'instlCstSprt',
|
||||
visible: true,
|
||||
upName: ["insenInfo", "instlCstSprt"],
|
||||
upSequnce: [2, 2],
|
||||
row: 3,
|
||||
rowSpan: 1,
|
||||
colSpan: 1,
|
||||
},
|
||||
|
||||
{
|
||||
id: "instlCstSprt",
|
||||
title: "설치비지원",
|
||||
upName:'insenInfo',
|
||||
visible: true,
|
||||
row: 2,
|
||||
rowSpan: 1,
|
||||
colSpan: 2,
|
||||
},
|
||||
|
||||
{
|
||||
id: "grntchBdstCertYn",
|
||||
title: "녹색건축물인증여부",
|
||||
upName:'grntchBdstCert',
|
||||
visible: true,
|
||||
upName: ["insenInfo", "grntchBdstCert"],
|
||||
upSequnce: [3, 1],
|
||||
row: 3,
|
||||
rowSpan: 1,
|
||||
colSpan: 1,
|
||||
},
|
||||
{
|
||||
id: "grntchBdstCertYr",
|
||||
title: "녹색건축물인증년도",
|
||||
upName:'grntchBdstCert',
|
||||
visible: true,
|
||||
upName: ["insenInfo", "grntchBdstCert"],
|
||||
upSequnce: [4, 2],
|
||||
row: 3,
|
||||
rowSpan: 1,
|
||||
colSpan: 1,
|
||||
},
|
||||
{
|
||||
id: "grntchBdstCertNo",
|
||||
title: "녹색건축물인증번호",
|
||||
upName:'grntchBdstCert',
|
||||
visible: true,
|
||||
upName: ["insenInfo", "grntchBdstCert"],
|
||||
upSequnce: [5, 3],
|
||||
row: 3,
|
||||
rowSpan: 1,
|
||||
colSpan: 1,
|
||||
},
|
||||
{
|
||||
id: "grntchBdstCertGrd",
|
||||
title: "녹색건축물인증등급",
|
||||
upName:'grntchBdstCert',
|
||||
visible: true,
|
||||
upName: ["insenInfo", "grntchBdstCert"],
|
||||
upSequnce: [6, 4],
|
||||
row: 3,
|
||||
rowSpan: 1,
|
||||
colSpan: 1,
|
||||
},
|
||||
{
|
||||
id: "grntchBdstCert",
|
||||
title: "녹색건축물인증",
|
||||
upName:'insenInfo',
|
||||
visible: true,
|
||||
row: 2,
|
||||
rowSpan: 1,
|
||||
colSpan: 4,
|
||||
},
|
||||
];
|
||||
|
||||
|
||||
@@ -2,31 +2,100 @@ import type { chHeadType } from "@/app/store/prfmncReg/chkgdnReg/rainChkgdn";
|
||||
import { fetchType, getFetch } from "@/components/lib/api";
|
||||
import {
|
||||
type customRainBdst,
|
||||
type TableTripleProps,
|
||||
} from "../../fcltReg/rainReg";
|
||||
import { excelSttnParsing } from "./excel";
|
||||
import { rainSttHeadListExport, rainSttHeadListExportTest, rainSttHeadNmExport, type TableUpperPropsTest } from "./headList";
|
||||
import {
|
||||
rainSttHeadListExport,
|
||||
rainSttnHeadListType,
|
||||
rainSttNodeListExport,
|
||||
} from "./headList";
|
||||
import type { z } from "zod";
|
||||
import type { CommonTableProps } from "@/app/store/common/type/headder";
|
||||
|
||||
// 테이블 헤드 리스트
|
||||
const rainSttHeadNm = rainSttHeadNmExport;
|
||||
|
||||
//const rainSttHeadList = rainSttHeadListExport;
|
||||
const rainSttHeadList = rainSttHeadListExportTest;
|
||||
const rainSttNodeList = rainSttNodeListExport;
|
||||
const rainSttHeadList = rainSttHeadListExport;
|
||||
const rainSttnRes: customRainBdst[] = [];
|
||||
|
||||
|
||||
|
||||
const visibleHeadList = (falseHeads:CommonTableProps[], orgNodeList:CommonTableProps[])=>{
|
||||
const visibleHeads = orgNodeList.map((node) => {
|
||||
const copyNode = {...node}
|
||||
falseHeads.forEach((head)=>{
|
||||
if(copyNode.id ===head.id)
|
||||
copyNode.visible = head.visible
|
||||
})
|
||||
return copyNode;
|
||||
})
|
||||
return visibleHeads
|
||||
}
|
||||
|
||||
const getColspanReductionMap = (falseHeads:CommonTableProps[], orgList:CommonTableProps[]):Record<string, number> => {
|
||||
const reduceMap:Record<string, number> = {};
|
||||
falseHeads.forEach(head => {
|
||||
const node = orgList.find(n => n.id === head.id);
|
||||
if (node?.upName) {
|
||||
reduceMap[node.upName] = (reduceMap[node.upName] || 0) + 1;
|
||||
if (node.row&& node.row >= 3) {
|
||||
const upperUpName = orgList.find(n => n.id === node.upName)?.upName;
|
||||
if (upperUpName) {
|
||||
reduceMap[upperUpName] = (reduceMap[upperUpName] || 0) + 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
return reduceMap;
|
||||
};
|
||||
|
||||
// colSpan 반영 및 visible 처리
|
||||
const applyColspanReduction = (
|
||||
orgList: CommonTableProps[],
|
||||
reduceMap: Record<string, number>
|
||||
): CommonTableProps[] => {
|
||||
return orgList.map(node => {
|
||||
const newNode: CommonTableProps = { ...node };
|
||||
const reduceCount = reduceMap[node.id];
|
||||
|
||||
if (
|
||||
newNode.colSpan !== undefined &&
|
||||
reduceCount !== undefined &&
|
||||
typeof newNode.colSpan === "number"
|
||||
) {
|
||||
newNode.colSpan -= reduceCount;
|
||||
if (newNode.colSpan <= 0) {
|
||||
newNode.visible = false;
|
||||
}
|
||||
}
|
||||
|
||||
return newNode;
|
||||
});
|
||||
};
|
||||
// 일단 헤더가 3개 이상인경우 visible 처리를 위해서 공통함수로 작업
|
||||
export const controlHeadView = (headList:CommonTableProps[], orgNodeList:CommonTableProps[] ) =>{
|
||||
const falseHeads = headList.filter((item) => item.visible == false);
|
||||
|
||||
const viewHeadList = visibleHeadList(falseHeads, orgNodeList)
|
||||
const reduceMap= getColspanReductionMap( falseHeads,viewHeadList)
|
||||
return applyColspanReduction(viewHeadList,reduceMap);
|
||||
}
|
||||
|
||||
|
||||
|
||||
export type rainSttnState = {
|
||||
rainSttn: {
|
||||
rainSttnRes: customRainBdst[];
|
||||
// rainSttHeadList: TableTripleProps[];
|
||||
rainSttHeadList: TableUpperPropsTest[];
|
||||
rainSttHeadNm: chHeadType[];
|
||||
rainSttHeadList: CommonTableProps[];
|
||||
rainSttNodeList: CommonTableProps[];
|
||||
excelList: [];
|
||||
isInit: boolean;
|
||||
};
|
||||
};
|
||||
type rainSttnActions = {
|
||||
rainSttnSearch: (page: string, total: string, con: string) => void;
|
||||
rainChSttnHead: (checkList: string[]) => void;
|
||||
rainChSttnHead: (
|
||||
headList: z.infer<typeof rainSttnHeadListType>,
|
||||
) => void;
|
||||
};
|
||||
|
||||
export type rainSttnType = rainSttnState & rainSttnActions;
|
||||
@@ -34,7 +103,7 @@ export type rainSttnType = rainSttnState & rainSttnActions;
|
||||
export const rainSttnStateExport: rainSttnState = {
|
||||
rainSttn: {
|
||||
rainSttHeadList: rainSttHeadList,
|
||||
rainSttHeadNm: rainSttHeadNm,
|
||||
rainSttNodeList: rainSttNodeList,
|
||||
rainSttnRes: rainSttnRes,
|
||||
excelList: [],
|
||||
isInit: false,
|
||||
@@ -77,31 +146,16 @@ export const rainSttnActionsExport: (set: any) => rainSttnActions = (
|
||||
console.log("error", erTxt);
|
||||
}
|
||||
},
|
||||
rainChSttnHead: async (checkList: string[]) => {
|
||||
const headList = rainSttHeadList;
|
||||
let chNm = 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: rainSttnState) => ({
|
||||
rainChSttnHead: async (
|
||||
headList: z.infer<typeof rainSttnHeadListType>
|
||||
) => {
|
||||
const changeNodeList= controlHeadView(headList,rainSttNodeList)
|
||||
|
||||
return set((state: rainSttnState) => ({
|
||||
rainSttn: {
|
||||
...state.rainSttn,
|
||||
rainSttHeadList: headList,
|
||||
rainSttHeadNm: chNm,
|
||||
rainSttNodeList: changeNodeList,
|
||||
},
|
||||
}));
|
||||
},
|
||||
|
||||
@@ -2,6 +2,11 @@ import type { rainChkZodType } from "@/app/store/prfmncReg/chkgdnReg/rainChkgdn"
|
||||
import type { TableUpperProps } from "@/app/store/ruseFcltMng/fcltReg/rainReg";
|
||||
import { Checkbox, Input, TableCell, TableRow } from "@common/components/ui";
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
export const rightTableData = (rainChk: rainChkZodType[]) => {
|
||||
// 1. chkgdnFk + utztnUsgCd 기준 누계 정보 만들기
|
||||
const maketotal = rainChk.map((item: rainChkZodType) => {
|
||||
@@ -23,7 +28,6 @@ export const rightTableData = (rainChk: rainChkZodType[]) => {
|
||||
|
||||
return selectTotal; // 모든 키: `${chkgdnFk}_${utztnUsgCd}` 형태
|
||||
});
|
||||
console.log("maketotal", maketotal);
|
||||
|
||||
|
||||
// 2. 누계 정보들을 하나의 객체로 합치기 (평탄화)
|
||||
@@ -65,7 +69,6 @@ export const chRowspanTable = (
|
||||
selectedIds: number[],
|
||||
handleCellClick: (index: number, headId: string) => void
|
||||
) => {
|
||||
console.log('chRowspanTable', makeTableData);
|
||||
// rowspan된 셀 렌더링 여부 추적용
|
||||
const renderedMap = new Map<string, Set<number>>();
|
||||
return (
|
||||
|
||||
@@ -20,7 +20,6 @@ export const getCity = (val: string, sggCd: SelectDataType[]) => {
|
||||
// cd text 넣기
|
||||
export const tableData = ( data: any,code:comCodeState)=>{
|
||||
const chCode = code.code;
|
||||
|
||||
return data?.map((item: { sggCd: string; ctpvCd: string; reuseBuilding: { lawTrgtYn: any , bdstUsgCd:any}[]; }) => {
|
||||
let returnData = {};
|
||||
const sggText = chCode.sggCd.find(
|
||||
@@ -29,16 +28,20 @@ export const getCity = (val: string, sggCd: SelectDataType[]) => {
|
||||
const cityText = chCode.cityCd.find(
|
||||
(cd) => cd.val === String(item.ctpvCd)
|
||||
)?.text;
|
||||
|
||||
console
|
||||
.log(item?.reuseBuilding)
|
||||
if (item?.reuseBuilding?.length >0) {
|
||||
|
||||
const bdsgUsgText = chCode.bdstUsgCd.find(
|
||||
(cd) =>cd.val === item?.reuseBuilding[0]?.bdstUsgCd
|
||||
(cd) =>Number(cd.val) === item?.reuseBuilding[0]?.bdstUsgCd
|
||||
)?.text
|
||||
const lawTrgtYn = item?.reuseBuilding[0]?.lawTrgtYn
|
||||
console
|
||||
.log(bdsgUsgText)
|
||||
|
||||
returnData= { ...item, sggText: sggText, cityText: cityText ,bdsgUsgText:bdsgUsgText ,lawTrgtYn:lawTrgtYn};
|
||||
returnData= { ...item, sggText: sggText??'없음', cityText: cityText??'없음' ,bdsgUsgText:bdsgUsgText ,lawTrgtYn:lawTrgtYn};
|
||||
}else{
|
||||
returnData= { ...item, sggText: sggText, cityText: cityText};
|
||||
returnData= { ...item, sggText: sggText??'없음', cityText: cityText??'없음'};
|
||||
}
|
||||
|
||||
return returnData;
|
||||
@@ -63,4 +66,20 @@ export const getCity = (val: string, sggCd: SelectDataType[]) => {
|
||||
}
|
||||
|
||||
|
||||
// onchange 텍스트를 숫자로 and ,제거
|
||||
export const handleCommaNumberChange = (
|
||||
e: React.ChangeEvent<HTMLInputElement>,
|
||||
onChange: (value: number | "") => void
|
||||
) => {
|
||||
const raw = e.target.value.replace(/,/g, "");
|
||||
if (!/^\d*$/.test(raw)) return;
|
||||
onChange(raw === "" ? "" : Number(raw));
|
||||
};
|
||||
// 숫자입력시 , 삽입
|
||||
|
||||
export const formatCommaNumber = (
|
||||
value: number | string | undefined | null
|
||||
): string => {
|
||||
if (value === undefined || value === null || value === "") return "";
|
||||
return Number(value).toLocaleString();
|
||||
};
|
||||
@@ -1,9 +1,18 @@
|
||||
import { useWrStore } from "@/app/store";
|
||||
import type { selectArray } from "@/app/store/common/code";
|
||||
import { selectClass } from "@/app/store/ruseFcltMng/fcltReg/rainReg";
|
||||
import { getCity } from "@/components/lib/func/commom";
|
||||
import {
|
||||
formatCommaNumber,
|
||||
getCity,
|
||||
handleCommaNumberChange,
|
||||
} from "@/components/lib/func/commom";
|
||||
import type { objSearchType } from "@/components/ui/modal/bdstRegModal/bdstRegModal";
|
||||
import { FormField, FormUi, DatePicker, SelectBox } from "@common/business_components";
|
||||
import {
|
||||
FormField,
|
||||
FormUi,
|
||||
DatePicker,
|
||||
SelectBox,
|
||||
} from "@common/business_components";
|
||||
import { Button, Input } from "@common/components";
|
||||
import { useEffect, useRef, useState } from "react";
|
||||
import { useFieldArray } from "react-hook-form";
|
||||
@@ -30,49 +39,46 @@ export default function BdstReg({ form }: { form: any }) {
|
||||
if (fields.length > 0) {
|
||||
remove(fields.length - 1);
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
const [selectSgg, setSelectSgg] = useState<selectArray[] | undefined>()
|
||||
const [objSearch, setObjSearch] = useState<objSearchType>({sgg:"",city:""});
|
||||
|
||||
const getSelCity = (val: string) => {
|
||||
const data= getCity(val,code.sggCd)
|
||||
setSelectSgg(data);
|
||||
const sgg =form.getValues('sggCd')
|
||||
const [selectSgg, setSelectSgg] = useState<selectArray[] | undefined>();
|
||||
const [objSearch, setObjSearch] = useState<objSearchType>({
|
||||
sgg: "",
|
||||
city: "",
|
||||
});
|
||||
|
||||
setObjSearch({ city:val , sgg:''})
|
||||
|
||||
};
|
||||
|
||||
const getSgg = (val: string | number) => {
|
||||
const getSelCity = (val: string) => {
|
||||
const data = getCity(val, code.sggCd);
|
||||
setSelectSgg(data);
|
||||
const sgg = form.getValues("sggCd");
|
||||
|
||||
const sgg =form.getValues('sggCd')
|
||||
setObjSearch({...objSearch,sgg: val!=''?String(val):sgg })
|
||||
};
|
||||
setObjSearch({ city: val, sgg: "" });
|
||||
};
|
||||
|
||||
|
||||
useEffect(()=>{
|
||||
const city =form.getValues('ctpvCd')
|
||||
const sgg =form.getValues('sggCd')
|
||||
setObjSearch({city:city , sgg:sgg })
|
||||
|
||||
}, [selectSgg])
|
||||
const getSgg = (val: string | number) => {
|
||||
const sgg = form.getValues("sggCd");
|
||||
setObjSearch({ ...objSearch, sgg: val != "" ? String(val) : sgg });
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
const city = form.getValues("ctpvCd");
|
||||
const sgg = form.getValues("sggCd");
|
||||
setObjSearch({ city: city, sgg: sgg });
|
||||
}, [selectSgg]);
|
||||
|
||||
useEffect(() => {
|
||||
const subscription = form.form?.watch((value: any) => {
|
||||
console.log('vale', value)
|
||||
console.log("vale", value);
|
||||
});
|
||||
|
||||
|
||||
return () => subscription?.unsubscribe();
|
||||
}, [form.form]);
|
||||
|
||||
|
||||
const safeDate = (value: any): Date | undefined => {
|
||||
const date = new Date(value);
|
||||
return isNaN(date.getTime()) ? undefined : date;
|
||||
};
|
||||
|
||||
|
||||
|
||||
return (
|
||||
<>
|
||||
<h1 className="bg-gray-400 text-xl text-center border-2 p-2 mt-4 pl-6">
|
||||
@@ -86,19 +92,15 @@ export default function BdstReg({ form }: { form: any }) {
|
||||
render={({ field }) => (
|
||||
<FormUi label="시도">
|
||||
<SelectBox
|
||||
className="col-span-3 "
|
||||
label={""}
|
||||
selectClass={selectClass}
|
||||
selectArray={code.cityCd}
|
||||
|
||||
onSelectValue={(val)=>{
|
||||
getSelCity(String(val))
|
||||
field.onChange(Number(val) );
|
||||
}
|
||||
|
||||
}
|
||||
value={field.value}
|
||||
|
||||
className="col-span-3 "
|
||||
label={""}
|
||||
selectClass={selectClass}
|
||||
selectArray={code.cityCd}
|
||||
onSelectValue={(val) => {
|
||||
getSelCity(String(val));
|
||||
field.onChange(Number(val));
|
||||
}}
|
||||
value={field.value}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
@@ -111,16 +113,15 @@ export default function BdstReg({ form }: { form: any }) {
|
||||
render={({ field }) => (
|
||||
<FormUi label="시군구">
|
||||
<SelectBox
|
||||
className="col-span-3"
|
||||
label={""}
|
||||
selectClass={selectClass}
|
||||
selectArray={selectSgg? selectSgg:code.sggCd || []}
|
||||
onSelectValue={(val) =>{
|
||||
getSgg(val)
|
||||
field.onChange(Number(val))
|
||||
}}
|
||||
value={field.value}
|
||||
|
||||
className="col-span-3"
|
||||
label={""}
|
||||
selectClass={selectClass}
|
||||
selectArray={selectSgg ? selectSgg : code.sggCd || []}
|
||||
onSelectValue={(val) => {
|
||||
getSgg(val);
|
||||
field.onChange(Number(val));
|
||||
}}
|
||||
value={field.value}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
@@ -135,7 +136,7 @@ export default function BdstReg({ form }: { form: any }) {
|
||||
render={({ field }) => (
|
||||
<FormUi label="건축물명">
|
||||
<Input
|
||||
className=""
|
||||
className={selectClass}
|
||||
placeholder="1,000,000"
|
||||
type="text"
|
||||
{...field}
|
||||
@@ -151,7 +152,7 @@ export default function BdstReg({ form }: { form: any }) {
|
||||
render={({ field }) => (
|
||||
<FormUi label="위치">
|
||||
<Input
|
||||
className=""
|
||||
className={selectClass}
|
||||
placeholder="1,000,000"
|
||||
type="search"
|
||||
{...field}
|
||||
@@ -186,16 +187,14 @@ export default function BdstReg({ form }: { form: any }) {
|
||||
name="frstArchPrmsnDt"
|
||||
render={({ field }) => (
|
||||
<FormUi label="최초건축허가일">
|
||||
<DatePicker
|
||||
mode={"single"}
|
||||
field={{
|
||||
value: field.value|| new Date(),
|
||||
onChange: (date: Date | undefined) =>
|
||||
field.onChange(date),
|
||||
}}
|
||||
selectClass={selectClass}
|
||||
></DatePicker>
|
||||
|
||||
<DatePicker
|
||||
mode={"single"}
|
||||
field={{
|
||||
value: field.value || new Date(),
|
||||
onChange: (date: Date | undefined) => field.onChange(date),
|
||||
}}
|
||||
selectClass={'w-full'}
|
||||
></DatePicker>
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
@@ -207,14 +206,13 @@ export default function BdstReg({ form }: { form: any }) {
|
||||
render={({ field }) => (
|
||||
<FormUi label="건축면적(m³)">
|
||||
<Input
|
||||
className=""
|
||||
className={selectClass}
|
||||
placeholder="1,000,000"
|
||||
type="number"
|
||||
{...field}
|
||||
onChange={(e) => {
|
||||
const value = e.target.value;
|
||||
field.onChange(value === "" ? "" : Number(value));
|
||||
handleCommaNumberChange(e, field.onChange);
|
||||
}}
|
||||
value={formatCommaNumber(field.value)}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
@@ -249,7 +247,7 @@ export default function BdstReg({ form }: { form: any }) {
|
||||
이력추가
|
||||
</Button>
|
||||
<Button
|
||||
type="button"
|
||||
type="button"
|
||||
className="rounded-lg bg-red-500 text-white"
|
||||
onClick={removeLastItem}
|
||||
>
|
||||
@@ -270,7 +268,6 @@ export default function BdstReg({ form }: { form: any }) {
|
||||
selectClass={selectClass}
|
||||
label={""}
|
||||
selectArray={code.chBuCd}
|
||||
|
||||
onSelectValue={(val) => {
|
||||
field.onChange(val);
|
||||
}}
|
||||
@@ -286,15 +283,15 @@ export default function BdstReg({ form }: { form: any }) {
|
||||
name={`chgBuilding.${index}.archChgPrmsnDt`}
|
||||
render={({ field }) => (
|
||||
<FormUi label="허가일">
|
||||
<DatePicker
|
||||
mode={"single"}
|
||||
field={{
|
||||
value: safeDate(field.value) || new Date(),
|
||||
onChange: (date: Date | undefined) =>
|
||||
field.onChange(date),
|
||||
}}
|
||||
selectClass={selectClass}
|
||||
></DatePicker>
|
||||
<DatePicker
|
||||
mode={"single"}
|
||||
field={{
|
||||
value: safeDate(field.value) || new Date(),
|
||||
onChange: (date: Date | undefined) =>
|
||||
field.onChange(date),
|
||||
}}
|
||||
selectClass={'w-full'}
|
||||
></DatePicker>
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
@@ -306,12 +303,13 @@ export default function BdstReg({ form }: { form: any }) {
|
||||
render={({ field }) => (
|
||||
<FormUi label="면적">
|
||||
<Input
|
||||
className=""
|
||||
className={selectClass}
|
||||
placeholder="-"
|
||||
type="text"
|
||||
value={ field.value??"-"}
|
||||
onChange={(e) => field.onChange((e.target.value))}
|
||||
|
||||
onChange={(e) => {
|
||||
handleCommaNumberChange(e, field.onChange);
|
||||
}}
|
||||
value={formatCommaNumber(field.value)}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
|
||||
@@ -18,6 +18,10 @@ import {
|
||||
} from "@/app/store/ruseFcltMng/fcltReg/htdflReg";
|
||||
import { useEffect } from "react";
|
||||
import BdstReg from "../bdstReg/bdstReg";
|
||||
import {
|
||||
formatCommaNumber,
|
||||
handleCommaNumberChange,
|
||||
} from "@/components/lib/func/commom";
|
||||
|
||||
export default function HtdflRegForm({
|
||||
htdflForm,
|
||||
@@ -35,19 +39,19 @@ export default function HtdflRegForm({
|
||||
defaultValues: defaultValues,
|
||||
});
|
||||
|
||||
const onSubmit=(values: z.infer<typeof hdtflZod>)=> {
|
||||
const onSubmit = (values: z.infer<typeof hdtflZod>) => {
|
||||
if (isModal) {
|
||||
htdflReg(values);
|
||||
} else {
|
||||
htdflUpdate(values);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
const onSelectValue = (val: string | number) => {
|
||||
console.log(val);
|
||||
};
|
||||
|
||||
const cleanHtdflData=(raw: any): z.infer<typeof hdtflZod> =>{
|
||||
const cleanHtdflData = (raw: any): z.infer<typeof hdtflZod> => {
|
||||
return {
|
||||
...raw,
|
||||
frstArchPrmsnDt: new Date(raw?.frstArchPrmsnDt || null),
|
||||
@@ -70,16 +74,12 @@ export default function HtdflRegForm({
|
||||
},
|
||||
})),
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
console.log("form errors:", form.formState.errors);
|
||||
}, [form.formState.errors]);
|
||||
|
||||
|
||||
useEffect(() => {
|
||||
if (hdtflZod) form.reset(cleanHtdflData(htdflForm));
|
||||
}, [htdflForm]);
|
||||
@@ -91,26 +91,24 @@ export default function HtdflRegForm({
|
||||
<div>
|
||||
<div className="grid grid-cols-12">
|
||||
<h1 className="pl-3 text-xl col-span-10">○온배수 시설 정보</h1>
|
||||
<Button size={"sm"} type="submit" className="col-start-12 col-span-1">
|
||||
<Button
|
||||
size={"sm"}
|
||||
type="submit"
|
||||
className="col-start-12 col-span-1"
|
||||
>
|
||||
저장
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{ isModal && htdflForm != undefined ? (
|
||||
<BdstReg form={form} />
|
||||
) : (
|
||||
<></>
|
||||
)}
|
||||
{isModal ? (
|
||||
<h1 className="pl-3 text-xl col-span-10 mt-4 ">
|
||||
○ 중수도 시설 정보{" "}
|
||||
</h1>
|
||||
) : (
|
||||
<></>
|
||||
)}
|
||||
|
||||
|
||||
{isModal && htdflForm != undefined ? <BdstReg form={form} /> : <></>}
|
||||
{isModal ? (
|
||||
<h1 className="pl-3 text-xl col-span-10 mt-4 ">
|
||||
○ 중수도 시설 정보{" "}
|
||||
</h1>
|
||||
) : (
|
||||
<></>
|
||||
)}
|
||||
|
||||
<div className="grid grid-cols-6 gap-2 mt-4 pl-6">
|
||||
<div className="col-span-2">
|
||||
@@ -120,7 +118,7 @@ export default function HtdflRegForm({
|
||||
render={({ field }) => (
|
||||
<FormUi label="발전유형(코드정비후 수정)">
|
||||
<Input
|
||||
className=""
|
||||
className={selectClass}
|
||||
placeholder="1,000,000"
|
||||
type="text"
|
||||
value={field.value ?? ""}
|
||||
@@ -138,13 +136,13 @@ export default function HtdflRegForm({
|
||||
render={({ field }) => (
|
||||
<FormUi label="설비용량">
|
||||
<Input
|
||||
className=""
|
||||
className={selectClass}
|
||||
placeholder="1,000,000"
|
||||
type="text"
|
||||
value={field.value ?? 0}
|
||||
onChange={(e) => {
|
||||
field.onChange(Number(e.target.value));
|
||||
handleCommaNumberChange(e, field.onChange);
|
||||
}}
|
||||
value={formatCommaNumber(field.value)}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
@@ -183,7 +181,7 @@ export default function HtdflRegForm({
|
||||
render={({ field }) => (
|
||||
<FormUi label="원수취수 지점(코드정비후 수정)">
|
||||
<Input
|
||||
className=""
|
||||
className={selectClass}
|
||||
placeholder="1,000,000"
|
||||
type="text"
|
||||
value={field.value ?? 0}
|
||||
@@ -202,7 +200,7 @@ export default function HtdflRegForm({
|
||||
render={({ field }) => (
|
||||
<FormUi label="원수발생 공정">
|
||||
<Input
|
||||
className=""
|
||||
className={selectClass}
|
||||
placeholder="1,000,000"
|
||||
type=""
|
||||
value={field.value ?? ""}
|
||||
@@ -219,13 +217,13 @@ export default function HtdflRegForm({
|
||||
render={({ field }) => (
|
||||
<FormUi label="취수구 온도">
|
||||
<Input
|
||||
className=""
|
||||
className={selectClass}
|
||||
placeholder="1,000,000"
|
||||
type=""
|
||||
value={field.value ?? 0}
|
||||
type="text"
|
||||
onChange={(e) => {
|
||||
field.onChange(Number(e.target.value));
|
||||
handleCommaNumberChange(e, field.onChange);
|
||||
}}
|
||||
value={formatCommaNumber(field.value)}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
@@ -238,11 +236,13 @@ export default function HtdflRegForm({
|
||||
render={({ field }) => (
|
||||
<FormUi label="발생량(m³/년)">
|
||||
<Input
|
||||
className=""
|
||||
className={selectClass}
|
||||
placeholder="1,000,000"
|
||||
type=""
|
||||
value={field.value ?? 0}
|
||||
onChange={(e) => field.onChange(Number(e.target.value))}
|
||||
type="text"
|
||||
onChange={(e) => {
|
||||
handleCommaNumberChange(e, field.onChange);
|
||||
}}
|
||||
value={formatCommaNumber(field.value)}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
@@ -273,11 +273,13 @@ export default function HtdflRegForm({
|
||||
render={({ field }) => (
|
||||
<FormUi label="처리시설 용량(m³/년)">
|
||||
<Input
|
||||
className=""
|
||||
className={selectClass}
|
||||
placeholder="1,000,000"
|
||||
type=""
|
||||
value={field.value ?? 0}
|
||||
onChange={(e) => field.onChange(Number(e.target.value))}
|
||||
type="text"
|
||||
onChange={(e) => {
|
||||
handleCommaNumberChange(e, field.onChange);
|
||||
}}
|
||||
value={formatCommaNumber(field.value)}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
@@ -308,11 +310,13 @@ export default function HtdflRegForm({
|
||||
render={({ field }) => (
|
||||
<FormUi label="이용량(m³/년)">
|
||||
<Input
|
||||
className=""
|
||||
className={selectClass}
|
||||
placeholder="1,000,000"
|
||||
type=""
|
||||
value={field.value ?? 0}
|
||||
onChange={(e) => field.onChange(Number(e.target.value))}
|
||||
type="text"
|
||||
onChange={(e) => {
|
||||
handleCommaNumberChange(e, field.onChange);
|
||||
}}
|
||||
value={formatCommaNumber(field.value)}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
@@ -325,7 +329,7 @@ export default function HtdflRegForm({
|
||||
render={({ field }) => (
|
||||
<FormUi label="이용용도">
|
||||
<Input
|
||||
className=""
|
||||
className={selectClass}
|
||||
placeholder="1,000,000"
|
||||
type="text"
|
||||
value={field.value ?? ""}
|
||||
@@ -351,10 +355,13 @@ export default function HtdflRegForm({
|
||||
render={({ field }) => (
|
||||
<FormUi label="총대장균군">
|
||||
<Input
|
||||
className={selectClass}
|
||||
placeholder="10"
|
||||
type="text"
|
||||
value={field.value ?? 0}
|
||||
onChange={(e) => field.onChange(Number(e.target.value))}
|
||||
onChange={(e) => {
|
||||
handleCommaNumberChange(e, field.onChange);
|
||||
}}
|
||||
value={formatCommaNumber(field.value)}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
@@ -368,10 +375,13 @@ export default function HtdflRegForm({
|
||||
render={({ field }) => (
|
||||
<FormUi label="총질소">
|
||||
<Input
|
||||
className={selectClass}
|
||||
placeholder="10"
|
||||
type="text"
|
||||
value={field.value ?? 0}
|
||||
onChange={(e) => field.onChange(Number(e.target.value))}
|
||||
onChange={(e) => {
|
||||
handleCommaNumberChange(e, field.onChange);
|
||||
}}
|
||||
value={formatCommaNumber(field.value)}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
@@ -387,10 +397,13 @@ export default function HtdflRegForm({
|
||||
render={({ field }) => (
|
||||
<FormUi label="결합잔류염소">
|
||||
<Input
|
||||
className={selectClass}
|
||||
placeholder="10"
|
||||
type="text"
|
||||
value={field.value ?? 0}
|
||||
onChange={(e) => field.onChange(Number(e.target.value))}
|
||||
onChange={(e) => {
|
||||
handleCommaNumberChange(e, field.onChange);
|
||||
}}
|
||||
value={formatCommaNumber(field.value)}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
@@ -404,10 +417,13 @@ export default function HtdflRegForm({
|
||||
render={({ field }) => (
|
||||
<FormUi label="총인">
|
||||
<Input
|
||||
className={selectClass}
|
||||
placeholder="10"
|
||||
type="text"
|
||||
value={field.value ?? 0}
|
||||
onChange={(e) => field.onChange(Number(e.target.value))}
|
||||
onChange={(e) => {
|
||||
handleCommaNumberChange(e, field.onChange);
|
||||
}}
|
||||
value={formatCommaNumber(field.value)}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
@@ -423,10 +439,13 @@ export default function HtdflRegForm({
|
||||
render={({ field }) => (
|
||||
<FormUi label="탁도">
|
||||
<Input
|
||||
className={selectClass}
|
||||
placeholder="10"
|
||||
type="text"
|
||||
value={field.value ?? 0}
|
||||
onChange={(e) => field.onChange(Number(e.target.value))}
|
||||
onChange={(e) => {
|
||||
handleCommaNumberChange(e, field.onChange);
|
||||
}}
|
||||
value={formatCommaNumber(field.value)}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
@@ -440,10 +459,13 @@ export default function HtdflRegForm({
|
||||
render={({ field }) => (
|
||||
<FormUi label="수소이온농도">
|
||||
<Input
|
||||
className={selectClass}
|
||||
placeholder="10"
|
||||
type="text"
|
||||
value={field.value ?? 0}
|
||||
onChange={(e) => field.onChange(Number(e.target.value))}
|
||||
onChange={(e) => {
|
||||
handleCommaNumberChange(e, field.onChange);
|
||||
}}
|
||||
value={formatCommaNumber(field.value)}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
@@ -459,10 +481,13 @@ export default function HtdflRegForm({
|
||||
render={({ field }) => (
|
||||
<FormUi label="생물학적 산소요구량">
|
||||
<Input
|
||||
className={selectClass}
|
||||
placeholder="10"
|
||||
type="text"
|
||||
value={field.value ?? 0}
|
||||
onChange={(e) => field.onChange(Number(e.target.value))}
|
||||
onChange={(e) => {
|
||||
handleCommaNumberChange(e, field.onChange);
|
||||
}}
|
||||
value={formatCommaNumber(field.value)}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
@@ -476,10 +501,13 @@ export default function HtdflRegForm({
|
||||
render={({ field }) => (
|
||||
<FormUi label="염화물">
|
||||
<Input
|
||||
className={selectClass}
|
||||
placeholder="10"
|
||||
type="text"
|
||||
value={field.value ?? 0}
|
||||
onChange={(e) => field.onChange(Number(e.target.value))}
|
||||
onChange={(e) => {
|
||||
handleCommaNumberChange(e, field.onChange);
|
||||
}}
|
||||
value={formatCommaNumber(field.value)}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
@@ -495,10 +523,13 @@ export default function HtdflRegForm({
|
||||
render={({ field }) => (
|
||||
<FormUi label="냄새">
|
||||
<Input
|
||||
className={selectClass}
|
||||
placeholder="10"
|
||||
type="text"
|
||||
value={field.value ?? 0}
|
||||
onChange={(e) => field.onChange(Number(e.target.value))}
|
||||
onChange={(e) => {
|
||||
handleCommaNumberChange(e, field.onChange);
|
||||
}}
|
||||
value={formatCommaNumber(field.value)}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
@@ -512,10 +543,13 @@ export default function HtdflRegForm({
|
||||
render={({ field }) => (
|
||||
<FormUi label="전기전도도">
|
||||
<Input
|
||||
className={selectClass}
|
||||
placeholder="10"
|
||||
type="text"
|
||||
value={field.value ?? 0}
|
||||
onChange={(e) => field.onChange(Number(e.target.value))}
|
||||
onChange={(e) => {
|
||||
handleCommaNumberChange(e, field.onChange);
|
||||
}}
|
||||
value={formatCommaNumber(field.value)}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
@@ -531,10 +565,13 @@ export default function HtdflRegForm({
|
||||
render={({ field }) => (
|
||||
<FormUi label="색도">
|
||||
<Input
|
||||
className={selectClass}
|
||||
placeholder="10"
|
||||
type="text"
|
||||
value={field.value ?? 0}
|
||||
onChange={(e) => field.onChange(Number(e.target.value))}
|
||||
onChange={(e) => {
|
||||
handleCommaNumberChange(e, field.onChange);
|
||||
}}
|
||||
value={formatCommaNumber(field.value)}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
@@ -548,10 +585,13 @@ export default function HtdflRegForm({
|
||||
render={({ field }) => (
|
||||
<FormUi label="배출구온도">
|
||||
<Input
|
||||
className={selectClass}
|
||||
placeholder="10"
|
||||
type="text"
|
||||
value={field.value ?? 0}
|
||||
onChange={(e) => field.onChange(Number(e.target.value))}
|
||||
onChange={(e) => {
|
||||
handleCommaNumberChange(e, field.onChange);
|
||||
}}
|
||||
value={formatCommaNumber(field.value)}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
|
||||
@@ -15,6 +15,7 @@ import { useEffect, useState } from "react";
|
||||
import { useForm, useWatch, type UseFormReturn } from "react-hook-form";
|
||||
import { z } from "zod";
|
||||
import BdstReg from "../bdstReg/bdstReg";
|
||||
import { formatCommaNumber, handleCommaNumberChange } from "@/components/lib/func/commom";
|
||||
|
||||
export default function RainRegForm({
|
||||
rainForm,
|
||||
@@ -23,7 +24,7 @@ export default function RainRegForm({
|
||||
rainForm: customRainBdst;
|
||||
isModal: boolean;
|
||||
}) {
|
||||
const { code, rainReg, rainUpdate, rain } = useWrStore((state) => state);
|
||||
const { code, rainBdstReg, rainBdstUpdate, rain } = useWrStore((state) => state);
|
||||
const { rainFcltCd } = code;
|
||||
const defaultValues: z.infer<typeof rainZod> = rainZod.parse({});
|
||||
|
||||
@@ -87,9 +88,9 @@ useEffect(() =>{
|
||||
|
||||
const onSubmit =(values: z.infer<typeof rainZod>)=> {
|
||||
if (isModal) {
|
||||
rainReg(values);
|
||||
rainBdstReg(values ,'41');
|
||||
} else {
|
||||
rainUpdate(values);
|
||||
rainBdstUpdate(values, '41');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -159,13 +160,11 @@ useEffect(() =>{
|
||||
render={({ field }) => (
|
||||
<FormUi label="설치비">
|
||||
<Input
|
||||
className={inputClass}
|
||||
placeholder="1,000,000"
|
||||
type="number"
|
||||
value={field.value ?? 0}
|
||||
onChange={(e) => {
|
||||
field.onChange(e.target.value === "" ? "" : Number(e.target.value));
|
||||
}}
|
||||
className={selectClass}
|
||||
placeholder="1,000,000"
|
||||
type="text"
|
||||
onChange={(e) => {handleCommaNumberChange(e, field.onChange) }}
|
||||
value={formatCommaNumber(field.value)}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
@@ -209,9 +208,9 @@ useEffect(() =>{
|
||||
<Input
|
||||
className={selectClass}
|
||||
placeholder="1,000,000"
|
||||
type="number"
|
||||
value={field.value ?? 0}
|
||||
onChange={(e) => field.onChange(Number(e.target.value))}
|
||||
type="text"
|
||||
onChange={(e) => {handleCommaNumberChange(e, field.onChange) }}
|
||||
value={formatCommaNumber(field.value)}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
@@ -250,9 +249,9 @@ useEffect(() =>{
|
||||
<Input
|
||||
className={selectClass}
|
||||
placeholder="1,000,000"
|
||||
type="number"
|
||||
value={field.value ?? 0}
|
||||
onChange={(e) => field.onChange(Number(e.target.value))}
|
||||
type="text"
|
||||
onChange={(e) => {handleCommaNumberChange(e, field.onChange) }}
|
||||
value={formatCommaNumber(field.value)}
|
||||
readOnly={filtrTrtmfctYn!=='Y'}
|
||||
|
||||
/>
|
||||
@@ -314,15 +313,12 @@ useEffect(() =>{
|
||||
render={({ field }) => (
|
||||
<FormUi label="지원금액(원)">
|
||||
<Input
|
||||
className=""
|
||||
className={selectClass}
|
||||
placeholder="1,000,000"
|
||||
type="number"
|
||||
onChange={(e) => {
|
||||
const value = e.target.value;
|
||||
field.onChange(value === "" ? "" : Number(value));
|
||||
}}
|
||||
value={field.value ?? 0}
|
||||
readOnly={instlCstSprtYn!=='Y'}
|
||||
type="text"
|
||||
onChange={(e) => {handleCommaNumberChange(e, field.onChange) }}
|
||||
value={formatCommaNumber(field.value)}
|
||||
readOnly={instlCstSprtYn !== 'Y'}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
@@ -358,7 +354,7 @@ useEffect(() =>{
|
||||
name="reuseBuilding.0.grntchBdstCertYr"
|
||||
render={({ field }) => (
|
||||
<FormUi label="인증년도">
|
||||
<Input className="" placeholder="2024" type="" value={field.value ?? ""}
|
||||
<Input className={selectClass} placeholder="2024" type="" value={field.value ?? ""}
|
||||
onChange={field.onChange}
|
||||
|
||||
readOnly={grntchBdstCertYn!=='Y'}/>
|
||||
@@ -373,7 +369,7 @@ useEffect(() =>{
|
||||
render={({ field }) => (
|
||||
<FormUi label="인증번호">
|
||||
<Input
|
||||
className=""
|
||||
className={selectClass}
|
||||
placeholder="ab1234678"
|
||||
type=""
|
||||
value={field.value ?? ""}
|
||||
@@ -390,7 +386,7 @@ useEffect(() =>{
|
||||
name="reuseBuilding.0.grntchBdstCertGrd"
|
||||
render={({ field }) => (
|
||||
<FormUi label="인증등급">
|
||||
<Input className="" placeholder="A" type="" value={field.value ?? ""}
|
||||
<Input className={selectClass} placeholder="A" type="" value={field.value ?? ""}
|
||||
onChange={field.onChange}
|
||||
readOnly={grntchBdstCertYn!=='Y'}
|
||||
/>
|
||||
|
||||
@@ -9,8 +9,8 @@ import {
|
||||
} from "@common/business_components/ui";
|
||||
import { Button, Input } from "@common/components/ui";
|
||||
import { zodResolver } from "@hookform/resolvers/zod";
|
||||
import { useForm } from "react-hook-form";
|
||||
import { 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 {
|
||||
@@ -19,6 +19,10 @@ import {
|
||||
} from "@/app/store/ruseFcltMng/fcltReg/rswtReg";
|
||||
import { useEffect } from "react";
|
||||
import BdstReg from "../bdstReg/bdstReg";
|
||||
import {
|
||||
formatCommaNumber,
|
||||
handleCommaNumberChange,
|
||||
} from "@/components/lib/func/commom";
|
||||
|
||||
export default function RswtrRegForm({
|
||||
rswtForm,
|
||||
@@ -27,78 +31,69 @@ export default function RswtrRegForm({
|
||||
rswtForm: customRswtBdst;
|
||||
isModal: boolean;
|
||||
}) {
|
||||
const { rswt, code ,rswtUpdate,rswtReg} = useWrStore((state) => state);
|
||||
|
||||
const { rswt, code, rswtBdstUpdate, rswtBdstReg } = useWrStore((state) => state);
|
||||
|
||||
const defaultValues: z.infer<typeof rswtZod> = rswtZod.parse({});
|
||||
|
||||
|
||||
const form = useForm<z.infer<typeof rswtZod>>({
|
||||
resolver: zodResolver(rswtZod),
|
||||
defaultValues: defaultValues,
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
const [grntchBdstCertYn, instlCstSprtYn,filtrTrtmfctProcs] = form.watch([
|
||||
const [grntchBdstCertYn, instlCstSprtYn, filtrTrtmfctProcs] = form.watch([
|
||||
"reuseBuilding.0.grntchBdstCertYn",
|
||||
"reuseBuilding.0.instlCstSprtYn",
|
||||
"reuseBuilding.0.rswtrObj.filtrTrtmfctProcs",
|
||||
]);
|
||||
|
||||
const onSubmit =(values: z.infer<typeof rswtZod>) => {
|
||||
const onSubmit = (values: z.infer<typeof rswtZod>) => {
|
||||
if (isModal) {
|
||||
rswtReg(values);
|
||||
} else {
|
||||
rswtUpdate(values);
|
||||
}
|
||||
}
|
||||
const cleanRswtData = (raw: any): z.infer<typeof rswtZod> =>{
|
||||
rswtBdstReg(values,'41');
|
||||
} else {
|
||||
rswtBdstUpdate(values,'41');
|
||||
}
|
||||
};
|
||||
const cleanRswtData = (raw: any): z.infer<typeof rswtZod> => {
|
||||
return {
|
||||
...raw,
|
||||
frstArchPrmsnDt: new Date(raw?.frstArchPrmsnDt||null),
|
||||
archChgPrmsnDt: raw?.archChgPrmsnDt ? new Date(raw?.archChgPrmsnDt) : null,
|
||||
frstArchPrmsnDt: new Date(raw?.frstArchPrmsnDt || null),
|
||||
archChgPrmsnDt: raw?.archChgPrmsnDt
|
||||
? new Date(raw?.archChgPrmsnDt)
|
||||
: null,
|
||||
reuseBuilding: (raw?.reuseBuilding || []).map((item: any) => ({
|
||||
...item,
|
||||
instlCmptnDt: new Date(item?.instlCmptnDt),
|
||||
operMngCd: item?.operMngCd ?? "", // null → ""
|
||||
grntchBdstCertYr: typeof item?.grntchBdstCertYr === "string"
|
||||
? item?.grntchBdstCertYr
|
||||
: "", // null → ""
|
||||
grntchBdstCertYr:
|
||||
typeof item?.grntchBdstCertYr === "string"
|
||||
? item?.grntchBdstCertYr
|
||||
: "", // null → ""
|
||||
rswtrObj: {
|
||||
...item?.rswtrObj
|
||||
}
|
||||
}))
|
||||
...item?.rswtrObj,
|
||||
},
|
||||
})),
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
console.log("form errors:", form.formState.errors);
|
||||
}, [form.formState.errors]);
|
||||
|
||||
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(() =>{
|
||||
|
||||
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)
|
||||
form.reset( cleanRswtData(rswtForm))
|
||||
useEffect(() => {
|
||||
if (rswtZod) form.reset(cleanRswtData(rswtForm));
|
||||
}, [rswtForm]);
|
||||
|
||||
|
||||
return (
|
||||
<div className="">
|
||||
<Form {...form}>
|
||||
@@ -106,20 +101,18 @@ useEffect(() => {
|
||||
{/* <div className="flex justify-between items-center mx-3"> */}
|
||||
<div>
|
||||
<div className="grid grid-cols-12">
|
||||
<h1 className="pl-3 text-xl col-span-10">
|
||||
○ 중수도 시설 정보
|
||||
</h1>
|
||||
<Button size={"sm"} type="submit" className="col-start-12 col-span-1">
|
||||
<h1 className="pl-3 text-xl col-span-10">○ 중수도 시설 정보</h1>
|
||||
<Button
|
||||
size={"sm"}
|
||||
type="submit"
|
||||
className="col-start-12 col-span-1"
|
||||
>
|
||||
저장
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{isModal && rswtForm != undefined ? (
|
||||
<BdstReg form={form} />
|
||||
) : (
|
||||
<></>
|
||||
)}
|
||||
{isModal && rswtForm != undefined ? <BdstReg form={form} /> : <></>}
|
||||
{isModal ? (
|
||||
<h1 className="pl-3 text-xl col-span-10 mt-4 ">
|
||||
○ 중수도 시설 정보{" "}
|
||||
@@ -160,11 +153,13 @@ useEffect(() => {
|
||||
render={({ field }) => (
|
||||
<FormUi label="설치비">
|
||||
<Input
|
||||
className=""
|
||||
className={selectClass}
|
||||
placeholder="1,000,000"
|
||||
type="number"
|
||||
value={field.value ?? ""}
|
||||
onChange={(e) => field.onChange(Number(e.target.value))}
|
||||
type="text"
|
||||
onChange={(e) => {
|
||||
handleCommaNumberChange(e, field.onChange);
|
||||
}}
|
||||
value={formatCommaNumber(field.value)}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
@@ -179,11 +174,13 @@ useEffect(() => {
|
||||
render={({ field }) => (
|
||||
<FormUi label="물사용량(m³)">
|
||||
<Input
|
||||
className=""
|
||||
className={selectClass}
|
||||
placeholder="1,000,000"
|
||||
type="number"
|
||||
value={field.value ?? 0}
|
||||
onChange={(e) => field.onChange(Number(e.target.value))}
|
||||
type="text"
|
||||
onChange={(e) => {
|
||||
handleCommaNumberChange(e, field.onChange);
|
||||
}}
|
||||
value={formatCommaNumber(field.value)}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
@@ -197,11 +194,13 @@ useEffect(() => {
|
||||
render={({ field }) => (
|
||||
<FormUi label="의무대상 물사용량(m³)">
|
||||
<Input
|
||||
className=""
|
||||
className={selectClass}
|
||||
placeholder="1,000,000"
|
||||
type="number"
|
||||
value={field.value ?? 0}
|
||||
onChange={(e) => field.onChange(Number(e.target.value))}
|
||||
type="text"
|
||||
onChange={(e) => {
|
||||
handleCommaNumberChange(e, field.onChange);
|
||||
}}
|
||||
value={formatCommaNumber(field.value)}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
@@ -240,7 +239,7 @@ useEffect(() => {
|
||||
render={({ field }) => (
|
||||
<FormUi label="주요처리공정">
|
||||
<Input
|
||||
className=""
|
||||
className={selectClass}
|
||||
placeholder="1,000,000"
|
||||
type=""
|
||||
value={field.value ?? ""}
|
||||
@@ -286,14 +285,14 @@ useEffect(() => {
|
||||
render={({ field }) => (
|
||||
<FormUi label="지원금액(원)">
|
||||
<Input
|
||||
className=""
|
||||
className={selectClass}
|
||||
placeholder="1,000,000"
|
||||
type="number"
|
||||
value={field.value ?? 0}
|
||||
type="text"
|
||||
onChange={(e) => {
|
||||
field.onChange(Number(e.target.value));
|
||||
handleCommaNumberChange(e, field.onChange);
|
||||
}}
|
||||
readOnly={instlCstSprtYn!=='Y'}
|
||||
value={formatCommaNumber(field.value)}
|
||||
readOnly={instlCstSprtYn !== "Y"}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
@@ -330,13 +329,13 @@ useEffect(() => {
|
||||
render={({ field }) => (
|
||||
<FormUi label="인증년도">
|
||||
<Input
|
||||
className=""
|
||||
className={selectClass}
|
||||
placeholder="2024"
|
||||
type="text"
|
||||
{...field}
|
||||
value={field.value ?? ""}
|
||||
onChange={field.onChange}
|
||||
readOnly={grntchBdstCertYn!=='Y'}
|
||||
readOnly={grntchBdstCertYn !== "Y"}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
@@ -349,13 +348,12 @@ useEffect(() => {
|
||||
render={({ field }) => (
|
||||
<FormUi label="인증번호">
|
||||
<Input
|
||||
className=""
|
||||
className={selectClass}
|
||||
placeholder="ab1234678"
|
||||
type=""
|
||||
value={field.value ?? ""}
|
||||
onChange={field.onChange}
|
||||
readOnly={grntchBdstCertYn!=='Y'}
|
||||
|
||||
readOnly={grntchBdstCertYn !== "Y"}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
@@ -368,13 +366,12 @@ useEffect(() => {
|
||||
render={({ field }) => (
|
||||
<FormUi label="인증등급">
|
||||
<Input
|
||||
className=""
|
||||
className={selectClass}
|
||||
placeholder="A"
|
||||
type=""
|
||||
value={field.value ?? ""}
|
||||
onChange={field.onChange}
|
||||
readOnly={grntchBdstCertYn!=='Y'}
|
||||
|
||||
readOnly={grntchBdstCertYn !== "Y"}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
|
||||
@@ -25,7 +25,6 @@ export default function ChkgdExcel({ type }: { type: string }) {
|
||||
});
|
||||
const [files, setFiles] = useState<File[] | null>(null);
|
||||
const [excelData , setExcelData] = useState<rainChkZodType[]>()
|
||||
|
||||
const defaultValues: z.infer<typeof rainRegExcel> = rainRegExcel.parse({});
|
||||
|
||||
const form = useForm<z.infer<typeof rainRegExcel>>({
|
||||
@@ -36,17 +35,14 @@ export default function ChkgdExcel({ type }: { type: string }) {
|
||||
useEffect(() => {
|
||||
if (files) {
|
||||
const file = files[0];
|
||||
|
||||
if(form.getValues("chckYr").length<1 ){
|
||||
alert("등록년도를 입력해주세요");
|
||||
ToastFormUi({body:"파일업로드 이전에 등록년도를 작성해주세요 " ,title:'지도점검 등록'})
|
||||
setFiles(null)
|
||||
return
|
||||
}
|
||||
if (file)
|
||||
filePicked(file, 0).then((res) => {
|
||||
if (res !== undefined)
|
||||
|
||||
console.log("exex ", excelToRainChkData(res, form.getValues("chckYr")))
|
||||
setExcelData(excelToRainChkData(res, form.getValues("chckYr")))
|
||||
});
|
||||
}
|
||||
@@ -54,15 +50,13 @@ export default function ChkgdExcel({ type }: { type: string }) {
|
||||
|
||||
const onSubmit =(values: z.infer<typeof rainRegExcel>)=> {
|
||||
if(values.chckYr ===''){
|
||||
console.log(values.chckYr)
|
||||
ToastFormUi({body:"등록년도를 작성해주세요" ,title:'엑셀등록'})
|
||||
ToastFormUi({body:"등록년도를 작성해주세요" ,title:'지도점검 등록'})
|
||||
return
|
||||
}else if(excelData ===undefined || excelData?.length === 0 ){
|
||||
ToastFormUi({body:"빈 파일입니다." ,title:'엑셀등록'})
|
||||
ToastFormUi({body:"빈 파일 및 파일 오류 입니다." ,title:'지도점검 등록'})
|
||||
return
|
||||
}
|
||||
if (excelData) {
|
||||
console.log("excelData ", excelData)
|
||||
rainChkExcelDataUPload(excelData);
|
||||
}
|
||||
}
|
||||
@@ -126,7 +120,7 @@ export default function ChkgdExcel({ type }: { type: string }) {
|
||||
</form>
|
||||
</Form>
|
||||
</div>
|
||||
<Toaster position="top-center" />
|
||||
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
import { useWrStore } from "@/app/store";
|
||||
import type { TableProps } from "@/app/store/ruseFcltMng/fcltReg/pbnstReg";
|
||||
import type { TableTripleProps } from "@/app/store/ruseFcltMng/fcltReg/rainReg";
|
||||
import { rainSttnHeadListType } from "@/app/store/ruseFcltMng/fcltSttn/rainSttn/headList";
|
||||
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 { useEffect, useState } from "react";
|
||||
import { useForm } from "react-hook-form";
|
||||
import { z } from "zod";
|
||||
|
||||
@@ -12,38 +11,34 @@ export default function HeadChModal({type }:{type: string }) {
|
||||
const { rainSttn ,rainChSttnHead} = useWrStore((state) => state);
|
||||
|
||||
|
||||
const { rainSttHeadList } =rainSttn;
|
||||
let items = rainSttHeadList.map(item => ({id:item.id, label:item.title, val:item.visible }));
|
||||
const { rainSttHeadList, rainSttNodeList } =rainSttn;
|
||||
let items = rainSttHeadList.map(item => ({id:item.id, title:item.title, val:item.visible }));
|
||||
|
||||
|
||||
|
||||
const FormSchema = z.object({
|
||||
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 FormSchema =
|
||||
// z.object({
|
||||
// id: z.string().refine((value) => value.some((item) => item), {
|
||||
// message: "최소한 하나를 선택해주시길 바랍니다.",
|
||||
// }),
|
||||
// visible: z.boolean()
|
||||
// })
|
||||
|
||||
|
||||
const form = useForm<z.infer<typeof rainSttnHeadListType>>({
|
||||
resolver: zodResolver(rainSttnHeadListType),
|
||||
defaultValues: [],
|
||||
})
|
||||
|
||||
|
||||
useEffect(() =>{
|
||||
form.reset({ data: items.map((el) => el.val!==undefined ? el.val.toString():undefined )})
|
||||
|
||||
form.reset(rainSttHeadList)
|
||||
|
||||
|
||||
},[rainSttHeadList])
|
||||
|
||||
const onSubmit = (val : z.infer<typeof FormSchema>) =>{
|
||||
|
||||
if(val?.data.length > 0)
|
||||
rainChSttnHead(val?.data, )
|
||||
|
||||
const onSubmit = (headList : z.infer<typeof rainSttnHeadListType> ) =>{
|
||||
rainChSttnHead(headList)
|
||||
}
|
||||
|
||||
return (
|
||||
@@ -51,57 +46,41 @@ export default function HeadChModal({type }:{type: string }) {
|
||||
<div>
|
||||
<Form {...form}>
|
||||
<form onSubmit={form.handleSubmit(onSubmit)} className="space-y-8">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="data"
|
||||
render={() => (
|
||||
<FormItem>
|
||||
|
||||
<div className="mb-4">
|
||||
<FormLabel className="text-2xl"> 조회항목 설정</FormLabel>
|
||||
|
||||
<h3>조회항목 설정</h3>
|
||||
</div>
|
||||
{items.map((item) => (
|
||||
{items.map((item,index) => (
|
||||
<FormField
|
||||
key={item.id}
|
||||
key={`${index}.id`}
|
||||
control={form.control}
|
||||
name="data"
|
||||
name={`${index}.visible`}
|
||||
render={({ field }) =>
|
||||
{
|
||||
return (
|
||||
<FormItem
|
||||
key={item.id}
|
||||
key={`${index}.id`+'item'}
|
||||
className="flex flex-row items-start space-x-3 space-y-0"
|
||||
>
|
||||
<FormControl>
|
||||
<Checkbox
|
||||
checked={field.value?.includes(item.id)}
|
||||
checked={field.value}
|
||||
onCheckedChange={(checked) =>
|
||||
|
||||
{
|
||||
return checked
|
||||
? field.onChange([...field.value, item.id])
|
||||
: field.onChange(
|
||||
field.value?.filter(
|
||||
(value) => value !== item.id
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
field.onChange(checked);
|
||||
return;
|
||||
}
|
||||
}
|
||||
/>
|
||||
</FormControl>
|
||||
<FormLabel className="text-xl">
|
||||
{item.label}
|
||||
{item.title}
|
||||
</FormLabel>
|
||||
</FormItem>
|
||||
);
|
||||
}}
|
||||
/>
|
||||
))}
|
||||
<FormMessage />
|
||||
</FormItem>
|
||||
)}
|
||||
/>
|
||||
<Button type="submit">항목 표출 변경</Button>
|
||||
</form>
|
||||
</Form>
|
||||
|
||||
@@ -14,14 +14,16 @@ import {
|
||||
} from "@common/components/ui";
|
||||
import { useCallback, useEffect, useState } from "react";
|
||||
export default function RainChkgdTable({
|
||||
detailUp, handleClick=() => {}
|
||||
detailUp,
|
||||
handleClick=() => {},
|
||||
deleteData
|
||||
}: {
|
||||
detailUp: (data: rainChkZodType[]) => void;
|
||||
handleClick?: (data:any) => void;
|
||||
deleteData:(selectedIds:number[])=>void
|
||||
}) {
|
||||
const { code, rainChkgdn } = useWrStore((state) => state);
|
||||
const [makeTableData, setMakeTableData] = useState<any[]>([]);
|
||||
const { rainChk } = rainChkgdn;
|
||||
const [selectedIds, setSelectedIds] = useState<number[]>([]);
|
||||
const [upRaintDetail, setUpRaintDetail] = useState<rainChkZodType[]>([]);
|
||||
const toggleSelection = (pk: number, checked: boolean) => {
|
||||
@@ -34,9 +36,11 @@ export default function RainChkgdTable({
|
||||
field: keyof (typeof makeTableData)[0],
|
||||
value: string | number
|
||||
) => {
|
||||
|
||||
setMakeTableData((prev) =>
|
||||
prev.map((row, idx) =>
|
||||
idx === rowIndex ? { ...row, [field]: value } : row
|
||||
prev.map((row, idx) => {
|
||||
return idx === rowIndex ? { ...row, [field]: value } : row
|
||||
}
|
||||
)
|
||||
);
|
||||
};
|
||||
@@ -53,9 +57,9 @@ export default function RainChkgdTable({
|
||||
|
||||
|
||||
useEffect(() => {
|
||||
const rainChg = rainChk.map((item: any) => {
|
||||
setSelectedIds([])// 셀렉트 초기화를 위한 작업
|
||||
const rainChg = rainChkgdn.rainChk.map((item: any) => {
|
||||
const bud = tableData([item.building], { code });
|
||||
|
||||
return {
|
||||
...item,
|
||||
...bud[0],
|
||||
@@ -64,22 +68,28 @@ export default function RainChkgdTable({
|
||||
});
|
||||
const tableTotalData = rightTableData(rainChg)
|
||||
setMakeTableData(tableTotalData);
|
||||
}, [rainChk, code]);
|
||||
}, [rainChkgdn.rainChk, code]);
|
||||
|
||||
useEffect(() => {
|
||||
const selectedData = makeTableData.filter((item) =>
|
||||
selectedIds.includes(item.chkgdnPk)
|
||||
);
|
||||
if (selectedData.length > 1) {
|
||||
const updateTableData = rainChk
|
||||
|
||||
|
||||
//데이터를 평탄화 한것중에 체크박스 선택한 테이블만 선택
|
||||
const selectedData = makeTableData.filter((item) =>selectedIds.includes(item.chkgdnPk));
|
||||
|
||||
if (selectedData.length > 0) {
|
||||
const updateTableData = rainChkgdn.rainChk
|
||||
.map((rc) => {
|
||||
const newRainyDetail = rc.rainyDetails
|
||||
.map((rd) => {
|
||||
|
||||
// 변경 데이터는 평탄화한 데이터 즉 루트에 변경되어 있음 이용용도까지 잇음 그걸로 찾기
|
||||
const findRain = selectedData.find(
|
||||
(sd) =>
|
||||
rd.chkgdnFk === sd.chkgdnPk && rd.utztnUsgCd === sd.utztnUsgCd
|
||||
);
|
||||
|
||||
if (findRain != undefined) {
|
||||
console.log(findRain)
|
||||
return {
|
||||
...rd,
|
||||
ph: Number(findRain.ph),
|
||||
@@ -105,14 +115,28 @@ export default function RainChkgdTable({
|
||||
}
|
||||
})
|
||||
.filter(Boolean);
|
||||
|
||||
|
||||
setUpRaintDetail(updateTableData as rainChkZodType[]);
|
||||
}
|
||||
}, [makeTableData]);
|
||||
}, [makeTableData,selectedIds]);
|
||||
|
||||
useEffect(() => {
|
||||
detailUp(upRaintDetail);
|
||||
}, [upRaintDetail]);
|
||||
|
||||
useEffect(() =>{
|
||||
if(selectedIds.length >0){
|
||||
// 삭제를 위한 데이터 삽입
|
||||
deleteData(selectedIds )
|
||||
}
|
||||
},[selectedIds])
|
||||
|
||||
useEffect(() => {
|
||||
|
||||
},[])
|
||||
|
||||
|
||||
return (
|
||||
<Table variant="secondary">
|
||||
<TableHeader className="font-bold">
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
import ChkgdModal from "@/components/ui/modal/chkgdModal/chkgdModal";
|
||||
import { UiModal } from "@common/business_components";
|
||||
|
||||
export default function RainChkgdTableModal({ isModal, setIsModal }: { isModal: { open: boolean; data: any }; setIsModal: (value: { open: boolean; data: any }) => void }) {
|
||||
return (<UiModal
|
||||
open={isModal.open}
|
||||
onOpenChange={() => {
|
||||
setIsModal({ open: !open, data: {} });
|
||||
}}
|
||||
bodyClass={"w-[80vw] max-w-none"}
|
||||
body={<ChkgdModal type={"RNB"} obj={isModal.data} />}
|
||||
></UiModal>)
|
||||
}
|
||||
Reference in New Issue
Block a user