+
0) {
- htdfMapSearch(
- page,
- rainMapSize,
- String(con),
- seartchTxt ?? ""
- );
- } else {
- htdfMapSearch(page, rainMapSize, String(con));
- }
+ htdfMapSearch(
+ false,
+ page,
+ String(htdfMapSize),
+ String(con),
+ seartchTxt||'',
+ code.cityCd,
+ code.sggCd
+ );
setIsReset(false);
}
}}
diff --git a/apps/wr/components/ui/map/LayerPopUp/RainFacility/RainFacility.tsx b/apps/wr/components/ui/map/LayerPopUp/RainFacility/RainFacility.tsx
index e1a917e8f..80bb8d7ec 100644
--- a/apps/wr/components/ui/map/LayerPopUp/RainFacility/RainFacility.tsx
+++ b/apps/wr/components/ui/map/LayerPopUp/RainFacility/RainFacility.tsx
@@ -1,7 +1,7 @@
import { useWrStore } from "@/app/store";
import { rainMapSize } from "@/app/store/map/rainMap";
import type { customRainBdst } from "@/app/store/ruseFcltMng/fcltReg/rainReg";
-import { getCity, tableData } from "@/components/lib/func/commom";
+import { excelDownload, getCity, tableData } from "@/components/lib/func/commom";
import type { objSearchType } from "@/components/ui/modal/fcltReg/bdstRegModal/bdstRegModal";
import {
ContentsDiv,
@@ -17,6 +17,8 @@ import {
import { HeadMakeColSpan } from "@common/business_components/ui/table/HeadMakeColSpan";
import { Button } from "@common/components/ui";
import { useCallback, useEffect, useState } from "react";
+import toast from "react-hot-toast";
+import { useTranslation } from "react-i18next";
export function RainFacility({
rtnFeature,
@@ -26,7 +28,7 @@ export function RainFacility({
const { code, rainMap, rainMapInit, rainMapSearch } = useWrStore(
(state) => state
);
- const { rainMapRes, rainMapCount, rainSttHeadList, rainSttNodeList } =
+ const { rainMapRes, rainMapExcelList,rainMapCount, rainSttHeadList, rainSttNodeList } =
rainMap;
const [rainTable, setRainTable] = useState();
const [isReset, setIsReset] = useState(false);
@@ -35,6 +37,7 @@ export function RainFacility({
sgg: "",
city: "",
});
+ const { t } = useTranslation('base');
const [seartchTxt, setSearchTxt] = useState();
@@ -116,7 +119,18 @@ export function RainFacility({
.filter((item: any) => item.rainyObj !== undefined);
setRainTable(chData);
}, [code, rainMapRes]);
-
+ useEffect(() => {
+ if (rainMapExcelList.length > 0) {
+ excelDownload(
+ rainMapExcelList,
+ "빗물재이용시설 현황",
+ "sample_rainSttn.xlsx",
+ "A1:W3"
+ );
+ } else {
+ toast.error(t("excelDownErrMsg"));
+ }
+ }, [rainMapExcelList]);
return (
<>
@@ -146,17 +160,50 @@ export function RainFacility({
/>
{
setSearchTxt(e);
}}
/>
+
+
-
+ */}
@@ -187,16 +243,16 @@ export function RainFacility({
? objSearch.sgg
: objSearch.city;
if (con) {
- if (seartchTxt && seartchTxt?.length > 0) {
- rainMapSearch(
- page,
- rainMapSize,
- String(con),
- seartchTxt ?? ""
- );
- } else {
- rainMapSearch(page, rainMapSize, String(con));
- }
+ rainMapSearch(
+ false,
+ page,
+ String(rainMapSize),
+ String(con),
+ seartchTxt ?? "",
+ code.cityCd,
+ code.sggCd
+ );
+
setIsReset(false);
}
}}
diff --git a/apps/wr/components/ui/map/LayerPopUp/RswtFacilty/RswtFacilty.tsx b/apps/wr/components/ui/map/LayerPopUp/RswtFacilty/RswtFacilty.tsx
index 18a2b2c1d..becd76872 100644
--- a/apps/wr/components/ui/map/LayerPopUp/RswtFacilty/RswtFacilty.tsx
+++ b/apps/wr/components/ui/map/LayerPopUp/RswtFacilty/RswtFacilty.tsx
@@ -1,57 +1,71 @@
import { useWrStore } from "@/app/store";
import { rainMapSize } from "@/app/store/map/rainMap";
import type { customRswtBdst } from "@/app/store/ruseFcltMng/fcltReg/rswtReg";
-import { getCity, tableData } from "@/components/lib/func/commom";
+import { excelDownload, getCity, tableData } from "@/components/lib/func/commom";
import type { objSearchType } from "@/components/ui/modal/fcltReg/bdstRegModal/bdstRegModal";
-import { ContentsDiv, SearchDiv, SearchFormLeft, SearchFormRight, SearchInput, SelectBox, Title, UiTable, type SelectDataType } from "@common/business_components/ui";
+import {
+ ContentsDiv,
+ SearchDiv,
+ SearchFormLeft,
+ SearchFormRight,
+ SearchInput,
+ SelectBox,
+ Title,
+ UiTable,
+ type SelectDataType,
+} from "@common/business_components/ui";
import { HeadMakeColSpan } from "@common/business_components/ui/table/HeadMakeColSpan";
import { Button } from "@common/components/ui";
import { useCallback, useEffect, useState } from "react";
+import toast from "react-hot-toast";
+import { useTranslation } from "react-i18next";
export function RswtFacility({
rtnFeature,
}: {
rtnFeature: (feature: any) => void;
}) {
- const { code, rswtMap, rswtMapInit,rswtMapSearch } = useWrStore((state) => state);
- const { rswtMapRes, rswtMapCount, rswtSttHeadList, rswtSttNodeList } =
+ const { code, rswtMap, rswtMapInit, rswtMapSearch } = useWrStore(
+ (state) => state
+ );
+ const { rswtMapRes, rswtMapExcelList, rswtMapCount, rswtSttHeadList, rswtSttNodeList } =
rswtMap;
const [rswtrTable, setRswtrTable] = useState
();
const [isReset, setIsReset] = useState(false);
-
const [selectSgg, setSelectSgg] = useState();
- const [objSearch, setObjSearch] = useState({
- sgg: "",
- city: "",
- });
-
- const [seartchTxt, setSearchTxt] = useState();
-
- const getSelCity = useCallback(
- (val: string | number) => {
- const cityValue = String(val);
- const data = getCity(cityValue, code.sggCd);
- setSelectSgg(data);
- setObjSearch({ city: cityValue, sgg: "0" });
- },
- [code.sggCd]
- );
-
- const getSgg = useCallback((val: string | number) => {
- setObjSearch((prev) => ({ ...prev, sgg: String(val) }));
- }, []);
-
- useEffect(() => {
- // code.cityCd 데이터가 로드되었고, 아직 시/도 선택이 안된 초기 상태일 때 실행
- if (code.cityCd && code.cityCd.length > 0 && !objSearch.city) {
- const firstCityVal = code.cityCd[0]?.val;
- if (firstCityVal) {
- // 첫 번째 시/도 값으로 상태를 초기화합니다.
- getSelCity(firstCityVal);
- }
+ const [objSearch, setObjSearch] = useState({
+ sgg: "",
+ city: "",
+ });
+ const { t } = useTranslation('base');
+
+ const [seartchTxt, setSearchTxt] = useState();
+
+ const getSelCity = useCallback(
+ (val: string | number) => {
+ const cityValue = String(val);
+ const data = getCity(cityValue, code.sggCd);
+ setSelectSgg(data);
+ setObjSearch({ city: cityValue, sgg: "0" });
+ },
+ [code.sggCd]
+ );
+
+ const getSgg = useCallback((val: string | number) => {
+ setObjSearch((prev) => ({ ...prev, sgg: String(val) }));
+ }, []);
+
+ useEffect(() => {
+ // code.cityCd 데이터가 로드되었고, 아직 시/도 선택이 안된 초기 상태일 때 실행
+ if (code.cityCd && code.cityCd.length > 0 && !objSearch.city) {
+ const firstCityVal = code.cityCd[0]?.val;
+ if (firstCityVal) {
+ // 첫 번째 시/도 값으로 상태를 초기화합니다.
+ getSelCity(firstCityVal);
}
- }, [code.cityCd, objSearch.city, getSelCity]);
+ }
+ }, [code.cityCd, objSearch.city, getSelCity]);
const rswtCellClick = (index: number | undefined, headId: string) => {
if (
headId !== "chBuildingYn" &&
@@ -100,6 +114,19 @@ export function RswtFacility({
);
setRswtrTable(chData);
}, [code, rswtMapRes]);
+
+ useEffect(() => {
+ if (rswtMapExcelList.length > 0) {
+ excelDownload(
+ rswtMapExcelList,
+ "중수도시설 현황",
+ "sample_rswtSttn.xlsx",
+ "A1:W3",
+ );
+ } else {
+ toast.error(t('excelDownErrMsg'));
+ }
+ }, [rswtMapExcelList]);
return (
<>
@@ -129,18 +156,14 @@ export function RswtFacility({
/>
{
setSearchTxt(e);
}}
/>
-