diff --git a/apps/wr/app/ruseFcltMng/fcltSttn/htdflSttn/page.tsx b/apps/wr/app/ruseFcltMng/fcltSttn/htdflSttn/page.tsx index 959367202..b943e8b4f 100644 --- a/apps/wr/app/ruseFcltMng/fcltSttn/htdflSttn/page.tsx +++ b/apps/wr/app/ruseFcltMng/fcltSttn/htdflSttn/page.tsx @@ -61,11 +61,11 @@ export default function HtdflSttn() { const excelClick = useCallback(() => { // 최신 검색 조건 반영 const con = getConValue(); - htdflSttnSearch(1, "10000", String(con), fcltNm, code.cityCd, code.sggCd); + htdflSttnSearch(true, 1, "20", String(con), fcltNm, code.cityCd, code.sggCd); }, [htdflSttnSearch, objSearch, code.cityCd, code.sggCd]); useEffect(() => { - htdflSttnSearch(pageNation, "20", String(getConValue()), fcltNm, code.cityCd, code.sggCd); + htdflSttnSearch(false, pageNation, "20", String(getConValue()), fcltNm, code.cityCd, code.sggCd); }, [pageNation]); const getSelCity = (val: string | number) => { @@ -113,7 +113,7 @@ export default function HtdflSttn() { htdflSttn.excelList, "온배수시설 현황", "sample_htdflSttn.xlsx", - "A1:S3" + "A1:R3" ); } }, [htdflSttn.excelList, code]); @@ -182,7 +182,7 @@ export default function HtdflSttn() { size={"sm"} onClick={() => { const con = getConValue(); - htdflSttnSearch(pageNation, "20", String(con), fcltNm, code.cityCd, code.sggCd); + htdflSttnSearch(false, pageNation, "20", String(con), fcltNm, code.cityCd, code.sggCd); }} > 조회 diff --git a/apps/wr/app/store/ruseFcltMng/fcltSttn/htdflSttn/index.tsx b/apps/wr/app/store/ruseFcltMng/fcltSttn/htdflSttn/index.tsx index eb37d0d73..229b4fe2a 100644 --- a/apps/wr/app/store/ruseFcltMng/fcltSttn/htdflSttn/index.tsx +++ b/apps/wr/app/store/ruseFcltMng/fcltSttn/htdflSttn/index.tsx @@ -6,6 +6,7 @@ import { controlHeadView } from "../rainSttn"; import type { customHtdflBdst } from "../../fcltReg/htdflReg"; import { fetchType, getFetch } from "@/components/lib/api"; import type { SelectDataType } from "@common/business_components/ui"; +import { excelHtdflSttnParsing } from "./excel"; const htdflSttHeadList = htdflSttHeadListExport; const htdflSttNodeList = htdflSttNodeListExport; @@ -24,7 +25,7 @@ type htdflSttnActions = { initHtdfl: (page: number, total: string, con: string, txt: string, sidoCode: SelectDataType[], sggCode: SelectDataType[]) => void; - htdflSttnSearch: (page: number, total: string, con: string, txt: string, + htdflSttnSearch: (isExcel:boolean, page: number, total: string, con: string, txt: string, sidoCode: SelectDataType[], sggCode: SelectDataType[]) => void; htdflChSttnHead: ( @@ -81,11 +82,10 @@ export const htdflSttnActionsExport: (set: any) => htdflSttnActions = ( console.log(error); } }, - htdflSttnSearch: async (page: number, total: string, con: string, txt: string, + htdflSttnSearch: async (isExcel:boolean, page: number, total: string, con: string, txt: string, sidoCode: SelectDataType[], sggCode: SelectDataType[]) => { try { - console.log("page", page) const htdflSttnRes = await getFetch( fetchType.WR, `/drain/facilityList` + @@ -95,13 +95,14 @@ export const htdflSttnActionsExport: (set: any) => htdflSttnActions = ( (txt ? `/${txt}` : "") ); - if (Number(total) > 9000) { + if (isExcel) { + const htdflExcel = excelHtdflSttnParsing(htdflSttnRes, sidoCode, sggCode); set((state: htdflSttnState) => { return { ...state, htdflSttn: { ...state.htdflSttn, - excelList: htdflSttnRes, + excelList: htdflExcel, }, }; }); diff --git a/apps/wr/public/sample_htdflSttn.xlsx b/apps/wr/public/sample_htdflSttn.xlsx index fd1dc5a89..463c1ca87 100644 Binary files a/apps/wr/public/sample_htdflSttn.xlsx and b/apps/wr/public/sample_htdflSttn.xlsx differ