온배수이용시설 현황 엑셀 다운로드 수정

This commit is contained in:
jyha00
2025-07-08 14:42:46 +09:00
parent f93ca3d71f
commit ff563600d7
3 changed files with 10 additions and 9 deletions
@@ -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);
}}
>
조회
@@ -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,
},
};
});
Binary file not shown.