From eafe131df1021619a62d24b8268302e500dec43a Mon Sep 17 00:00:00 2001 From: Your Name Date: Tue, 29 Jul 2025 18:11:39 +0900 Subject: [PATCH] =?UTF-8?q?=EA=B3=84=ED=9A=8D=EC=A0=95=EB=B3=B4=20?= =?UTF-8?q?=EB=AA=BB=EB=B6=88=EB=9F=AC=20=EC=98=AC=20=EA=B2=BD=EC=9A=B0=20?= =?UTF-8?q?progressbar=20=EC=97=86=EC=96=B4=EC=A7=80=EA=B2=8C=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/fo/app/store/dashboard/index.tsx | 12 ++++++++++-- apps/fo/app/store/processArea/index.tsx | 11 +++++++++-- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/apps/fo/app/store/dashboard/index.tsx b/apps/fo/app/store/dashboard/index.tsx index 412571587..d2a380107 100644 --- a/apps/fo/app/store/dashboard/index.tsx +++ b/apps/fo/app/store/dashboard/index.tsx @@ -689,7 +689,7 @@ const drainageEquipmentList : DrainageEquipmentListProps[] = [ * Store - api (데이터 호출) ====================================*/ /* 시설정보 및 운영현황 - 계획 */ -const fetchFacilityPlan = async (targetYear : string | undefined, fcltyCd : string | undefined) => { +const fetchFacilityPlan = async (targetYear : string | undefined, fcltyCd : string | undefined, set : (fn: (state: DashBoardType) => DashBoardType) => void) => { try { targetYear = targetYear ? targetYear : "2024"; const baseUrl = 'https://apigateway.rsonesoft.com/dc-service/api/v1/nowDmgMtncGnsvy'; @@ -703,6 +703,14 @@ const fetchFacilityPlan = async (targetYear : string | undefined, fcltyCd : stri return res } catch (error) { console.error('시설계획정보를 가져오는데 실패했습니다:', error); + set((state) => ({ + ...state, + PlanFclty : { + ...state.PlanFclty, + isLoadingPlanFclty : false, + isLoadingOperationStatus : false + } + })); return {data: [], count: 0}; } }; @@ -1069,7 +1077,7 @@ export const dashBoardReducer:(set:(fn: (state: DashBoardType) => DashBoardType) isLoadingPlanFclty: true, }, })); - const res = await fetchFacilityPlan(targetYear, fcltyCd); + const res = await fetchFacilityPlan(targetYear, fcltyCd, set); let waterUsage = [0, 0, 0]; let minDiff=9999999; let minIndex; diff --git a/apps/fo/app/store/processArea/index.tsx b/apps/fo/app/store/processArea/index.tsx index a737d153c..67fe2fa29 100644 --- a/apps/fo/app/store/processArea/index.tsx +++ b/apps/fo/app/store/processArea/index.tsx @@ -227,7 +227,7 @@ const fetchFacilityDetailInfo = async (swtrmtFcltCd: string) => { }; // 시설정보 리스트 데이터 호출(구분 선택 후 시설명 있을 경우) -const fetchProcessAreaList = async (pageNo : number, pageSize : number, ctpvNm : string | undefined, sggNm : string | undefined, targetYear : string | undefined ): Promise<{data:ProcessAreaProps[], count:number}> => { +const fetchProcessAreaList = async (pageNo : number, pageSize : number, ctpvNm : string | undefined, sggNm : string | undefined, targetYear : string | undefined, set : (fn: (state: ProcessAreaType) => ProcessAreaType) => void): Promise<{data:ProcessAreaProps[], count:number}> => { try { targetYear = targetYear ? targetYear : "2023"; console.log('targetYear', targetYear); @@ -294,6 +294,13 @@ const fetchProcessAreaList = async (pageNo : number, pageSize : number, ctpvNm : } } catch (error) { console.error('시설계획정보를 가져오는데 실패했습니다:', error); + set((state) => ({ + ...state, + ProcessArea : { + ...state.ProcessArea, + isLoading : false + } + })); return {data: [], count: 0}; } }; @@ -378,7 +385,7 @@ export const processAreaReducer:(set:SetStateFunction)=>ProcessAreaActions=(set: isLoading: true, }, })); - const res = await fetchProcessAreaList(pageNo, pageSize, ctpvNm, sggNm, targetYear); + const res = await fetchProcessAreaList(pageNo, pageSize, ctpvNm, sggNm, targetYear, set); res.data.forEach((item:ProcessAreaProps) => { DataForm({ type: 'float1', column: 'fctCpc', item:item as unknown as Record}); })