하수처리시설 팝업도 수정
This commit is contained in:
@@ -2,7 +2,7 @@ import { useWrStore } from "@/app/store";
|
||||
import { btnClass } from "@/app/store/common/code";
|
||||
import { pbnMapTableSize } from "@/app/store/map/pbnstMap";
|
||||
import type { pubHasuType } from "@/app/store/ruseFcltMng/fcltReg/pbnstReg/type";
|
||||
import { tableData } from "@/components/lib/func/commom";
|
||||
import { excelDownload, tableData } from "@/components/lib/func/commom";
|
||||
import {
|
||||
ContentsDiv,
|
||||
SearchBaseForm,
|
||||
@@ -13,14 +13,17 @@ import {
|
||||
} from "@common/business_components/ui";
|
||||
import { Label } from "@common/components/ui";
|
||||
import { useEffect, useRef, useState } from "react";
|
||||
import toast from "react-hot-toast";
|
||||
import { useTranslation } from "react-i18next";
|
||||
|
||||
export function HasuFacility({rtnFeature}:{rtnFeature:(feature:any)=>void } ) {
|
||||
const { code, pbnMap, pbnMapInit } = useWrStore((state) => state);
|
||||
const { code, pbnMap, pbnMapInit ,pbnMapSearch} = useWrStore((state) => state);
|
||||
const [hasuTable, setHasuTable] = useState<pubHasuType[]>();
|
||||
const [isReset, setIsReset] = useState(false);
|
||||
const [pbnRuseNm, setPbnRuseNm] = useState<string>("");
|
||||
const ref = useRef<ReturnType>({} as ReturnType);
|
||||
const { pbnMapHeadList, pbnMapRes, pbnMapCount } = pbnMap;
|
||||
const { pbnMapHeadList, pbnMapRes, pbnMapCount ,hasuMapExcelList} = pbnMap;
|
||||
const { t } = useTranslation("base");
|
||||
|
||||
useEffect(() => {
|
||||
if (!pbnMap.isInit) {
|
||||
@@ -39,6 +42,22 @@ export function HasuFacility({rtnFeature}:{rtnFeature:(feature:any)=>void } ) {
|
||||
rtnFeature(pbnMapRes[index])
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
useEffect(() => {
|
||||
if (hasuMapExcelList.length > 0) {
|
||||
excelDownload(
|
||||
hasuMapExcelList,
|
||||
"하수처리시설 현황",
|
||||
"sample_hasuMap.xlsx",
|
||||
"A1:H1",
|
||||
2
|
||||
);
|
||||
} else {
|
||||
toast.error(t("excelDownErrMsg"));
|
||||
}
|
||||
}, [hasuMapExcelList]);
|
||||
|
||||
return (
|
||||
<>
|
||||
<ContentsDiv>
|
||||
@@ -83,6 +102,10 @@ export function HasuFacility({rtnFeature}:{rtnFeature:(feature:any)=>void } ) {
|
||||
isAdmin={false}
|
||||
excelClick={function (returnType: ReturnType): void {
|
||||
console.log("pbnstSttnSearch ", returnType);
|
||||
|
||||
|
||||
pbnMapSearch(true,1, 100000, returnType,'' )
|
||||
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
@@ -96,7 +119,9 @@ export function HasuFacility({rtnFeature}:{rtnFeature:(feature:any)=>void } ) {
|
||||
headName={""}
|
||||
cellClick={hasuCellClick}
|
||||
onPageChange={(page) => {
|
||||
pbnMapInit(page, pbnMapTableSize, ref.current);
|
||||
//pbnMapInit(page, pbnMapTableSize, ref.current);
|
||||
|
||||
pbnMapSearch(false,page, pbnMapTableSize, ref.current,pbnRuseNm??'' )
|
||||
setIsReset(false);
|
||||
}}
|
||||
resetPageNo={isReset}
|
||||
|
||||
Reference in New Issue
Block a user