diff --git a/apps/fo/app/pages/dashboard/facilityInfo/page.tsx b/apps/fo/app/pages/dashboard/facilityInfo/page.tsx index 3cc4229a2..fa6905fa2 100644 --- a/apps/fo/app/pages/dashboard/facilityInfo/page.tsx +++ b/apps/fo/app/pages/dashboard/facilityInfo/page.tsx @@ -5,6 +5,7 @@ import { ContentsDiv, UiModal, UiTable } from "@common/business_components"; import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "@common/components"; import { useEffect, useState } from "react"; import DashBoardChartModal from "./modal/page"; +import LoadingOverlay from "@common/business_components/ui/loadingBar"; export type facilityInfoProps = { searchYear?: string; @@ -80,13 +81,15 @@ export default function ProcessFacilitySearch({searchYear = '', fcltyList = []}: planYearList, waterUsage1, waterUsage2, - waterUsage3 + waterUsage3, + isLoadingPlanFclty } = PlanFclty; // 그리드 관련 const { upHeadListOperationStatus, - operationalStatusList + operationalStatusList, + isLoadingOperationStatus } = OperationStatus; const closeModal = () => { @@ -201,6 +204,7 @@ export default function ProcessFacilitySearch({searchYear = '', fcltyList = []}: <> { } } /> +
@@ -236,39 +240,40 @@ export default function ProcessFacilitySearch({searchYear = '', fcltyList = []}:
-
- - {upChangeHeadListOperationStatus} - - - {operationalStatusList.map((el: { [key: string]: string | number | boolean },index) => ( - - {upHeadListOperationStatus.map((head) => ( - (head.id === 'flowRate' && index === 0)?{el[head.id]}: - (head.id === 'flowRate' && index === 5)?{el[head.id]}: - (head.id === 'flowRate' && index === 11)?{el[head.id]}: - (head.id === 'groundWaterAvg'||head.id === 'groundWaterSummer'||head.id === 'groundWaterWinter')&&(index === 0)?{el[head.id]}: - (head.id === 'groundWaterAvg'||head.id === 'groundWaterSummer'||head.id === 'groundWaterWinter')&&(index === 7)?{el[head.id]}: - (head.id === 'rdi'&&index === 0)?{el[head.id]}: - (head.id === 'rdi'&&index === 7)?{el[head.id]}: - (head.id === 'rdiRain'&&index === 0)?{el['rdiRain']}: - (head.id === 'rdiRain'&&index === 7)?: - (head.id === 'waterQlty')?{el[head.id]}: - ((head.id === 'yearAvg' || head.id === 'yearMax' || head.id === 'yearMin') && (index>=0 && index<=4))?{fncLoadModal('flowRate', 'year', el['waterQlty'] as string);}}>{el[head.id]}: - ((head.id === 'yearAvg' || head.id === 'yearMax' || head.id === 'yearMin') && (index>=5 && index<=10))?{fncLoadModal('waterQlty', 'year', el['waterQlty'] as string);}}>{el[head.id]}: - ((head.id === 'yearAvg' || head.id === 'yearMax' || head.id === 'yearMin') && (index>=11 && index<=12))?{fncLoadModal('chongin', 'year', el['waterQlty'] as string);}}>{el[head.id]}: - ((head.id === 'summerAll' || head.id === 'summerThree' || head.id === 'summerRain') && (index>=0 && index<=4))?{fncLoadModal('flowRate', 'summer', el['waterQlty'] as string);}}>{el[head.id]}: - ((head.id === 'summerAll' || head.id === 'summerThree' || head.id === 'summerRain') && (index>=5 && index<=10))?{fncLoadModal('waterQlty', 'summer', el['waterQlty'] as string);}}>{el[head.id]}: - ((head.id === 'summerAll' || head.id === 'summerThree' || head.id === 'summerRain') && (index>=11 && index<=12))?{fncLoadModal('chongin', 'summer', el['waterQlty'] as string);}}>{el[head.id]}: - ((head.id === 'winterAll' || head.id === 'winterSunnyAvg' || head.id === 'winterSunnyMax' || head.id === 'winterSunnyMin') && (index>=0 && index<=4))?{fncLoadModal('flowRate', 'winter', el['waterQlty'] as string);}}>{el[head.id]}: - ((head.id === 'winterAll' || head.id === 'winterSunnyAvg' || head.id === 'winterSunnyMax' || head.id === 'winterSunnyMin') && (index>=5 && index<=10))?{fncLoadModal('waterQlty', 'winter', el['waterQlty'] as string);}}>{el[head.id]}: - ((head.id === 'winterAll' || head.id === 'winterSunnyAvg' || head.id === 'winterSunnyMax' || head.id === 'winterSunnyMin') && (index>=11 && index<=12))?{fncLoadModal('chongin', 'winter', el['waterQlty'] as string);}}>{el[head.id]}: - null - ))} - - ))} - -
+ + + + {upChangeHeadListOperationStatus} + + + {operationalStatusList.map((el: { [key: string]: string | number | boolean },index) => ( + + {upHeadListOperationStatus.map((head) => ( + (head.id === 'flowRate' && index === 0)?{el[head.id]}: + (head.id === 'flowRate' && index === 5)?{el[head.id]}: + (head.id === 'flowRate' && index === 11)?{el[head.id]}: + (head.id === 'groundWaterAvg'||head.id === 'groundWaterSummer'||head.id === 'groundWaterWinter')&&(index === 0)?{el[head.id]}: + (head.id === 'groundWaterAvg'||head.id === 'groundWaterSummer'||head.id === 'groundWaterWinter')&&(index === 7)?{el[head.id]}: + (head.id === 'rdi'&&index === 0)?{el[head.id]}: + (head.id === 'rdi'&&index === 7)?{el[head.id]}: + (head.id === 'rdiRain'&&index === 0)?{el['rdiRain']}: + (head.id === 'rdiRain'&&index === 7)?: + (head.id === 'waterQlty')?{el[head.id]}: + ((head.id === 'yearAvg' || head.id === 'yearMax' || head.id === 'yearMin') && (index>=0 && index<=4))?{fncLoadModal('flowRate', 'year', el['waterQlty'] as string);}}>{el[head.id]}: + ((head.id === 'yearAvg' || head.id === 'yearMax' || head.id === 'yearMin') && (index>=5 && index<=10))?{fncLoadModal('waterQlty', 'year', el['waterQlty'] as string);}}>{el[head.id]}: + ((head.id === 'yearAvg' || head.id === 'yearMax' || head.id === 'yearMin') && (index>=11 && index<=12))?{fncLoadModal('chongin', 'year', el['waterQlty'] as string);}}>{el[head.id]}: + ((head.id === 'summerAll' || head.id === 'summerThree' || head.id === 'summerRain') && (index>=0 && index<=4))?{fncLoadModal('flowRate', 'summer', el['waterQlty'] as string);}}>{el[head.id]}: + ((head.id === 'summerAll' || head.id === 'summerThree' || head.id === 'summerRain') && (index>=5 && index<=10))?{fncLoadModal('waterQlty', 'summer', el['waterQlty'] as string);}}>{el[head.id]}: + ((head.id === 'summerAll' || head.id === 'summerThree' || head.id === 'summerRain') && (index>=11 && index<=12))?{fncLoadModal('chongin', 'summer', el['waterQlty'] as string);}}>{el[head.id]}: + ((head.id === 'winterAll' || head.id === 'winterSunnyAvg' || head.id === 'winterSunnyMax' || head.id === 'winterSunnyMin') && (index>=0 && index<=4))?{fncLoadModal('flowRate', 'winter', el['waterQlty'] as string);}}>{el[head.id]}: + ((head.id === 'winterAll' || head.id === 'winterSunnyAvg' || head.id === 'winterSunnyMax' || head.id === 'winterSunnyMin') && (index>=5 && index<=10))?{fncLoadModal('waterQlty', 'winter', el['waterQlty'] as string);}}>{el[head.id]}: + ((head.id === 'winterAll' || head.id === 'winterSunnyAvg' || head.id === 'winterSunnyMax' || head.id === 'winterSunnyMin') && (index>=11 && index<=12))?{fncLoadModal('chongin', 'winter', el['waterQlty'] as string);}}>{el[head.id]}: + null + ))} + + ))} + +
diff --git a/apps/fo/app/pages/dashboard/maingraph/page.tsx b/apps/fo/app/pages/dashboard/maingraph/page.tsx index 5ee9eeda0..375cdbbdf 100644 --- a/apps/fo/app/pages/dashboard/maingraph/page.tsx +++ b/apps/fo/app/pages/dashboard/maingraph/page.tsx @@ -5,6 +5,7 @@ import { CHART_FORM, type ChartConfig, ContentsDiv, MainChart } from "@common/bu import { Card, CardContent } from "@common/business_components/ui/chart/lib/card"; import ListDiv from "@common/business_components/ui/list_div"; import { useEffect, useState } from "react"; +import LoadingOverlay from "@common/business_components/ui/loadingBar"; type facilityInfoProps = { searchYear?: string; @@ -44,6 +45,7 @@ export default function DashBoardChart({searchYear = '', fcltyList = []}: facili chart_inflTn, chart_efflTn, chart_inflBod, + isLoadingMainGraph, } = MainGraph; /** @@ -179,6 +181,7 @@ export default function DashBoardChart({searchYear = '', fcltyList = []}: facili return ( <> + diff --git a/apps/fo/app/pages/dashboard/page.tsx b/apps/fo/app/pages/dashboard/page.tsx index 97827f690..0903c9229 100644 --- a/apps/fo/app/pages/dashboard/page.tsx +++ b/apps/fo/app/pages/dashboard/page.tsx @@ -57,8 +57,7 @@ export default function DashBoard() { /******************선택된 데이터******************/ // 연도 - //const [searchYear, setSearchYear] = useState(selectSearchYear[0]?.val || '0'); - const [searchYear, setSearchYear] = useState('2023'); + const [searchYear, setSearchYear] = useState(selectSearchYear[0]?.val || '0'); // 시설명 const [fcltyList, setFcltyList] = useState<{bscFctCd: string, bscFctNm: string, fcltyCpc: number | '', trtFrfNm: string | '', efflWqltStndrdNm: string | ''}>({ bscFctCd: '26260PB001R', @@ -280,7 +279,7 @@ export default function DashBoard() { trtFrfNm: '표준활성슬러지법, MLE, MBR', efflWqltStndrdNm: '500톤 이상(Ⅳ지역)' }); - setSearchYear('2023'); + setSearchYear(selectSearchYear[0]?.val || '0'); searchFcltyList.bscFctNm = '수영'; setSidoValue('0'); diff --git a/apps/fo/app/pages/facilityPrecipitation/page.tsx b/apps/fo/app/pages/facilityPrecipitation/page.tsx index 4d75ed052..a0dce5274 100644 --- a/apps/fo/app/pages/facilityPrecipitation/page.tsx +++ b/apps/fo/app/pages/facilityPrecipitation/page.tsx @@ -5,6 +5,7 @@ import { ContentsDiv, downloadExcel, MainDiv, SearchBaseForm, SearchInput, Selec import ListDiv from "@common/business_components/ui/list_div"; import { useCallback, useEffect, useRef, useState } from "react"; import PrecipitationModal from "./modal/page"; +import LoadingOverlay from "@common/business_components/ui/loadingBar"; export default function FacilityPrecipitation() { const {Common @@ -39,7 +40,8 @@ export default function FacilityPrecipitation() { upHeadList3, excelList, facilityPrecipitation, - facilityPrecipitationCount + facilityPrecipitationCount, + isLoading, } = FacilityPrecipitation; const { @@ -81,8 +83,7 @@ export default function FacilityPrecipitation() { // 시설상태 const [operationValue, setOperationValue] = useState("0"); // 조회기간 - //const [searchYear, setSearchYear] = useState(selectSearchYear[0]?.val || "0"); - const [searchYear, setSearchYear] = useState("2023"); + const [searchYear, setSearchYear] = useState(selectSearchYear[0]?.val || "0"); /** * 페이지 함수 @@ -94,7 +95,7 @@ export default function FacilityPrecipitation() { // 상태값 설정 setFcltCpct(selectUpdownData[0]?.val || "0"); setOperationValue(selectOperationData[0]?.val || "0"); - setSearchYear("2023"); + setSearchYear(selectSearchYear[0]?.val || "0"); // SearchInputSelect 초기화 setFcltyName(""); if (searchInputRef.current) { @@ -103,7 +104,7 @@ export default function FacilityPrecipitation() { input.value = ""; } } - searchFacilityPrecipitationList(1, 10, "2023"); + searchFacilityPrecipitationList(1, 10, selectSearchYear[0]?.val || "0"); } // 모달 닫기 @@ -126,7 +127,7 @@ export default function FacilityPrecipitation() { useEffect(() => { if (!isInit) { initializeCommonData(); - searchFacilityPrecipitationList(1, 10, "2023"); + searchFacilityPrecipitationList(1, 10, selectSearchYear[0]?.val || "0"); } }, [isInit, initializeCommonData, searchFacilityPrecipitationList]); @@ -227,6 +228,7 @@ export default function FacilityPrecipitation() { initClick={resetVal} ref={ref} isAdmin={false} /> +
index !== undefined && cellClick(index)} headName={"시설별 강수현황"} tableData={mainList} headlist={upheadList} pageSize={10} total={total} resetPageNo={resetPage} onPageChange={handlePageChange} /> diff --git a/apps/fo/app/pages/facilityWaterQlty/page.tsx b/apps/fo/app/pages/facilityWaterQlty/page.tsx index 6600061d0..0e215f565 100644 --- a/apps/fo/app/pages/facilityWaterQlty/page.tsx +++ b/apps/fo/app/pages/facilityWaterQlty/page.tsx @@ -7,6 +7,7 @@ import ListDiv from "@common/business_components/ui/list_div"; import { useCallback, useEffect, useRef, useState } from "react"; import WaterQualityModal from "./modal/page"; import type { FacilityWaterQltyProps } from "@/app/store/facilityWaterQlty"; +import LoadingOverlay from "@common/business_components/ui/loadingBar"; export default function ProcessFacilitySearch() { const { Common @@ -36,7 +37,8 @@ export default function ProcessFacilitySearch() { upHeadList3, facilityWaterQltyList, facilityWaterQltyCount, - excelList + excelList, + isLoading, } = FacilityWaterQltyMain; const mainList: FacilityWaterQltyProps[] = facilityWaterQltyList || []; @@ -48,8 +50,7 @@ export default function ProcessFacilitySearch() { const [upheadList, setUpheadList] = useState(upHeadList1); const [fcltyName, setFcltyName] = useState(""); const [operationValue, setOperationValue] = useState("0"); - //const [searchYearValue, setSearchYearValue] = useState(selectSearchYear[0]?.val || "0"); - const [searchYearValue, setSearchYearValue] = useState("2023"); + const [searchYearValue, setSearchYearValue] = useState(selectSearchYear[0]?.val || "0"); const [fcltCpct, setFcltCpct] = useState("0"); // 모달 상태 추가 @@ -89,7 +90,7 @@ export default function ProcessFacilitySearch() { // 상태값 설정 setFcltCpct(selectUpdownData[0]?.val || "0"); setOperationValue(selectOperationData[0]?.val || "0"); - setSearchYearValue("2023"); + setSearchYearValue(selectSearchYear[0]?.val || "0"); // SearchInputSelect 초기화 setFcltyName(""); if (searchInputRef.current) { @@ -98,7 +99,7 @@ export default function ProcessFacilitySearch() { input.value = ""; } } - searchFacilityWaterQltyList(1, 10, "2023"); + searchFacilityWaterQltyList(1, 10, selectSearchYear[0]?.val || "0"); } // 셀 클릭 시 모달 표시 @@ -131,7 +132,7 @@ export default function ProcessFacilitySearch() { useEffect(() => { if (!isInit) { initializeCommonData(); - searchFacilityWaterQltyList(1, 10, "2023"); + searchFacilityWaterQltyList(1, 10, selectSearchYear[0]?.val || "0"); } }, [isInit, initializeCommonData, searchFacilityWaterQltyList]); @@ -187,6 +188,7 @@ export default function ProcessFacilitySearch() { initClick={resetVal} ref={ref} isAdmin={false} /> +
index !== undefined && cellClick(index)} headName={"시설별 수질현황"} tableData={mainList} headlist={upheadList} pageSize={10} total={total<10?facilityWaterQltyList.length:total} resetPageNo={resetPage} onPageChange={handlePageChange} /> diff --git a/apps/fo/app/pages/flowRate/page.tsx b/apps/fo/app/pages/flowRate/page.tsx index 154fe72ef..fdb0db487 100644 --- a/apps/fo/app/pages/flowRate/page.tsx +++ b/apps/fo/app/pages/flowRate/page.tsx @@ -6,6 +6,7 @@ import ListDiv from "@common/business_components/ui/list_div"; import { useCallback, useEffect, useRef, useState } from "react"; import FlowRateModal from "./modal/page"; import type { ExcelType } from "@/app/store/flowRate"; +import LoadingOverlay from "@common/business_components/ui/loadingBar"; export default function ProcessFacilitySearch() { const {Common @@ -42,15 +43,15 @@ export default function ProcessFacilitySearch() { upHeadList3, flowRateList, flowRateCount, - excelList + excelList, + isLoading, } = FlowRateList; // 입력값 상태 관리 const [fcltCpct, setFcltCpct] = useState("0"); const [fcltyName, setFcltyName] = useState(""); const [operationValue, setOperationValue] = useState("0"); - //const [searchYearValue, setSearchYearValue] = useState(selectSearchYear[0]?.val || "0"); - const [searchYearValue, setSearchYearValue] = useState("2023"); + const [searchYearValue, setSearchYearValue] = useState(selectSearchYear[0]?.val || "0"); const [widthSize, setWidthSize] = useState("w-[120%]"); const [upheadList, setUpheadList] = useState(upHeadList1); const [resetPage, setResetPage] = useState(false); @@ -89,7 +90,7 @@ export default function ProcessFacilitySearch() { setWidthSize("w-[120%]"); setUpheadList(upHeadList1) // 상태값 설정 - setSearchYearValue("2023"); + setSearchYearValue(selectSearchYear[0]?.val || "0"); setFcltCpct(selectUpdownData[0]?.val || "0"); setOperationValue(selectOperationData[0]?.val || "0"); // SearchInputSelect 초기화 @@ -100,7 +101,7 @@ export default function ProcessFacilitySearch() { input.value = ""; } } - searchFlowRateList(1, 10, "2023"); + searchFlowRateList(1, 10, selectSearchYear[0]?.val || "0"); } // 셀 클릭 시 모달 표시 @@ -127,7 +128,7 @@ export default function ProcessFacilitySearch() { useEffect(() => { if(!isInit) { initializeCommonData(); - searchFlowRateList(1, 10, "2023"); + searchFlowRateList(1, 10, selectSearchYear[0]?.val || "0"); } }, [isInit, initializeCommonData, searchFlowRateList]); @@ -188,6 +189,7 @@ export default function ProcessFacilitySearch() { initClick={resetVal} ref={ref} isAdmin={false} /> +
index !== undefined && cellClick(index)} headName={"시설별 유량현황"} tableData={flowRateList} headlist={upheadList} pageSize={10} total={total} resetPageNo={resetPage} onPageChange={handlePageChange} /> diff --git a/apps/fo/app/pages/planSewage/page.tsx b/apps/fo/app/pages/planSewage/page.tsx index 1db7f0d3b..b39a3e8df 100644 --- a/apps/fo/app/pages/planSewage/page.tsx +++ b/apps/fo/app/pages/planSewage/page.tsx @@ -4,6 +4,7 @@ import type { TableUpperProps } from "@/app/store/common"; import { downloadExcel, MainDiv, SearchBaseForm, SearchInput, SelectBox, Title, UiTable, type ReturnType } from "@common/business_components"; import ListDiv from "@common/business_components/ui/list_div"; import { useCallback, useEffect, useRef, useState } from "react"; +import LoadingOverlay from "@common/business_components/ui/loadingBar"; export default function PlanSewage() { const {Common @@ -37,7 +38,8 @@ export default function PlanSewage() { upHeadList3, planSewageList, planSewageCount, - excelList + excelList, + isLoading, } = PlanSewage; const ref = useRef({ @@ -70,8 +72,7 @@ export default function PlanSewage() { // 시설상태 const [operationValue, setOperationValue] = useState("0"); // 조회기간 - //const [searchYear, setSearchYear] = useState(selectSearchYear[0]?.val || "0"); - const [searchYear, setSearchYear] = useState("2023"); + const [searchYear, setSearchYear] = useState(selectSearchYear[0]?.val || "0"); /** * 페이지 함수 @@ -83,7 +84,7 @@ export default function PlanSewage() { // 상태값 설정 setFcltCpct(selectUpdownData[0]?.val || "0"); setOperationValue(selectOperationData[0]?.val || "0"); - setSearchYear("2023"); + setSearchYear(selectSearchYear[0]?.val || "0"); // SearchInputSelect 초기화 setFcltyName(""); if (searchInputRef.current) { @@ -92,7 +93,7 @@ export default function PlanSewage() { input.value = ""; } } - searchPlanSewageList(1, 10, "2023", ref.current.partValue); + searchPlanSewageList(1, 10, selectSearchYear[0]?.val || "0", ref.current.partValue); } /** @@ -101,7 +102,7 @@ export default function PlanSewage() { useEffect(() => { if (!isInit) { initializeCommonData(); - searchPlanSewageList(1, 10, "2023", ref.current.partValue); + searchPlanSewageList(1, 10, selectSearchYear[0]?.val || "0", ref.current.partValue); } }, [isInit, initializeCommonData, searchPlanSewageList]); @@ -188,6 +189,7 @@ export default function PlanSewage() { initClick={resetVal} ref={ref} isAdmin={false}/> +
diff --git a/apps/fo/app/pages/processArea/page.tsx b/apps/fo/app/pages/processArea/page.tsx index 441d0b35f..24a30d910 100644 --- a/apps/fo/app/pages/processArea/page.tsx +++ b/apps/fo/app/pages/processArea/page.tsx @@ -4,6 +4,7 @@ import { ContentsDiv, downloadExcel, MainDiv, SearchBaseForm, SelectBox, Title, import ListDiv from "@common/business_components/ui/list_div"; import { useCallback, useEffect, useRef, useState } from "react"; import ProcessFacilityInfoModal from "./modal/page"; +import LoadingOverlay from "@common/business_components/ui/loadingBar"; export default function ProcessArea() { const {Common, @@ -39,7 +40,8 @@ export default function ProcessArea() { upHeadList1, processAreaList, processAreaCount, - excelList + excelList, + isLoading, } = ProcessArea; const mainList: Record[] = processAreaList || []; @@ -52,8 +54,7 @@ export default function ProcessArea() { const [fcltyCd, setFcltyCd] = useState(""); const [resetPage, setResetPage] = useState(false); - //const [searchYearValue, setSearchYearValue] = useState(selectSearchYear[0]?.val || "0"); - const [searchYearValue, setSearchYearValue] = useState("2023"); + const [searchYearValue, setSearchYearValue] = useState(selectSearchYear[0]?.val || "0"); const ref = useRef({ partValue: '', @@ -84,8 +85,8 @@ export default function ProcessArea() { input.value = ""; } } - setSearchYearValue("2023"); - searchProcessAreaList(1, 10, '', '', "2023"); + setSearchYearValue(selectSearchYear[0]?.val || "0"); + searchProcessAreaList(1, 10, '', '', selectSearchYear[0]?.val || "0"); } // 셀 클릭 시 모달 표시 @@ -105,7 +106,7 @@ export default function ProcessArea() { useEffect(() => { if (!isInit) { initializeCommonData(); - searchProcessAreaList(1, 10, '', '', "2023"); + searchProcessAreaList(1, 10, '', '', selectSearchYear[0]?.val || "0"); } }, [isInit, initializeCommonData, searchProcessAreaList]); @@ -153,6 +154,7 @@ export default function ProcessArea() { isAdmin={true} /> +
index !== undefined && cellClick(index)} headName={"처리구역정보"} tableData={mainList} headlist={upHeadList1} pageSize={10} total={total} resetPageNo={resetPage} onPageChange={handlePageChange} /> diff --git a/apps/fo/app/pages/processFacility/page.tsx b/apps/fo/app/pages/processFacility/page.tsx index ed58dea2b..109b64562 100644 --- a/apps/fo/app/pages/processFacility/page.tsx +++ b/apps/fo/app/pages/processFacility/page.tsx @@ -5,6 +5,7 @@ import { ContentsDiv, downloadExcel, MainDiv, SearchBaseForm, SearchInput, Selec import ListDiv from "@common/business_components/ui/list_div"; import { useCallback, useEffect, useRef, useState } from "react"; import ProcessFacilityInfoModal from "./modal/page"; +import LoadingOverlay from "@common/business_components/ui/loadingBar"; export default function ProcessFacilitySearch() { const {Common @@ -63,7 +64,8 @@ export default function ProcessFacilitySearch() { upHeadList1, upHeadList2, upHeadList3, - excelList + excelList, + isLoading, } = ProcessFacilityList; const processFacilityList = ProcessFacilityList?.processFacilityList || []; @@ -262,6 +264,7 @@ export default function ProcessFacilitySearch() { initClick={resetVal} ref={ref} isAdmin={false} /> +
({ @@ -68,7 +70,11 @@ export default function Rdi() { // 시설상태 const [operationValue, setOperationValue] = useState("0"); // 조회기간 - const [searchYear, setSearchYear] = useState("2023"); + const [searchYear, setSearchYear] = useState(selectSearchYear[0]?.val || "0"); + + useEffect(() => { + console.log(isLoading); + }, [isLoading]); /** * 페이지 함수 @@ -81,7 +87,7 @@ export default function Rdi() { // 상태값 설정 setFcltCpct(selectUpdownData[0]?.val || "0"); setOperationValue(selectOperationData[0]?.val || "0"); - setSearchYear("2023"); + setSearchYear(selectSearchYear[0]?.val || "0"); // SearchInputSelect 초기화 setFcltyName(""); if (searchInputRef.current) { @@ -90,8 +96,7 @@ export default function Rdi() { input.value = ""; } } - searchRdiList(1, 10, "2023"); - + searchRdiList(1, 10, selectSearchYear[0]?.val || "0"); } /** @@ -100,7 +105,7 @@ export default function Rdi() { useEffect(() => { if (!isInit) { initializeCommonData(); - searchRdiList(1, 10, "2023"); + searchRdiList(1, 10, selectSearchYear[0]?.val || "0"); } }, [isInit, initializeCommonData, searchRdiList]); @@ -187,6 +192,7 @@ export default function Rdi() { initClick={resetVal} ref={ref} isAdmin={false} /> +
diff --git a/apps/fo/app/pages/sewageOccur/page.tsx b/apps/fo/app/pages/sewageOccur/page.tsx index 8b4a46db3..885af7567 100644 --- a/apps/fo/app/pages/sewageOccur/page.tsx +++ b/apps/fo/app/pages/sewageOccur/page.tsx @@ -6,6 +6,7 @@ import ListDiv from "@common/business_components/ui/list_div"; import { useCallback, useEffect, useRef, useState } from "react"; import SewageOccurModal from "./modal/page"; import type { SewageOccurProps } from "@/app/store/sewageOccur"; +import LoadingOverlay from "@common/business_components/ui/loadingBar"; export default function PlanSewage() { const {Common @@ -46,7 +47,8 @@ export default function PlanSewage() { upHeadList3, sewageOccurList, sewageOccurCount, - excelList + excelList, + isLoading, } = SewageOccur; const ref = useRef({ @@ -84,8 +86,7 @@ export default function PlanSewage() { // 시설상태 const [operationValue, setOperationValue] = useState("0"); // 조회기간 - // const [searchYear, setSearchYear] = useState(selectSearchYear[0]?.val || "0"); - const [searchYear, setSearchYear] = useState("2023"); + const [searchYear, setSearchYear] = useState(selectSearchYear[0]?.val || "0"); /** * 페이지 함수 @@ -97,7 +98,7 @@ export default function PlanSewage() { // 상태값 설정 setFcltCpct(selectUpdownData[0]?.val || "0"); setOperationValue(selectOperationData[0]?.val || "0"); - setSearchYear("2023"); + setSearchYear(selectSearchYear[0]?.val || "0"); // SearchInputSelect 초기화 setFcltyName(""); if (searchInputRef.current) { @@ -106,7 +107,7 @@ export default function PlanSewage() { input.value = ""; } } - searchSewageOccurList(1, 10, "2023"); + searchSewageOccurList(1, 10, selectSearchYear[0]?.val || "0"); } // 모달 닫기 @@ -129,7 +130,7 @@ export default function PlanSewage() { useEffect(() => { if (!isInit) { initializeCommonData(); - searchSewageOccurList(1, 10, "2023"); + searchSewageOccurList(1, 10, selectSearchYear[0]?.val || "0"); } }, [isInit, initializeCommonData, searchSewageOccurList]); @@ -218,6 +219,7 @@ export default function PlanSewage() { isAdmin={false} /> +
index !== undefined && cellClick(index)} headName={"오수발생량 추정"} tableData={mainList} headlist={upheadList} pageSize={10} total={total} resetPageNo={resetPage} onPageChange={handlePageChange} /> diff --git a/apps/fo/app/pages/underWaterInput/page.tsx b/apps/fo/app/pages/underWaterInput/page.tsx index 45344755c..8debdb15e 100644 --- a/apps/fo/app/pages/underWaterInput/page.tsx +++ b/apps/fo/app/pages/underWaterInput/page.tsx @@ -6,6 +6,7 @@ import ListDiv from "@common/business_components/ui/list_div"; import { useCallback, useEffect, useRef, useState } from "react"; import UnderWaterInputModal from "./modal/page"; import type { UnderWaterProps } from "@/app/store/underWaterInput/types"; +import LoadingOverlay from "@common/business_components/ui/loadingBar"; export default function UnderWaterInput() { const {Common @@ -46,6 +47,7 @@ export default function UnderWaterInput() { underWaterList, underWaterCount, excelList, + isLoading, } = UnderWater; const ref = useRef({ @@ -82,8 +84,7 @@ export default function UnderWaterInput() { // 시설상태 const [operationValue, setOperationValue] = useState("0"); // 조회기간 - //const [searchYear, setSearchYear] = useState(selectSearchYear[0]?.val || "0"); - const [searchYear, setSearchYear] = useState("2023"); + const [searchYear, setSearchYear] = useState(selectSearchYear[0]?.val || "0"); /** * 페이지 함수 @@ -95,7 +96,7 @@ export default function UnderWaterInput() { // 상태값 설정 setFcltCpct(selectUpdownData[0]?.val || "0"); setOperationValue(selectOperationData[0]?.val || "0"); - setSearchYear("2023"); + setSearchYear(selectSearchYear[0]?.val || "0"); // SearchInputSelect 초기화 setFcltyName(""); if (searchInputRef.current) { @@ -104,7 +105,7 @@ export default function UnderWaterInput() { input.value = ""; } } - searchUnderWaterList(1, 10, "2023"); + searchUnderWaterList(1, 10, selectSearchYear[0]?.val || "0"); } // 모달 닫기 @@ -126,7 +127,7 @@ export default function UnderWaterInput() { useEffect(() => { if (!isInit) { initializeCommonData(); - searchUnderWaterList(1, 10, "2023"); + searchUnderWaterList(1, 10, selectSearchYear[0]?.val || "0"); } }, [isInit, initializeCommonData, searchUnderWaterList]); @@ -215,6 +216,7 @@ export default function UnderWaterInput() { isAdmin={false} /> +
index !== undefined && cellClick(index)} headName={"지하수유입량 추정"} tableData={mainList} headlist={upheadList} pageSize={10} total={total} resetPageNo={resetPage} onPageChange={handlePageChange} /> diff --git a/apps/fo/app/store/dashboard/index.tsx b/apps/fo/app/store/dashboard/index.tsx index f69f36b54..412571587 100644 --- a/apps/fo/app/store/dashboard/index.tsx +++ b/apps/fo/app/store/dashboard/index.tsx @@ -691,7 +691,7 @@ const drainageEquipmentList : DrainageEquipmentListProps[] = [ /* 시설정보 및 운영현황 - 계획 */ const fetchFacilityPlan = async (targetYear : string | undefined, fcltyCd : string | undefined) => { try { - targetYear = targetYear ? targetYear : "2023"; + targetYear = targetYear ? targetYear : "2024"; const baseUrl = 'https://apigateway.rsonesoft.com/dc-service/api/v1/nowDmgMtncGnsvy'; const queryParams = new URLSearchParams(); @@ -782,12 +782,14 @@ export type DashBoardType = { waterUsage1 : number | '', waterUsage2 : number | '', waterUsage3 : number | '', + isLoadingPlanFclty : boolean; }, OperationStatus : { isInit : boolean; upHeadListOperationStatus : TableUpperProps[]; operationalStatusList : OperationalStatusListProps[]; + isLoadingOperationStatus : boolean; } MainGraph : { @@ -801,6 +803,7 @@ export type DashBoardType = { chart_efflTn : lineChartDataProps[]; chart_inflBod : lineChartDataProps[]; chart_efflBod : lineChartDataProps[]; + isLoadingMainGraph : boolean; }, RainManage : { @@ -808,6 +811,7 @@ export type DashBoardType = { upHeadListRainManage : TableUpperProps[]; rainManageList : RainManageListProps[]; excelList : RainManageExcelType[]; + isLoadingRainManage : boolean; }, DrainageEquipment : { @@ -839,13 +843,15 @@ export const dashBoardInitState:DashBoardType = { planFcltyList : planFcltyList, waterUsage1 : 0, waterUsage2 : 0, - waterUsage3 : 0 + waterUsage3 : 0, + isLoadingPlanFclty : false, }, OperationStatus : { isInit : false, upHeadListOperationStatus : upHeadListOperationStatus, - operationalStatusList : operationalStatusList + operationalStatusList : operationalStatusList, + isLoadingOperationStatus : false, }, MainGraph : { @@ -858,14 +864,16 @@ export const dashBoardInitState:DashBoardType = { chart_inflTn : chart_inflTn, chart_efflTn : chart_efflTn, chart_inflBod : chart_inflBod, - chart_efflBod : chart_efflBod + chart_efflBod : chart_efflBod, + isLoadingMainGraph : false, }, RainManage : { isInit : false, upHeadListRainManage : upHeadListRainManage, rainManageList : rainManageList, - excelList : [] + excelList : [], + isLoadingRainManage : false, }, DrainageEquipment : { @@ -906,6 +914,7 @@ export const dataFormSetting=(item : OperationalStatusListProps)=> { }; const changeValue=(operationalStatus, data, keyTxt = 'INFL_AMNT')=>{ + console.log('changeValue data :', data); operationalStatus.yearAvg = data.yearData ? (keyTxt.includes('_TP') || keyTxt.includes("_TN"))? data.yearData?Number(Math.round(data.yearData['AVG_'+keyTxt] * 1000) / 1000).toFixed(3).toString():'': data.yearData['AVG_'+keyTxt] : ''; operationalStatus.yearMax = data.yearData ? (keyTxt.includes('_TP') || keyTxt.includes("_TN"))? data.yearData?Number(Math.round(data.yearData['MAX_'+keyTxt] * 1000) / 1000).toFixed(3).toString():'': data.yearData['MAX_'+keyTxt] : ''; operationalStatus.yearMin = data.yearData ? (keyTxt.includes('_TP') || keyTxt.includes("_TN"))? data.yearData?Number(Math.round(data.yearData['MIN_'+keyTxt] * 1000) / 1000).toFixed(3).toString():'': data.yearData['MIN_'+keyTxt] : ''; @@ -934,18 +943,18 @@ const changeValue=(operationalStatus, data, keyTxt = 'INFL_AMNT')=>{ const calcValue = (operationalStatus, data, keyTxt='INFL_ASSCT_BFR_WQLT_TP') => { // 연간 - operationalStatus.yearAvg = data.yearData ? Number(Math.round(data.yearData['AVG_'+keyTxt] * 1000) / 1000).toFixed(3).toString() : ''; - operationalStatus.yearMax = data.yearData ? Number(Math.round(data.yearData['MAX_'+keyTxt] * 1000) / 1000).toFixed(3).toString() : ''; - operationalStatus.yearMin = data.yearData ? Number(Math.round(data.yearData['MIN_'+keyTxt] * 1000) / 1000).toFixed(3).toString() : ''; + operationalStatus.yearAvg = data.yearData && data.yearData['AVG_'+keyTxt] ? Number(Math.round(data.yearData['AVG_'+keyTxt] * 1000) / 1000).toFixed(3).toString() : ''; + operationalStatus.yearMax = data.yearData && data.yearData['MAX_'+keyTxt] ? Number(Math.round(data.yearData['MAX_'+keyTxt] * 1000) / 1000).toFixed(3).toString() : ''; + operationalStatus.yearMin = data.yearData && data.yearData['MIN_'+keyTxt] ? Number(Math.round(data.yearData['MIN_'+keyTxt] * 1000) / 1000).toFixed(3).toString() : ''; // 여름 - operationalStatus.summerAll = data.summer ? Number(Math.round(data.summer['AVG_'+keyTxt] * 0.8 * 1000) / 1000).toFixed(3).toString() : ''; - operationalStatus.summerThree = data.summerRainy ? Number(Math.round(data.summerRainy['AVG_'+keyTxt] * 0.82 * 1000) / 1000).toFixed(3).toString() : ''; - operationalStatus.summerRain = data.summerSunny ? Number(Math.round(data.summerSunny['AVG_'+keyTxt] * 0.74 * 1000) / 1000).toFixed(3).toString() : ''; + operationalStatus.summerAll = data.summer && data.summer['AVG_'+keyTxt] ? Number(Math.round(data.summer['AVG_'+keyTxt] * 0.8 * 1000) / 1000).toFixed(3).toString() : ''; + operationalStatus.summerThree = data.summerRainy && data.summerRainy['AVG_'+keyTxt] ? Number(Math.round(data.summerRainy['AVG_'+keyTxt] * 0.82 * 1000) / 1000).toFixed(3).toString() : ''; + operationalStatus.summerRain = data.summerSunny && data.summerSunny['AVG_'+keyTxt] ? Number(Math.round(data.summerSunny['AVG_'+keyTxt] * 0.74 * 1000) / 1000).toFixed(3).toString() : ''; // 겨울 - operationalStatus.winterAll = data.winter ? Number(Math.round(data.winter['AVG_'+keyTxt] * 1.16*1000) / 1000).toFixed(3).toString() : ''; - operationalStatus.winterSunnyMin = data.winterSunny ? Number(Math.round(data.winterSunny['MIN_'+keyTxt] * 1.2 * 1000) / 1000).toFixed(3).toString() : ''; - operationalStatus.winterSunnyAvg = data.winterSunny ? Number(Math.round(data.winterSunny['AVG_'+keyTxt] * 1.25 *1000) / 1000).toFixed(3).toString() : ''; - operationalStatus.winterSunnyMax = data.winterSunny ? Number(Math.round(data.winterSunny['MAX_'+keyTxt] * 1.3 *1000) / 1000).toFixed(3).toString() : ''; + operationalStatus.winterAll = data.winter && data.winter['AVG_'+keyTxt] ? Number(Math.round(data.winter['AVG_'+keyTxt] * 1.16*1000) / 1000).toFixed(3).toString() : ''; + operationalStatus.winterSunnyMin = data.winterSunny && data.winterSunny['MIN_'+keyTxt] ? Number(Math.round(data.winterSunny['MIN_'+keyTxt] * 1.2 * 1000) / 1000).toFixed(3).toString() : ''; + operationalStatus.winterSunnyAvg = data.winterSunny && data.winterSunny['AVG_'+keyTxt] ? Number(Math.round(data.winterSunny['AVG_'+keyTxt] * 1.25 *1000) / 1000).toFixed(3).toString() : ''; + operationalStatus.winterSunnyMax = data.winterSunny && data.winterSunny['MAX_'+keyTxt] ? Number(Math.round(data.winterSunny['MAX_'+keyTxt] * 1.3 *1000) / 1000).toFixed(3).toString() : ''; } type RtnFlowType = { @@ -1053,6 +1062,13 @@ export const dashBoardReducer:(set:(fn: (state: DashBoardType) => DashBoardType) /** 시설정보 및 운영현황 - 계획정보 */ searchPlanInfo : async (targetYear: string, fcltyCd: string) => { + set((state: DashBoardType) => ({ + ...state, + PlanFclty: { + ...state.PlanFclty, + isLoadingPlanFclty: true, + }, + })); const res = await fetchFacilityPlan(targetYear, fcltyCd); let waterUsage = [0, 0, 0]; let minDiff=9999999; @@ -1116,13 +1132,21 @@ export const dashBoardReducer:(set:(fn: (state: DashBoardType) => DashBoardType) planFcltyList : planFcltyList, waterUsage1 : waterUsage[0] || 0, waterUsage2 : waterUsage[1] || 0, - waterUsage3 : waterUsage[2] || 0 - } + waterUsage3 : waterUsage[2] || 0, + isLoadingPlanFclty : false, + }, })); }, /** 시설정보 및 운영현황 - 운영실태 */ searchOperationStatus: async (isExcel: boolean, searchYear: string, fcltyCd: string) => { + set((state: DashBoardType) => ({ + ...state, + OperationStatus: { + ...state.OperationStatus, + isLoadingOperationStatus: true, + }, + })); const res = await fetchOperationStatus(searchYear, fcltyCd); const data = res.data; @@ -1225,7 +1249,7 @@ export const dashBoardReducer:(set:(fn: (state: DashBoardType) => DashBoardType) operationalStatusList[7].groundWaterAvg = Math.round((Number(operationalStatusList[0].groundWaterAvg) / Number(data.yearData.AVG_INFL_AMNT) * 100) * 10) / 10+'%'; operationalStatusList[7].groundWaterSummer = Math.round((Number(operationalStatusList[0].groundWaterSummer) / Number(data.summer.AVG_INFL_AMNT) * 100) * 10) / 10+'%'; operationalStatusList[7].groundWaterWinter = Math.round((Number(operationalStatusList[0].groundWaterWinter) / Number(data.winter.AVG_INFL_AMNT) * 100) * 10) / 10+'%'; - operationalStatusList[7].rdi = Math.round((Number(operationalStatusList[0].rdi) / Number(data.summerBod.INFL_AMNT) * 100) * 10) / 10+'%'; + operationalStatusList[7].rdi = operationalStatusList[0].rdi===null?0:Math.round((Number(operationalStatusList[0].rdi) / (data.summerBod&&data.summerBod.INFL_AMNT&&data.summerBod.INFL_AMNT!='null'?Number(data.summerBod.INFL_AMNT):0) * 100) * 10) / 10+'%'; /* operationalStatusList[7].groundWaterAvg = operationalStatusList[0].groundWaterAvg === null ? '' : Number(Number(operationalStatusList[0].groundWaterAvg) / Number(data.yearData.AVG_INFL_AMNT)) * 100; operationalStatusList[7].groundWaterSummer = operationalStatusList[0].groundWaterSummer === null ? '' : Number(Number(operationalStatusList[0].groundWaterSummer) / Number(data.summer.AVG_INFL_AMNT)) * 100; operationalStatusList[7].groundWaterWinter = operationalStatusList[0].groundWaterWinter === null ? '' : Number(Number(operationalStatusList[0].groundWaterWinter) / Number(data.winter.AVG_INFL_AMNT)) * 100;*/ @@ -1233,7 +1257,7 @@ export const dashBoardReducer:(set:(fn: (state: DashBoardType) => DashBoardType) } for(let i=1; i DashBoardType) OperationStatus: { ...state.OperationStatus, operationalStatusList: operationalStatusList, - operationalStatusCount: res.count - } + operationalStatusCount: res.count, + isLoadingOperationStatus : false, + }, })) }, searchMainGraph: async (searchYear: string, fcltyCd: string) => { + set((state: DashBoardType) => ({ + ...state, + MainGraph: { + ...state.MainGraph, + isLoadingMainGraph: true, + }, + })); const res = await fetchMainGraph(searchYear, fcltyCd); if(res == null || res.data == null || res.data.length === 0) { set((state: DashBoardType) => ({ @@ -1301,6 +1333,7 @@ export const dashBoardReducer:(set:(fn: (state: DashBoardType) => DashBoardType) chart_efflTn: [], chart_inflBod: [], chart_efflBod: [], + isLoadingMainGraph : false, } })); return; @@ -1366,12 +1399,20 @@ export const dashBoardReducer:(set:(fn: (state: DashBoardType) => DashBoardType) chart_inflTn: chart_inflTn, chart_efflTn: chart_efflTn, chart_inflBod: chart_inflBod, - chart_efflBod: chart_efflBod - } + chart_efflBod: chart_efflBod, + isLoadingMainGraph : false, + }, })) }, searchRainManage: async (searchYear: string, fcltyCd: string, isExcel : boolean) => { + set((state: DashBoardType) => ({ + ...state, + RainManage: { + ...state.RainManage, + isLoadingRainManage: true, + }, + })); const res = await fetchMainGraph(searchYear, fcltyCd); if(res == null || res.data.wqltObjs == null || res.data.wqltObjs.length === 0) { set((state: DashBoardType) => ({ @@ -1379,6 +1420,7 @@ export const dashBoardReducer:(set:(fn: (state: DashBoardType) => DashBoardType) RainManage: { ...state.RainManage, rainManageList: [], + isLoadingRainManage : false, } })); return; @@ -1756,9 +1798,11 @@ export const dashBoardReducer:(set:(fn: (state: DashBoardType) => DashBoardType) ...state.RainManage, rainManageList: filteredData as RainManageListProps[], excelList: excelList, + isLoadingRainManage : false, } : { ...state.RainManage, rainManageList: filteredData as RainManageListProps[], + isLoadingRainManage : false, } })); }, diff --git a/apps/fo/app/store/facilityPrecipitation/index.tsx b/apps/fo/app/store/facilityPrecipitation/index.tsx index 0c94cf553..833100a75 100644 --- a/apps/fo/app/store/facilityPrecipitation/index.tsx +++ b/apps/fo/app/store/facilityPrecipitation/index.tsx @@ -217,6 +217,7 @@ export type FacilityPrecipitationType = { facilityPrecipitation: FacilityPrecipitationProps[]; excelList: ExcelType[]; facilityPrecipitationCount: number; + isLoading: boolean; }, PrecipitationDetail : { @@ -239,7 +240,8 @@ export const facilityPrecipitationInitState: FacilityPrecipitationType = { upHeadList3 : upHeadList3, facilityPrecipitation : facilityPrecipitation, excelList : [], - facilityPrecipitationCount : 0 + facilityPrecipitationCount : 0, + isLoading : true, }, PrecipitationDetail : { @@ -254,6 +256,14 @@ export type FacilityPrecipitationStore = FacilityPrecipitationType & FacilityPre export const facilityPrecipitationReducer:(set:(fn: (state: FacilityPrecipitationType) => FacilityPrecipitationType) => void)=>FacilityPrecipitationActions=(set: (fn: (state: FacilityPrecipitationType) => FacilityPrecipitationType) => void) => { return { searchFacilityPrecipitationList: async (pageNo: number, pageSize: number, searchYear: string, part?: string, nameCd?: string, fcltCpct?: string, operationValue?: string, fcltyNm?: string) => { + set((state: FacilityPrecipitationType) => ({ + ...state, + FacilityPrecipitation: { + ...state.FacilityPrecipitation, + isLoading: true, + }, + })); + const res = await fetchFacilityPrecipitationList(pageNo, pageSize, searchYear, part, nameCd, fcltCpct, operationValue, fcltyNm); const data = res.data; const excelDownList: ExcelType[] = []; @@ -293,13 +303,15 @@ export const facilityPrecipitationReducer:(set:(fn: (state: FacilityPrecipitatio ...state.FacilityPrecipitation, facilityPrecipitation: res.data, facilityPrecipitationCount: res.count, + isLoading : false, }:{ ...state.FacilityPrecipitation, excelList: excelDownList, + isLoading : false, }, PrecipitationDetail:{ ...state.PrecipitationDetail, - gridListPrecipitationDetail: res.detailData + gridListPrecipitationDetail: res.detailData, } })) } diff --git a/apps/fo/app/store/facilityWaterQlty/index.tsx b/apps/fo/app/store/facilityWaterQlty/index.tsx index 37cc27143..53e430d47 100644 --- a/apps/fo/app/store/facilityWaterQlty/index.tsx +++ b/apps/fo/app/store/facilityWaterQlty/index.tsx @@ -292,6 +292,7 @@ export type FacilityWaterQltyType = { upHeadList1: TableUpperProps[]; upHeadList2: TableUpperProps[]; upHeadList3: TableUpperProps[]; + isLoading: boolean; }, FacilityWaterQltyModal: { @@ -315,6 +316,7 @@ export const facilityWaterQltyInitState: FacilityWaterQltyType = { facilityWaterQltyCount: 0, facilityWaterQltyList: [], excelList: [], + isLoading: true, isInit: false, mainLabelArray: mainLabelArray, upHeadList1: upHeadList1, @@ -395,6 +397,13 @@ export const facilityWaterQltyReducer = (set: (fn: (state: FacilityWaterQltyType * @param fcltyNm : 시설명 */ searchFacilityWaterQltyList: async (pageNo: number, pageSize: number, searchYear: string, part?: string, nameCd?: string, fcltCpct?: string, operationValue?: string, fcltyNm?: string) => { + set((state: FacilityWaterQltyType) => ({ + ...state, + FacilityWaterQltyMain: { + ...state.FacilityWaterQltyMain, + isLoading: true, + }, + })); const res = await fetchFacilityWaterQltyList(pageNo, pageSize, searchYear, part, nameCd, fcltCpct, operationValue, fcltyNm); const rtnData = res.data.map(item => { dataFormSetting(item) @@ -480,10 +489,12 @@ export const facilityWaterQltyReducer = (set: (fn: (state: FacilityWaterQltyType ...state.FacilityWaterQltyMain, facilityWaterQltyList: rtnData, facilityWaterQltyCount: res.count, + isLoading : false, }:{ ...state.FacilityWaterQltyMain, excelList: excelDownList, - } + isLoading : false, + }, })) }, @@ -574,7 +585,7 @@ export const facilityWaterQltyReducer = (set: (fn: (state: FacilityWaterQltyType } } } - + // 이틀 전, 하루 전이 강우영향일(3 이상)인 경우 해당 날도 강우영향일로 설정 for(let idx = 0; idx < data.length; idx++) { if(data[idx]) { diff --git a/apps/fo/app/store/flowRate/index.tsx b/apps/fo/app/store/flowRate/index.tsx index 3456bb8cc..a7be5bf60 100644 --- a/apps/fo/app/store/flowRate/index.tsx +++ b/apps/fo/app/store/flowRate/index.tsx @@ -219,6 +219,7 @@ export type FlowRateSearchType = { flowRateList:flowRateListProps[]; flowRateCount: number; excelList: ExcelType[]; + isLoading: boolean; }, FlowRateModal : { @@ -252,7 +253,8 @@ export const flowRateSearchInitState:FlowRateSearchType = { upHeadList3 : upHeadList3, flowRateList : flowRateList, flowRateCount : 0, - excelList: [] + excelList: [], + isLoading: true, }, FlowRateModal : { isInit : false, @@ -264,6 +266,13 @@ export const flowRateSearchInitState:FlowRateSearchType = { export const flowRateSearchReducer:(set:(fn: (state: FlowRateSearchType) => FlowRateSearchType) => void)=>FlowRateSearchActions=(set: (fn: (state: FlowRateSearchType) => FlowRateSearchType) => void) => { return { searchFlowRateList: async (pageNo: number, pageSize: number, searchYear: string, partCd?: string, nameCd?: string, fcltCpct?: string, operationValue?: string, fcltyNm?: string) => { + set((state: FlowRateSearchType) => ({ + ...state, + FlowRateList: { + ...state.FlowRateList, + isLoading: true, + }, + })); const res = await fetchFlowRateList(pageNo, pageSize, searchYear, partCd, nameCd, fcltCpct, operationValue, fcltyNm); const data = res.data; const excelDownList: ExcelType[] = []; @@ -302,10 +311,12 @@ export const flowRateSearchReducer:(set:(fn: (state: FlowRateSearchType) => Flow ...state.FlowRateList, flowRateList: rtnData, flowRateCount: res.count, + isLoading : false, }:{ ...state.FlowRateList, excelList: excelDownList, - } + isLoading : false, + }, })) }, searchFlowRateModalList: async (bscFctCd: string, searchYear: string) => { diff --git a/apps/fo/app/store/planSewage/index.tsx b/apps/fo/app/store/planSewage/index.tsx index c5286db8d..112070300 100644 --- a/apps/fo/app/store/planSewage/index.tsx +++ b/apps/fo/app/store/planSewage/index.tsx @@ -146,6 +146,7 @@ export type PlanSewageType = { planSewageList: PlanSewageProps[]; planSewageCount: number; excelList: ExcelType[]; + isLoading: boolean; }, } @@ -162,7 +163,8 @@ export const planSewageInitState: PlanSewageType = { upHeadList3 : upHeadList3, planSewageList : planSewageList, planSewageCount : 0, - excelList : [] + excelList : [], + isLoading : true, }, } @@ -171,6 +173,13 @@ export type PlanSewageStore = PlanSewageType & PlanSewageActions; export const planSewageReducer:(set:(fn: (state: PlanSewageType) => PlanSewageType) => void)=>PlanSewageActions=(set: (fn: (state: PlanSewageType) => PlanSewageType) => void) => { return { searchPlanSewageList: async (pageNo: number, pageSize: number, searchYear: string, partCd?: string, nameCd?: string, fcltCpct?: string, operationValue?: string, fcltyNm?: string) => { + set((state: PlanSewageType) => ({ + ...state, + PlanSewage: { + ...state.PlanSewage, + isLoading: true, + }, + })); const res = await fetchPlanSewageList(pageNo, pageSize, searchYear, partCd, nameCd, fcltCpct, operationValue, fcltyNm); const excelDownList: ExcelType[] = []; const data = res.data @@ -237,10 +246,12 @@ export const planSewageReducer:(set:(fn: (state: PlanSewageType) => PlanSewageTy ...state.PlanSewage, planSewageList: resultData, planSewageCount: res.count, + isLoading : false, }:{ ...state.PlanSewage, excelList: excelDownList, - } + isLoading : false, + }, })) } } diff --git a/apps/fo/app/store/processArea/index.tsx b/apps/fo/app/store/processArea/index.tsx index ba0f5a749..406c43f05 100644 --- a/apps/fo/app/store/processArea/index.tsx +++ b/apps/fo/app/store/processArea/index.tsx @@ -318,6 +318,7 @@ export type ProcessAreaType = { processAreaList: ProcessAreaProps[]; processAreaCount: number; excelList: ExcelType[]; + isLoading: boolean; }, ProcessAreaDetail : { @@ -342,7 +343,8 @@ export const processAreaInitState: ProcessAreaType = { upHeadList1 : upHeadList1, processAreaList : processAreaList, processAreaCount : 0, - excelList : [] + excelList : [], + isLoading : true, }, ProcessAreaDetail : { @@ -369,6 +371,13 @@ export const processAreaReducer:(set:SetStateFunction)=>ProcessAreaActions=(set: * @param pageSize : 페이지 크기 */ searchProcessAreaList: async ( pageNo:number, pageSize:number, ctpvNm?:string, sggNm?:string, targetYear?:string) => { + set((state: ProcessAreaType) => ({ + ...state, + ProcessArea: { + ...state.ProcessArea, + isLoading: true, + }, + })); const res = await fetchProcessAreaList(pageNo, pageSize, ctpvNm, sggNm, targetYear); res.data.forEach((item:ProcessAreaProps) => { DataForm({ type: 'float1', column: 'fctCpc', item:item as unknown as Record}); @@ -414,9 +423,11 @@ export const processAreaReducer:(set:SetStateFunction)=>ProcessAreaActions=(set: ...state.ProcessArea, processAreaList: res.data, processAreaCount: res.count, + isLoading : false, }:{ ...state.ProcessArea, excelList: excelDownList, + isLoading : false, }, })) }, @@ -427,49 +438,49 @@ export const processAreaReducer:(set:SetStateFunction)=>ProcessAreaActions=(set: if (rtnData) { upHeadListFcltyImproveInfo.forEach((head:TableUpperProps) => { if(head.id === 'planSwageQntSum' || head.id === 'swtrmtPpltnCnt' || head.id === 'swtrmtZoneArea') { - head.title = '현재\n(' + rtnData.yr + '년)'; + rtnData.yr?head.title = '현재\n(' + rtnData.yr + '년)':head.title = '현재'; } else if(head.id === 'planSwageQntSumDc1' || head.id === 'swtrmtPpltnCntDc1' || head.id === 'swtrmtZoneAreaDc1') { - head.title = '1단계\n(' + rtnData.yrDc1 + '년)'; + rtnData.yrDc1?head.title = '1단계\n(' + rtnData.yrDc1 + '년)':head.title = '1단계'; } else if(head.id === 'planSwageQntSumDc2' || head.id === 'swtrmtPpltnCntDc2' || head.id === 'swtrmtZoneAreaDc2') { - head.title = '2단계\n(' + rtnData.yrDc2 + '년)'; + rtnData.yrDc2?head.title = '2단계\n(' + rtnData.yrDc2 + '년)':head.title = '2단계'; } else if(head.id === 'planSwageQntSumDc3' || head.id === 'swtrmtPpltnCntDc3' || head.id === 'swtrmtZoneAreaDc3') { - head.title = '3단계\n(' + rtnData.yrDc3 + '년)'; + rtnData.yrDc3?head.title = '3단계\n(' + rtnData.yrDc3 + '년)':head.title = '3단계'; } else if(head.id === 'planSwageQntSumDc4' || head.id === 'swtrmtPpltnCntDc4' || head.id === 'swtrmtZoneAreaDc4') { - head.title = '4단계\n(' + rtnData.yrDc4 + '년)'; + rtnData.yrDc4?head.title = '4단계\n(' + rtnData.yrDc4 + '년)':head.title = '4단계'; } else if(head.id === 'planSwageQntSumDt4' || head.id === 'swtrmtPpltnCntDt4' || head.id === 'swtrmtZoneAreaDt4') { - head.title = '기승인\n4단계(' + rtnData.yrDt4 + '년)'; + rtnData.yrDt4?head.title = '기승인\n4단계(' + rtnData.yrDt4 + '년)':head.title = '기승인\n4단계'; } }); upHeadListProcessAreaPlan.forEach((head:TableUpperProps) => { if(head.id === 'planSwageQntSum' || head.id === 'swtrmtPpltnCnt' || head.id === 'swtrmtZoneArea') { - head.title = '현재\n(' + rtnData.yr + '년)'; + rtnData.yr?head.title = '현재\n(' + rtnData.yr + '년)':head.title = '현재'; } else if(head.id === 'planSwageQntSumDc1' || head.id === 'swtrmtPpltnCntDc1' || head.id === 'swtrmtZoneAreaDc1') { - head.title = '1단계\n(' + rtnData.yrDc1 + '년)'; + rtnData.yrDc1?head.title = '1단계\n(' + rtnData.yrDc1 + '년)':head.title = '1단계'; } else if(head.id === 'planSwageQntSumDc2' || head.id === 'swtrmtPpltnCntDc2' || head.id === 'swtrmtZoneAreaDc2') { - head.title = '2단계\n(' + rtnData.yrDc2 + '년)'; + rtnData.yrDc2?head.title = '2단계\n(' + rtnData.yrDc2 + '년)':head.title = '2단계'; } else if(head.id === 'planSwageQntSumDc3' || head.id === 'swtrmtPpltnCntDc3' || head.id === 'swtrmtZoneAreaDc3') { - head.title = '3단계\n(' + rtnData.yrDc3 + '년)'; + rtnData.yrDc3?head.title = '3단계\n(' + rtnData.yrDc3 + '년)':head.title = '3단계'; } else if(head.id === 'planSwageQntSumDc4' || head.id === 'swtrmtPpltnCntDc4' || head.id === 'swtrmtZoneAreaDc4') { - head.title = '4단계\n(' + rtnData.yrDc4 + '년)'; + rtnData.yrDc4?head.title = '4단계\n(' + rtnData.yrDc4 + '년)':head.title = '4단계'; } else if(head.id === 'planSwageQntSumDt4' || head.id === 'swtrmtPpltnCntDt4' || head.id === 'swtrmtZoneAreaDt4') { - head.title = '기승인\n4단계(' + rtnData.yrDt4 + '년)'; + rtnData.yrDt4?head.title = '기승인\n4단계(' + rtnData.yrDt4 + '년)':head.title = '기승인\n4단계'; } }); upHeadListProcessPopulation.forEach((head:TableUpperProps) => { if(head.id === 'planSwageQntSum' || head.id === 'swtrmtPpltnCnt' || head.id === 'swtrmtZoneArea') { - head.title = '현재\n(' + rtnData.yr + '년)'; + rtnData.yr?head.title = '현재\n(' + rtnData.yr + '년)':head.title = '현재'; } else if(head.id === 'planSwageQntSumDc1' || head.id === 'swtrmtPpltnCntDc1' || head.id === 'swtrmtZoneAreaDc1') { - head.title = '1단계\n(' + rtnData.yrDc1 + '년)'; + rtnData.yrDc1?head.title = '1단계\n(' + rtnData.yrDc1 + '년)':head.title = '1단계'; } else if(head.id === 'planSwageQntSumDc2' || head.id === 'swtrmtPpltnCntDc2' || head.id === 'swtrmtZoneAreaDc2') { - head.title = '2단계\n(' + rtnData.yrDc2 + '년)'; + rtnData.yrDc2?head.title = '2단계\n(' + rtnData.yrDc2 + '년)':head.title = '2단계'; } else if(head.id === 'planSwageQntSumDc3' || head.id === 'swtrmtPpltnCntDc3' || head.id === 'swtrmtZoneAreaDc3') { - head.title = '3단계\n(' + rtnData.yrDc3 + '년)'; + rtnData.yrDc3?head.title = '3단계\n(' + rtnData.yrDc3 + '년)':head.title = '3단계'; } else if(head.id === 'planSwageQntSumDc4' || head.id === 'swtrmtPpltnCntDc4' || head.id === 'swtrmtZoneAreaDc4') { - head.title = '4단계\n(' + rtnData.yrDc4 + '년)'; + rtnData.yrDc4?head.title = '4단계\n(' + rtnData.yrDc4 + '년)':head.title = '4단계'; } else if(head.id === 'planSwageQntSumDt4' || head.id === 'swtrmtPpltnCntDt4' || head.id === 'swtrmtZoneAreaDt4') { - head.title = '기승인\n4단계(' + rtnData.yrDt4 + '년)'; + rtnData.yrDt4?head.title = '기승인\n4단계(' + rtnData.yrDt4 + '년)':head.title = '기승인\n4단계'; } }); diff --git a/apps/fo/app/store/processFacility/index.tsx b/apps/fo/app/store/processFacility/index.tsx index a8c04930d..022c28c3e 100644 --- a/apps/fo/app/store/processFacility/index.tsx +++ b/apps/fo/app/store/processFacility/index.tsx @@ -517,6 +517,7 @@ export type ProcessFacilityType = { processFacilityList:facilityListProps[]; processFacilityCount:number; excelList : ExcelType[]; + isLoading: boolean; }, ProcessFacilityDetail : { @@ -551,7 +552,8 @@ export const processFacilityInitState:ProcessFacilityType = { upHeadList3 : upHeadList3, processFacilityList : processFacilityList, processFacilityCount:1, - excelList : [] + excelList : [], + isLoading : true, }, ProcessFacilityDetail : { @@ -588,6 +590,13 @@ export const processFacilityReducer:(set:SetStateFunction)=>ProcessFacilityActio * @param pageSize : 페이지 크기 */ searchProcessFacility: async (pageNo:number, pageSize:number, partValue?:string, nameCd?:string, fcltCpct?:string, oprtngSttsCd?:string, facilityPartValue?:string, facilityName?:string) => { + set((state: ProcessFacilityType) => ({ + ...state, + ProcessFacilityList: { + ...state.ProcessFacilityList, + isLoading: true, + }, + })); const res = await fetchFacilityList(pageNo, pageSize, partValue, nameCd, fcltCpct, oprtngSttsCd, facilityPartValue, facilityName); res.data.forEach((item:facilityListProps) => { DataForm({ type: 'date', column: 'cmplDt', item:item as unknown as Record}); @@ -635,9 +644,11 @@ export const processFacilityReducer:(set:SetStateFunction)=>ProcessFacilityActio ...state.ProcessFacilityList, processFacilityList: res.data, processFacilityCount: res.count, + isLoading: false, }:{ ...state.ProcessFacilityList, excelList: excelDownList, + isLoading: false, }, })) }, @@ -648,6 +659,13 @@ export const processFacilityReducer:(set:SetStateFunction)=>ProcessFacilityActio * @param pageSize : 페이지 크기 */ searchProcessFacilitySearching: async (pageNo:number, pageSize:number, partValue?:string, nameCd?:string, fcltCpct?:string, oprtngSttsCd?:string, facilityPartValue?:string, facilityName?:string) => { + set((state: ProcessFacilityType) => ({ + ...state, + ProcessFacilityList: { + ...state.ProcessFacilityList, + isLoading: true, + }, + })); const res = await fetchFacilityListSearching(pageNo, pageSize, partValue, nameCd, fcltCpct, oprtngSttsCd, facilityPartValue, facilityName); /* res.data.forEach((item:facilityListProps) => { DataForm({ type: 'date', column: 'cmplDt', item:item as unknown as Record}); @@ -665,6 +683,7 @@ export const processFacilityReducer:(set:SetStateFunction)=>ProcessFacilityActio ...state.ProcessFacilityList, processFacilityList: res.data, processFacilityCount: res.count, + isLoading: false, }, })) }, diff --git a/apps/fo/app/store/rdi/index.tsx b/apps/fo/app/store/rdi/index.tsx index e7acb2231..b1eccc2b7 100644 --- a/apps/fo/app/store/rdi/index.tsx +++ b/apps/fo/app/store/rdi/index.tsx @@ -183,6 +183,7 @@ export type RdiType = { rdiList: RdiProps[]; // Changed from facilityAreaProps to ProcessAreaProps rdiCount: number; excelList: ExcelType[]; + isLoading: boolean; }, } @@ -199,7 +200,8 @@ export const rdiInitState: RdiType = { upHeadList3 : upHeadList3, rdiList : rdiList, rdiCount : 2, - excelList : [] + excelList : [], + isLoading : true, } } @@ -220,6 +222,14 @@ export const rdiReducer:(set:SetStateFunction)=>RdiActions=(set: SetStateFunctio console.log("tableActionsExport"); return { searchRdiList: async (pageNo: number, pageSize: number, searchYear: string, partCd?: string, nameCd?: string, fcltCpct?: string, operationValue?: string, fcltyNm?: string) => { + set((state: RdiType) => ({ + ...state, + Rdi: { + ...state.Rdi, + isLoading: true, + }, + })); + const res = await fetchRdiList(pageNo, pageSize, searchYear, partCd, nameCd, fcltCpct, operationValue, fcltyNm); const data = res.data; const excelDownList: ExcelType[] = []; @@ -264,10 +274,12 @@ export const rdiReducer:(set:SetStateFunction)=>RdiActions=(set: SetStateFunctio ...state.Rdi, rdiList: rtnData, rdiCount: res.count, + isLoading : false, }:{ ...state.Rdi, excelList: excelDownList, - } + isLoading : false, + }, })) }, } diff --git a/apps/fo/app/store/sewageOccur/index.tsx b/apps/fo/app/store/sewageOccur/index.tsx index 426030c59..5feb91f94 100644 --- a/apps/fo/app/store/sewageOccur/index.tsx +++ b/apps/fo/app/store/sewageOccur/index.tsx @@ -161,6 +161,7 @@ export type SewageOccurType = { sewageOccurList: SewageOccurProps[]; // Changed from facilityAreaProps to ProcessAreaProps sewageOccurCount: number; excelList: ExcelType[]; + isLoading: boolean; }, SewageOccurDetail : { @@ -183,7 +184,8 @@ export const sewageOccurInitState: SewageOccurType = { upHeadList3 : upHeadList3, sewageOccurList : sewageOccurList, sewageOccurCount : 2, - excelList : [] + excelList : [], + isLoading : true, }, SewageOccurDetail : { @@ -212,9 +214,15 @@ export type FlowResponse = { export const sewageOccurReducer:(set:any)=>SewageOccurActions=(set: any) => { return { searchSewageOccurList: async (pageNo: number, pageSize: number, searchYear: string, part?: string, nameCd?: string, fcltCpct?: string, operationValue?: string, fcltyNm?: string) => { + set((state: SewageOccurType) => ({ + ...state, + SewageOccur: { + ...state.SewageOccur, + isLoading: true, + }, + })); const res = await fetchSewageOccurList(pageNo, pageSize, searchYear, part, nameCd, fcltCpct, operationValue, fcltyNm); const data = res.data; - console.log('first data : ', data); // Promise.all을 사용하여 모든 비동기 작업이 완료될 때까지 기다림 const calData = await Promise.all(data.map(async (item: SewageOccurProps) => { item.sidoNm = item.lclgvrnmntNm.split(' ')[0]?.toString() || ''; @@ -300,10 +308,12 @@ export const sewageOccurReducer:(set:any)=>SewageOccurActions=(set: any) => { ...state.SewageOccur, sewageOccurList: calData, sewageOccurCount: res.count, + isLoading : false, }:{ ...state.SewageOccur, excelList: [], - } + isLoading : false, + }, })) }, diff --git a/apps/fo/app/store/underWaterInput/index.tsx b/apps/fo/app/store/underWaterInput/index.tsx index 90f621193..70964d496 100644 --- a/apps/fo/app/store/underWaterInput/index.tsx +++ b/apps/fo/app/store/underWaterInput/index.tsx @@ -218,6 +218,7 @@ export type UnderWaterType = { underWaterList: UnderWaterProps[]; // Changed from facilityAreaProps to ProcessAreaProps underWaterCount: number; excelList: ExcelType[]; + isLoading: boolean; }, UnderWaterDetail : { @@ -240,7 +241,8 @@ export const underWaterInitState: UnderWaterType = { upHeadList3 : upHeadList3, underWaterList : underWaterList, underWaterCount : 4, - excelList : [] + excelList : [], + isLoading : true, }, UnderWaterDetail : { @@ -315,6 +317,14 @@ export const calRainEffectDay = (data: FlowDataItem[], weather: string) => { export const underWaterReducer:(set:(fn: (state: UnderWaterType) => UnderWaterType) => void)=>UnderWaterActions=(set: (fn: (state: UnderWaterType) => UnderWaterType) => void) => { return { searchUnderWaterList: async (pageNo: number, pageSize: number, searchYear: string, part?: string, nameCd?: string, fcltCpct?: string, operationValue?: string, fcltyNm?: string) => { + set((state: UnderWaterType) => ({ + ...state, + UnderWater: { + ...state.UnderWater, + isLoading: true, + }, + })); + const res = await fetchUnderWaterList(pageNo, pageSize, searchYear, part, nameCd, fcltCpct, operationValue, fcltyNm); const data = res.data; const calData = await Promise.all(data.map(async (item: UnderWaterProps) => { @@ -394,10 +404,12 @@ export const underWaterReducer:(set:(fn: (state: UnderWaterType) => UnderWaterTy ...state.UnderWater, underWaterList: calData, underWaterCount: res.count, + isLoading : false, }:{ ...state.UnderWater, - excelList: excelDownList, - } + isLoading : false, + excelList: excelDownList + }, })) }, unserWaterModal:async (bscFctCd, searchYear)=>{