Merge commit '5a681420465af0ffe153b9fce121484947c53b9c' into iipbs/wr/dev
iipbs_wr / build (push) Waiting to run
iipbs_wr / build (push) Waiting to run
This commit is contained in:
@@ -8,6 +8,7 @@ import type {
|
|||||||
} from "@/app/store/ruseFcltMng/fcltReg/rainReg";
|
} from "@/app/store/ruseFcltMng/fcltReg/rainReg";
|
||||||
import {
|
import {
|
||||||
excelDownload,
|
excelDownload,
|
||||||
|
getCity,
|
||||||
getCityOrSgg,
|
getCityOrSgg,
|
||||||
tableData,
|
tableData,
|
||||||
} from "@/components/lib/func/commom";
|
} from "@/components/lib/func/commom";
|
||||||
@@ -16,16 +17,23 @@ import SttnDetailModal from "@/components/ui/modal/sttn/sttnDetailModal/sttnDeta
|
|||||||
import {
|
import {
|
||||||
ContentsDiv,
|
ContentsDiv,
|
||||||
SearchBaseForm,
|
SearchBaseForm,
|
||||||
|
SearchDiv,
|
||||||
|
SearchFormLeft,
|
||||||
|
SearchFormRight,
|
||||||
|
SearchInput,
|
||||||
|
SelectBox,
|
||||||
Title,
|
Title,
|
||||||
UiModal,
|
UiModal,
|
||||||
UiTable,
|
UiTable,
|
||||||
type ReturnType,
|
type ReturnType,
|
||||||
|
type SelectDataType,
|
||||||
} from "@common/business_components/ui";
|
} from "@common/business_components/ui";
|
||||||
import ListDiv from "@common/business_components/ui/list_div";
|
import ListDiv from "@common/business_components/ui/list_div";
|
||||||
import { Button } from "@common/components/ui";
|
import { Button, Label } from "@common/components/ui";
|
||||||
import { useCallback, useEffect, useRef, useState } from "react";
|
import { useCallback, useEffect, useRef, useState } from "react";
|
||||||
import { excelHtdflSttnParsing } from "@/app/store/ruseFcltMng/fcltSttn/htdflSttn/excel";
|
import { excelHtdflSttnParsing } from "@/app/store/ruseFcltMng/fcltSttn/htdflSttn/excel";
|
||||||
import { HeadMakeColSpan } from "@common/business_components/ui/table/HeadMakeColSpan";
|
import { HeadMakeColSpan } from "@common/business_components/ui/table/HeadMakeColSpan";
|
||||||
|
import type { objSearchType } from "@/components/ui/modal/fcltReg/bdstRegModal/bdstRegModal";
|
||||||
|
|
||||||
export default function HtdflSttn() {
|
export default function HtdflSttn() {
|
||||||
const { code, htdflSttn, htdflSttnSearch, initHtdfl } = useWrStore(
|
const { code, htdflSttn, htdflSttnSearch, initHtdfl } = useWrStore(
|
||||||
@@ -38,6 +46,8 @@ export default function HtdflSttn() {
|
|||||||
const [pageNation, setPageNation] = useState(1);
|
const [pageNation, setPageNation] = useState(1);
|
||||||
const [isChHead, setIsChHead] = useState(false);
|
const [isChHead, setIsChHead] = useState(false);
|
||||||
const [bdstTable, setBdstTable] = useState<customRainBdst[]>();
|
const [bdstTable, setBdstTable] = useState<customRainBdst[]>();
|
||||||
|
const [selectSgg, setSelectSgg] = useState<SelectDataType[] | []>()
|
||||||
|
const [objSearch, setObjSearch] = useState<objSearchType>({ sgg: "", city: "" });
|
||||||
const [detailModal, setDetailModal] = useState<{
|
const [detailModal, setDetailModal] = useState<{
|
||||||
isOpen: boolean;
|
isOpen: boolean;
|
||||||
data: customRainBdst | undefined;
|
data: customRainBdst | undefined;
|
||||||
@@ -46,17 +56,47 @@ export default function HtdflSttn() {
|
|||||||
isOpen: boolean;
|
isOpen: boolean;
|
||||||
chBuilding: chgBuilding[];
|
chBuilding: chgBuilding[];
|
||||||
}>({ isOpen: false, chBuilding: [] });
|
}>({ isOpen: false, chBuilding: [] });
|
||||||
|
const [fcltNm, setFcltNm] = useState<string>("");
|
||||||
const codeData = getCityOrSgg(ref);
|
|
||||||
|
|
||||||
const excelClick = useCallback(() => {
|
const excelClick = useCallback(() => {
|
||||||
if (codeData) htdflSttnSearch(1, "10000", codeData);
|
// 최신 검색 조건 반영
|
||||||
}, [htdflSttnSearch, codeData]);
|
const con = getConValue();
|
||||||
|
htdflSttnSearch(1, "10000", String(con), fcltNm, code.cityCd, code.sggCd);
|
||||||
|
}, [htdflSttnSearch, objSearch, code.cityCd, code.sggCd]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (codeData != null) htdflSttnSearch(pageNation, "20", codeData);
|
htdflSttnSearch(pageNation, "20", String(getConValue()), fcltNm, code.cityCd, code.sggCd);
|
||||||
}, [pageNation]);
|
}, [pageNation]);
|
||||||
|
|
||||||
|
const getSelCity = (val: string | number) => {
|
||||||
|
const cityValue = String(val);
|
||||||
|
|
||||||
|
if (cityValue === "0") {
|
||||||
|
setSelectSgg([]);
|
||||||
|
setObjSearch({ city: cityValue, sgg: "" });
|
||||||
|
} else {
|
||||||
|
const data = getCity(cityValue, code.sggCd);
|
||||||
|
setSelectSgg(data);
|
||||||
|
|
||||||
|
const firstSggVal = data.find(item => item.val === "0")?.val || (data[0]?.val ?? "");
|
||||||
|
setObjSearch({ city: cityValue, sgg: firstSggVal });
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const getSgg = (val: string | number) => {
|
||||||
|
setObjSearch({ ...objSearch, sgg: String(val) })
|
||||||
|
};
|
||||||
|
|
||||||
|
const getConValue = () => {
|
||||||
|
if (!objSearch.city || objSearch.city === "0") {
|
||||||
|
return "0";
|
||||||
|
}
|
||||||
|
if (objSearch.sgg && objSearch.sgg !== "0") {
|
||||||
|
return objSearch.sgg;
|
||||||
|
}
|
||||||
|
return objSearch.city;
|
||||||
|
};
|
||||||
|
|
||||||
const cellClick = (index: number | undefined, headId: string) => {
|
const cellClick = (index: number | undefined, headId: string) => {
|
||||||
if (
|
if (
|
||||||
headId !== "chBuildingYn" &&
|
headId !== "chBuildingYn" &&
|
||||||
@@ -67,42 +107,34 @@ export default function HtdflSttn() {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const excelDown = async () => {
|
if (htdflSttn.excelList.length > 0) {
|
||||||
if (htdflSttn.excelList.length > 0) {
|
if (htdflSttn.excelList.length === 0) return;
|
||||||
if (htdflSttn.excelList.length === 0) return;
|
excelDownload(
|
||||||
const excelData = await tableData(htdflSttn.excelList, { code });
|
htdflSttn.excelList,
|
||||||
const htdflExcel = excelHtdflSttnParsing(excelData, code.cityCd, code.sggCd);
|
"온배수시설 현황",
|
||||||
excelDownload(
|
"sample_htdflSttn.xlsx",
|
||||||
htdflExcel as [[]],
|
"A1:S3"
|
||||||
"온배수시설 현황",
|
);
|
||||||
"sample_htdflSttn.xlsx",
|
}
|
||||||
"A1:S3"
|
|
||||||
);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
excelDown();
|
|
||||||
}, [htdflSttn.excelList, code]);
|
}, [htdflSttn.excelList, code]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!htdflSttn.isInit) {
|
if (!htdflSttn.isInit) {
|
||||||
initHtdfl(codeData ?? "0");
|
initHtdfl(1, "20", "0", fcltNm, code.cityCd, code.sggCd);
|
||||||
}
|
}
|
||||||
}, [htdflSttn.isInit, initHtdfl]);
|
}, [htdflSttn.isInit, initHtdfl]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (htdflSttnRes.length > 0 && code.cityCd.length > 0) {
|
const data = tableData(htdflSttnRes, { code });
|
||||||
const data = tableData(htdflSttnRes, { code });
|
const chData = data
|
||||||
const chData = data
|
.map((item: any) => ({
|
||||||
.map((item: any) => ({
|
...item,
|
||||||
...item,
|
...item.reuseBuilding[0],
|
||||||
...item.reuseBuilding[0],
|
...item.reuseBuilding[0].htdflObj,
|
||||||
...item.reuseBuilding[0].htdflObj,
|
chBuildingYn: item.chgBuilding[0]?.bdstChgNm !== null ? "Y" : "N",
|
||||||
chBuildingYn: item.chgBuilding[0]?.bdstChgNm !== null ? "Y" : "N",
|
}))
|
||||||
}))
|
.filter((item: any) => item.htdflObj !== undefined);
|
||||||
.filter((item: any) => item.htdflObj !== undefined);
|
setBdstTable(chData);
|
||||||
|
|
||||||
setBdstTable(chData);
|
|
||||||
}
|
|
||||||
}, [code, htdflSttnRes, htdflSttn.htdflSttHeadList]);
|
}, [code, htdflSttnRes, htdflSttn.htdflSttHeadList]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -111,43 +143,76 @@ export default function HtdflSttn() {
|
|||||||
<div className="grid grid-cols-4 gap-4 ">
|
<div className="grid grid-cols-4 gap-4 ">
|
||||||
<div className="col-span-4">
|
<div className="col-span-4">
|
||||||
<Title title={"온배수 시설 현황"} />
|
<Title title={"온배수 시설 현황"} />
|
||||||
<SearchBaseForm
|
|
||||||
selectSidoData={code.cityCd}
|
<SearchDiv>
|
||||||
selectSigunData={code.sggCd}
|
<SearchFormLeft>
|
||||||
selectRegionData={code.rvbsnCd}
|
<div className="col-span-10 flex flex-row">
|
||||||
selectUnitWaterShedData={code.lgbsnCd}
|
<SelectBox
|
||||||
selectMiddleRegionData={code.mdmbsnCd}
|
className="col-span-2 w-1/6 h-full text-2xl"
|
||||||
selectEnvPartData={code.lclgvrnmntCd}
|
label="시도"
|
||||||
rightChildren={<Button
|
selectClass={""}
|
||||||
className={btnClass}
|
selectArray={code.cityCd}
|
||||||
onClick={() => {
|
onSelectValue={getSelCity}
|
||||||
setIsChHead(true);
|
/>
|
||||||
} }
|
<SelectBox
|
||||||
>
|
className="col-span-2 w-1/6 h-full text-2xl ml-4"
|
||||||
조회항목설정
|
label="시군구"
|
||||||
</Button>}
|
selectClass={""}
|
||||||
leftChildren={undefined}
|
selectArray={selectSgg || []}
|
||||||
queryClick={function (returnType: ReturnType): void {
|
value={objSearch.sgg} // value props 추가
|
||||||
// '{partValue: 'A', sidoValue: '0', sigunValue: '0', regionValue: '0', unitWaterShedValue: '0', …}'
|
onSelectValue={getSgg}
|
||||||
let con;
|
/>
|
||||||
if (returnType.sigunValue != "0") {
|
<div className="col-span-2 flex flex-row space-x-2">
|
||||||
con = returnType.sigunValue;
|
<Label className="w-28 mt-2 text-xl text-gray-600">
|
||||||
} else {
|
{"시설명"}
|
||||||
con = returnType.sidoValue;
|
</Label>
|
||||||
}
|
<SearchInput
|
||||||
htdflSttnSearch(pageNation, "20", con);
|
className={"w-full h-full text-2xl"}
|
||||||
} }
|
label={""}
|
||||||
excelClick={excelClick}
|
textValue={fcltNm || ""}
|
||||||
initClick={function (): void { } }
|
setText={setFcltNm}
|
||||||
btnClass={btnClass}
|
/>
|
||||||
ref={ref} isAdmin={false} />
|
</div>
|
||||||
|
</div>
|
||||||
|
</SearchFormLeft>
|
||||||
|
<SearchFormRight
|
||||||
|
className="w-2/12 mx-5 flex flex-col items-center justify-center space-x-2 ">
|
||||||
|
<div className="flex flex-row space-x-2 items-center">
|
||||||
|
<Button
|
||||||
|
size={"sm"}
|
||||||
|
onClick={() => {
|
||||||
|
const con = getConValue();
|
||||||
|
htdflSttnSearch(pageNation, "20", String(con), fcltNm, code.cityCd, code.sggCd);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
조회
|
||||||
|
</Button>
|
||||||
|
<Button
|
||||||
|
size={"sm"}
|
||||||
|
className={`${btnClass} green`}
|
||||||
|
onClick={excelClick}
|
||||||
|
>
|
||||||
|
다운로드
|
||||||
|
</Button>
|
||||||
|
<Button
|
||||||
|
size={"sm"}
|
||||||
|
className={btnClass}
|
||||||
|
onClick={() => {
|
||||||
|
setIsChHead(true);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
조회항목설정
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
|
</SearchFormRight>
|
||||||
|
</SearchDiv>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="grid grid-cols-6 gap-4 ">
|
<div className="grid grid-cols-6 gap-4 ">
|
||||||
<div className="col-span-6">
|
<div className="col-span-6">
|
||||||
<ListDiv>
|
<ListDiv>
|
||||||
<UiTable
|
<UiTable
|
||||||
headName={[]}
|
headName={undefined}
|
||||||
tableData={bdstTable || []}
|
tableData={bdstTable || []}
|
||||||
children={
|
children={
|
||||||
<HeadMakeColSpan upHeadList={htdflSttn.htdflSttNodeList} />
|
<HeadMakeColSpan upHeadList={htdflSttn.htdflSttNodeList} />
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ import {
|
|||||||
type SelectDataType,
|
type SelectDataType,
|
||||||
} from "@common/business_components/ui";
|
} from "@common/business_components/ui";
|
||||||
import ListDiv from "@common/business_components/ui/list_div";
|
import ListDiv from "@common/business_components/ui/list_div";
|
||||||
import { Button } from "@common/components/ui";
|
import { Button, Label } from "@common/components/ui";
|
||||||
import { useCallback, useEffect, useRef, useState } from "react";
|
import { useCallback, useEffect, useRef, useState } from "react";
|
||||||
import type {
|
import type {
|
||||||
chgBuilding,
|
chgBuilding,
|
||||||
@@ -52,8 +52,7 @@ export default function RainSttn() {
|
|||||||
isOpen: boolean;
|
isOpen: boolean;
|
||||||
chBuilding: chgBuilding[];
|
chBuilding: chgBuilding[];
|
||||||
}>({ isOpen: false, chBuilding: [] });
|
}>({ isOpen: false, chBuilding: [] });
|
||||||
|
const [fcltNm, setFcltNm] = useState<string>("");
|
||||||
const codeData = getCityOrSgg(ref);
|
|
||||||
|
|
||||||
const cellClick = (index: number | undefined, headId: string) => {
|
const cellClick = (index: number | undefined, headId: string) => {
|
||||||
|
|
||||||
@@ -82,7 +81,6 @@ export default function RainSttn() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const getSgg = (val: string | number) => {
|
const getSgg = (val: string | number) => {
|
||||||
console.log("val", val)
|
|
||||||
setObjSearch({ ...objSearch, sgg: String(val) })
|
setObjSearch({ ...objSearch, sgg: String(val) })
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -96,11 +94,9 @@ export default function RainSttn() {
|
|||||||
return objSearch.city;
|
return objSearch.city;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!rainSttn.isInit) {
|
if (!rainSttn.isInit) {
|
||||||
rainSttnInit(codeData ?? "0");
|
rainSttnInit(1, "20", "0", fcltNm, code.cityCd, code.sggCd);
|
||||||
}
|
}
|
||||||
}, [rainSttn.isInit, rainSttnInit]);
|
}, [rainSttn.isInit, rainSttnInit]);
|
||||||
|
|
||||||
@@ -108,8 +104,6 @@ export default function RainSttn() {
|
|||||||
const data = tableData(rainSttnRes, { code });
|
const data = tableData(rainSttnRes, { code });
|
||||||
const chData = data
|
const chData = data
|
||||||
.map((item: any) => {
|
.map((item: any) => {
|
||||||
console.log("item", item);
|
|
||||||
console.log("왜안돼", item.reuseBuilding[0].rainyObj.dtfcltCpct)
|
|
||||||
return {
|
return {
|
||||||
...item,
|
...item,
|
||||||
...item.reuseBuilding[0],
|
...item.reuseBuilding[0],
|
||||||
@@ -124,15 +118,21 @@ export default function RainSttn() {
|
|||||||
? "확인불가"
|
? "확인불가"
|
||||||
: item.reuseBuilding[0].instlCstSprtAmt,
|
: item.reuseBuilding[0].instlCstSprtAmt,
|
||||||
chBuildingYn: item.chgBuilding[0]?.bdstChgNm !== null ? "Y" : "N",
|
chBuildingYn: item.chgBuilding[0]?.bdstChgNm !== null ? "Y" : "N",
|
||||||
|
pntfColArea: item.reuseBuilding[0].rainyObj.pntfColArea === -1
|
||||||
|
? "확인불가"
|
||||||
|
: item.reuseBuilding[0].rainyObj.pntfColArea,
|
||||||
|
filtrTrtmfctCpct: item.reuseBuilding[0].rainyObj.filtrTrtmfctCpct === -1
|
||||||
|
? "확인불가"
|
||||||
|
: item.reuseBuilding[0].rainyObj.filtrTrtmfctCpct,
|
||||||
|
archArea: Math.floor(item.archArea) === -1 ? "확인불가" : item.archArea,
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
.filter((item: any) => item.rainyObj !== undefined);
|
.filter((item: any) => item.rainyObj !== undefined);
|
||||||
console.log("chData", chData)
|
|
||||||
setBdstTable(chData);
|
setBdstTable(chData);
|
||||||
}, [code, rainSttnRes, rainSttn.rainSttHeadList]);
|
}, [code, rainSttnRes, rainSttn.rainSttHeadList]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (codeData != null) rainSttnSearch(pageNation, "20", codeData, code.cityCd, code.sggCd);
|
rainSttnSearch(pageNation, "20", String(getConValue()), fcltNm, code.cityCd, code.sggCd);
|
||||||
}, [pageNation]);
|
}, [pageNation]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@@ -147,13 +147,10 @@ export default function RainSttn() {
|
|||||||
}
|
}
|
||||||
}, [rainSttn.excelList]);
|
}, [rainSttn.excelList]);
|
||||||
|
|
||||||
// const excelClick = useCallback(() => {
|
|
||||||
// if (codeData) rainSttnSearch(1, "10000", codeData, code.cityCd, code.sggCd);
|
|
||||||
// }, [rainSttnSearch, codeData, code.cityCd, code.sggCd]);
|
|
||||||
const excelClick = useCallback(() => {
|
const excelClick = useCallback(() => {
|
||||||
// 최신 검색 조건 반영
|
// 최신 검색 조건 반영
|
||||||
const con = getConValue();
|
const con = getConValue();
|
||||||
rainSttnSearch(1, "10000", String(con), code.cityCd, code.sggCd);
|
rainSttnSearch(1, "10000", String(con), fcltNm, code.cityCd, code.sggCd);
|
||||||
}, [rainSttnSearch, objSearch, code.cityCd, code.sggCd]);
|
}, [rainSttnSearch, objSearch, code.cityCd, code.sggCd]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -162,8 +159,6 @@ export default function RainSttn() {
|
|||||||
<div className="grid grid-cols-4 gap-4 ">
|
<div className="grid grid-cols-4 gap-4 ">
|
||||||
<div className="col-span-4">
|
<div className="col-span-4">
|
||||||
<Title title={"빗물재이용 시설 현황"} />
|
<Title title={"빗물재이용 시설 현황"} />
|
||||||
|
|
||||||
|
|
||||||
<SearchDiv>
|
<SearchDiv>
|
||||||
<SearchFormLeft>
|
<SearchFormLeft>
|
||||||
<div className="col-span-10 flex flex-row">
|
<div className="col-span-10 flex flex-row">
|
||||||
@@ -182,6 +177,17 @@ export default function RainSttn() {
|
|||||||
value={objSearch.sgg} // value props 추가
|
value={objSearch.sgg} // value props 추가
|
||||||
onSelectValue={getSgg}
|
onSelectValue={getSgg}
|
||||||
/>
|
/>
|
||||||
|
<div className="col-span-2 flex flex-row space-x-2">
|
||||||
|
<Label className="w-28 mt-2 text-xl text-gray-600">
|
||||||
|
{"시설명"}
|
||||||
|
</Label>
|
||||||
|
<SearchInput
|
||||||
|
className={"w-full h-full text-2xl"}
|
||||||
|
label={""}
|
||||||
|
textValue={fcltNm || ""}
|
||||||
|
setText={setFcltNm}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</SearchFormLeft>
|
</SearchFormLeft>
|
||||||
<SearchFormRight
|
<SearchFormRight
|
||||||
@@ -191,7 +197,7 @@ export default function RainSttn() {
|
|||||||
size={"sm"}
|
size={"sm"}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
const con = getConValue();
|
const con = getConValue();
|
||||||
rainSttnSearch(1, "20", String(con), code.cityCd, code.sggCd);
|
rainSttnSearch(pageNation, "20", String(con), fcltNm, code.cityCd, code.sggCd);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
조회
|
조회
|
||||||
@@ -215,50 +221,6 @@ export default function RainSttn() {
|
|||||||
</div>
|
</div>
|
||||||
</SearchFormRight>
|
</SearchFormRight>
|
||||||
</SearchDiv>
|
</SearchDiv>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
{/* <SearchBaseForm
|
|
||||||
selectSidoData={code.cityCd}
|
|
||||||
selectSigunData={code.sggCd}
|
|
||||||
selectRegionData={code.rvbsnCd}
|
|
||||||
selectUnitWaterShedData={code.lgbsnCd}
|
|
||||||
selectMiddleRegionData={code.mdmbsnCd}
|
|
||||||
selectEnvPartData={code.lclgvrnmntCd}
|
|
||||||
rightChildren={
|
|
||||||
<Button
|
|
||||||
className={btnClass}
|
|
||||||
onClick={() => {
|
|
||||||
setIsChHead(true);
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
조회항목설정
|
|
||||||
</Button>
|
|
||||||
}
|
|
||||||
leftChildren={undefined}
|
|
||||||
queryClick={function (returnType: ReturnType): void {
|
|
||||||
// '{partValue: 'A', sidoValue: '0', sigunValue: '0', regionValue: '0', unitWaterShedValue: '0', …}'
|
|
||||||
let con;
|
|
||||||
if (returnType.sigunValue != "0") {
|
|
||||||
con = returnType.sigunValue;
|
|
||||||
} else {
|
|
||||||
con = returnType.sidoValue;
|
|
||||||
}
|
|
||||||
rainSttnSearch(1, "20", con, code.cityCd, code.sggCd);
|
|
||||||
}}
|
|
||||||
excelClick={excelClick}
|
|
||||||
initClick={function (): void { }}
|
|
||||||
btnClass={btnClass}
|
|
||||||
ref={ref}
|
|
||||||
isAdmin={false}
|
|
||||||
/> */}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="grid grid-cols-6 gap-4 ">
|
<div className="grid grid-cols-6 gap-4 ">
|
||||||
|
|||||||
@@ -5,23 +5,31 @@ import type { chgBuilding } from "@/app/store/ruseFcltMng/fcltReg/rainReg";
|
|||||||
import type { customRswtBdst } from "@/app/store/ruseFcltMng/fcltReg/rswtReg";
|
import type { customRswtBdst } from "@/app/store/ruseFcltMng/fcltReg/rswtReg";
|
||||||
import {
|
import {
|
||||||
excelDownload,
|
excelDownload,
|
||||||
|
getCity,
|
||||||
getCityOrSgg,
|
getCityOrSgg,
|
||||||
tableData,
|
tableData,
|
||||||
} from "@/components/lib/func/commom";
|
} from "@/components/lib/func/commom";
|
||||||
import BdstChgModal from "@/components/ui/modal/fcltReg/bdstChgModal/bdstChgModal";
|
import BdstChgModal from "@/components/ui/modal/fcltReg/bdstChgModal/bdstChgModal";
|
||||||
|
import type { objSearchType } from "@/components/ui/modal/fcltReg/bdstRegModal/bdstRegModal";
|
||||||
import HeadChModal from "@/components/ui/modal/sttn/headChModal/headChModal";
|
import HeadChModal from "@/components/ui/modal/sttn/headChModal/headChModal";
|
||||||
import SttnDetailModal from "@/components/ui/modal/sttn/sttnDetailModal/sttnDetailModal";
|
import SttnDetailModal from "@/components/ui/modal/sttn/sttnDetailModal/sttnDetailModal";
|
||||||
import {
|
import {
|
||||||
ContentsDiv,
|
ContentsDiv,
|
||||||
SearchBaseForm,
|
SearchBaseForm,
|
||||||
|
SearchDiv,
|
||||||
|
SearchFormLeft,
|
||||||
|
SearchFormRight,
|
||||||
|
SearchInput,
|
||||||
|
SelectBox,
|
||||||
Title,
|
Title,
|
||||||
UiModal,
|
UiModal,
|
||||||
UiTable,
|
UiTable,
|
||||||
type ReturnType,
|
type ReturnType,
|
||||||
|
type SelectDataType,
|
||||||
} from "@common/business_components/ui";
|
} from "@common/business_components/ui";
|
||||||
import ListDiv from "@common/business_components/ui/list_div";
|
import ListDiv from "@common/business_components/ui/list_div";
|
||||||
import { HeadMakeColSpan } from "@common/business_components/ui/table/HeadMakeColSpan";
|
import { HeadMakeColSpan } from "@common/business_components/ui/table/HeadMakeColSpan";
|
||||||
import { Button } from "@common/components/ui";
|
import { Button, Label } from "@common/components/ui";
|
||||||
import { useCallback, useEffect, useRef, useState } from "react";
|
import { useCallback, useEffect, useRef, useState } from "react";
|
||||||
|
|
||||||
export default function RswtSttn() {
|
export default function RswtSttn() {
|
||||||
@@ -34,13 +42,14 @@ export default function RswtSttn() {
|
|||||||
const [isChHead, setIsChHead] = useState(false);
|
const [isChHead, setIsChHead] = useState(false);
|
||||||
const ref = useRef<ReturnType>({} as ReturnType);
|
const ref = useRef<ReturnType>({} as ReturnType);
|
||||||
const [bdstTable, setBdstTable] = useState<customRswtBdst[]>();
|
const [bdstTable, setBdstTable] = useState<customRswtBdst[]>();
|
||||||
|
const [selectSgg, setSelectSgg] = useState<SelectDataType[] | []>()
|
||||||
|
const [objSearch, setObjSearch] = useState<objSearchType>({ sgg: "", city: "" });
|
||||||
const [detailModal, setDetailModal] = useState<{ isOpen: boolean, data: customRswtBdst | undefined }>({ data: undefined, isOpen: false })
|
const [detailModal, setDetailModal] = useState<{ isOpen: boolean, data: customRswtBdst | undefined }>({ data: undefined, isOpen: false })
|
||||||
const [bdstChgProps, setBdstChgProps] = useState<{
|
const [bdstChgProps, setBdstChgProps] = useState<{
|
||||||
isOpen: boolean;
|
isOpen: boolean;
|
||||||
chBuilding: chgBuilding[];
|
chBuilding: chgBuilding[];
|
||||||
}>({ isOpen: false, chBuilding: [] });
|
}>({ isOpen: false, chBuilding: [] });
|
||||||
|
const [fcltNm, setFcltNm] = useState<string>("");
|
||||||
const codeCityOrSgg = getCityOrSgg(ref);
|
|
||||||
|
|
||||||
const cellClick = (index: number | undefined, headId: string) => {
|
const cellClick = (index: number | undefined, headId: string) => {
|
||||||
|
|
||||||
@@ -50,37 +59,67 @@ export default function RswtSttn() {
|
|||||||
if (
|
if (
|
||||||
bdstTable[index] &&
|
bdstTable[index] &&
|
||||||
bdstTable[index]?.chBuildingYn === 'Y'
|
bdstTable[index]?.chBuildingYn === 'Y'
|
||||||
|
|
||||||
) {
|
) {
|
||||||
|
|
||||||
setBdstChgProps({ isOpen: true, chBuilding: bdstTable[index].chgBuilding });
|
setBdstChgProps({ isOpen: true, chBuilding: bdstTable[index].chgBuilding });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const getSelCity = (val: string | number) => {
|
||||||
|
const cityValue = String(val);
|
||||||
|
|
||||||
|
if (cityValue === "0") {
|
||||||
|
setSelectSgg([]);
|
||||||
|
setObjSearch({ city: cityValue, sgg: "" });
|
||||||
|
} else {
|
||||||
|
const data = getCity(cityValue, code.sggCd);
|
||||||
|
setSelectSgg(data);
|
||||||
|
|
||||||
|
const firstSggVal = data.find(item => item.val === "0")?.val || (data[0]?.val ?? "");
|
||||||
|
setObjSearch({ city: cityValue, sgg: firstSggVal });
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const getSgg = (val: string | number) => {
|
||||||
|
setObjSearch({ ...objSearch, sgg: String(val) })
|
||||||
|
};
|
||||||
|
|
||||||
|
const getConValue = () => {
|
||||||
|
if (!objSearch.city || objSearch.city === "0") {
|
||||||
|
return "0";
|
||||||
|
}
|
||||||
|
if (objSearch.sgg && objSearch.sgg !== "0") {
|
||||||
|
return objSearch.sgg;
|
||||||
|
}
|
||||||
|
return objSearch.city;
|
||||||
|
};
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!rswtSttn.isInit) {
|
if (!rswtSttn.isInit) {
|
||||||
rswtSttnInit("0");
|
rswtSttnInit(1, "20", "0", fcltNm, code.cityCd, code.sggCd);
|
||||||
}
|
}
|
||||||
}, [rswtSttn.isInit, rswtSttnInit]);
|
}, [rswtSttn.isInit, rswtSttnInit]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (rswtSttnRes?.length > 0 && code.cityCd.length > 0) {
|
const data = tableData(rswtSttnRes, { code });
|
||||||
const data = tableData(rswtSttnRes, { code });
|
const chData = data
|
||||||
const chData = data
|
.map((item: customRswtBdst) => {
|
||||||
.map((item: customRswtBdst) => ({
|
return {
|
||||||
...item,
|
...item,
|
||||||
...item.reuseBuilding[0],
|
...item.reuseBuilding[0],
|
||||||
...item.reuseBuilding[0]?.rswtrObj,
|
...item.reuseBuilding[0]?.rswtrObj,
|
||||||
chBuildingYn: item?.chgBuilding[0]?.bdstChgNm !== null && item?.chgBuilding.length > 0 ? 'Y' : 'N'
|
chBuildingYn: item?.chgBuilding[0]?.bdstChgNm !== null && item?.chgBuilding.length > 0 ? 'Y' : 'N',
|
||||||
}))
|
instlCst: item.reuseBuilding[0]?.instlCst === -1 ? "확인불가" : item.reuseBuilding[0]?.instlCst,
|
||||||
.filter(
|
instlCstSprtAmt: item.reuseBuilding[0]?.instlCstSprtAmt === -1 ? "확인불가" : item.reuseBuilding[0]?.instlCstSprtAmt,
|
||||||
(item: customRswtBdst) =>
|
archArea : item?.archArea.split('.')[0]!=='-1'?item?.archArea.split('.')[0]:'확인불가'
|
||||||
item.reuseBuilding[0]?.rswtrObj !== undefined
|
}
|
||||||
);
|
})
|
||||||
|
.filter(
|
||||||
|
(item: customRswtBdst) =>
|
||||||
|
item.reuseBuilding[0]?.rswtrObj !== undefined
|
||||||
|
);
|
||||||
|
|
||||||
setBdstTable(chData);
|
setBdstTable(chData);
|
||||||
}
|
|
||||||
}, [code, rswtSttnRes]);
|
}, [code, rswtSttnRes]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@@ -95,16 +134,14 @@ export default function RswtSttn() {
|
|||||||
}
|
}
|
||||||
}, [rswtSttn.excelList]);
|
}, [rswtSttn.excelList]);
|
||||||
|
|
||||||
const excelClick = useCallback(
|
const excelClick = useCallback(() => {
|
||||||
(returnType: ReturnType) => {
|
// 최신 검색 조건 반영
|
||||||
if (codeCityOrSgg)
|
const con = getConValue();
|
||||||
rswtSttnSearch(1, "10000", codeCityOrSgg, code.cityCd, code.sggCd);
|
rswtSttnSearch(1, "10000", String(con), fcltNm, code.cityCd, code.sggCd);
|
||||||
},
|
}, [rswtSttnSearch, objSearch, code.cityCd, code.sggCd]);
|
||||||
[rswtSttnSearch, code.cityCd, code.sggCd, codeCityOrSgg]
|
|
||||||
);
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (codeCityOrSgg != null) rswtSttnSearch(pageNation, "20", codeCityOrSgg, code.cityCd, code.sggCd);
|
rswtSttnSearch(pageNation, "20", String(getConValue()), fcltNm, code.cityCd, code.sggCd);
|
||||||
}, [pageNation]);
|
}, [pageNation]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -113,38 +150,75 @@ export default function RswtSttn() {
|
|||||||
<div className="grid grid-cols-4 gap-4 ">
|
<div className="grid grid-cols-4 gap-4 ">
|
||||||
<div className="col-span-4">
|
<div className="col-span-4">
|
||||||
<Title title={"중수도시설 현황"} />
|
<Title title={"중수도시설 현황"} />
|
||||||
<SearchBaseForm
|
<SearchDiv>
|
||||||
selectSidoData={code.cityCd}
|
<SearchFormLeft>
|
||||||
selectSigunData={code.sggCd}
|
<div className="col-span-10 flex flex-row">
|
||||||
selectRegionData={code.rvbsnCd}
|
<SelectBox
|
||||||
selectUnitWaterShedData={code.lgbsnCd}
|
className="col-span-2 w-1/6 h-full text-2xl"
|
||||||
selectMiddleRegionData={code.mdmbsnCd}
|
label="시도"
|
||||||
selectEnvPartData={code.lclgvrnmntCd}
|
selectClass={""}
|
||||||
rightChildren={<Button
|
selectArray={code.cityCd}
|
||||||
className={btnClass}
|
onSelectValue={getSelCity}
|
||||||
onClick={() => {
|
/>
|
||||||
setIsChHead(true);
|
<SelectBox
|
||||||
} }
|
className="col-span-2 w-1/6 h-full text-2xl ml-4"
|
||||||
>
|
label="시군구"
|
||||||
조회항목설정
|
selectClass={""}
|
||||||
</Button>}
|
selectArray={selectSgg || []}
|
||||||
leftChildren={undefined}
|
value={objSearch.sgg} // value props 추가
|
||||||
queryClick={function (returnType: ReturnType): void {
|
onSelectValue={getSgg}
|
||||||
// '{partValue: 'A', sidoValue: '0', sigunValue: '0', regionValue: '0', unitWaterShedValue: '0', …}'
|
/>
|
||||||
if (codeCityOrSgg)
|
<div className="col-span-2 flex flex-row space-x-2">
|
||||||
rswtSttnSearch(1, "20", codeCityOrSgg, code.cityCd, code.sggCd);
|
<Label className="w-28 mt-2 text-xl text-gray-600">
|
||||||
} }
|
{"시설명"}
|
||||||
excelClick={excelClick}
|
</Label>
|
||||||
initClick={function (): void { } }
|
<SearchInput
|
||||||
btnClass={btnClass}
|
className={"w-full h-full text-2xl"}
|
||||||
ref={ref} isAdmin={false} />
|
label={""}
|
||||||
|
textValue={fcltNm || ""}
|
||||||
|
setText={setFcltNm}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</SearchFormLeft>
|
||||||
|
<SearchFormRight
|
||||||
|
className="w-2/12 mx-5 flex flex-col items-center justify-center space-x-2 ">
|
||||||
|
<div className="flex flex-row space-x-2 items-center">
|
||||||
|
<Button
|
||||||
|
size={"sm"}
|
||||||
|
onClick={() => {
|
||||||
|
const con = getConValue();
|
||||||
|
rswtSttnSearch(pageNation, "20", String(con), fcltNm, code.cityCd, code.sggCd);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
조회
|
||||||
|
</Button>
|
||||||
|
<Button
|
||||||
|
size={"sm"}
|
||||||
|
className={`${btnClass} green`}
|
||||||
|
onClick={excelClick}
|
||||||
|
>
|
||||||
|
다운로드
|
||||||
|
</Button>
|
||||||
|
<Button
|
||||||
|
size={"sm"}
|
||||||
|
className={btnClass}
|
||||||
|
onClick={() => {
|
||||||
|
setIsChHead(true);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
조회항목설정
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
|
</SearchFormRight>
|
||||||
|
</SearchDiv>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="grid grid-cols-6 gap-4 ">
|
<div className="grid grid-cols-6 gap-4 ">
|
||||||
<div className="col-span-6">
|
<div className="col-span-6">
|
||||||
<ListDiv>
|
<ListDiv>
|
||||||
<UiTable
|
<UiTable
|
||||||
headName={[]}
|
headName={undefined}
|
||||||
tableData={bdstTable || []}
|
tableData={bdstTable || []}
|
||||||
children={
|
children={
|
||||||
<HeadMakeColSpan upHeadList={rswtSttn.rswtSttNodeList} />
|
<HeadMakeColSpan upHeadList={rswtSttn.rswtSttNodeList} />
|
||||||
|
|||||||
@@ -79,7 +79,8 @@ export default function Page() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
const rainPageChange = (pageNo: number) => {
|
|
||||||
|
const rainPageChange = (pageNo: number) => {
|
||||||
if (pageNo > 0) {
|
if (pageNo > 0) {
|
||||||
setRainPageNation(pageNo);
|
setRainPageNation(pageNo);
|
||||||
rainChkSttnInit(pageNo, rainPageSize, searchYear, commonCd);
|
rainChkSttnInit(pageNo, rainPageSize, searchYear, commonCd);
|
||||||
@@ -96,6 +97,7 @@ const rainPageChange = (pageNo: number) => {
|
|||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!rainChkSttn.isInit) {
|
if (!rainChkSttn.isInit) {
|
||||||
isRainSttn(true)
|
isRainSttn(true)
|
||||||
|
console.log("여기", rainPageSize)
|
||||||
rainChkSttnInit(1, rainPageSize, new Date().getFullYear().toString(), commonCd);
|
rainChkSttnInit(1, rainPageSize, new Date().getFullYear().toString(), commonCd);
|
||||||
setIsModal({ data: {}, open: false });
|
setIsModal({ data: {}, open: false });
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,16 +45,15 @@ const rainChk: rainChkZodType[] = [];
|
|||||||
export type rainChkgdnState = {
|
export type rainChkgdnState = {
|
||||||
rainChkgdn: {
|
rainChkgdn: {
|
||||||
rainChkgdnHeadList: TableUpperProps[];
|
rainChkgdnHeadList: TableUpperProps[];
|
||||||
rainSplHeadNm:chHeadType[]
|
rainSplHeadNm: chHeadType[]
|
||||||
rainRuseHeadNm:chHeadType[]
|
rainRuseHeadNm: chHeadType[]
|
||||||
rainChk: rainChkZodType[];
|
rainChk: rainChkZodType[];
|
||||||
rainHeadNm: chHeadType[];
|
|
||||||
ruseHeadList: TableUpperProps[];
|
ruseHeadList: TableUpperProps[];
|
||||||
splHeadList: TableUpperProps[];
|
splHeadList: TableUpperProps[];
|
||||||
isInit: boolean;
|
isInit: boolean;
|
||||||
isModalClose: boolean;
|
isModalClose: boolean;
|
||||||
fcltDiv: SelectDataType[];
|
fcltDiv: SelectDataType[];
|
||||||
rainMainHeadNm:chHeadType[]
|
rainMainHeadNm: chHeadType[]
|
||||||
excelList: [];
|
excelList: [];
|
||||||
isSttn: boolean;
|
isSttn: boolean;
|
||||||
rainChkCount: number;
|
rainChkCount: number;
|
||||||
@@ -93,8 +92,8 @@ export const rainChkgdnStateExport: rainChkgdnState = {
|
|||||||
rainChkgdn: {
|
rainChkgdn: {
|
||||||
rainChkgdnHeadList: rainChkgdnHeadList,
|
rainChkgdnHeadList: rainChkgdnHeadList,
|
||||||
rainRuseHeadNm: rainRuseHeadNm,
|
rainRuseHeadNm: rainRuseHeadNm,
|
||||||
rainSplHeadNm:rainSplHeadNm,
|
rainSplHeadNm: rainSplHeadNm,
|
||||||
rainMainHeadNm:rainMainHeadNm,
|
rainMainHeadNm: rainMainHeadNm,
|
||||||
rainChk: rainChk,
|
rainChk: rainChk,
|
||||||
splHeadList: splHeadList,
|
splHeadList: splHeadList,
|
||||||
ruseHeadList: ruseHeadList,
|
ruseHeadList: ruseHeadList,
|
||||||
@@ -136,10 +135,10 @@ const initFetch = async (
|
|||||||
const rainRes = await getFetchWithCount(
|
const rainRes = await getFetchWithCount(
|
||||||
"wr",
|
"wr",
|
||||||
`/reuseChk/rainy` +
|
`/reuseChk/rainy` +
|
||||||
(pageNo ? `/${pageNo}` : "/1") +
|
(pageNo ? `/${pageNo}` : "/1") +
|
||||||
(cnt ? `/${cnt}` : "/10") +
|
(cnt ? `/${cnt}` : "/10") +
|
||||||
(year ? `/${year}` : `/${currentYear}`) +
|
(year ? `/${year}` : `/${currentYear}`) +
|
||||||
(sgg ? `/${sgg}` : "/0")
|
(sgg ? `/${sgg}` : "/0")
|
||||||
);
|
);
|
||||||
|
|
||||||
return rainRes;
|
return rainRes;
|
||||||
@@ -204,7 +203,7 @@ export const rainChkgdnActionsExport: (set: any) => rainChkgdnActions = (
|
|||||||
year: string,
|
year: string,
|
||||||
sggCd: string
|
sggCd: string
|
||||||
) => {
|
) => {
|
||||||
set((state: rainChkgdnType) => ({ rainChkgdn: { ...state.rainChkgdn, isLoading: true } }));
|
// set((state: rainChkgdnType) => ({ rainChkgdn: { ...state.rainChkgdn, isLoading: true } }));
|
||||||
try {
|
try {
|
||||||
const rainChkRes = await initFetch(pageNo, cnt, year, sggCd);
|
const rainChkRes = await initFetch(pageNo, cnt, year, sggCd);
|
||||||
set((state: rainChkgdnState) => ({
|
set((state: rainChkgdnState) => ({
|
||||||
@@ -213,17 +212,17 @@ export const rainChkgdnActionsExport: (set: any) => rainChkgdnActions = (
|
|||||||
...state.rainChkgdn,
|
...state.rainChkgdn,
|
||||||
rainChk: rainChkRes.data,
|
rainChk: rainChkRes.data,
|
||||||
rainChkCount: rainChkRes.count,
|
rainChkCount: rainChkRes.count,
|
||||||
isInit: true, // 무한 루프 방지를 위해 isInit을 true로 설정
|
isInit: false, // 무한 루프 방지를 위해 isInit을 true로 설정
|
||||||
},
|
},
|
||||||
}));
|
}));
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(error);
|
console.log(error);
|
||||||
// 에러가 발생하더라도 무한 루프에 빠지지 않도록 isInit을 true로 설정합니다.
|
// 에러가 발생하더라도 무한 루프에 빠지지 않도록 isInit을 true로 설정합니다.
|
||||||
set((state: rainChkgdnType) => ({
|
// set((state: rainChkgdnType) => ({
|
||||||
rainChkgdn: { ...state.rainChkgdn, isInit: true },
|
// rainChkgdn: { ...state.rainChkgdn, isInit: true },
|
||||||
}));
|
// }));
|
||||||
} finally {
|
} finally {
|
||||||
set((state: rainChkgdnType) => ({ rainChkgdn: { ...state.rainChkgdn, isLoading: false } }));
|
// set((state: rainChkgdnType) => ({ rainChkgdn: { ...state.rainChkgdn, isLoading: false } }));
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
rainChkNmSearch: async (
|
rainChkNmSearch: async (
|
||||||
@@ -238,11 +237,11 @@ export const rainChkgdnActionsExport: (set: any) => rainChkgdnActions = (
|
|||||||
const rainChkRes = await getFetchWithCount(
|
const rainChkRes = await getFetchWithCount(
|
||||||
"wr",
|
"wr",
|
||||||
`/reuseChk/rainy` +
|
`/reuseChk/rainy` +
|
||||||
(pageNo ? `/${pageNo}` : "/1") +
|
(pageNo ? `/${pageNo}` : "/1") +
|
||||||
(cnt ? `/${cnt}` : "/10") +
|
(cnt ? `/${cnt}` : "/10") +
|
||||||
(year ? `/${year}` : `/${currentYear}`) +
|
(year ? `/${year}` : `/${currentYear}`) +
|
||||||
(sggCd ? `/${sggCd}` : "/0") +
|
(sggCd ? `/${sggCd}` : "/0") +
|
||||||
(txt ? `/${txt}` : "")
|
(txt ? `/${txt}` : "")
|
||||||
);
|
);
|
||||||
return set((state: rainChkgdnState) => ({
|
return set((state: rainChkgdnState) => ({
|
||||||
...state,
|
...state,
|
||||||
|
|||||||
@@ -185,10 +185,12 @@ export const rswtChkgdnActionsExport: (set: any) => rswtChkgdnActions = (
|
|||||||
year: string,
|
year: string,
|
||||||
sggCd: string
|
sggCd: string
|
||||||
) => {
|
) => {
|
||||||
set((state: rswtChkgdnType) => ({ rswtChkgdn: { ...state.rswtChkgdn, isLoading: true } }));
|
// set((state: rswtChkgdnType) => ({ rswtChkgdn: { ...state.rswtChkgdn, isLoading: true } }));
|
||||||
try {
|
try {
|
||||||
const rswtChkRes = await initFetch(pageNo, cnt, year, sggCd);
|
const rswtChkRes = await initFetch(pageNo, cnt, year, sggCd);
|
||||||
|
|
||||||
|
console.log("rswtChkRes", rswtChkRes)
|
||||||
|
|
||||||
set((state: rswtChkgdnState) => ({
|
set((state: rswtChkgdnState) => ({
|
||||||
...state,
|
...state,
|
||||||
rswtChkgdn: {
|
rswtChkgdn: {
|
||||||
@@ -199,12 +201,12 @@ export const rswtChkgdnActionsExport: (set: any) => rswtChkgdnActions = (
|
|||||||
},
|
},
|
||||||
}));
|
}));
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(error);
|
// console.log(error);
|
||||||
set((state: rswtChkgdnType) => ({
|
// set((state: rswtChkgdnType) => ({
|
||||||
rswtChkgdn: { ...state.rswtChkgdn, isInit: true },
|
// rswtChkgdn: { ...state.rswtChkgdn, isInit: true },
|
||||||
}));
|
// }));
|
||||||
} finally {
|
} finally {
|
||||||
set((state: rswtChkgdnType) => ({ rswtChkgdn: { ...state.rswtChkgdn, isLoading: false } }));
|
// set((state: rswtChkgdnType) => ({ rswtChkgdn: { ...state.rswtChkgdn, isLoading: false } }));
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
rswtChkNmSearch: async (
|
rswtChkNmSearch: async (
|
||||||
@@ -215,6 +217,7 @@ export const rswtChkgdnActionsExport: (set: any) => rswtChkgdnActions = (
|
|||||||
txt: string
|
txt: string
|
||||||
) => {
|
) => {
|
||||||
try {
|
try {
|
||||||
|
console.log("여기")
|
||||||
const currentYear = new Date().getFullYear().toString();
|
const currentYear = new Date().getFullYear().toString();
|
||||||
const rswtChkRes = await getFetchWithCount(
|
const rswtChkRes = await getFetchWithCount(
|
||||||
"wr",
|
"wr",
|
||||||
@@ -232,7 +235,7 @@ export const rswtChkgdnActionsExport: (set: any) => rswtChkgdnActions = (
|
|||||||
...state.rswtChkgdn,
|
...state.rswtChkgdn,
|
||||||
rswtChkRes: rswtChkRes.data,
|
rswtChkRes: rswtChkRes.data,
|
||||||
rswtChkCount: rswtChkRes.count,
|
rswtChkCount: rswtChkRes.count,
|
||||||
isInit: false,
|
// isInit: false,
|
||||||
},
|
},
|
||||||
}));
|
}));
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|||||||
@@ -22,10 +22,10 @@ export type rainChkSttnState = {
|
|||||||
rainChkRes: rainChkZodType[];
|
rainChkRes: rainChkZodType[];
|
||||||
fcltDiv: SelectDataType[];
|
fcltDiv: SelectDataType[];
|
||||||
rainChkgdnHeadList: TableUpperProps[];
|
rainChkgdnHeadList: TableUpperProps[];
|
||||||
rainHeadNm:chHeadType[];
|
rainHeadNm: chHeadType[];
|
||||||
ruseHeadList: TableUpperProps[];
|
ruseHeadList: TableUpperProps[];
|
||||||
splHeadList: TableUpperProps[];
|
splHeadList: TableUpperProps[];
|
||||||
sttnExcelList:[]
|
sttnExcelList: []
|
||||||
isInit: boolean;
|
isInit: boolean;
|
||||||
isSttn: boolean;
|
isSttn: boolean;
|
||||||
rainChkCount: number;
|
rainChkCount: number;
|
||||||
@@ -48,7 +48,7 @@ export const rainChkSttnStateExport: rainChkSttnState = {
|
|||||||
rainChkgdnHeadList: rainChkgdnHeadList,
|
rainChkgdnHeadList: rainChkgdnHeadList,
|
||||||
ruseHeadList: ruseHeadList,
|
ruseHeadList: ruseHeadList,
|
||||||
splHeadList: splHeadList,
|
splHeadList: splHeadList,
|
||||||
rainHeadNm:rainHeadNm,
|
rainHeadNm: rainHeadNm,
|
||||||
isInit: false,
|
isInit: false,
|
||||||
sttnExcelList: [],
|
sttnExcelList: [],
|
||||||
isSttn: false,
|
isSttn: false,
|
||||||
@@ -125,13 +125,13 @@ export const rainChkSttnActionsExport: (set: any) => rainChkSttnActions = (
|
|||||||
...state,
|
...state,
|
||||||
rainChkSttn: {
|
rainChkSttn: {
|
||||||
...state.rainChkSttn,
|
...state.rainChkSttn,
|
||||||
isSttn:isSttn
|
isSttn: isSttn
|
||||||
},
|
},
|
||||||
}));
|
}));
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(error);
|
console.log(error);
|
||||||
}
|
}
|
||||||
},getRainSttnExcel: async (excelList:rainChkZodType[]) => {
|
}, getRainSttnExcel: async (excelList: rainChkZodType[]) => {
|
||||||
try {
|
try {
|
||||||
|
|
||||||
const excelData = buildingExcelRainSttn(excelList)
|
const excelData = buildingExcelRainSttn(excelList)
|
||||||
@@ -140,7 +140,7 @@ export const rainChkSttnActionsExport: (set: any) => rainChkSttnActions = (
|
|||||||
...state,
|
...state,
|
||||||
rainChkSttn: {
|
rainChkSttn: {
|
||||||
...state.rainChkSttn,
|
...state.rainChkSttn,
|
||||||
sttnExcelList:excelData
|
sttnExcelList: excelData
|
||||||
},
|
},
|
||||||
}));
|
}));
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|||||||
@@ -20,11 +20,12 @@ export type rswtChkSttnState = {
|
|||||||
rswtChkRes: rswtChkZodType[];
|
rswtChkRes: rswtChkZodType[];
|
||||||
isInit: boolean;
|
isInit: boolean;
|
||||||
isSttn: boolean;
|
isSttn: boolean;
|
||||||
|
rswtChkCount: number;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
type rswtChkSttnActions = {
|
type rswtChkSttnActions = {
|
||||||
rswtChkSttnInit: (searchTxt: string, sggCd: string) => void;
|
rswtChkSttnInit: (pageNo: number, cnt: number, searchTxt: string, sggCd: string) => void;
|
||||||
isRswtSttn: (isSttn: boolean) => void;
|
isRswtSttn: (isSttn: boolean) => void;
|
||||||
getRswtSttnExcel: (excelList: rswtChkZodType[]) => void;
|
getRswtSttnExcel: (excelList: rswtChkZodType[]) => void;
|
||||||
rswtChkNmSttnSearch: (pageNo: number, cnt: number, year: string, sggCd: string, txt: string) => void;
|
rswtChkNmSttnSearch: (pageNo: number, cnt: number, year: string, sggCd: string, txt: string) => void;
|
||||||
@@ -41,33 +42,36 @@ export const rswtChkStateExport: rswtChkSttnState = {
|
|||||||
rswtChkRes: [],
|
rswtChkRes: [],
|
||||||
isInit: false,
|
isInit: false,
|
||||||
isSttn: false,
|
isSttn: false,
|
||||||
|
rswtChkCount: 1,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
const initFetch = async (year: string | undefined, sgg: string | undefined) => {
|
const initFetch = async (pageNo: number, cnt: number, year: string | undefined, sgg: string | undefined) => {
|
||||||
const currentYear = new Date().getFullYear().toString();
|
const currentYear = new Date().getFullYear().toString();
|
||||||
const rswtChkRes = await getFetch(
|
const rswtChkRes = await getFetchWithCount(
|
||||||
"wr",
|
"wr",
|
||||||
`/reuseChk/reuseWater/` +
|
`/reuseChk/reuseWater` +
|
||||||
(year ? `${year}` : currentYear) +
|
(pageNo ? `/${pageNo}` : "/1") +
|
||||||
|
(cnt ? `/${cnt}` : "/20") +
|
||||||
|
(year ? `/${year}` : `/${currentYear}`) +
|
||||||
(sgg ? `/${sgg}` : "/0")
|
(sgg ? `/${sgg}` : "/0")
|
||||||
);
|
);
|
||||||
return rswtChkRes;
|
return rswtChkRes;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
export const rswtChkSttnActionsExport: (set: any) => rswtChkSttnActions = (
|
export const rswtChkSttnActionsExport: (set: any) => rswtChkSttnActions = (
|
||||||
set: any
|
set: any
|
||||||
) => {
|
) => {
|
||||||
return {
|
return {
|
||||||
rswtChkSttnInit: async (searchTxt: string, sggCd: string) => {
|
rswtChkSttnInit: async (pageNo: number, cnt: number, searchTxt: string, sggCd: string) => {
|
||||||
try {
|
try {
|
||||||
const rswtChkRes = await initFetch(searchTxt, sggCd);
|
const rswtChkRes = await initFetch(pageNo, cnt, searchTxt, sggCd);
|
||||||
return set((state: rswtChkSttnState) => ({
|
return set((state: rswtChkSttnState) => ({
|
||||||
...state,
|
...state,
|
||||||
rswtChkSttn: {
|
rswtChkSttn: {
|
||||||
...state.rswtChkSttn,
|
...state.rswtChkSttn,
|
||||||
rswtChkRes: rswtChkRes,
|
rswtChkRes: rswtChkRes.data,
|
||||||
|
rswtChkCount: rswtChkRes.count,
|
||||||
isInit: false,
|
isInit: false,
|
||||||
},
|
},
|
||||||
}));
|
}));
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import type { z } from "zod";
|
|||||||
import { controlHeadView } from "../rainSttn";
|
import { controlHeadView } from "../rainSttn";
|
||||||
import type { customHtdflBdst } from "../../fcltReg/htdflReg";
|
import type { customHtdflBdst } from "../../fcltReg/htdflReg";
|
||||||
import { fetchType, getFetch } from "@/components/lib/api";
|
import { fetchType, getFetch } from "@/components/lib/api";
|
||||||
|
import type { SelectDataType } from "@common/business_components/ui";
|
||||||
|
|
||||||
const htdflSttHeadList = htdflSttHeadListExport;
|
const htdflSttHeadList = htdflSttHeadListExport;
|
||||||
const htdflSttNodeList = htdflSttNodeListExport;
|
const htdflSttNodeList = htdflSttNodeListExport;
|
||||||
@@ -20,8 +21,12 @@ export type htdflSttnState = {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
type htdflSttnActions = {
|
type htdflSttnActions = {
|
||||||
initHtdfl: (con: string) => void;
|
initHtdfl: (page: number, total: string, con: string, txt: string,
|
||||||
htdflSttnSearch: (page: number, total: string, con: string) => void;
|
sidoCode: SelectDataType[],
|
||||||
|
sggCode: SelectDataType[]) => void;
|
||||||
|
htdflSttnSearch: (page: number, total: string, con: string, txt: string,
|
||||||
|
sidoCode: SelectDataType[],
|
||||||
|
sggCode: SelectDataType[]) => void;
|
||||||
htdflChSttnHead: (
|
htdflChSttnHead: (
|
||||||
headList: z.infer<typeof sttnHeadListType>,
|
headList: z.infer<typeof sttnHeadListType>,
|
||||||
) => void;
|
) => void;
|
||||||
@@ -38,10 +43,17 @@ export const htdflSttnStateExport: htdflSttnState = {
|
|||||||
isInit: false,
|
isInit: false,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
const initFetch = async (code: string | number) => {
|
const initFetch = async (page: number, total: string, con: string, txt: string,
|
||||||
|
sidoCode: SelectDataType[],
|
||||||
|
sggCode: SelectDataType[]) => {
|
||||||
const htdflRes = await getFetch(
|
const htdflRes = await getFetch(
|
||||||
"wr",
|
"wr",
|
||||||
`/drain/facilityList/1/20/${code}`)
|
`/drain/facilityList` +
|
||||||
|
(page ? `/${page}` : "/1") +
|
||||||
|
(total ? `/${total}` : "/20") +
|
||||||
|
(con ? `/${con}` : "/0") +
|
||||||
|
(txt ? `/${txt}` : "")
|
||||||
|
);
|
||||||
|
|
||||||
return htdflRes;
|
return htdflRes;
|
||||||
};
|
};
|
||||||
@@ -50,9 +62,11 @@ export const htdflSttnActionsExport: (set: any) => htdflSttnActions = (
|
|||||||
set: any
|
set: any
|
||||||
) => {
|
) => {
|
||||||
return {
|
return {
|
||||||
initHtdfl: async (code: string | number) => {
|
initHtdfl: async (page: number, total: string, con: string, txt: string,
|
||||||
|
sidoCode: SelectDataType[],
|
||||||
|
sggCode: SelectDataType[]) => {
|
||||||
try {
|
try {
|
||||||
const htdflSttnRes = await initFetch(code);
|
const htdflSttnRes = await initFetch(page, total, con, txt, sidoCode, sggCode);
|
||||||
set((state: htdflSttnState) => {
|
set((state: htdflSttnState) => {
|
||||||
return {
|
return {
|
||||||
...state,
|
...state,
|
||||||
@@ -67,17 +81,22 @@ export const htdflSttnActionsExport: (set: any) => htdflSttnActions = (
|
|||||||
console.log(error);
|
console.log(error);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
htdflSttnSearch: async (page: number, total: string, con: string) => {
|
htdflSttnSearch: async (page: number, total: string, con: string, txt: string,
|
||||||
|
sidoCode: SelectDataType[],
|
||||||
|
sggCode: SelectDataType[]) => {
|
||||||
try {
|
try {
|
||||||
|
console.log("page", page)
|
||||||
const htdflSttnRes = await getFetch(
|
const htdflSttnRes = await getFetch(
|
||||||
fetchType.WR,
|
fetchType.WR,
|
||||||
`/drain/facilityList/${page}/${total}/${con}`
|
`/drain/facilityList` +
|
||||||
|
(page ? `/${page}` : "/1") +
|
||||||
|
(total ? `/${total}` : "/20") +
|
||||||
|
(con ? `/${con}` : "/0") +
|
||||||
|
(txt ? `/${txt}` : "")
|
||||||
);
|
);
|
||||||
|
|
||||||
if (Number(total) > 9000) {
|
if (Number(total) > 9000) {
|
||||||
|
|
||||||
|
|
||||||
set((state: htdflSttnState) => {
|
set((state: htdflSttnState) => {
|
||||||
|
|
||||||
return {
|
return {
|
||||||
...state,
|
...state,
|
||||||
htdflSttn: {
|
htdflSttn: {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import type { rainChkZodType } from "@/app/store/prfmncReg/chkgdnReg/rainChkgdn";
|
import type { rainChkZodType } from "@/app/store/prfmncReg/chkgdnReg/rainChkgdn";
|
||||||
import { fetchType, getFetch } from "@/components/lib/api";
|
import { fetchType, getFetch } from "@/components/lib/api";
|
||||||
import {
|
import {
|
||||||
type customRainBdst,
|
type customRainBdst,
|
||||||
@@ -22,28 +22,28 @@ const rainSttnDetailNodeList = rainSttnDetailNodeListExport;
|
|||||||
const rainSttnDetailHeadList = rainSttnDetailHeadListExport;
|
const rainSttnDetailHeadList = rainSttnDetailHeadListExport;
|
||||||
|
|
||||||
const rainSttnRes: customRainBdst[] = [];
|
const rainSttnRes: customRainBdst[] = [];
|
||||||
const rainChkRes : rainChkZodType ={} as rainChkZodType
|
const rainChkRes: rainChkZodType = {} as rainChkZodType
|
||||||
|
|
||||||
|
|
||||||
const visibleHeadList = (falseHeads:CommonTableProps[], orgNodeList:CommonTableProps[])=>{
|
const visibleHeadList = (falseHeads: CommonTableProps[], orgNodeList: CommonTableProps[]) => {
|
||||||
const visibleHeads = orgNodeList.map((node) => {
|
const visibleHeads = orgNodeList.map((node) => {
|
||||||
const copyNode = {...node}
|
const copyNode = { ...node }
|
||||||
falseHeads.forEach((head)=>{
|
falseHeads.forEach((head) => {
|
||||||
if(copyNode.id ===head.id)
|
if (copyNode.id === head.id)
|
||||||
copyNode.visible = head.visible
|
copyNode.visible = head.visible
|
||||||
})
|
})
|
||||||
return copyNode;
|
return copyNode;
|
||||||
})
|
})
|
||||||
return visibleHeads
|
return visibleHeads
|
||||||
}
|
}
|
||||||
|
|
||||||
const getColspanReductionMap = (falseHeads:CommonTableProps[], orgList:CommonTableProps[]):Record<string, number> => {
|
const getColspanReductionMap = (falseHeads: CommonTableProps[], orgList: CommonTableProps[]): Record<string, number> => {
|
||||||
const reduceMap:Record<string, number> = {};
|
const reduceMap: Record<string, number> = {};
|
||||||
falseHeads.forEach(head => {
|
falseHeads.forEach(head => {
|
||||||
const node = orgList.find(n => n.id === head.id);
|
const node = orgList.find(n => n.id === head.id);
|
||||||
if (node?.upName) {
|
if (node?.upName) {
|
||||||
reduceMap[node.upName] = (reduceMap[node.upName] || 0) + 1;
|
reduceMap[node.upName] = (reduceMap[node.upName] || 0) + 1;
|
||||||
if (node.row&& node.row >= 3) {
|
if (node.row && node.row >= 3) {
|
||||||
const upperUpName = orgList.find(n => n.id === node.upName)?.upName;
|
const upperUpName = orgList.find(n => n.id === node.upName)?.upName;
|
||||||
if (upperUpName) {
|
if (upperUpName) {
|
||||||
reduceMap[upperUpName] = (reduceMap[upperUpName] || 0) + 1;
|
reduceMap[upperUpName] = (reduceMap[upperUpName] || 0) + 1;
|
||||||
@@ -78,35 +78,37 @@ const applyColspanReduction = (
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
// 일단 헤더가 3개 이상인경우 visible 처리를 위해서 공통함수로 작업
|
// 일단 헤더가 3개 이상인경우 visible 처리를 위해서 공통함수로 작업
|
||||||
export const controlHeadView = (headList:CommonTableProps[], orgNodeList:CommonTableProps[] ) =>{
|
export const controlHeadView = (headList: CommonTableProps[], orgNodeList: CommonTableProps[]) => {
|
||||||
const falseHeads = headList.filter((item) => item.visible == false);
|
const falseHeads = headList.filter((item) => item.visible == false);
|
||||||
|
|
||||||
const viewHeadList = visibleHeadList(falseHeads, orgNodeList)
|
const viewHeadList = visibleHeadList(falseHeads, orgNodeList)
|
||||||
const reduceMap= getColspanReductionMap( falseHeads,viewHeadList)
|
const reduceMap = getColspanReductionMap(falseHeads, viewHeadList)
|
||||||
return applyColspanReduction(viewHeadList,reduceMap);
|
return applyColspanReduction(viewHeadList, reduceMap);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
export type rainSttnState = {
|
export type rainSttnState = {
|
||||||
rainSttn: {
|
rainSttn: {
|
||||||
rainSttnRes: customRainBdst[];
|
rainSttnRes: customRainBdst[];
|
||||||
rainSttHeadList: CommonTableProps[];
|
rainSttHeadList: CommonTableProps[];
|
||||||
rainSttNodeList: CommonTableProps[];
|
rainSttNodeList: CommonTableProps[];
|
||||||
rainSttnDetailHeadList:CommonTableProps[]
|
rainSttnDetailHeadList: CommonTableProps[]
|
||||||
rainSttnDetailNodeList:CommonTableProps[]
|
rainSttnDetailNodeList: CommonTableProps[]
|
||||||
rainChkRes:rainChkZodType
|
rainChkRes: rainChkZodType
|
||||||
excelList: [];
|
excelList: [];
|
||||||
isInit: boolean;
|
isInit: boolean;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
type rainSttnActions = {
|
type rainSttnActions = {
|
||||||
rainSttnInit:(con:string) => void
|
rainSttnInit: (page: number, total: string, con: string, txt: string,
|
||||||
rainSttnSearch: (page: number, total: string, con: string, sidoCode: SelectDataType[], sggCode: SelectDataType[]) => void;
|
sidoCode: SelectDataType[],
|
||||||
|
sggCode: SelectDataType[]) => void
|
||||||
|
rainSttnSearch: (page: number, total: string, con: string, txt: string,
|
||||||
|
sidoCode: SelectDataType[],
|
||||||
|
sggCode: SelectDataType[]) => void;
|
||||||
rainChSttnHead: (
|
rainChSttnHead: (
|
||||||
headList: z.infer<typeof sttnHeadListType>,
|
headList: z.infer<typeof sttnHeadListType>,
|
||||||
) => void;
|
) => void;
|
||||||
rainSttnChkSearch:(rusePk:string) => void;
|
rainSttnChkSearch: (rusePk: string) => void;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type rainSttnType = rainSttnState & rainSttnActions;
|
export type rainSttnType = rainSttnState & rainSttnActions;
|
||||||
@@ -115,10 +117,10 @@ export const rainSttnStateExport: rainSttnState = {
|
|||||||
rainSttn: {
|
rainSttn: {
|
||||||
rainSttHeadList: rainSttHeadList,
|
rainSttHeadList: rainSttHeadList,
|
||||||
rainSttNodeList: rainSttNodeList,
|
rainSttNodeList: rainSttNodeList,
|
||||||
rainSttnDetailHeadList:rainSttnDetailHeadList,
|
rainSttnDetailHeadList: rainSttnDetailHeadList,
|
||||||
rainSttnDetailNodeList:rainSttnDetailNodeList,
|
rainSttnDetailNodeList: rainSttnDetailNodeList,
|
||||||
rainSttnRes: rainSttnRes,
|
rainSttnRes: rainSttnRes,
|
||||||
rainChkRes:rainChkRes,
|
rainChkRes: rainChkRes,
|
||||||
excelList: [],
|
excelList: [],
|
||||||
isInit: false,
|
isInit: false,
|
||||||
},
|
},
|
||||||
@@ -128,12 +130,18 @@ export const rainSttnActionsExport: (set: any) => rainSttnActions = (
|
|||||||
set: any
|
set: any
|
||||||
) => {
|
) => {
|
||||||
return {
|
return {
|
||||||
rainSttnInit: async( con:string)=>{
|
rainSttnInit: async (page: number, total: string, con: string, txt: string,
|
||||||
try{
|
sidoCode: SelectDataType[],
|
||||||
|
sggCode: SelectDataType[]) => {
|
||||||
|
try {
|
||||||
|
|
||||||
const rainSttnRes = await getFetch(
|
const rainSttnRes = await getFetch(
|
||||||
fetchType.WR,
|
fetchType.WR,
|
||||||
`/reuseFc/rainyInfoList/1/20/${con}`
|
`/reuseFc/rainyInfoList` +
|
||||||
|
(page ? `/${page}` : "/1") +
|
||||||
|
(total ? `/${total}` : "/20") +
|
||||||
|
(con ? `/${con}` : "/0") +
|
||||||
|
(txt ? `/${txt}` : "")
|
||||||
);
|
);
|
||||||
set((state: rainSttnState) => {
|
set((state: rainSttnState) => {
|
||||||
return {
|
return {
|
||||||
@@ -145,21 +153,22 @@ export const rainSttnActionsExport: (set: any) => rainSttnActions = (
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
}catch(e){
|
} catch (e) {
|
||||||
console.log(e)
|
console.log(e)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
rainSttnSearch: async (page: number, total: string, con: string,
|
rainSttnSearch: async (page: number, total: string, con: string, txt: string,
|
||||||
sidoCode: SelectDataType[],
|
sidoCode: SelectDataType[],
|
||||||
sggCode: SelectDataType[]) => {
|
sggCode: SelectDataType[]) => {
|
||||||
try {
|
try {
|
||||||
let a = `/reuseFc/rainyInfoList/${page}/${total}/${con}`
|
|
||||||
console.log("주소", a)
|
|
||||||
const rainSttnRes = await getFetch(
|
const rainSttnRes = await getFetch(
|
||||||
fetchType.WR,
|
fetchType.WR,
|
||||||
`/reuseFc/rainyInfoList/${page}/${total}/${con}`
|
`/reuseFc/rainyInfoList` +
|
||||||
|
(page ? `/${page}` : "/1") +
|
||||||
|
(total ? `/${total}` : "/20") +
|
||||||
|
(con ? `/${con}` : "/0") +
|
||||||
|
(txt ? `/${txt}` : "")
|
||||||
);
|
);
|
||||||
console.log("rainSttnRes", rainSttnRes)
|
|
||||||
if (Number(total) > 9000) {
|
if (Number(total) > 9000) {
|
||||||
const rainExcel = excelRainSttnParsing(rainSttnRes, sidoCode, sggCode);
|
const rainExcel = excelRainSttnParsing(rainSttnRes, sidoCode, sggCode);
|
||||||
set((state: rainSttnState) => {
|
set((state: rainSttnState) => {
|
||||||
@@ -189,7 +198,7 @@ export const rainSttnActionsExport: (set: any) => rainSttnActions = (
|
|||||||
rainChSttnHead: async (
|
rainChSttnHead: async (
|
||||||
headList: z.infer<typeof sttnHeadListType>
|
headList: z.infer<typeof sttnHeadListType>
|
||||||
) => {
|
) => {
|
||||||
const changeNodeList= controlHeadView(headList,rainSttNodeList)
|
const changeNodeList = controlHeadView(headList, rainSttNodeList)
|
||||||
|
|
||||||
return set((state: rainSttnState) => ({
|
return set((state: rainSttnState) => ({
|
||||||
rainSttn: {
|
rainSttn: {
|
||||||
@@ -199,21 +208,21 @@ export const rainSttnActionsExport: (set: any) => rainSttnActions = (
|
|||||||
},
|
},
|
||||||
}));
|
}));
|
||||||
},
|
},
|
||||||
rainSttnChkSearch: async(
|
rainSttnChkSearch: async (
|
||||||
rusePk:string
|
rusePk: string
|
||||||
)=>{
|
) => {
|
||||||
const rainChkRes = await getFetch(
|
const rainChkRes = await getFetch(
|
||||||
fetchType.WR,
|
fetchType.WR,
|
||||||
`/reuseChk/rainy/${rusePk}`
|
`/reuseChk/rainy/${rusePk}`
|
||||||
);
|
);
|
||||||
|
|
||||||
return set((state: rainSttnState) =>({
|
return set((state: rainSttnState) => ({
|
||||||
rainSttn: {
|
rainSttn: {
|
||||||
...state.rainSttn,
|
...state.rainSttn,
|
||||||
rainChkRes:rainChkRes
|
rainChkRes: rainChkRes
|
||||||
},
|
},
|
||||||
|
|
||||||
}) )
|
}))
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -28,9 +28,12 @@ export type rswtSttnState = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
type rswtSttnActions = {
|
type rswtSttnActions = {
|
||||||
rswtSttnInit: (con: string) => void;
|
rswtSttnInit: (page: number, total: string, con: string, txt: string,
|
||||||
rswtSttnSearch: (page: number, total: string, con: string, sidoCode: SelectDataType[],
|
sidoCode: SelectDataType[],
|
||||||
sggCode: SelectDataType[]) => void;
|
sggCode: SelectDataType[]) => void;
|
||||||
|
rswtSttnSearch: (page: number, total: string, con: string, txt: string,
|
||||||
|
sidoCode: SelectDataType[],
|
||||||
|
sggCode: SelectDataType[]) => void;
|
||||||
rswtChSttnHead: (
|
rswtChSttnHead: (
|
||||||
headList: z.infer<typeof sttnHeadListType>,
|
headList: z.infer<typeof sttnHeadListType>,
|
||||||
) => void;
|
) => void;
|
||||||
@@ -54,12 +57,18 @@ export const rswtSttnActionsExport: (set: any) => rswtSttnActions = (
|
|||||||
set: any
|
set: any
|
||||||
) => {
|
) => {
|
||||||
return {
|
return {
|
||||||
rswtSttnInit: async (con: string) => {
|
rswtSttnInit: async (page: number, total: string, con: string, txt: string,
|
||||||
|
sidoCode: SelectDataType[],
|
||||||
|
sggCode: SelectDataType[]) => {
|
||||||
try {
|
try {
|
||||||
|
|
||||||
const rswtSttnRes = await getFetch(
|
const rswtSttnRes = await getFetch(
|
||||||
fetchType.WR,
|
fetchType.WR,
|
||||||
`/reuseFc/waterreuseFc/1/20/${con}`
|
`/reuseFc/waterreuseFc` +
|
||||||
|
(page ? `/${page}` : "/1") +
|
||||||
|
(total ? `/${total}` : "/20") +
|
||||||
|
(con ? `/${con}` : "/0") +
|
||||||
|
(txt ? `/${txt}` : "")
|
||||||
);
|
);
|
||||||
set((state: rswtSttnState) => {
|
set((state: rswtSttnState) => {
|
||||||
return {
|
return {
|
||||||
@@ -75,13 +84,18 @@ export const rswtSttnActionsExport: (set: any) => rswtSttnActions = (
|
|||||||
console.log(e)
|
console.log(e)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
rswtSttnSearch: async (page: number, total: string, con: string,
|
rswtSttnSearch: async (page: number, total: string, con: string, txt: string,
|
||||||
sidoCode: SelectDataType[],
|
sidoCode: SelectDataType[],
|
||||||
sggCode: SelectDataType[]) => {
|
sggCode: SelectDataType[]) => {
|
||||||
try {
|
try {
|
||||||
|
console.log("헐", page)
|
||||||
const rswtSttnRes = await getFetch(
|
const rswtSttnRes = await getFetch(
|
||||||
fetchType.WR,
|
fetchType.WR,
|
||||||
`/reuseFc/waterreuseFc/${page}/${total}/${con}`
|
`/reuseFc/waterreuseFc` +
|
||||||
|
(page ? `/${page}` : "/1") +
|
||||||
|
(total ? `/${total}` : "/20") +
|
||||||
|
(con ? `/${con}` : "/0") +
|
||||||
|
(txt ? `/${txt}` : "")
|
||||||
);
|
);
|
||||||
if (Number(total) > 9000) {
|
if (Number(total) > 9000) {
|
||||||
const rswtExcel = excelRSwtSttnParsing(rswtSttnRes, sidoCode, sggCode);
|
const rswtExcel = excelRSwtSttnParsing(rswtSttnRes, sidoCode, sggCode);
|
||||||
|
|||||||
@@ -111,9 +111,9 @@ export function PbnstBuseForm({
|
|||||||
const fcOrgwts = form.watch(`items.${indexMng}.fcBizs.${indexBiz}.fcOrgwts`);
|
const fcOrgwts = form.watch(`items.${indexMng}.fcBizs.${indexBiz}.fcOrgwts`);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
console.log("fcOrgwts ", fcOrgwts);
|
console.log("fcOrgwts", fcOrgwts);
|
||||||
if (fcOrgwts && fcOrgwts?.length > 0) {
|
if (fcOrgwts && fcOrgwts?.length > 0) {
|
||||||
const swtrmtFcltFkList = fcOrgwts.map((item) => item.swtrmtFcltFk);
|
const swtrmtFcltFkList = fcOrgwts?.map((item) => item.swtrmtFcltFk);
|
||||||
|
|
||||||
console.log("swtrmtFcltFkList ", swtrmtFcltFkList);
|
console.log("swtrmtFcltFkList ", swtrmtFcltFkList);
|
||||||
|
|
||||||
@@ -128,8 +128,6 @@ export function PbnstBuseForm({
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (fcOrgwtsNmList && fcOrgwtsNmList.length > 0) {
|
if (fcOrgwtsNmList && fcOrgwtsNmList.length > 0) {
|
||||||
console.log("fcOrgwtsNmList ", fcOrgwtsNmList);
|
|
||||||
console.log("fcOrgwts ", fcOrgwts);
|
|
||||||
|
|
||||||
fcOrgwts?.forEach((item, index) => {
|
fcOrgwts?.forEach((item, index) => {
|
||||||
const orgwtNm = fcOrgwtsNmList.find(
|
const orgwtNm = fcOrgwtsNmList.find(
|
||||||
@@ -421,6 +419,7 @@ export function PbnstBuseForm({
|
|||||||
</div>
|
</div>
|
||||||
<RuseMngTable
|
<RuseMngTable
|
||||||
key={`fcOrgwts-${indexMng}-${indexBiz}`} // 이게 핵심!
|
key={`fcOrgwts-${indexMng}-${indexBiz}`} // 이게 핵심!
|
||||||
|
|
||||||
tableData={
|
tableData={
|
||||||
form.getValues(
|
form.getValues(
|
||||||
`items.${indexMng}.fcBizs.${indexBiz}.fcOrgwts`
|
`items.${indexMng}.fcBizs.${indexBiz}.fcOrgwts`
|
||||||
@@ -724,6 +723,9 @@ export function PbnstBuseForm({
|
|||||||
bodyClass={"w-[70vw] max-w-none max-h-[90vh] overflow-y-auto"}
|
bodyClass={"w-[70vw] max-w-none max-h-[90vh] overflow-y-auto"}
|
||||||
body={
|
body={
|
||||||
<FcOrgwtsRegModal
|
<FcOrgwtsRegModal
|
||||||
|
initTableData={form.getValues(
|
||||||
|
`items.${indexMng}.fcBizs.${indexBiz}.fcOrgwts`
|
||||||
|
) ?? []}
|
||||||
closeModal={() => {
|
closeModal={() => {
|
||||||
setIsFcOrgwts(false);
|
setIsFcOrgwts(false);
|
||||||
}}
|
}}
|
||||||
|
|||||||
@@ -7,11 +7,9 @@ import {
|
|||||||
excelToRswtGuideData,
|
excelToRswtGuideData,
|
||||||
excelToRswtPolution,
|
excelToRswtPolution,
|
||||||
} from "@/app/store/prfmncReg/chkgdnReg/rswrtChkgdn/excel";
|
} from "@/app/store/prfmncReg/chkgdnReg/rswrtChkgdn/excel";
|
||||||
import { ToastFormUi } from "@/components/ui/toast/toastFromUi";
|
|
||||||
import {
|
import {
|
||||||
filePicked,
|
filePicked,
|
||||||
filePickedArray,
|
filePickedArray,
|
||||||
FileUpload,
|
|
||||||
Form,
|
Form,
|
||||||
FormField,
|
FormField,
|
||||||
FormUi,
|
FormUi,
|
||||||
@@ -26,7 +24,7 @@ import { useForm } from "react-hook-form";
|
|||||||
import toast from "react-hot-toast";
|
import toast from "react-hot-toast";
|
||||||
import type { z } from "zod";
|
import type { z } from "zod";
|
||||||
|
|
||||||
export default function ChkgdExcel({ type }: { type: string }) {
|
export default function ChkgdExcel({ type,setIsRegExcel }: { type: string, setIsRegExcel:(open:boolean) =>void }) {
|
||||||
const { rswtChkgdn, rainChkExcelDataUPload, rswtChkExceDataUpload } =
|
const { rswtChkgdn, rainChkExcelDataUPload, rswtChkExceDataUpload } =
|
||||||
useWrStore((state) => {
|
useWrStore((state) => {
|
||||||
return state;
|
return state;
|
||||||
@@ -146,29 +144,28 @@ export default function ChkgdExcel({ type }: { type: string }) {
|
|||||||
|
|
||||||
const onSubmit = (values: z.infer<typeof chkgdRegExcel>) => {
|
const onSubmit = (values: z.infer<typeof chkgdRegExcel>) => {
|
||||||
if (values.chckYr === "") {
|
if (values.chckYr === "") {
|
||||||
ToastFormUi({ body: "등록년도를 작성해주세요", title: "지도점검 등록" });
|
toast.error("등록년도를 작성해주세요");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (type === "RNB") {
|
if (type === "RNB") {
|
||||||
if (excelData === undefined || excelData?.length === 0) {
|
if (excelData === undefined || excelData?.length === 0) {
|
||||||
ToastFormUi({
|
toast.error("빈 파일 및 파일 오류 입니다.");
|
||||||
body: "빈 파일 및 파일 오류 입니다.",
|
|
||||||
title: "지도점검 등록",
|
|
||||||
});
|
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
rainChkExcelDataUPload(excelData as rainChkZodType[]);
|
rainChkExcelDataUPload(excelData as rainChkZodType[]);
|
||||||
|
setIsRegExcel(false)
|
||||||
}
|
}
|
||||||
} else if (type === "RST") {
|
} else if (type === "RST") {
|
||||||
if (excelRswtData === undefined || excelRswtData?.length === 0) {
|
if (excelRswtData === undefined || excelRswtData?.length === 0) {
|
||||||
ToastFormUi({
|
toast.error("빈 파일 및 파일 오류 입니다.");
|
||||||
body: "빈 파일 및 파일 오류 입니다.",
|
|
||||||
title: "중수지도점검 등록",
|
|
||||||
});
|
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
rswtChkExceDataUpload(excelRswtData as rswtChkZodType[]);
|
rswtChkExceDataUpload(excelRswtData as rswtChkZodType[]);
|
||||||
|
setIsRegExcel(false)
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import { Button } from "@common/components/ui";
|
|||||||
import React, { useEffect, useState } from "react";
|
import React, { useEffect, useState } from "react";
|
||||||
import type { z } from "zod";
|
import type { z } from "zod";
|
||||||
|
|
||||||
export default function ChkgdModal({ type, obj }: { type: string; obj: any }) {
|
export default function ChkgdModal({ type, obj, setIsModal }: { type: string; obj: any, setIsModal: (open: boolean) => void }) {
|
||||||
const {
|
const {
|
||||||
rainChkgdn,
|
rainChkgdn,
|
||||||
rswtChkgdn,
|
rswtChkgdn,
|
||||||
|
|||||||
@@ -14,13 +14,16 @@ import { Button } from "@common/business_components/ui/table/lib/button";
|
|||||||
import { Input } from "@common/components/ui";
|
import { Input } from "@common/components/ui";
|
||||||
import { ArrowLeft, ArrowRight } from "lucide-react";
|
import { ArrowLeft, ArrowRight } from "lucide-react";
|
||||||
import { useEffect, useRef, useState } from "react";
|
import { useEffect, useRef, useState } from "react";
|
||||||
|
import toast from "react-hot-toast";
|
||||||
|
|
||||||
export default function FcOrgwtsRegModal({
|
export default function FcOrgwtsRegModal({
|
||||||
onRightSet,
|
onRightSet,
|
||||||
closeModal,
|
closeModal,
|
||||||
|
initTableData,
|
||||||
}: {
|
}: {
|
||||||
onRightSet?: (rightData: fcOrgwtType[]) => void;
|
onRightSet?: (rightData: fcOrgwtType[]) => void;
|
||||||
closeModal?: (val: boolean) => void;
|
closeModal?: (val: boolean) => void;
|
||||||
|
initTableData?: any[];
|
||||||
}) {
|
}) {
|
||||||
const { code, pbnst, getSwtrmtFcltNm, searchFclts } = useWrStore(
|
const { code, pbnst, getSwtrmtFcltNm, searchFclts } = useWrStore(
|
||||||
(state) => state
|
(state) => state
|
||||||
@@ -31,6 +34,30 @@ export default function FcOrgwtsRegModal({
|
|||||||
const leftRef = useRef<pubHasuType[] | null>([] as pubHasuType[]);
|
const leftRef = useRef<pubHasuType[] | null>([] as pubHasuType[]);
|
||||||
const [rightData, setRightData] = useState<pubHasuType[]>();
|
const [rightData, setRightData] = useState<pubHasuType[]>();
|
||||||
const [inputVal, setInputVal] = useState<string>("");
|
const [inputVal, setInputVal] = useState<string>("");
|
||||||
|
const saveData = () => {
|
||||||
|
if (rightData && rightData?.length > 0) {
|
||||||
|
if (onRightSet)
|
||||||
|
onRightSet(
|
||||||
|
(rightData as pubHasuType[])?.map((item) => {
|
||||||
|
return {
|
||||||
|
...item,
|
||||||
|
swtrmtFcltFk: item.bscFctCd, // 임시값, 실제 데이터에 맞게 수정
|
||||||
|
orgwtWtritQnt: Number(item.fctCpc), // 임시값, 실제 데이터에 맞게 수정
|
||||||
|
tmsYn: "N", // 임시값, 실제 데이터에 맞게 수정
|
||||||
|
dschgFmYn: "N", // 임시값, 실제 데이터에 맞게 수정
|
||||||
|
dtlPstnExpln: item.addr, // 임시값, 실제 데이터에 맞게 수정
|
||||||
|
choose: false, // 임시값, 실제 데이터에 맞게 수정
|
||||||
|
}
|
||||||
|
// 필요한 경우 다른 속성들도 추가
|
||||||
|
}) as unknown as fcOrgwtType[]
|
||||||
|
);
|
||||||
|
|
||||||
|
closeModal?.(false)
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
toast.error("취수하수처리장 목록을 선택해주세요.")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (Array.isArray(searchFclts)) {
|
if (Array.isArray(searchFclts)) {
|
||||||
@@ -48,46 +75,50 @@ export default function FcOrgwtsRegModal({
|
|||||||
}, [searchFclts]);
|
}, [searchFclts]);
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (code.sggCd.length > 0 && pbnstHasuRes.length > 0) {
|
if (code.sggCd.length > 0 && pbnstHasuRes.length > 0) {
|
||||||
setbdstTable(tableData(pbnstHasuRes, { code }));
|
const data = pbnstHasuRes.filter((item) => !initTableData?.find((initItem) => initItem.ruseUtztnFcltNm === item.bscFctNm))
|
||||||
|
leftRef.current?.filter((item) => !initTableData?.find((initItem) => initItem.ruseUtztnFcltNm === item.bscFctNm));
|
||||||
console.log("bdstTable ", bdstTable);
|
setbdstTable(tableData(data, { code }));
|
||||||
}
|
}
|
||||||
}, [code, pbnstHasuRes]);
|
}, [code, pbnstHasuRes, initTableData]);
|
||||||
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
console.log("rightData ", rightData);
|
if (initTableData && Array.isArray(initTableData)) {
|
||||||
if (onRightSet)
|
setRightData(initTableData.map(item => ({
|
||||||
onRightSet(
|
...item,
|
||||||
(rightData as pubHasuType[])?.map((item) => ({
|
choose: item.choose,
|
||||||
swtrmtFcltFk: item.bscFctCd, // 임시값, 실제 데이터에 맞게 수정
|
sido: item.dtlPstnExpln?.split(" ")[0] || "",
|
||||||
orgwtWtritQnt: Number(item.fctCpc), // 임시값, 실제 데이터에 맞게 수정
|
gugun: item.dtlPstnExpln?.split(" ")[1] || "",
|
||||||
tmsYn: "N", // 임시값, 실제 데이터에 맞게 수정
|
bscFctNm: item.ruseUtztnFcltNm,
|
||||||
dschgFmYn: "N", // 임시값, 실제 데이터에 맞게 수정
|
addr: item.dtlPstnExpln,
|
||||||
dtlPstnExpln: item.addr, // 임시값, 실제 데이터에 맞게 수정
|
orgwtWtritQnt: String(item.orgwtWtritQnt),
|
||||||
choose: false, // 임시값, 실제 데이터에 맞게 수정
|
fctCpc: String(item.orgwtWtritQnt),
|
||||||
// 필요한 경우 다른 속성들도 추가
|
swtrmtFcltFk: item.swtrmtFcltFk,
|
||||||
})) as unknown as fcOrgwtType[]
|
})));
|
||||||
);
|
rightRef.current = initTableData.map(item => ({ ...item }));
|
||||||
}, [rightData]);
|
}
|
||||||
|
}, []);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="flex flex-col h-[80vh]">
|
<div className="flex flex-col h-[80vh]">
|
||||||
<div className="shrink-0 p-4 border-b z-10 bg-white">
|
<div className="shrink-0 p-4 border-b z-10 bg-white">
|
||||||
<div className="flex items-center">
|
<div className="flex items-center">
|
||||||
<Title title="취수하수처리장 추가" />
|
<Title title="취수하수처리장 추가" />
|
||||||
{/* <Button size="sm" onClick={() => closeModal?.(false)}>저장</Button> */}
|
|
||||||
<div className="flex items-center gap-2 mt-8">
|
<div className="flex items-center gap-2 mt-8">
|
||||||
|
|
||||||
<Label className="text-xl text-gray-600">시설명</Label>
|
|
||||||
<Input
|
<Label className="text-xl text-gray-600">시설명</Label>
|
||||||
className="w-48 text-xl"
|
<Input
|
||||||
type="text"
|
className="w-48 text-xl"
|
||||||
value={inputVal}
|
type="text"
|
||||||
onChange={(e) => setInputVal(e.target.value)}
|
value={inputVal}
|
||||||
/>
|
onChange={(e) => setInputVal(e.target.value)}
|
||||||
<Button size="sm" onClick={() => getSwtrmtFcltNm(inputVal)}>
|
/>
|
||||||
조회
|
<Button size="sm" onClick={() => getSwtrmtFcltNm(inputVal)}>
|
||||||
</Button>
|
조회
|
||||||
|
</Button>
|
||||||
|
<Button size="sm" onClick={saveData}>저장</Button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -107,10 +138,10 @@ export default function FcOrgwtsRegModal({
|
|||||||
|
|
||||||
{/* 테이블 영역 */}
|
{/* 테이블 영역 */}
|
||||||
<div className="flex flex-row gap-4 flex-grow p-4 overflow-x-auto">
|
<div className="flex flex-row gap-4 flex-grow p-4 overflow-x-auto">
|
||||||
{/* 왼쪽 테이블 */}
|
{/* 왼쪽 테이블 */}
|
||||||
|
|
||||||
<div className="w-5/12 min-w-[400px]">
|
<div className="w-5/12 min-w-[400px]">
|
||||||
<Label className="text-2xl text-gray-600 mb-2 block text-right">
|
<Label className="text-2xl text-gray-600 mb-2 block text-right">
|
||||||
공공하수처리시설 목록
|
공공하수처리시설 목록
|
||||||
</Label>
|
</Label>
|
||||||
<RuseMngTable
|
<RuseMngTable
|
||||||
@@ -123,7 +154,7 @@ export default function FcOrgwtsRegModal({
|
|||||||
|
|
||||||
{/* 중간 이동 버튼 */}
|
{/* 중간 이동 버튼 */}
|
||||||
<div className="flex flex-col justify-center items-center gap-4 w-[200px] min-w-[120px]">
|
<div className="flex flex-col justify-center items-center gap-4 w-[200px] min-w-[120px]">
|
||||||
<ArrowRight
|
<ArrowRight
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
const checked = leftRef.current?.filter((item) => item.choose);
|
const checked = leftRef.current?.filter((item) => item.choose);
|
||||||
const unchecked = leftRef.current?.filter((item) => !item.choose);
|
const unchecked = leftRef.current?.filter((item) => !item.choose);
|
||||||
@@ -159,7 +190,7 @@ export default function FcOrgwtsRegModal({
|
|||||||
|
|
||||||
{/* 오른쪽 테이블 */}
|
{/* 오른쪽 테이블 */}
|
||||||
<div className="w-5/12 min-w-[400px]">
|
<div className="w-5/12 min-w-[400px]">
|
||||||
<Label className="text-2xl text-gray-600 mb-2 block text-right">
|
<Label className="text-2xl text-gray-600 mb-2 block text-right">
|
||||||
취수하수처리장 목록
|
취수하수처리장 목록
|
||||||
</Label>
|
</Label>
|
||||||
<RuseMngTable
|
<RuseMngTable
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import { useWrStore } from "@/app/store";
|
|||||||
import type { TableUpperProps } from "@/app/store/common/type/header";
|
import type { TableUpperProps } from "@/app/store/common/type/header";
|
||||||
import type {
|
import type {
|
||||||
} from "@/app/store/prfmncReg/chkgdnReg/rainChkgdn";
|
} from "@/app/store/prfmncReg/chkgdnReg/rainChkgdn";
|
||||||
|
import type { chHeadType } from "@/app/store/prfmncReg/chkgdnReg/rainChkgdn/headList";
|
||||||
import { InputTableBody } from "@/components/lib/func/TableData";
|
import { InputTableBody } from "@/components/lib/func/TableData";
|
||||||
import {
|
import {
|
||||||
Input,
|
Input,
|
||||||
@@ -13,16 +14,18 @@ import {
|
|||||||
TableHeader,
|
TableHeader,
|
||||||
TableRow,
|
TableRow,
|
||||||
} from "@common/components/ui";
|
} from "@common/components/ui";
|
||||||
import { useEffect, useState, type Dispatch, type SetStateAction } from "react";
|
import { useEffect, useState, type Dispatch, type SetStateAction } from "react";
|
||||||
|
|
||||||
export function GuideDetailsTable({
|
export function GuideDetailsTable({
|
||||||
chgRes,
|
chgRes,
|
||||||
headList,
|
headList,
|
||||||
|
upheadList,
|
||||||
type,
|
type,
|
||||||
setChGuidData,
|
setChGuidData,
|
||||||
}: {
|
}: {
|
||||||
chgRes: any[];
|
chgRes: any[];
|
||||||
headList: TableUpperProps[];
|
headList: TableUpperProps[];
|
||||||
|
upheadList: chHeadType[];
|
||||||
type: string;
|
type: string;
|
||||||
setChGuidData: (chgRes: any[]) => void;
|
setChGuidData: (chgRes: any[]) => void;
|
||||||
}) {
|
}) {
|
||||||
@@ -35,21 +38,21 @@ export function GuideDetailsTable({
|
|||||||
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setChGuidData(inputData??[] );
|
setChGuidData(inputData ?? []);
|
||||||
|
|
||||||
}, [inputData]);
|
}, [inputData]);
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div className={`card !m-[1.2rem] !p-0r `}>
|
<div className={`card !m-[1.2rem] !p-0r `}>
|
||||||
<Table variant="secondary">
|
<Table variant="secondary">
|
||||||
<TableHeader className="font-bold">{headMakeprfmnc(headList, rainChkgdn?.rainHeadNm)}</TableHeader>
|
<TableHeader className="font-bold">{headMakeprfmnc(headList, upheadList)}</TableHeader>
|
||||||
<TableBody >
|
<TableBody >
|
||||||
{InputTableBody(inputData ?? [],headList, setInputData) }
|
{InputTableBody(inputData ?? [], headList, setInputData)}
|
||||||
</TableBody>
|
</TableBody>
|
||||||
</Table>
|
</Table>
|
||||||
</div>
|
</div>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -76,7 +76,6 @@ export default function RswtChkgdTable({
|
|||||||
}, [rswtChkgdn.rswtChkPolGuide]);
|
}, [rswtChkgdn.rswtChkPolGuide]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
console.log("makeTableData ", makeTableData)
|
|
||||||
getRswtSttnExcel(makeTableData)
|
getRswtSttnExcel(makeTableData)
|
||||||
const selectedData = makeTableData
|
const selectedData = makeTableData
|
||||||
.map((item) => {
|
.map((item) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user