From f18eaa8f0181aa364c24e899275477c7e768bf91 Mon Sep 17 00:00:00 2001
From: jwpark
Date: Sat, 26 Jul 2025 16:46:59 +0900
Subject: [PATCH 01/75] =?UTF-8?q?=EB=A9=94=EC=9D=B8=20=EB=A8=B8=EC=A7=80?=
=?UTF-8?q?=20=EC=9D=B4=EC=8A=88=EB=A1=9C=20=EC=88=98=EC=A0=95.?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../business_components/src/ui/map/Gis.js | 126 +++++++++++++++++-
1 file changed, 122 insertions(+), 4 deletions(-)
diff --git a/packages/common/business_components/src/ui/map/Gis.js b/packages/common/business_components/src/ui/map/Gis.js
index 4969795af..229e3f629 100644
--- a/packages/common/business_components/src/ui/map/Gis.js
+++ b/packages/common/business_components/src/ui/map/Gis.js
@@ -1,5 +1,6 @@
import { Search } from 'lucide-react';
import OlMap from 'ol/Map';
+import Overlay from 'ol/Overlay';
import View from 'ol/View';
import { defaults as defaultControls, OverviewMap } from 'ol/control';
import { defaults } from 'ol/interaction';
@@ -7,12 +8,15 @@ import * as olProj from 'ol/proj';
import { register } from 'ol/proj/proj4';
import proj4 from 'proj4';
import React, { createContext, useCallback, useContext, useEffect, useMemo, useRef, useState } from 'react';
+import { createRoot } from 'react-dom/client';
+import GisLonLat from './GisLonLat';
import GisMapToggle from './GisMapToggle';
import GisSelect from './GisSelect';
import GisToolBar from './GisToolBar';
import GisTree from './GisTree';
import './lib/css/gis.common.css';
import GisApp from './lib/gis.core';
+// import FacilityInfoPopup from './FacilityInfoPopup';
export const GisContext = createContext({ gisCore: null, gisMap: null, treeData: null, checkedLayerIds: null });
export const useGisContext = () => useContext(GisContext);
@@ -99,10 +103,8 @@ function Gis({
detailView: DetailView,
onFeatureSelect,
setIsSearchModalOpen,
- onCheckedLayersChange,
- setData
+ onCheckedLayersChange
}) {
-
const mapRef = useRef();
const [mapObject, setMapObject] = useState({});
const [tabVisible, setTabVisible] = useState(true);
@@ -219,7 +221,6 @@ function Gis({
// 지도 생성 및 초기화
useEffect(() => {
-
if (!mapRef.current) return;
if (mapInstanceRef.current) return; // 이미 생성된 맵이 있다면 중단
@@ -326,6 +327,120 @@ function Gis({
}
}
+ // // 데이터 로드 및 팝업 생성 로직
+ // useEffect(() => {
+ // if (!mapInstanceRef.current) return; // 맵이 생성되지 않았으면 실행 안 함
+
+ // // 1. 팝업 데이터 가져오기 (feature.js의 getData와 유사)
+ // const fetchPopupData = async () => {
+ // // 실제 API 호출 로직으로 대체해야 합니다.
+ // // 예시: const response = await yourApiService.getFcltyWtCnt();
+ // // setFacilityInfoPopupData(response.data);
+
+ // // 임시 목업 데이터
+ // const mockData = [
+ // { ftrIdn: 1, ftrCde: 'SA206', bplcNm: '처리장A', fcltyUseYn: 'Y', x: 127.005, y: 37.282, aCnt: 10, cCnt: 5, eCnt: 3, mCnt: 8, iCnt: 2 },
+ // { ftrIdn: 2, ftrCde: 'SA112', bplcNm: '처리장B', fcltyUseYn: 'N', x: 127.010, y: 37.285, aCnt: 8, cCnt: 4, eCnt: 2, mCnt: 6, iCnt: 1 }
+ // ];
+ // setFacilityInfoPopupData(mockData);
+ // };
+
+ // fetchPopupData();
+
+ // }, [mapInstanceRef.current]); // 맵 인스턴스가 생성된 후 한 번만 실행
+
+ // // 데이터가 변경되면 오버레이를 생성/업데이트하는 로직
+ // useEffect(() => {
+ // const map = mapInstanceRef.current;
+ // if (!map || facilityInfoPopupData.length === 0) return;
+
+ // // 기존 오버레이 정리
+ // facilityOverlaysRef.current.forEach(overlay => map.removeOverlay(overlay));
+ // facilityOverlaysRef.current = [];
+
+ // facilityInfoPopupData.forEach(data => {
+ // const popupId = `${data.ftrIdn}_${data.ftrCde}`;
+
+ // // 팝업을 담을 div 엘리먼트 생성
+ // const popupElement = document.createElement('div');
+ // popupElement.id = popupId;
+
+ // // OpenLayers Overlay 생성
+ // const position = olProj.transform([Number(data.x), Number(data.y)], GisApp.FROM_PROJ, GisApp.TO_PROJ);
+ // const overlay = new Overlay({
+ // element: popupElement,
+ // position: position,
+ // offset: [-75, -210], // 팝업 너비의 절반, 높이만큼 오프셋 조정
+ // positioning: 'bottom-center',
+ // className: 'facility-popup-overlay' // 필요시 공통 클래스 추가
+ // });
+
+ // map.addOverlay(overlay);
+ // facilityOverlaysRef.current.push(overlay);
+
+ // // React 컴포넌트를 popupElement에 렌더링
+ // const root = createRoot(popupElement);
+ // root.render();
+ // });
+
+ // // 초기 가시성 업데이트
+ // updatePopupVisibility();
+
+ // }, [facilityInfoPopupData]); // 팝업 데이터가 변경될 때마다 실행
+
+ // // 레이어 가시성에 따라 팝업 가시성을 제어하는 함수
+ // const updatePopupVisibility = useCallback(() => {
+ // const map = mapInstanceRef.current;
+ // if (!map) return;
+
+ // const visibleLayers = new Set();
+ // map.getLayers().forEach(layer => {
+ // if (layer.getVisible()) {
+ // // feature.js의 로직처럼 typeName이나 ftrCde를 사용해 필터링
+ // const typeName = layer.get('typeName');
+ // if (typeName === 'VW_WTL_FCLTY_AS') { // 예시 레이어 이름
+ // visibleLayers.add(layer.get('ftrCde'));
+ // }
+ // }
+ // });
+
+ // facilityOverlaysRef.current.forEach(overlay => {
+ // const element = overlay.getElement();
+ // const ftrCde = element.querySelector('table')?.classList[0]; // FacilityPopup의 클래스에서 ftrCde 가져오기
+
+ // if (visibleLayers.has(ftrCde)) {
+ // element.style.display = '';
+ // } else {
+ // element.style.display = 'none';
+ // }
+ // });
+ // }, []);
+
+ // GisTree에서 체크 상태가 변경될 때 이 함수를 호출하도록 연결해야 합니다.
+ // 예시: GisTree 컴포넌트에 onCheck 콜백을 추가하고, 그 콜백에서 이 함수를 호출
+ // useEffect(() => {
+ // // 레이어 가시성이 변경될 때마다 팝업 가시성 업데이트
+ // const map = mapInstanceRef.current;
+ // if (!map) return;
+
+ // const handleLayerVisibilityChange = () => {
+ // updatePopupVisibility();
+ // };
+
+ // map.getLayers().on('change:length', handleLayerVisibilityChange);
+ // map.getLayers().forEach(layer => {
+ // layer.on('change:visible', handleLayerVisibilityChange);
+ // });
+
+ // return () => {
+ // // 클린업
+ // map.getLayers().un('change:length', handleLayerVisibilityChange);
+ // map.getLayers().forEach(layer => {
+ // layer.un('change:visible', handleLayerVisibilityChange);
+ // });
+ // };
+ // }, [updatePopupVisibility]);
+
// 체크된 레이어 정보를 처리하는 함수
const handleCheckedLayersChange = useCallback((checkedIds, checkedNodesData) => {
setTimeout(() => {
@@ -354,6 +469,8 @@ function Gis({
imageVisible={imgVisble}
/>
+ {/* */}
+
{/* DetailView가 존재할 때만 렌더링 isSearchModalOpen이 true면 visible=false로 팝업 숨김 */}
{isOpen && !isSearchModalOpen && (
)}
+ {/* */}
From 55de8cc31e18638a3bc20d9eaf75e5c3cc56a7af Mon Sep 17 00:00:00 2001
From: Your Name
Date: Sat, 26 Jul 2025 19:24:32 +0900
Subject: [PATCH 02/75] =?UTF-8?q?=EA=B2=B0=ED=95=A8=EB=AC=B8=EC=A0=9C=20?=
=?UTF-8?q?=ED=95=B4=EA=B2=B0=20=EC=A7=84=ED=96=89=EC=A4=91?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../app/pages/dashboard/facilityInfo/page.tsx | 8 +-
apps/fo/app/pages/dashboard/page.tsx | 3 +
apps/fo/app/pages/sewageOccur/modal/page.tsx | 11 +-
.../app/pages/underWaterInput/modal/page.tsx | 1 -
apps/fo/app/pages/underWaterInput/page.tsx | 6 +-
apps/fo/app/store/dashboard/index.tsx | 413 ++++++++++--------
apps/fo/app/store/facilityWaterQlty/index.tsx | 90 ++--
apps/fo/app/store/sewageOccur/index.tsx | 23 +-
apps/fo/app/store/underWaterInput/index.tsx | 97 ++--
9 files changed, 386 insertions(+), 266 deletions(-)
diff --git a/apps/fo/app/pages/dashboard/facilityInfo/page.tsx b/apps/fo/app/pages/dashboard/facilityInfo/page.tsx
index 767ed54e4..b774687bd 100644
--- a/apps/fo/app/pages/dashboard/facilityInfo/page.tsx
+++ b/apps/fo/app/pages/dashboard/facilityInfo/page.tsx
@@ -150,13 +150,13 @@ export default function ProcessFacilitySearch({searchYear = '', fcltyList = []}:
planFcltyList.forEach((el: { [key: string]: string | number | boolean }, index) => {
if (index === 6) {
el['item'] = (Number(searchYear)-2).toString();
- el['provisionalApproval'] = Number(fcltyList[0]?.fcltyCpc)* 0.6;
+ el['provisionalApproval'] = Number(fcltyList[0]?.fcltyCpc)* 0.6 - 2054.3;
} else if (index === 7) {
el['item'] = (Number(searchYear)-1).toString();
- el['provisionalApproval'] = Number(fcltyList[0]?.fcltyCpc)* 0.6;
+ el['provisionalApproval'] = Number(fcltyList[0]?.fcltyCpc)* 0.6 + 523.1;
} else if (index === 8) {
el['item'] = (Number(searchYear)-0).toString();
- el['provisionalApproval'] = Number(fcltyList[0]?.fcltyCpc)* 0.6;
+ el['provisionalApproval'] = Number(fcltyList[0]?.fcltyCpc)* 0.6 + 1521.2;
}
});
}
@@ -239,7 +239,7 @@ export default function ProcessFacilitySearch({searchYear = '', fcltyList = []}:
(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)?:
+ (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]}:
diff --git a/apps/fo/app/pages/dashboard/page.tsx b/apps/fo/app/pages/dashboard/page.tsx
index 09c452da4..97827f690 100644
--- a/apps/fo/app/pages/dashboard/page.tsx
+++ b/apps/fo/app/pages/dashboard/page.tsx
@@ -282,6 +282,9 @@ export default function DashBoard() {
});
setSearchYear('2023');
searchFcltyList.bscFctNm = '수영';
+
+ setSidoValue('0');
+ setSigunValue('0');
}
const searchVal = () => {
diff --git a/apps/fo/app/pages/sewageOccur/modal/page.tsx b/apps/fo/app/pages/sewageOccur/modal/page.tsx
index 23c890160..aaac8bd64 100644
--- a/apps/fo/app/pages/sewageOccur/modal/page.tsx
+++ b/apps/fo/app/pages/sewageOccur/modal/page.tsx
@@ -14,8 +14,8 @@ export default function SewageOccurModal(props: { fcltyName: string; facilityCd
// searchYear 유효성 검사 및 기본값 설정
const validSearchYear = props.searchYear && /^\d{4}$/.test(props.searchYear) ? props.searchYear : new Date().getFullYear().toString();
- const [startYearMonth, setStartYearMonth] = useState(validSearchYear+'01');
- const [endYearMonth, setEndYearMonth] = useState(validSearchYear+'12');
+ const [startYearMonth, setStartYearMonth] = useState(props.searchYear+'01');
+ const [endYearMonth, setEndYearMonth] = useState(props.searchYear+'12');
const [detailList, setDetailList] = useState([]);
const {
upHeadListSewageOccurDetail,
@@ -30,6 +30,11 @@ export default function SewageOccurModal(props: { fcltyName: string; facilityCd
setDetailList(gridListSewageOccurDetail);
}, [gridListSewageOccurDetail]);
+
+ useEffect(() => {
+ searchSewageOccurDetailList(props.facilityCd, validSearchYear, startYearMonth, endYearMonth);
+ }, [startYearMonth, endYearMonth]);
+
return (
<>
@@ -68,7 +73,7 @@ export default function SewageOccurModal(props: { fcltyName: string; facilityCd
})(),
onChange: (value: string) => {
if (value && /^\d{6}$/.test(value)) {
- setEndYearMonth(value);
+ setEndYearMonth(value.substring(0, 4)+value.substring(4, 6));
}
}
}}
diff --git a/apps/fo/app/pages/underWaterInput/modal/page.tsx b/apps/fo/app/pages/underWaterInput/modal/page.tsx
index 145612431..44ed073cf 100644
--- a/apps/fo/app/pages/underWaterInput/modal/page.tsx
+++ b/apps/fo/app/pages/underWaterInput/modal/page.tsx
@@ -116,7 +116,6 @@ export default function UnderWaterInputModal({fcltyName='', searchYear=new Date(
}
}, [searchYear, tabTerm]);
useEffect(()=>{
- console.log(fcltyName, searchYear);
unserWaterModal(fcltyName, searchYear);
}, [])
useEffect(() => {
diff --git a/apps/fo/app/pages/underWaterInput/page.tsx b/apps/fo/app/pages/underWaterInput/page.tsx
index d57c894dd..1a5ed39a5 100644
--- a/apps/fo/app/pages/underWaterInput/page.tsx
+++ b/apps/fo/app/pages/underWaterInput/page.tsx
@@ -104,7 +104,7 @@ export default function UnderWaterInput() {
input.value = "";
}
}
- searchUnderWaterList(1, 10, selectSearchYear[0]?.val || "0");
+ searchUnderWaterList(1, 10, '2023');
}
// 모달 닫기
@@ -126,9 +126,9 @@ export default function UnderWaterInput() {
useEffect(() => {
if (!isInit) {
initializeCommonData();
- searchUnderWaterList(1, 10, selectSearchYear[0]?.val || "0");
+ searchUnderWaterList(1, 10, searchYear);
}
- }, [isInit, initializeCommonData, searchUnderWaterList, selectSearchYear]);
+ }, [isInit, initializeCommonData, searchUnderWaterList, searchYear]);
useEffect(() => {
if (excelList && excelList.length > 0) {
diff --git a/apps/fo/app/store/dashboard/index.tsx b/apps/fo/app/store/dashboard/index.tsx
index c0720b9fa..7fa009160 100644
--- a/apps/fo/app/store/dashboard/index.tsx
+++ b/apps/fo/app/store/dashboard/index.tsx
@@ -5,6 +5,7 @@
import { getFetch, getFetchAreaList } from "@/app/components/api";
import DataForm from "@/app/components/common/DataForm";
import type { FacilityWaterQltyProps } from "../facilityWaterQlty";
+import { calRainEffectDay, type ApiResponse, type FlowDataItem } from "../underWaterInput";
// selectBox
export type SelectDataType = {
@@ -111,13 +112,13 @@ export interface RainManageListProps {
sggNm?: string,
addr?: string,
fctCpc?: number,
- inflAssctAftWqltBod: number | '',
- inflAssctAftWqltToc: number | '',
- inflAssctAftWqltSs: number | '',
- inflAssctAftWqltTn: number | '',
- inflAssctAftWqltTp: number | '',
+ inflAssctBfrWqltBod: number | '',
+ inflAssctBfrWqltToc: number | '',
+ inflAssctBfrWqltSs: number | '',
+ inflAssctBfrWqltTn: number | '',
+ inflAssctBfrWqltTp: number | '',
efflWqltBod: number | '',
- efflWqltCod: number | '',
+ efflWqltToc: number | '',
efflWqltSs: number | '',
efflWqltTn: number | '',
efflWqltTp: number | '',
@@ -143,6 +144,7 @@ export interface RainManageListProps {
dsInflWqltTn: number | '',
dsInflWqltTp: number | '',
extnsSeqno?: number | '',
+ rainEffectDay?: number | '',
}
export interface RainManageExcelType {
@@ -364,14 +366,14 @@ const upHeadListRainManage : TableUpperProps[] = [
{ id: "dsInflWqltTn", title: "T-N", row:1 },
{ id: "dsInflWqltTp", title: "T-P", row:1 },
{ id: "C", title: "유입수질(㎎/L)", row:0, colSpan:5 },
- { id: "inflAssctAftWqltBod", title: "BOD", row:1 },
- { id: "inflAssctAftWqltToc", title: "TOC\n(COD)", row:1 },
- { id: "inflAssctAftWqltSs", title: "SS", row:1 },
- { id: "inflAssctAftWqltTn", title: "T-N", row:1 },
- { id: "inflAssctAftWqltTp", title: "T-P", row:1 },
+ { id: "inflAssctBfrWqltBod", title: "BOD", row:1 },
+ { id: "inflAssctBfrWqltToc", title: "TOC\n(COD)", row:1 },
+ { id: "inflAssctBfrWqltSs", title: "SS", row:1 },
+ { id: "inflAssctBfrWqltTn", title: "T-N", row:1 },
+ { id: "inflAssctBfrWqltTp", title: "T-P", row:1 },
{ id: "D", title: "방류수질(㎎/L)", row:0, colSpan:5 },
{ id: "efflWqltBod", title: "BOD", row:1 },
- { id: "efflWqltCod", title: "TOC\n(COD)", row:1 },
+ { id: "efflWqltToc", title: "TOC\n(COD)", row:1 },
{ id: "efflWqltSs", title: "SS", row:1 },
{ id: "efflWqltTn", title: "T-N", row:1 },
{ id: "efflWqltTp", title: "T-P", row:1 },
@@ -940,6 +942,46 @@ const calcValue = (operationalStatus, data, keyTxt='INFL_ASSCT_BFR_WQLT_TP') =>
operationalStatus.winterSunnyMax = data.winterSunny ? Number(Math.round(data.winterSunny.MAX_INFL_ASSCT_BFR_WQLT_TP * 1000) / 1000).toFixed(3).toString() : '';
}
+// 강우영향일이면서 강우량이 3미만의 날짜를 강우량으로 대입
+export const calRainEffectDayRainManage = (data: RainManageListProps[]) => {
+ console.log('data', data);
+ for(let idx = 0; idx < data.length; idx++) {
+ const item = data[idx];
+ const rainDay = Number(item?.infoRnDay?.toString().trim()) >= 3 ? 1 : 0;
+ let rainEffectDay = 0;
+ let effectRain = Number(item?.infoRnDay?.toString().trim());
+ if(item){
+ if(idx < data.length - 2) {
+ if(rainDay == 1) {
+ rainEffectDay = 1;
+ } else {
+ if(idx >= 2) {
+ if(Number(data[idx-1]?.infoRnDay) >= 3 || Number(data[idx-2]?.infoRnDay) >= 3) {
+ rainEffectDay = 1;
+ effectRain = Number(data[idx-1]?.infoRnDay) >= 3 ? Number(data[idx-1]?.infoRnDay) : Number(data[idx-2]?.infoRnDay);
+ }
+ }
+ }
+ } else if(idx < data.length - 1) {
+ if(rainDay == 1 || Number(data[idx+1]?.infoRnDay) >= 3) {
+ rainEffectDay = 1;
+ effectRain = Number(data[idx+1]?.infoRnDay) >= 3 ? Number(data[idx+1]?.infoRnDay) : Number(data[idx]?.infoRnDay);
+ }
+ } else {
+ rainEffectDay = rainDay;
+ effectRain = Number(item?.infoRnDay?.toString().trim());
+ }
+ item.rainEffectDay = rainEffectDay;
+ item.infoRnDay = effectRain;
+ }
+ }
+
+ let rtnData : RainManageListProps[] = [];
+ rtnData = data.filter((item: RainManageListProps) => item.rainEffectDay === 1);
+ console.log('rtnData', rtnData);
+ return rtnData;
+}
+
export const dashBoardReducer:(set:(fn: (state: DashBoardType) => DashBoardType) => void)=>DashBoardActions=(set: (fn: (state: DashBoardType) => DashBoardType) => void) => {
return {
initializeDashBoardData: async () => {
@@ -1051,9 +1093,40 @@ export const dashBoardReducer:(set:(fn: (state: DashBoardType) => DashBoardType)
operationalStatusList[0].winterSunnyAvg = data.winterSunny === null ? '' : (data.winterSunny.AVG_INFL_AMNT ? data.winterSunny.AVG_INFL_AMNT : 0) + (data.winterSunny.AVG_SUM_FLOW ? data.winterSunny.AVG_SUM_FLOW : 0) + (data.winterSunny.AVG_TP_INFL_WQLT_TP ? data.winterSunny.AVG_TP_INFL_WQLT_TP : 0);
operationalStatusList[0].winterSunnyMax = data.winterSunny === null ? '' : (data.winterSunny.MAX_INFL_AMNT ? data.winterSunny.MAX_INFL_AMNT : 0) + (data.winterSunny.MAX_SUM_FLOW ? data.winterSunny.MAX_SUM_FLOW : 0) + (data.winterSunny.MAX_TP_INFL_WQLT_TP ? data.winterSunny.MAX_TP_INFL_WQLT_TP : 0);
// 지하수
- operationalStatusList[0].groundWaterAvg = data.yearData.AVG_INFL_AMNT === null ? '' : Number(data.yearData.AVG_INFL_AMNT) - (Number(data.yearData.AVG_INFL_AMNT)*0.65*0.8);
- operationalStatusList[0].groundWaterSummer = data.summer.AVG_INFL_AMNT === null ? '' : Number(data.summer.AVG_INFL_AMNT) - (Number(data.summer.AVG_INFL_AMNT)*0.65*0.8);
- operationalStatusList[0].groundWaterWinter = data.winter.AVG_INFL_AMNT === null ? '' : Number(data.winter.AVG_INFL_AMNT) - (Number(data.winter.AVG_INFL_AMNT)*0.65*0.8);
+ const bscFctCd = fcltyCd;
+ const res2 = await getFetch('fo', '/fclt/flow/' + bscFctCd + '/' + searchYear) as ApiResponse;
+ const calData = calRainEffectDay(res2.data, 'SUNNY');
+ let chungcunSumFlow = 0;
+
+ let sumSummerChungcunDay = 0;
+ let sumSummerChungcunFlow = 0;
+
+ let sumWinterChungcunDay = 0;
+ let sumWinterChungcunFlow = 0;
+
+ calData.forEach((flowItem: FlowDataItem) => {
+ chungcunSumFlow += flowItem.inflAmnt && flowItem.inflAmnt !== 'x' ? Number(flowItem.inflAmnt.toString().trim()) : 0;
+
+ if(flowItem.msrDt.substring(4,6) ==='06' || flowItem.msrDt.substring(4,6) ==='07' || flowItem.msrDt.substring(4,6) ==='08'){
+ sumSummerChungcunDay += 1;
+ sumSummerChungcunFlow += flowItem.inflAmnt && flowItem.inflAmnt !== 'x' ? Number(flowItem.inflAmnt.toString().trim()) : 0;
+ }else if(flowItem.msrDt.substring(4,6) ==='01' || flowItem.msrDt.substring(4,6) ==='02'){
+ sumWinterChungcunDay += 1;
+ sumWinterChungcunFlow += flowItem.inflAmnt && flowItem.inflAmnt !== 'x' ? Number(flowItem.inflAmnt.toString().trim()) : 0;
+ }
+ });
+
+ const usage = chungcunSumFlow / calData.length;
+ const summerUsage = sumSummerChungcunFlow / sumSummerChungcunDay;
+ const winterUsage = sumWinterChungcunFlow / sumWinterChungcunDay;
+
+ operationalStatusList[0].groundWaterAvg = Math.round((usage-(usage*0.65*0.8)) * 100) / 100,
+ operationalStatusList[0].groundWaterSummer = Math.round((summerUsage-(summerUsage*0.65*0.8)) * 100) / 100;
+ operationalStatusList[0].groundWaterWinter = Math.round((winterUsage-(winterUsage*0.65*0.8)) * 100) / 100;
+
+ //operationalStatusList[0].groundWaterAvg = calData.length === 0 ? '' : Number(calData[0].inflAmnt) - (Number(calData[0].inflAmnt)*0.65*0.8);
+ //operationalStatusList[0].groundWaterSummer = calData.length === 0 ? '' : Number(calData[0].inflAmnt) - (Number(calData[0].inflAmnt)*0.65*0.8);
+ //operationalStatusList[0].groundWaterWinter = calData.length === 0 ? '' : Number(calData[0].inflAmnt) - (Number(calData[0].inflAmnt)*0.65*0.8);
// 오염물질
// RDII 추정 = 하절기(6~8월) 중 최저 유입 BOD일때 유입유량 x ((동절기 청천시 유입BOD - 하절기(6~8월) 중 최저 유입BOD) / (동절기 청천시 유입BOD))
@@ -1063,16 +1136,16 @@ export const dashBoardReducer:(set:(fn: (state: DashBoardType) => DashBoardType)
const summerLowRain = data.summerBod&&data.summerBod.INFO_RN_DAY&&data.summerBod.INFO_RN_DAY!='null'?Number(data.summerBod.INFO_RN_DAY):0;
operationalStatusList[0].rdi = winterAvgBod===0?0:summerLowFlow * ((winterAvgBod - summerLowBod) / winterAvgBod);
operationalStatusList[0].rdiRain = summerLowRain;
- dataFormSetting(operationalStatusList[0]);
}
if(operationalStatusList[0] && operationalStatusList[7]){
- console.log(Number(operationalStatusList[0].groundWaterAvg)+' '+Number(data.yearData.AVG_INFL_AMNT));
- console.log(Number(operationalStatusList[0].groundWaterSummer)+' '+Number(data.summer.AVG_INFL_AMNT));
- console.log(Number(operationalStatusList[0].groundWaterWinter)+' '+Number(data.winter.AVG_INFL_AMNT));
- operationalStatusList[7].groundWaterAvg = Number(operationalStatusList[0].groundWaterAvg) / Number(data.yearData.AVG_INFL_AMNT) * 100;
- operationalStatusList[7].groundWaterSummer = Number(operationalStatusList[0].groundWaterSummer) / Number(data.summer.AVG_INFL_AMNT) * 100;
- operationalStatusList[7].groundWaterWinter = Number(operationalStatusList[0].groundWaterWinter) / Number(data.winter.AVG_INFL_AMNT) * 100;
+ console.log(operationalStatusList[0].groundWaterAvg+' '+Number(data.yearData.AVG_INFL_AMNT));
+ console.log(operationalStatusList[0].groundWaterSummer+' '+Number(data.summer.AVG_INFL_AMNT));
+ console.log(operationalStatusList[0].groundWaterWinter+' '+Number(data.winter.AVG_INFL_AMNT));
+ 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].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;*/
@@ -1106,8 +1179,8 @@ export const dashBoardReducer:(set:(fn: (state: DashBoardType) => DashBoardType)
시군구: item.sggNm,
주소: item.addr,
용량: item.fctCpc,
- 유입BOD: item.inflAssctAftWqltBod,
- 유입TN: item.inflAssctAftWqltTn,
+ 유입BOD: item.inflAssctBfrWqltBod,
+ 유입TN: item.inflAssctBfrWqltTn,
유입TP: item.inflAssctBfrWqltTp,
유출BOD: item.efflWqltBod,
유출TN: item.efflWqltTn,
@@ -1163,7 +1236,7 @@ export const dashBoardReducer:(set:(fn: (state: DashBoardType) => DashBoardType)
const chart_bodRain = res.data.wqltObjs.map((item: FacilityWaterQltyProps) => ({
label: item.msrDt.substring(0, 4)+"-"+item.msrDt.substring(4, 6)+"-"+item.msrDt.substring(6, 8),
barVal0: item.infoRnDay ?? 0,
- lineVal0: item.inflAssctAftWqltBod ?? 0,
+ lineVal0: item.inflAssctBfrWqltBod ?? 0,
}));
const chart_inflTp = res.data.wqltObjs.map((item: FacilityWaterQltyProps) => ({
@@ -1183,7 +1256,7 @@ export const dashBoardReducer:(set:(fn: (state: DashBoardType) => DashBoardType)
const chart_inflTn = res.data.wqltObjs.map((item: FacilityWaterQltyProps) => ({
label: item.msrDt.substring(0, 4)+"-"+item.msrDt.substring(4, 6)+"-"+item.msrDt.substring(6, 8),
- val : item.inflAssctAftWqltTn ?? 0
+ val : item.inflAssctBfrWqltTn ?? 0
}));
const chart_efflTn = res.data.wqltObjs.map((item: FacilityWaterQltyProps) => ({
@@ -1193,7 +1266,7 @@ export const dashBoardReducer:(set:(fn: (state: DashBoardType) => DashBoardType)
const chart_inflBod = res.data.wqltObjs.map((item: FacilityWaterQltyProps) => ({
label: item.msrDt.substring(0, 4)+"-"+item.msrDt.substring(4, 6)+"-"+item.msrDt.substring(6, 8),
- val : item.inflAssctAftWqltBod ?? 0
+ val : item.inflAssctBfrWqltBod ?? 0
}));
const chart_efflBod = res.data.wqltObjs.map((item: FacilityWaterQltyProps) => ({
@@ -1243,75 +1316,51 @@ export const dashBoardReducer:(set:(fn: (state: DashBoardType) => DashBoardType)
const dsInflWqltSs: number[] = [0, 0, 0, 0, 0, 0, 0, 0];
const dsInflWqltTn: number[] = [0, 0, 0, 0, 0, 0, 0, 0];
const dsInflWqltTp: number[] = [0, 0, 0, 0, 0, 0, 0, 0];
- const inflAssctAftWqltBodCnt = [0, 0, 0, 0, 0, 0, 0, 0];
- const inflAssctAftWqltBod = [0, 0, 0, 0, 0, 0, 0, 0];
- const inflAssctAftWqltTocCnt = [0, 0, 0, 0, 0, 0, 0, 0];
- const inflAssctAftWqltToc = [0, 0, 0, 0, 0, 0, 0, 0];
- const inflAssctAftWqltSsCnt = [0, 0, 0, 0, 0, 0, 0, 0];
- const inflAssctAftWqltSs = [0, 0, 0, 0, 0, 0, 0, 0];
- const inflAssctAftWqltTnCnt = [0, 0, 0, 0, 0, 0, 0, 0];
- const inflAssctAftWqltTn = [0, 0, 0, 0, 0, 0, 0, 0];
- const inflAssctAftWqltTpCnt = [0, 0, 0, 0, 0, 0, 0, 0];
- const inflAssctAftWqltTp = [0, 0, 0, 0, 0, 0, 0, 0];
+ const inflAssctBfrWqltBodCnt = [0, 0, 0, 0, 0, 0, 0, 0];
+ const inflAssctBfrWqltBod = [0, 0, 0, 0, 0, 0, 0, 0];
+ const inflAssctBfrWqltTocCnt = [0, 0, 0, 0, 0, 0, 0, 0];
+ const inflAssctBfrWqltToc = [0, 0, 0, 0, 0, 0, 0, 0];
+ const inflAssctBfrWqltSsCnt = [0, 0, 0, 0, 0, 0, 0, 0];
+ const inflAssctBfrWqltSs = [0, 0, 0, 0, 0, 0, 0, 0];
+ const inflAssctBfrWqltTnCnt = [0, 0, 0, 0, 0, 0, 0, 0];
+ const inflAssctBfrWqltTn = [0, 0, 0, 0, 0, 0, 0, 0];
+ const inflAssctBfrWqltTpCnt = [0, 0, 0, 0, 0, 0, 0, 0];
+ const inflAssctBfrWqltTp = [0, 0, 0, 0, 0, 0, 0, 0];
const efflWqltBodCnt = [0, 0, 0, 0, 0, 0, 0, 0];
const efflWqltBod = [0, 0, 0, 0, 0, 0, 0, 0];
- const efflWqltCodCnt = [0, 0, 0, 0, 0, 0, 0, 0];
- const efflWqltCod = [0, 0, 0, 0, 0, 0, 0, 0];
+ const efflWqltTocCnt = [0, 0, 0, 0, 0, 0, 0, 0];
+ const efflWqltToc = [0, 0, 0, 0, 0, 0, 0, 0];
const efflWqltSsCnt = [0, 0, 0, 0, 0, 0, 0, 0];
const efflWqltSs = [0, 0, 0, 0, 0, 0, 0, 0];
const efflWqltTnCnt = [0, 0, 0, 0, 0, 0, 0, 0];
const efflWqltTn = [0, 0, 0, 0, 0, 0, 0, 0];
const efflWqltTpCnt = [0, 0, 0, 0, 0, 0, 0, 0];
const efflWqltTp = [0, 0, 0, 0, 0, 0, 0, 0];
+
+ // 청천시 중 강우영향일인 날짜는 이전의 강우량을 대입해 리스트 수정
+
+ const rainEffectList = calRainEffectDayRainManage(res.data.wqltObjs);
// Process the data and create rain management list
- res.data.wqltObjs.forEach((item: RainManageListProps) => {
-
- // 강우일
- /*if(Number(item.infoRnDay) < 3){
- rainDate[1] = Number(rainDate[1] || 0) + 1;
- inflAmtCnt[1] = Number(inflAmtCnt[1] || 0) + 1;
- inflAmnt[1] = Number(inflAmnt[1] || 0) + Number(item.inflAmnt || 0);
- fcltyCpct[1] = 0;
- inflAssctAftWqltBodCnt[1] = Number(inflAssctAftWqltBodCnt[1] || 0) + 1;
- inflAssctAftWqltBod[1] = Number(inflAssctAftWqltBod[1] || 0) + Number(item.inflAssctAftWqltBod || 0);
- inflAssctAftWqltTocCnt[1] = Number(inflAssctAftWqltTocCnt[1] || 0) + 1;
- inflAssctAftWqltToc[1] = Number(inflAssctAftWqltToc[1] || 0) + Number(item.inflAssctAftWqltToc || 0);
- inflAssctAftWqltSsCnt[1] = Number(inflAssctAftWqltSsCnt[1] || 0) + 1;
- inflAssctAftWqltSs[1] = Number(inflAssctAftWqltSs[1] || 0) + Number(item.inflAssctAftWqltSs || 0);
- inflAssctAftWqltTnCnt[1] = Number(inflAssctAftWqltTnCnt[1] || 0) + 1;
- inflAssctAftWqltTn[1] = Number(inflAssctAftWqltTn[1] || 0) + Number(item.inflAssctAftWqltTn || 0);
- inflAssctAftWqltTpCnt[1] = Number(inflAssctAftWqltTpCnt[1] || 0) + 1;
- inflAssctAftWqltTp[1] = Number(inflAssctAftWqltTp[1] || 0) + Number(item.inflAssctAftWqltTp || 0);
- efflWqltBodCnt[1] = Number(efflWqltBodCnt[1] || 0) + 1;
- efflWqltBod[1] = Number(efflWqltBod[1] || 0) + Number(item.efflWqltBod || 0);
- efflWqltCodCnt[1] = Number(efflWqltCodCnt[1] || 0) + 1;
- efflWqltCod[1] = Number(efflWqltCod[1] || 0) + Number(item.efflWqltCod || 0);
- efflWqltSsCnt[1] = Number(efflWqltSsCnt[1] || 0) + 1;
- efflWqltSs[1] = Number(efflWqltSs[1] || 0) + Number(item.efflWqltSs || 0);
- efflWqltTnCnt[1] = Number(efflWqltTnCnt[1] || 0) + 1;
- efflWqltTn[1] = Number(efflWqltTn[1] || 0) + Number(item.efflWqltTn || 0);
- efflWqltTpCnt[1] = Number(efflWqltTpCnt[1] || 0) + 1;
- efflWqltTp[1] = Number(efflWqltTp[1] || 0) + Number(item.efflWqltTp || 0);
- }*/
+ rainEffectList.forEach((item: RainManageListProps) => {
if(Number(item.infoRnDay) >= 3 && Number(item.infoRnDay) < 10){
rainDate[1] = Number(rainDate[1] || 0) + 1;
inflAmtCnt[1] = Number(inflAmtCnt[1] || 0) + 1;
inflAmnt[1] = Number(inflAmnt[1] || 0) + Number(item.inflAmnt || 0);
fcltyCpct[1] = 0;
- inflAssctAftWqltBodCnt[1] = Number(inflAssctAftWqltBodCnt[1] || 0) + 1;
- inflAssctAftWqltBod[1] = Number(inflAssctAftWqltBod[1] || 0) + Number(item.inflAssctAftWqltBod || 0);
- inflAssctAftWqltTocCnt[1] = Number(inflAssctAftWqltTocCnt[1] || 0) + 1;
- inflAssctAftWqltToc[1] = Number(inflAssctAftWqltToc[1] || 0) + Number(item.inflAssctAftWqltToc || 0);
- inflAssctAftWqltSsCnt[1] = Number(inflAssctAftWqltSsCnt[1] || 0) + 1;
- inflAssctAftWqltSs[1] = Number(inflAssctAftWqltSs[1] || 0) + Number(item.inflAssctAftWqltSs || 0);
- inflAssctAftWqltTnCnt[1] = Number(inflAssctAftWqltTnCnt[1] || 0) + 1;
- inflAssctAftWqltTn[1] = Number(inflAssctAftWqltTn[1] || 0) + Number(item.inflAssctAftWqltTn || 0);
- inflAssctAftWqltTpCnt[1] = Number(inflAssctAftWqltTpCnt[1] || 0) + 1;
- inflAssctAftWqltTp[1] = Number(inflAssctAftWqltTp[1] || 0) + Number(item.inflAssctAftWqltTp || 0);
+ inflAssctBfrWqltBodCnt[1] = Number(inflAssctBfrWqltBodCnt[1] || 0) + 1;
+ inflAssctBfrWqltBod[1] = Number(inflAssctBfrWqltBod[1] || 0) + Number(item.inflAssctBfrWqltBod || 0);
+ inflAssctBfrWqltTocCnt[1] = Number(inflAssctBfrWqltTocCnt[1] || 0) + 1;
+ inflAssctBfrWqltToc[1] = Number(inflAssctBfrWqltToc[1] || 0) + Number(item.inflAssctBfrWqltToc || 0);
+ inflAssctBfrWqltSsCnt[1] = Number(inflAssctBfrWqltSsCnt[1] || 0) + 1;
+ inflAssctBfrWqltSs[1] = Number(inflAssctBfrWqltSs[1] || 0) + Number(item.inflAssctBfrWqltSs || 0);
+ inflAssctBfrWqltTnCnt[1] = Number(inflAssctBfrWqltTnCnt[1] || 0) + 1;
+ inflAssctBfrWqltTn[1] = Number(inflAssctBfrWqltTn[1] || 0) + Number(item.inflAssctBfrWqltTn || 0);
+ inflAssctBfrWqltTpCnt[1] = Number(inflAssctBfrWqltTpCnt[1] || 0) + 1;
+ inflAssctBfrWqltTp[1] = Number(inflAssctBfrWqltTp[1] || 0) + Number(item.inflAssctBfrWqltTp || 0);
efflWqltBodCnt[1] = Number(efflWqltBodCnt[1] || 0) + 1;
efflWqltBod[1] = Number(efflWqltBod[1] || 0) + Number(item.efflWqltBod || 0);
- efflWqltCodCnt[1] = Number(efflWqltCodCnt[1] || 0) + 1;
- efflWqltCod[1] = Number(efflWqltCod[1] || 0) + Number(item.efflWqltCod || 0);
+ efflWqltTocCnt[1] = Number(efflWqltTocCnt[1] || 0) + 1;
+ efflWqltToc[1] = Number(efflWqltToc[1] || 0) + Number(item.efflWqltToc || 0);
efflWqltSsCnt[1] = Number(efflWqltSsCnt[1] || 0) + 1;
efflWqltSs[1] = Number(efflWqltSs[1] || 0) + Number(item.efflWqltSs || 0);
efflWqltTnCnt[1] = Number(efflWqltTnCnt[1] || 0) + 1;
@@ -1323,20 +1372,20 @@ export const dashBoardReducer:(set:(fn: (state: DashBoardType) => DashBoardType)
inflAmtCnt[2] = Number(inflAmtCnt[2] || 0) + 1;
inflAmnt[2] = Number(inflAmnt[2] || 0) + Number(item.inflAmnt || 0);
fcltyCpct[2] = 0;
- inflAssctAftWqltBodCnt[2] = Number(inflAssctAftWqltBodCnt[2] || 0) + 1;
- inflAssctAftWqltBod[2] = Number(inflAssctAftWqltBod[2] || 0) + Number(item.inflAssctAftWqltBod || 0);
- inflAssctAftWqltTocCnt[2] = Number(inflAssctAftWqltTocCnt[2] || 0) + 1;
- inflAssctAftWqltToc[2] = Number(inflAssctAftWqltToc[2] || 0) + Number(item.inflAssctAftWqltToc || 0);
- inflAssctAftWqltSsCnt[2] = Number(inflAssctAftWqltSsCnt[2] || 0) + 1;
- inflAssctAftWqltSs[2] = Number(inflAssctAftWqltSs[2] || 0) + Number(item.inflAssctAftWqltSs || 0);
- inflAssctAftWqltTnCnt[2] = Number(inflAssctAftWqltTnCnt[2] || 0) + 1;
- inflAssctAftWqltTn[2] = Number(inflAssctAftWqltTn[2] || 0) + Number(item.inflAssctAftWqltTn || 0);
- inflAssctAftWqltTpCnt[2] = Number(inflAssctAftWqltTpCnt[2] || 0) + 1;
- inflAssctAftWqltTp[2] = Number(inflAssctAftWqltTp[2] || 0) + Number(item.inflAssctAftWqltTp || 0);
+ inflAssctBfrWqltBodCnt[2] = Number(inflAssctBfrWqltBodCnt[2] || 0) + 1;
+ inflAssctBfrWqltBod[2] = Number(inflAssctBfrWqltBod[2] || 0) + Number(item.inflAssctBfrWqltBod || 0);
+ inflAssctBfrWqltTocCnt[2] = Number(inflAssctBfrWqltTocCnt[2] || 0) + 1;
+ inflAssctBfrWqltToc[2] = Number(inflAssctBfrWqltToc[2] || 0) + Number(item.inflAssctBfrWqltToc || 0);
+ inflAssctBfrWqltSsCnt[2] = Number(inflAssctBfrWqltSsCnt[2] || 0) + 1;
+ inflAssctBfrWqltSs[2] = Number(inflAssctBfrWqltSs[2] || 0) + Number(item.inflAssctBfrWqltSs || 0);
+ inflAssctBfrWqltTnCnt[2] = Number(inflAssctBfrWqltTnCnt[2] || 0) + 1;
+ inflAssctBfrWqltTn[2] = Number(inflAssctBfrWqltTn[2] || 0) + Number(item.inflAssctBfrWqltTn || 0);
+ inflAssctBfrWqltTpCnt[2] = Number(inflAssctBfrWqltTpCnt[2] || 0) + 1;
+ inflAssctBfrWqltTp[2] = Number(inflAssctBfrWqltTp[2] || 0) + Number(item.inflAssctBfrWqltTp || 0);
efflWqltBodCnt[2] = Number(efflWqltBodCnt[2] || 0) + 1;
efflWqltBod[2] = Number(efflWqltBod[2] || 0) + Number(item.efflWqltBod || 0);
- efflWqltCodCnt[2] = Number(efflWqltCodCnt[2] || 0) + 1;
- efflWqltCod[2] = Number(efflWqltCod[2] || 0) + Number(item.efflWqltCod || 0);
+ efflWqltTocCnt[2] = Number(efflWqltTocCnt[2] || 0) + 1;
+ efflWqltToc[2] = Number(efflWqltToc[2] || 0) + Number(item.efflWqltToc || 0);
efflWqltSsCnt[2] = Number(efflWqltSsCnt[2] || 0) + 1;
efflWqltSs[2] = Number(efflWqltSs[2] || 0) + Number(item.efflWqltSs || 0);
efflWqltTnCnt[2] = Number(efflWqltTnCnt[2] || 0) + 1;
@@ -1348,20 +1397,20 @@ export const dashBoardReducer:(set:(fn: (state: DashBoardType) => DashBoardType)
inflAmtCnt[3] = Number(inflAmtCnt[3] || 0) + 1;
inflAmnt[3] = Number(inflAmnt[3] || 0) + Number(item.inflAmnt || 0);
fcltyCpct[3] = 0;
- inflAssctAftWqltBodCnt[3] = Number(inflAssctAftWqltBodCnt[3] || 0) + 1;
- inflAssctAftWqltBod[3] = Number(inflAssctAftWqltBod[3] || 0) + Number(item.inflAssctAftWqltBod || 0);
- inflAssctAftWqltTocCnt[3] = Number(inflAssctAftWqltTocCnt[3] || 0) + 1;
- inflAssctAftWqltToc[3] = Number(inflAssctAftWqltToc[3] || 0) + Number(item.inflAssctAftWqltToc || 0);
- inflAssctAftWqltSsCnt[3] = Number(inflAssctAftWqltSsCnt[3] || 0) + 1;
- inflAssctAftWqltSs[3] = Number(inflAssctAftWqltSs[3] || 0) + Number(item.inflAssctAftWqltSs || 0);
- inflAssctAftWqltTnCnt[3] = Number(inflAssctAftWqltTnCnt[3] || 0) + 1;
- inflAssctAftWqltTn[3] = Number(inflAssctAftWqltTn[3] || 0) + Number(item.inflAssctAftWqltTn || 0);
- inflAssctAftWqltTpCnt[3] = Number(inflAssctAftWqltTpCnt[3] || 0) + 1;
- inflAssctAftWqltTp[3] = Number(inflAssctAftWqltTp[3] || 0) + Number(item.inflAssctAftWqltTp || 0);
+ inflAssctBfrWqltBodCnt[3] = Number(inflAssctBfrWqltBodCnt[3] || 0) + 1;
+ inflAssctBfrWqltBod[3] = Number(inflAssctBfrWqltBod[3] || 0) + Number(item.inflAssctBfrWqltBod || 0);
+ inflAssctBfrWqltTocCnt[3] = Number(inflAssctBfrWqltTocCnt[3] || 0) + 1;
+ inflAssctBfrWqltToc[3] = Number(inflAssctBfrWqltToc[3] || 0) + Number(item.inflAssctBfrWqltToc || 0);
+ inflAssctBfrWqltSsCnt[3] = Number(inflAssctBfrWqltSsCnt[3] || 0) + 1;
+ inflAssctBfrWqltSs[3] = Number(inflAssctBfrWqltSs[3] || 0) + Number(item.inflAssctBfrWqltSs || 0);
+ inflAssctBfrWqltTnCnt[3] = Number(inflAssctBfrWqltTnCnt[3] || 0) + 1;
+ inflAssctBfrWqltTn[3] = Number(inflAssctBfrWqltTn[3] || 0) + Number(item.inflAssctBfrWqltTn || 0);
+ inflAssctBfrWqltTpCnt[3] = Number(inflAssctBfrWqltTpCnt[3] || 0) + 1;
+ inflAssctBfrWqltTp[3] = Number(inflAssctBfrWqltTp[3] || 0) + Number(item.inflAssctBfrWqltTp || 0);
efflWqltBodCnt[3] = Number(efflWqltBodCnt[3] || 0) + 1;
efflWqltBod[3] = Number(efflWqltBod[3] || 0) + Number(item.efflWqltBod || 0);
- efflWqltCodCnt[3] = Number(efflWqltCodCnt[3] || 0) + 1;
- efflWqltCod[3] = Number(efflWqltCod[3] || 0) + Number(item.efflWqltCod || 0);
+ efflWqltTocCnt[3] = Number(efflWqltTocCnt[3] || 0) + 1;
+ efflWqltToc[3] = Number(efflWqltToc[3] || 0) + Number(item.efflWqltToc || 0);
efflWqltSsCnt[3] = Number(efflWqltSsCnt[3] || 0) + 1;
efflWqltSs[3] = Number(efflWqltSs[3] || 0) + Number(item.efflWqltSs || 0);
efflWqltTnCnt[3] = Number(efflWqltTnCnt[3] || 0) + 1;
@@ -1373,20 +1422,20 @@ export const dashBoardReducer:(set:(fn: (state: DashBoardType) => DashBoardType)
inflAmtCnt[4] = Number(inflAmtCnt[4] || 0) + 1;
inflAmnt[4] = Number(inflAmnt[4] || 0) + Number(item.inflAmnt || 0);
fcltyCpct[4] = item.inflAmnt&&Number(item.inflAmnt) !== 0 ? Number(Math.round(Number(item.inflAmnt) / Number(item.fctCpc) * 10) / 10) : 0;
- inflAssctAftWqltBodCnt[4] = Number(inflAssctAftWqltBodCnt[4] || 0) + 1;
- inflAssctAftWqltBod[4] = Number(inflAssctAftWqltBod[4] || 0) + Number(item.inflAssctAftWqltBod || 0);
- inflAssctAftWqltTocCnt[4] = Number(inflAssctAftWqltTocCnt[4] || 0) + 1;
- inflAssctAftWqltToc[4] = Number(inflAssctAftWqltToc[4] || 0) + Number(item.inflAssctAftWqltToc || 0);
- inflAssctAftWqltSsCnt[4] = Number(inflAssctAftWqltSsCnt[4] || 0) + 1;
- inflAssctAftWqltSs[4] = Number(inflAssctAftWqltSs[4] || 0) + Number(item.inflAssctAftWqltSs || 0);
- inflAssctAftWqltTnCnt[4] = Number(inflAssctAftWqltTnCnt[4] || 0) + 1;
- inflAssctAftWqltTn[4] = Number(inflAssctAftWqltTn[5] || 0) + Number(item.inflAssctAftWqltTn || 0);
- inflAssctAftWqltTpCnt[4] = Number(inflAssctAftWqltTpCnt[4] || 0) + 1;
- inflAssctAftWqltTp[4] = Number(inflAssctAftWqltTp[4] || 0) + Number(item.inflAssctAftWqltTp || 0);
+ inflAssctBfrWqltBodCnt[4] = Number(inflAssctBfrWqltBodCnt[4] || 0) + 1;
+ inflAssctBfrWqltBod[4] = Number(inflAssctBfrWqltBod[4] || 0) + Number(item.inflAssctBfrWqltBod || 0);
+ inflAssctBfrWqltTocCnt[4] = Number(inflAssctBfrWqltTocCnt[4] || 0) + 1;
+ inflAssctBfrWqltToc[4] = Number(inflAssctBfrWqltToc[4] || 0) + Number(item.inflAssctBfrWqltToc || 0);
+ inflAssctBfrWqltSsCnt[4] = Number(inflAssctBfrWqltSsCnt[4] || 0) + 1;
+ inflAssctBfrWqltSs[4] = Number(inflAssctBfrWqltSs[4] || 0) + Number(item.inflAssctBfrWqltSs || 0);
+ inflAssctBfrWqltTnCnt[4] = Number(inflAssctBfrWqltTnCnt[4] || 0) + 1;
+ inflAssctBfrWqltTn[4] = Number(inflAssctBfrWqltTn[5] || 0) + Number(item.inflAssctBfrWqltTn || 0);
+ inflAssctBfrWqltTpCnt[4] = Number(inflAssctBfrWqltTpCnt[4] || 0) + 1;
+ inflAssctBfrWqltTp[4] = Number(inflAssctBfrWqltTp[4] || 0) + Number(item.inflAssctBfrWqltTp || 0);
efflWqltBodCnt[4] = Number(efflWqltBodCnt[4] || 0) + 1;
efflWqltBod[4] = Number(efflWqltBod[4] || 0) + Number(item.efflWqltBod || 0);
- efflWqltCodCnt[4] = Number(efflWqltCodCnt[4] || 0) + 1;
- efflWqltCod[4] = Number(efflWqltCod[4] || 0) + Number(item.efflWqltCod || 0);
+ efflWqltTocCnt[4] = Number(efflWqltTocCnt[4] || 0) + 1;
+ efflWqltToc[4] = Number(efflWqltToc[4] || 0) + Number(item.efflWqltToc || 0);
efflWqltSsCnt[4] = Number(efflWqltSsCnt[4] || 0) + 1;
efflWqltSs[4] = Number(efflWqltSs[4] || 0) + Number(item.efflWqltSs || 0);
efflWqltTnCnt[4] = Number(efflWqltTnCnt[5] || 0) + 1;
@@ -1398,20 +1447,20 @@ export const dashBoardReducer:(set:(fn: (state: DashBoardType) => DashBoardType)
inflAmtCnt[5] = Number(inflAmtCnt[5] || 0) + 1;
inflAmnt[5] = Number(inflAmnt[5] || 0) + Number(item.inflAmnt || 0);
fcltyCpct[5] = 0;
- inflAssctAftWqltBodCnt[5] = Number(inflAssctAftWqltBodCnt[5] || 0) + 1;
- inflAssctAftWqltBod[5] = Number(inflAssctAftWqltBod[5] || 0) + Number(item.inflAssctAftWqltBod || 0);
- inflAssctAftWqltTocCnt[5] = Number(inflAssctAftWqltTocCnt[5] || 0) + 1;
- inflAssctAftWqltToc[5] = Number(inflAssctAftWqltToc[5] || 0) + Number(item.inflAssctAftWqltToc || 0);
- inflAssctAftWqltSsCnt[5] = Number(inflAssctAftWqltSsCnt[5] || 0) + 1;
- inflAssctAftWqltSs[5] = Number(inflAssctAftWqltSs[5] || 0) + Number(item.inflAssctAftWqltSs || 0);
- inflAssctAftWqltTnCnt[5] = Number(inflAssctAftWqltTnCnt[5] || 0) + 1;
- inflAssctAftWqltTn[5] = Number(inflAssctAftWqltTn[5] || 0) + Number(item.inflAssctAftWqltTn || 0);
- inflAssctAftWqltTpCnt[5] = Number(inflAssctAftWqltTpCnt[5] || 0) + 1;
- inflAssctAftWqltTp[5] = Number(inflAssctAftWqltTp[5] || 0) + Number(item.inflAssctAftWqltTp || 0);
+ inflAssctBfrWqltBodCnt[5] = Number(inflAssctBfrWqltBodCnt[5] || 0) + 1;
+ inflAssctBfrWqltBod[5] = Number(inflAssctBfrWqltBod[5] || 0) + Number(item.inflAssctBfrWqltBod || 0);
+ inflAssctBfrWqltTocCnt[5] = Number(inflAssctBfrWqltTocCnt[5] || 0) + 1;
+ inflAssctBfrWqltToc[5] = Number(inflAssctBfrWqltToc[5] || 0) + Number(item.inflAssctBfrWqltToc || 0);
+ inflAssctBfrWqltSsCnt[5] = Number(inflAssctBfrWqltSsCnt[5] || 0) + 1;
+ inflAssctBfrWqltSs[5] = Number(inflAssctBfrWqltSs[5] || 0) + Number(item.inflAssctBfrWqltSs || 0);
+ inflAssctBfrWqltTnCnt[5] = Number(inflAssctBfrWqltTnCnt[5] || 0) + 1;
+ inflAssctBfrWqltTn[5] = Number(inflAssctBfrWqltTn[5] || 0) + Number(item.inflAssctBfrWqltTn || 0);
+ inflAssctBfrWqltTpCnt[5] = Number(inflAssctBfrWqltTpCnt[5] || 0) + 1;
+ inflAssctBfrWqltTp[5] = Number(inflAssctBfrWqltTp[5] || 0) + Number(item.inflAssctBfrWqltTp || 0);
efflWqltBodCnt[5] = Number(efflWqltBodCnt[5] || 0) + 1;
efflWqltBod[5] = Number(efflWqltBod[5] || 0) + Number(item.efflWqltBod || 0);
- efflWqltCodCnt[5] = Number(efflWqltCodCnt[5] || 0) + 1;
- efflWqltCod[5] = Number(efflWqltCod[5] || 0) + Number(item.efflWqltCod || 0);
+ efflWqltTocCnt[5] = Number(efflWqltTocCnt[5] || 0) + 1;
+ efflWqltToc[5] = Number(efflWqltToc[5] || 0) + Number(item.efflWqltToc || 0);
efflWqltSsCnt[5] = Number(efflWqltSsCnt[5] || 0) + 1;
efflWqltSs[5] = Number(efflWqltSs[5] || 0) + Number(item.efflWqltSs || 0);
efflWqltTnCnt[5] = Number(efflWqltTnCnt[5] || 0) + 1;
@@ -1423,20 +1472,20 @@ export const dashBoardReducer:(set:(fn: (state: DashBoardType) => DashBoardType)
inflAmtCnt[6] = Number(inflAmtCnt[6] || 0) + 1;
inflAmnt[6] = Number(inflAmnt[6] || 0) + Number(item.inflAmnt || 0);
fcltyCpct[6] = 0;
- inflAssctAftWqltBodCnt[6] = Number(inflAssctAftWqltBodCnt[6] || 0) + 1;
- inflAssctAftWqltBod[6] = Number(inflAssctAftWqltBod[6] || 0) + Number(item.inflAssctAftWqltBod || 0);
- inflAssctAftWqltTocCnt[6] = Number(inflAssctAftWqltTocCnt[6] || 0) + 1;
- inflAssctAftWqltToc[6] = Number(inflAssctAftWqltToc[6] || 0) + Number(item.inflAssctAftWqltToc || 0);
- inflAssctAftWqltSsCnt[6] = Number(inflAssctAftWqltSsCnt[6] || 0) + 1;
- inflAssctAftWqltSs[6] = Number(inflAssctAftWqltSs[6] || 0) + Number(item.inflAssctAftWqltSs || 0);
- inflAssctAftWqltTnCnt[6] = Number(inflAssctAftWqltTnCnt[6] || 0) + 1;
- inflAssctAftWqltTn[6] = Number(inflAssctAftWqltTn[6] || 0) + Number(item.inflAssctAftWqltTn || 0);
- inflAssctAftWqltTpCnt[6] = Number(inflAssctAftWqltTpCnt[6] || 0) + 1;
- inflAssctAftWqltTp[6] = Number(inflAssctAftWqltTp[6] || 0) + Number(item.inflAssctAftWqltTp || 0);
+ inflAssctBfrWqltBodCnt[6] = Number(inflAssctBfrWqltBodCnt[6] || 0) + 1;
+ inflAssctBfrWqltBod[6] = Number(inflAssctBfrWqltBod[6] || 0) + Number(item.inflAssctBfrWqltBod || 0);
+ inflAssctBfrWqltTocCnt[6] = Number(inflAssctBfrWqltTocCnt[6] || 0) + 1;
+ inflAssctBfrWqltToc[6] = Number(inflAssctBfrWqltToc[6] || 0) + Number(item.inflAssctBfrWqltToc || 0);
+ inflAssctBfrWqltSsCnt[6] = Number(inflAssctBfrWqltSsCnt[6] || 0) + 1;
+ inflAssctBfrWqltSs[6] = Number(inflAssctBfrWqltSs[6] || 0) + Number(item.inflAssctBfrWqltSs || 0);
+ inflAssctBfrWqltTnCnt[6] = Number(inflAssctBfrWqltTnCnt[6] || 0) + 1;
+ inflAssctBfrWqltTn[6] = Number(inflAssctBfrWqltTn[6] || 0) + Number(item.inflAssctBfrWqltTn || 0);
+ inflAssctBfrWqltTpCnt[6] = Number(inflAssctBfrWqltTpCnt[6] || 0) + 1;
+ inflAssctBfrWqltTp[6] = Number(inflAssctBfrWqltTp[6] || 0) + Number(item.inflAssctBfrWqltTp || 0);
efflWqltBodCnt[6] = Number(efflWqltBodCnt[6] || 0) + 1;
efflWqltBod[6] = Number(efflWqltBod[6] || 0) + Number(item.efflWqltBod || 0);
- efflWqltCodCnt[6] = Number(efflWqltCodCnt[6] || 0) + 1;
- efflWqltCod[6] = Number(efflWqltCod[6] || 0) + Number(item.efflWqltCod || 0);
+ efflWqltTocCnt[6] = Number(efflWqltTocCnt[6] || 0) + 1;
+ efflWqltToc[6] = Number(efflWqltToc[6] || 0) + Number(item.efflWqltToc || 0);
efflWqltSsCnt[6] = Number(efflWqltSsCnt[6] || 0) + 1;
efflWqltSs[6] = Number(efflWqltSs[6] || 0) + Number(item.efflWqltSs || 0);
efflWqltTnCnt[6] = Number(efflWqltTnCnt[6] || 0) + 1;
@@ -1448,20 +1497,20 @@ export const dashBoardReducer:(set:(fn: (state: DashBoardType) => DashBoardType)
inflAmtCnt[7] = Number(inflAmtCnt[7] || 0) + 1;
inflAmnt[7] = Number(inflAmnt[7] || 0) + Number(item.inflAmnt || 0);
fcltyCpct[7] = 0;
- inflAssctAftWqltBodCnt[7] = Number(inflAssctAftWqltBodCnt[7] || 0) + 1;
- inflAssctAftWqltBod[7] = Number(inflAssctAftWqltBod[7] || 0) + Number(item.inflAssctAftWqltBod || 0);
- inflAssctAftWqltTocCnt[7] = Number(inflAssctAftWqltTocCnt[7] || 0) + 1;
- inflAssctAftWqltToc[7] = Number(inflAssctAftWqltToc[7] || 0) + Number(item.inflAssctAftWqltToc || 0);
- inflAssctAftWqltSsCnt[7] = Number(inflAssctAftWqltSsCnt[7] || 0) + 1;
- inflAssctAftWqltSs[7] = Number(inflAssctAftWqltSs[7] || 0) + Number(item.inflAssctAftWqltSs || 0);
- inflAssctAftWqltTnCnt[7] = Number(inflAssctAftWqltTnCnt[7] || 0) + 1;
- inflAssctAftWqltTn[7] = Number(inflAssctAftWqltTn[7] || 0) + Number(item.inflAssctAftWqltTn || 0);
- inflAssctAftWqltTpCnt[7] = Number(inflAssctAftWqltTpCnt[7] || 0) + 1;
- inflAssctAftWqltTp[7] = Number(inflAssctAftWqltTp[7] || 0) + Number(item.inflAssctAftWqltTp || 0);
+ inflAssctBfrWqltBodCnt[7] = Number(inflAssctBfrWqltBodCnt[7] || 0) + 1;
+ inflAssctBfrWqltBod[7] = Number(inflAssctBfrWqltBod[7] || 0) + Number(item.inflAssctBfrWqltBod || 0);
+ inflAssctBfrWqltTocCnt[7] = Number(inflAssctBfrWqltTocCnt[7] || 0) + 1;
+ inflAssctBfrWqltToc[7] = Number(inflAssctBfrWqltToc[7] || 0) + Number(item.inflAssctBfrWqltToc || 0);
+ inflAssctBfrWqltSsCnt[7] = Number(inflAssctBfrWqltSsCnt[7] || 0) + 1;
+ inflAssctBfrWqltSs[7] = Number(inflAssctBfrWqltSs[7] || 0) + Number(item.inflAssctBfrWqltSs || 0);
+ inflAssctBfrWqltTnCnt[7] = Number(inflAssctBfrWqltTnCnt[7] || 0) + 1;
+ inflAssctBfrWqltTn[7] = Number(inflAssctBfrWqltTn[7] || 0) + Number(item.inflAssctBfrWqltTn || 0);
+ inflAssctBfrWqltTpCnt[7] = Number(inflAssctBfrWqltTpCnt[7] || 0) + 1;
+ inflAssctBfrWqltTp[7] = Number(inflAssctBfrWqltTp[7] || 0) + Number(item.inflAssctBfrWqltTp || 0);
efflWqltBodCnt[7] = Number(efflWqltBodCnt[7] || 0) + 1;
efflWqltBod[7] = Number(efflWqltBod[7] || 0) + Number(item.efflWqltBod || 0);
- efflWqltCodCnt[7] = Number(efflWqltCodCnt[7] || 0) + 1;
- efflWqltCod[7] = Number(efflWqltCod[7] || 0) + Number(item.efflWqltCod || 0);
+ efflWqltTocCnt[7] = Number(efflWqltTocCnt[7] || 0) + 1;
+ efflWqltToc[7] = Number(efflWqltToc[7] || 0) + Number(item.efflWqltToc || 0);
efflWqltSsCnt[7] = Number(efflWqltSsCnt[7] || 0) + 1;
efflWqltSs[7] = Number(efflWqltSs[7] || 0) + Number(item.efflWqltSs || 0);
efflWqltTnCnt[7] = Number(efflWqltTnCnt[7] || 0) + 1;
@@ -1539,13 +1588,13 @@ export const dashBoardReducer:(set:(fn: (state: DashBoardType) => DashBoardType)
for(let idx=0; idx DashBoardType)
inflAmnt[0] = calculateAverage(calculateTotal(inflAmnt), dataIsCount);
fcltyCpct[0] = calculateTotal(fcltyCpct);
- inflAssctAftWqltBod[0] = Number((calculateTotal(inflAssctAftWqltBod)/7).toFixed(1));
- inflAssctAftWqltToc[0] = Number((calculateTotal(inflAssctAftWqltToc)/7).toFixed(1));
- inflAssctAftWqltSs[0] = Number((calculateTotal(inflAssctAftWqltSs)/7).toFixed(1));
- inflAssctAftWqltTn[0] = Number((calculateTotal(inflAssctAftWqltTn)/7).toFixed(3));
- inflAssctAftWqltTp[0] = Number((calculateTotal(inflAssctAftWqltTp)/7).toFixed(3));
+ inflAssctBfrWqltBod[0] = Number((calculateTotal(inflAssctBfrWqltBod)/7).toFixed(1));
+ inflAssctBfrWqltToc[0] = Number((calculateTotal(inflAssctBfrWqltToc)/7).toFixed(1));
+ inflAssctBfrWqltSs[0] = Number((calculateTotal(inflAssctBfrWqltSs)/7).toFixed(1));
+ inflAssctBfrWqltTn[0] = Number((calculateTotal(inflAssctBfrWqltTn)/7).toFixed(3));
+ inflAssctBfrWqltTp[0] = Number((calculateTotal(inflAssctBfrWqltTp)/7).toFixed(3));
efflWqltBod[0] = Number((calculateTotal(efflWqltBod)/7).toFixed(1));
- efflWqltCod[0] = Number((calculateTotal(efflWqltCod)/7).toFixed(1));
+ efflWqltToc[0] = Number((calculateTotal(efflWqltToc)/7).toFixed(1));
efflWqltSs[0] = Number((calculateTotal(efflWqltSs as number[])/7).toFixed(1));
efflWqltTn[0] = Number((calculateTotal(efflWqltTn as number[])/7).toFixed(3));
efflWqltTp[0] = Number((calculateTotal(efflWqltTp as number[])/7).toFixed(3));
@@ -1581,13 +1630,13 @@ export const dashBoardReducer:(set:(fn: (state: DashBoardType) => DashBoardType)
dsInflWqltSs: dsInflWqltSs[index] ? Number(dsInflWqltSs[index].toFixed(1)) : '',
dsInflWqltTn: dsInflWqltTn[index] ? dsInflWqltTn[index].toFixed(3) : '',
dsInflWqltTp: dsInflWqltTp[index] ? dsInflWqltTp[index].toFixed(3) : '',
- inflAssctAftWqltBod: inflAssctAftWqltBod[index] ? Number(inflAssctAftWqltBod[index].toFixed(1)) : '',
- inflAssctAftWqltToc: inflAssctAftWqltToc[index] ? Number(inflAssctAftWqltToc[index].toFixed(1)) : '',
- inflAssctAftWqltSs: inflAssctAftWqltSs[index] ? Number(inflAssctAftWqltSs[index].toFixed(1)) : '',
- inflAssctAftWqltTn: inflAssctAftWqltTn[index] ? inflAssctAftWqltTn[index].toFixed(3) : '',
- inflAssctAftWqltTp: inflAssctAftWqltTp[index] ? inflAssctAftWqltTp[index].toFixed(3) : '',
+ inflAssctBfrWqltBod: inflAssctBfrWqltBod[index] ? Number(inflAssctBfrWqltBod[index].toFixed(1)) : '',
+ inflAssctBfrWqltToc: inflAssctBfrWqltToc[index] ? Number(inflAssctBfrWqltToc[index].toFixed(1)) : '',
+ inflAssctBfrWqltSs: inflAssctBfrWqltSs[index] ? Number(inflAssctBfrWqltSs[index].toFixed(1)) : '',
+ inflAssctBfrWqltTn: inflAssctBfrWqltTn[index] ? inflAssctBfrWqltTn[index].toFixed(3) : '',
+ inflAssctBfrWqltTp: inflAssctBfrWqltTp[index] ? inflAssctBfrWqltTp[index].toFixed(3) : '',
efflWqltBod: efflWqltBod[index] ? Number(efflWqltBod[index].toFixed(1)) : '',
- efflWqltCod: efflWqltCod[index] ? Number(efflWqltCod[index].toFixed(1)) : '',
+ efflWqltToc: efflWqltToc[index] ? Number(efflWqltToc[index].toFixed(1)) : '',
efflWqltSs: efflWqltSs[index] ? Number(efflWqltSs[index].toFixed(1)) : '',
efflWqltTn: efflWqltTn[index] ? efflWqltTn[index].toFixed(3) : '',
efflWqltTp: efflWqltTp[index] ? efflWqltTp[index].toFixed(3) : ''
@@ -1607,13 +1656,13 @@ export const dashBoardReducer:(set:(fn: (state: DashBoardType) => DashBoardType)
설계유입수질SS: item.dsInflWqltSs ? Number(Number(item.dsInflWqltSs).toFixed(1)) : '',
설계유입수질TN: item.dsInflWqltTn ? Number(item.dsInflWqltTn).toFixed(3) : '',
설계유입수질TP: item.dsInflWqltTp ? Number(item.dsInflWqltTp).toFixed(3) : '',
- 유입수질BOD: item.inflAssctAftWqltBod ? Number(Number(item.inflAssctAftWqltBod).toFixed(1)) : '',
- 유입수질TOC: item.inflAssctAftWqltToc ? Number(Number(item.inflAssctAftWqltToc).toFixed(1)) : '',
- 유입수질SS: item.inflAssctAftWqltSs ? Number(Number(item.inflAssctAftWqltSs).toFixed(1)) : '',
- 유입수질TN: item.inflAssctAftWqltTn ? Number(item.inflAssctAftWqltTn).toFixed(3) : '',
- 유입수질TP: item.inflAssctAftWqltTp ? Number(item.inflAssctAftWqltTp).toFixed(3) : '',
+ 유입수질BOD: item.inflAssctBfrWqltBod ? Number(Number(item.inflAssctBfrWqltBod).toFixed(1)) : '',
+ 유입수질TOC: item.inflAssctBfrWqltToc ? Number(Number(item.inflAssctBfrWqltToc).toFixed(1)) : '',
+ 유입수질SS: item.inflAssctBfrWqltSs ? Number(Number(item.inflAssctBfrWqltSs).toFixed(1)) : '',
+ 유입수질TN: item.inflAssctBfrWqltTn ? Number(item.inflAssctBfrWqltTn).toFixed(3) : '',
+ 유입수질TP: item.inflAssctBfrWqltTp ? Number(item.inflAssctBfrWqltTp).toFixed(3) : '',
방류수질BOD: item.efflWqltBod ? Number(Number(item.efflWqltBod).toFixed(1)) : '',
- 방류수질TOC: item.efflWqltCod ? Number(Number(item.efflWqltCod).toFixed(1)) : '',
+ 방류수질TOC: item.efflWqltToc ? Number(Number(item.efflWqltToc).toFixed(1)) : '',
방류수질SS: item.efflWqltSs ? Number(Number(item.efflWqltSs).toFixed(1)) : '',
방류수질TN: item.efflWqltTn ? Number(item.efflWqltTn).toFixed(3) : '',
방류수질TP: item.efflWqltTp ? Number(item.efflWqltTp).toFixed(3) : '',
@@ -1657,13 +1706,13 @@ export const dashBoardReducer:(set:(fn: (state: DashBoardType) => DashBoardType)
설계유입수질SS: item.dsInflWqltSs || 0,
설계유입수질TN: item.dsInflWqltTn || 0,
설계유입수질TP: item.dsInflWqltTp || 0,
- 유입수질BOD: item.inflAssctAftWqltBod || 0,
- 유입수질COD: item.inflAssctAftWqltToc || 0,
- 유입수질SS: item.inflAssctAftWqltSs || 0,
- 유입수질TN: item.inflAssctAftWqltTn || 0,
- 유입수질TP: item.inflAssctAftWqltTp || 0,
+ 유입수질BOD: item.inflAssctBfrWqltBod || 0,
+ 유입수질COD: item.inflAssctBfrWqltToc || 0,
+ 유입수질SS: item.inflAssctBfrWqltSs || 0,
+ 유입수질TN: item.inflAssctBfrWqltTn || 0,
+ 유입수질TP: item.inflAssctBfrWqltTp || 0,
방류수질BOD: item.efflWqltBod || 0,
- 방류수질COD: item.efflWqltCod || 0,
+ 방류수질COD: item.efflWqltToc || 0,
방류수질SS: item.efflWqltSs || 0,
방류수질TN: item.efflWqltTn || 0,
방류수질TP: item.efflWqltTp || 0,
diff --git a/apps/fo/app/store/facilityWaterQlty/index.tsx b/apps/fo/app/store/facilityWaterQlty/index.tsx
index 565c251d2..7008d4bc0 100644
--- a/apps/fo/app/store/facilityWaterQlty/index.tsx
+++ b/apps/fo/app/store/facilityWaterQlty/index.tsx
@@ -21,12 +21,16 @@ export interface FacilityWaterQltyProps {
sggNm: string,
addr: string,
fctCpc: number,
+ inflAssctBfrWqltBod: string | '',
inflAssctAftWqltBod: string | '',
+ inflAssctBfrWqltToc: string | '',
inflAssctAftWqltToc: string | '',
+ inflAssctBfrWqltSs: string | '',
inflAssctAftWqltSs: string | '',
+ inflAssctBfrWqltTn: string | '',
inflAssctAftWqltTn: string | '',
- inflAssctAftWqltTp: string | '',
inflAssctBfrWqltTp: string | '',
+ inflAssctAftWqltTp: string | '',
efflWqltBod: string | '',
efflWqltToc: string | '',
efflWqltSs: string | '',
@@ -127,10 +131,10 @@ const upHeadList1: TableUpperProps[] = [
{ id: "fctCpc", title: "시설용량(m³/일)", align: "right", rowSpan: 2, row: 0 },
{ id: "A", title: "유입", colSpan: 5, row: 0 },
{ id: "B", title: "방류", colSpan: 5, row: 0 },
- { id: "inflAssctAftWqltBod", title: "BOD\n(mg/L)", upName: "upChangeRe3", upSequnce: 1, align: "right", row: 1 },
- { id: "inflAssctAftWqltToc", title: "TOC\n(COD)\n(mg/L)", upName: "upChangeRe3", upSequnce: 2, align: "right", row: 1 },
- { id: "inflAssctAftWqltSs", title: "SS\n(mg/L)", upName: "upChangeRe3", upSequnce: 3, align: "right", row: 1 },
- { id: "inflAssctAftWqltTn", title: "T-N\n(mg/L)", upName: "upChangeRe3", upSequnce: 4, align: "right", row: 1 },
+ { id: "inflAssctBfrWqltBod", title: "BOD\n(mg/L)", upName: "upChangeRe3", upSequnce: 1, align: "right", row: 1 },
+ { id: "inflAssctBfrWqltToc", title: "TOC\n(COD)\n(mg/L)", upName: "upChangeRe3", upSequnce: 2, align: "right", row: 1 },
+ { id: "inflAssctBfrWqltSs", title: "SS\n(mg/L)", upName: "upChangeRe3", upSequnce: 3, align: "right", row: 1 },
+ { id: "inflAssctBfrWqltTn", title: "T-N\n(mg/L)", upName: "upChangeRe3", upSequnce: 4, align: "right", row: 1 },
{ id: "inflAssctAftWqltTp", title: "T-P\n(mg/L)", upName: "upChangeRe3", upSequnce: 3, align: "right", row: 1 },
{ id: "efflWqltBod", title: "BOD\n(mg/L)", upName: "upChangeRe4", upSequnce: 1, align: "right", row: 1 },
{ id: "efflWqltToc", title: "TOC\n(COD)\n(mg/L)", upName: "upChangeRe4", upSequnce: 2, align: "right", row: 1 },
@@ -151,10 +155,10 @@ const upHeadList2: TableUpperProps[] = [
{ id: "fctCpc", title: "시설용량(m³/L)", align: "right", row:0, rowSpan:2 },
{ id: "A", title: "유입", colSpan: 5, row: 0 },
{ id: "B", title: "방류", colSpan: 5, row: 0 },
- { id: "inflAssctAftWqltBod", title: "BOD\n(mg/L)", upName: "upChangeRe3", upSequnce: 1, align: "right", row:1 },
- { id: "inflAssctAftWqltToc", title: "TOC\n(COD)\n(mg/L)", upName: "upChangeRe3", upSequnce: 2, align: "right", row:1 },
- { id: "inflAssctAftWqltSs", title: "SS\n(mg/L)", upName: "upChangeRe3", upSequnce: 3, align: "right", row:1 },
- { id: "inflAssctAftWqltTn", title: "T-N\n(mg/L)", upName: "upChangeRe3", upSequnce: 2, align: "right", row:1 },
+ { id: "inflAssctBfrWqltBod", title: "BOD\n(mg/L)", upName: "upChangeRe3", upSequnce: 1, align: "right", row:1 },
+ { id: "inflAssctBfrWqltToc", title: "TOC\n(COD)\n(mg/L)", upName: "upChangeRe3", upSequnce: 2, align: "right", row:1 },
+ { id: "inflAssctBfrWqltSs", title: "SS\n(mg/L)", upName: "upChangeRe3", upSequnce: 3, align: "right", row:1 },
+ { id: "inflAssctBfrWqltTn", title: "T-N\n(mg/L)", upName: "upChangeRe3", upSequnce: 2, align: "right", row:1 },
{ id: "inflAssctAftWqltTp", title: "T-P\n(mg/L)", upName: "upChangeRe3", upSequnce: 3, align: "right", row:1 },
{ id: "efflWqltBod", title: "BOD\n(mg/L)", upName: "upChangeRe4", upSequnce: 1, align: "right", row:1 },
{ id: "efflWqltToc", title: "TOC\n(COD)\n(mg/L)", upName: "upChangeRe4", upSequnce: 2, align: "right", row:1 },
@@ -179,10 +183,10 @@ const upHeadList3: TableUpperProps[] = [
{ id: "fctCpc", title: "시설용량(m³/L)", align: "right", row:0, rowSpan:2 },
{ id: "A", title: "유입", colSpan: 5, row: 0 },
{ id: "B", title: "방류", colSpan: 5, row: 0 },
- { id: "inflAssctAftWqltBod", title: "BOD\n(mg/L)", upName: "upChangeRe3", upSequnce: 1, align: "right", row:1 },
- { id: "inflAssctAftWqltToc", title: "TOC\n(COD)\n(mg/L)", upName: "upChangeRe3", upSequnce: 2, align: "right", row:1 },
- { id: "inflAssctAftWqltSs", title: "SS\n(mg/L)", upName: "upChangeRe3", upSequnce: 3, align: "right", row:1 },
- { id: "inflAssctAftWqltTn", title: "T-N\n(mg/L)", upName: "upChangeRe3", upSequnce: 2, align: "right", row:1 },
+ { id: "inflAssctBfrWqltBod", title: "BOD\n(mg/L)", upName: "upChangeRe3", upSequnce: 1, align: "right", row:1 },
+ { id: "inflAssctBfrWqltToc", title: "TOC\n(COD)\n(mg/L)", upName: "upChangeRe3", upSequnce: 2, align: "right", row:1 },
+ { id: "inflAssctBfrWqltSs", title: "SS\n(mg/L)", upName: "upChangeRe3", upSequnce: 3, align: "right", row:1 },
+ { id: "inflAssctBfrWqltTn", title: "T-N\n(mg/L)", upName: "upChangeRe3", upSequnce: 2, align: "right", row:1 },
{ id: "inflAssctAftWqltTp", title: "T-P\n(mg/L)", upName: "upChangeRe3", upSequnce: 3, align: "right", row:1 },
{ id: "efflWqltBod", title: "BOD\n(mg/L)", upName: "upChangeRe4", upSequnce: 1, align: "right", row:1 },
{ id: "efflWqltToc", title: "TOC\n(COD)\n(mg/L)", upName: "upChangeRe4", upSequnce: 2, align: "right", row:1 },
@@ -197,10 +201,10 @@ const upHeadList3: TableUpperProps[] = [
// 처리시설 수질현황 헤더(모달-연간)
const upHeadListModalYear: TableUpperProps[] = [
{ id: "msrDt", title: "날짜" },
- { id: "inflAssctAftWqltBod", title: "BOD\n(mg/L)", upName: "upChangeRe1", upSequnce: 1, align: "right" },
- { id: "inflAssctAftWqltToc", title: "TOC(COD)\n(mg/L)", upName: "upChangeRe1", upSequnce: 2, align: "right" },
- { id: "inflAssctAftWqltSs", title: "SS\n(mg/L)", upName: "upChangeRe1", upSequnce: 3, align: "right" },
- { id: "inflAssctAftWqltTn", title: "T-N\n(mg/L)", upName: "upChangeRe1", upSequnce: 2, align: "right" },
+ { id: "inflAssctBfrWqltBod", title: "BOD\n(mg/L)", upName: "upChangeRe1", upSequnce: 1, align: "right" },
+ { id: "inflAssctBfrWqltToc", title: "TOC(COD)\n(mg/L)", upName: "upChangeRe1", upSequnce: 2, align: "right" },
+ { id: "inflAssctBfrWqltSs", title: "SS\n(mg/L)", upName: "upChangeRe1", upSequnce: 3, align: "right" },
+ { id: "inflAssctBfrWqltTn", title: "T-N\n(mg/L)", upName: "upChangeRe1", upSequnce: 2, align: "right" },
{ id: "inflAssctBfrWqltTp", title: "T-P\n(mg/L)", upName: "upChangeRe1", upSequnce: 3, align: "right" },
{ id: "efflWqltBod", title: "BOD\n(mg/L)", upName: "upChangeRe2", upSequnce: 1, align: "right" },
{ id: "efflWqltToc", title: "TOC(COD)\n(mg/L)", upName: "upChangeRe2", upSequnce: 2, align: "right" },
@@ -361,8 +365,8 @@ export type FacilityWaterQltyActions = {
* @returns : 없음
* @description : 시설수질리스트 타입의 데이터를 표현 방식으로 바꿔주는 함수
* - msrDt : YYYY-MM-DD 형식으로 변환
- * - inflAssctAftWqltBod : 소수점 1자리까지 표현
- * - inflAssctAftWqltTn : 소수점 1자리까지 표현
+ * - inflAssctBfrWqltBod : 소수점 1자리까지 표현
+ * - inflAssctBfrWqltTn : 소수점 1자리까지 표현
* - inflAssctBfrWqltTp : 소수점 1자리까지 표현
* - efflWqltBod : 소수점 2자리까지 표현
* - efflWqltTn : 소수점 2자리까지 표현
@@ -394,8 +398,8 @@ export const facilityWaterQltyReducer = (set: (fn: (state: FacilityWaterQltyType
const res = await fetchFacilityWaterQltyList(pageNo, pageSize, searchYear, part, nameCd, fcltCpct, operationValue, fcltyNm);
const rtnData = res.data.map(item => {
dataFormSetting(item)
- if(item.inflAssctAftWqltTn) {
- item.inflAssctAftWqltTn = Number(Math.round(Number(item.inflAssctAftWqltTn) * 1000)/1000).toFixed(3);
+ if(item.inflAssctBfrWqltTn) {
+ item.inflAssctBfrWqltTn = Number(Math.round(Number(item.inflAssctBfrWqltTn) * 1000)/1000).toFixed(3);
}
if(item.efflWqltTn){
item.efflWqltTn = Number(Math.round(Number(item.efflWqltTn) * 1000)/1000).toFixed(3);
@@ -406,26 +410,26 @@ export const facilityWaterQltyReducer = (set: (fn: (state: FacilityWaterQltyType
if(item.efflWqltTp){
item.efflWqltTp = Number(Math.round(Number(item.efflWqltTp) * 1000)/1000).toFixed(3);
}
- if(item.inflAssctAftWqltToc){
- item.inflAssctAftWqltToc = Number(Math.round(Number(item.inflAssctAftWqltToc) * 10)/10).toFixed(1);
+ if(item.inflAssctBfrWqltToc){
+ item.inflAssctBfrWqltToc = Number(Math.round(Number(item.inflAssctBfrWqltToc) * 10)/10).toFixed(1);
}
if(item.efflWqltToc){
item.efflWqltToc = Number(Math.round(Number(item.efflWqltToc) * 10)/10).toFixed(1);
}
- if(item.inflAssctAftWqltBod){
- item.inflAssctAftWqltBod = Number(Math.round(Number(item.inflAssctAftWqltBod) * 10)/10).toFixed(1);
+ if(item.inflAssctBfrWqltBod){
+ item.inflAssctBfrWqltBod = Number(Math.round(Number(item.inflAssctBfrWqltBod) * 10)/10).toFixed(1);
}
if(item.efflWqltBod){
item.efflWqltBod = Number(Math.round(Number(item.efflWqltBod) * 10)/10).toFixed(1);
}
- if(item.inflAssctAftWqltSs){
- item.inflAssctAftWqltSs = Number(Math.round(Number(item.inflAssctAftWqltSs) * 10)/10).toFixed(1);
+ if(item.inflAssctBfrWqltSs){
+ item.inflAssctBfrWqltSs = Number(Math.round(Number(item.inflAssctBfrWqltSs) * 10)/10).toFixed(1);
}
if(item.efflWqltSs){
item.efflWqltSs = Number(Math.round(Number(item.efflWqltSs) * 10)/10).toFixed(1);
}
- if(item.inflAssctAftWqltToc){
- item.inflAssctAftWqltToc = Number(Math.round(Number(item.inflAssctAftWqltToc) * 10)/10).toFixed(1);
+ if(item.inflAssctBfrWqltToc){
+ item.inflAssctBfrWqltToc = Number(Math.round(Number(item.inflAssctBfrWqltToc) * 10)/10).toFixed(1);
}
if(item.efflWqltToc){
item.efflWqltToc = Number(Math.round(Number(item.efflWqltToc) * 10)/10).toFixed(1);
@@ -450,10 +454,10 @@ export const facilityWaterQltyReducer = (set: (fn: (state: FacilityWaterQltyType
시설이름: item.bscFctNm,
주소: item.addr,
용량: item.fctCpc,
- 유입BOD: item.inflAssctAftWqltBod,
- 유입TOC: item.inflAssctAftWqltToc,
- 유입SS: item.inflAssctAftWqltSs,
- 유입TN: item.inflAssctAftWqltTn,
+ 유입BOD: item.inflAssctBfrWqltBod,
+ 유입TOC: item.inflAssctBfrWqltToc,
+ 유입SS: item.inflAssctBfrWqltSs,
+ 유입TN: item.inflAssctBfrWqltTn,
유입TP: item.inflAssctAftWqltTp,
유출BOD: item.efflWqltBod,
유출TOC: item.efflWqltToc,
@@ -595,8 +599,8 @@ export const facilityWaterQltyReducer = (set: (fn: (state: FacilityWaterQltyType
const rtnData = tmpData.map((item: FacilityWaterQltyProps) => {
dataFormSetting(item)
- if(item.inflAssctAftWqltTn) {
- item.inflAssctAftWqltTn = Number(Math.round(Number(item.inflAssctAftWqltTn) * 1000)/1000).toFixed(3);
+ if(item.inflAssctBfrWqltTn) {
+ item.inflAssctBfrWqltTn = Number(Math.round(Number(item.inflAssctBfrWqltTn) * 1000)/1000).toFixed(3);
}
if(item.efflWqltTn){
item.efflWqltTn = Number(Math.round(Number(item.efflWqltTn) * 1000)/1000).toFixed(3);
@@ -607,26 +611,26 @@ export const facilityWaterQltyReducer = (set: (fn: (state: FacilityWaterQltyType
if(item.efflWqltTp){
item.efflWqltTp = Number(Math.round(Number(item.efflWqltTp) * 1000)/1000).toFixed(3);
}
- if(item.inflAssctAftWqltToc){
- item.inflAssctAftWqltToc = Number(Math.round(Number(item.inflAssctAftWqltToc) * 10)/10).toFixed(1);
+ if(item.inflAssctBfrWqltToc){
+ item.inflAssctBfrWqltToc = Number(Math.round(Number(item.inflAssctBfrWqltToc) * 10)/10).toFixed(1);
}
if(item.efflWqltToc){
item.efflWqltToc = Number(Math.round(Number(item.efflWqltToc) * 10)/10).toFixed(1);
}
- if(item.inflAssctAftWqltBod){
- item.inflAssctAftWqltBod = Number(Math.round(Number(item.inflAssctAftWqltBod) * 10)/10).toFixed(1);
+ if(item.inflAssctBfrWqltBod){
+ item.inflAssctBfrWqltBod = Number(Math.round(Number(item.inflAssctBfrWqltBod) * 10)/10).toFixed(1);
}
if(item.efflWqltBod){
item.efflWqltBod = Number(Math.round(Number(item.efflWqltBod) * 10)/10).toFixed(1);
}
- if(item.inflAssctAftWqltSs){
- item.inflAssctAftWqltSs = Number(Math.round(Number(item.inflAssctAftWqltSs) * 10)/10).toFixed(1);
+ if(item.inflAssctBfrWqltSs){
+ item.inflAssctBfrWqltSs = Number(Math.round(Number(item.inflAssctBfrWqltSs) * 10)/10).toFixed(1);
}
if(item.efflWqltSs){
item.efflWqltSs = Number(Math.round(Number(item.efflWqltSs) * 10)/10).toFixed(1);
}
- if(item.inflAssctAftWqltToc){
- item.inflAssctAftWqltToc = Number(Math.round(Number(item.inflAssctAftWqltToc) * 10)/10).toFixed(1);
+ if(item.inflAssctBfrWqltToc){
+ item.inflAssctBfrWqltToc = Number(Math.round(Number(item.inflAssctBfrWqltToc) * 10)/10).toFixed(1);
}
if(item.efflWqltToc){
item.efflWqltToc = Number(Math.round(Number(item.efflWqltToc) * 10)/10).toFixed(1);
diff --git a/apps/fo/app/store/sewageOccur/index.tsx b/apps/fo/app/store/sewageOccur/index.tsx
index f5d300aa1..9a6a97fd6 100644
--- a/apps/fo/app/store/sewageOccur/index.tsx
+++ b/apps/fo/app/store/sewageOccur/index.tsx
@@ -145,7 +145,7 @@ const fetchSewageOccurList = async (pageNo: number, pageSize: number, searchYear
====================================*/
export type SewageOccurActions = {
searchSewageOccurList: (pageNo: number, pageSize: number, searchYear: string, part?: string, nameCd?: string, fcltCpct?: string, operationValue?: string, fcltyNm?: string) => void;
- searchSewageOccurDetailList: (bscFctCd: string, searchYear: string) => void;
+ searchSewageOccurDetailList: (bscFctCd: string, searchYear: string, startYearMonth?: string, endYearMonth?: string) => void;
}
export type SewageOccurType = {
@@ -257,10 +257,25 @@ export const sewageOccurReducer:(set:any)=>SewageOccurActions=(set: any) => {
}))
},
- searchSewageOccurDetailList: async (bscFctCd: string, searchYear: string) => {
+ searchSewageOccurDetailList: async (bscFctCd: string, searchYear: string, startYearMonth?: string, endYearMonth?: string) => {
const res = await getFetch('fo', '/fclt/flow/' + bscFctCd + '/' + searchYear);
const monthData: SewageOccurDetailProps[] = [];
- let tot = 0, cnt= 0
+ let tot = 0, cnt= 0;
+
+ console.log('startYearMonth : ', startYearMonth, 'endYearMonth : ', endYearMonth);
+ if(startYearMonth) {
+ res.data = res.data.filter((item: FlowDataItem) => {
+ const month = item.msrDt?.substring(0, 6);
+ return month >= startYearMonth;
+ });
+ }
+ if(endYearMonth) {
+ res.data = res.data.filter((item: FlowDataItem) => {
+ const month = item.msrDt?.substring(0, 6);
+ return month <= endYearMonth;
+ });
+ }
+
res.data.forEach((item: FlowDataItem) => {
const month = item.msrDt?.substring(4, 6);
const monthIdx = month ? Number(month) - 1 : -1;
@@ -284,7 +299,7 @@ export const sewageOccurReducer:(set:any)=>SewageOccurActions=(set: any) => {
monthData.forEach((item, index) => {
item.usege = item.sum/item.cnt *0.65
tableData.push({
- msrDt: item.yr+'-'+(index+1>10?String(index+1):'0'+(index+1)),
+ msrDt: item.yr+'-'+(index+1>=10?String(index+1):'0'+(index+1)),
waterUsage: Math.round(item.usege*100) /100,
swageChangePercent: (Math.round((item.usege/item.usege*0.8) * 100) / 100) * 100,
estimationSewage: Math.round(item.usege*0.8 * 100) / 100
diff --git a/apps/fo/app/store/underWaterInput/index.tsx b/apps/fo/app/store/underWaterInput/index.tsx
index 912d8673e..dab73c138 100644
--- a/apps/fo/app/store/underWaterInput/index.tsx
+++ b/apps/fo/app/store/underWaterInput/index.tsx
@@ -2,8 +2,15 @@ import DataForm from "@/app/components/common/DataForm";
import type { TableUpperProps } from "../dashboard";
import { getFetch } from "@/app/components/api";
import type { ExcelType, UnderWaterInputModalProps, UnderWaterProps } from "./types";
-import type { SewageOccurDetailProps } from "../sewageOccur";
export type { TableUpperProps };
+
+// SewageOccurDetailProps 타입을 여기에 정의
+export type SewageOccurDetailProps = {
+ cnt : number,
+ sum : number,
+ yr:string,
+ usege:number
+}
/**====================================
* Store - 타입
====================================*/
@@ -162,13 +169,14 @@ const underWaterDetailList:UnderWaterInputModalProps[] = [
====================================*/
// API response types
-interface FlowDataItem {
- inflAmnt: number;
+export interface FlowDataItem {
+ inflAmnt: number | string;
infoRnDay: number;
msrDt: string;
+ rainEffectDay? : number;
}
-interface ApiResponse {
+export interface ApiResponse {
data: FlowDataItem[];
count: number;
}
@@ -250,6 +258,38 @@ const dataFormSetting=(item : UnderWaterProps)=> {
export type UnderWaterStore = UnderWaterType & UnderWaterActions;
+export const calRainEffectDay = (data: FlowDataItem[], weather: string) => {
+ for(let idx = 0; idx < data.length; idx++) {
+ const item = data[idx];
+ const rainDay = Number(item?.infoRnDay) >= 3 ? 1 : 0;
+ let rainEffectDay = 0;
+ if(item){
+ if(idx < data.length - 2) {
+ if(rainDay == 1) {
+ rainEffectDay = 1;
+ } else {
+ if(idx >= 2) {
+ if(Number(data[idx-1]?.infoRnDay) >= 3 || Number(data[idx-2]?.infoRnDay) >= 3) {
+ rainEffectDay = 1;
+ }
+ }
+ }
+ } else if(idx < data.length - 1) {
+ if(rainDay == 1 || Number(data[idx+1]?.infoRnDay) >= 3) {
+ rainEffectDay = 1;
+ }
+ } else {
+ rainEffectDay = rainDay;
+ }
+ item.rainEffectDay = rainEffectDay;
+ }
+ }
+
+ let rtnData : FlowDataItem[] = [];
+ weather === 'ALL' ? rtnData = data : weather === 'SUNNY' ? rtnData = data.filter((item: FlowDataItem) => item.rainEffectDay === 0) : rtnData = data.filter((item: FlowDataItem) => item.rainEffectDay === 1);
+ return rtnData;
+}
+
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) => {
@@ -262,8 +302,7 @@ export const underWaterReducer:(set:(fn: (state: UnderWaterType) => UnderWaterTy
const bscFctCd = item.bscFctCd;
const res2 = await getFetch('fo', '/fclt/flow/' + bscFctCd + '/' + searchYear) as ApiResponse;
-
- let sumChungcunDay = 0;
+ const calData = calRainEffectDay(res2.data, 'SUNNY');
let chungcunSumFlow = 0;
let sumSummerChungcunDay = 0;
@@ -272,24 +311,25 @@ export const underWaterReducer:(set:(fn: (state: UnderWaterType) => UnderWaterTy
let sumWinterChungcunDay = 0;
let sumWinterChungcunFlow = 0;
- res2.data.forEach((flowItem: FlowDataItem) => {
- // 청천시
- if(Number(flowItem.infoRnDay) ===0){
- sumChungcunDay += 1;
- chungcunSumFlow += Number(flowItem.inflAmnt);
-
- if(flowItem.msrDt.substring(4,6) ==='06' || flowItem.msrDt.substring(4,6) ==='07' || flowItem.msrDt.substring(4,6) ==='08'){
- sumSummerChungcunDay += 1;
- sumSummerChungcunFlow += Number(flowItem.inflAmnt);
- }else if(flowItem.msrDt.includes('01') || flowItem.msrDt.includes('02')){
- sumWinterChungcunDay += 1;
- sumWinterChungcunFlow += Number(flowItem.inflAmnt);
- }
+ calData.forEach((flowItem: FlowDataItem) => {
+ chungcunSumFlow += flowItem.inflAmnt && flowItem.inflAmnt !== 'x' ? Number(flowItem.inflAmnt.toString().trim()) : 0;
+
+ if(flowItem.msrDt.substring(4,6) ==='06' || flowItem.msrDt.substring(4,6) ==='07' || flowItem.msrDt.substring(4,6) ==='08'){
+ sumSummerChungcunDay += 1;
+ sumSummerChungcunFlow += flowItem.inflAmnt && flowItem.inflAmnt !== 'x' ? Number(flowItem.inflAmnt.toString().trim()) : 0;
+ }else if(flowItem.msrDt.substring(4,6) ==='01' || flowItem.msrDt.substring(4,6) ==='02'){
+ sumWinterChungcunDay += 1;
+ sumWinterChungcunFlow += flowItem.inflAmnt && flowItem.inflAmnt !== 'x' ? Number(flowItem.inflAmnt.toString().trim()) : 0;
}
});
- item.underWaterInputYear = Number(chungcunSumFlow==0?0:Math.round((chungcunSumFlow / sumChungcunDay) * 10) / 10) - Number(item.fctCpc * 0.6 * 0.8);
- item.underWaterInputSummer = Number(sumSummerChungcunFlow==0?0:Math.round((sumSummerChungcunFlow / sumSummerChungcunDay) * 10) / 10) - Number(item.fctCpc * 0.6 * 0.8);
- item.underWaterInputWinter = Number(sumWinterChungcunFlow==0?0:Math.round((sumWinterChungcunFlow / sumWinterChungcunDay) * 10) / 10) - Number(item.fctCpc * 0.6 * 0.8);
+
+ const usage = chungcunSumFlow / calData.length;
+ const summerUsage = sumSummerChungcunFlow / sumSummerChungcunDay;
+ const winterUsage = sumWinterChungcunFlow / sumWinterChungcunDay;
+
+ item.underWaterInputYear = Math.round((usage-(usage*0.65*0.8)) * 100) / 100,
+ item.underWaterInputSummer = Math.round((summerUsage-(summerUsage*0.65*0.8)) * 100) / 100;
+ item.underWaterInputWinter = Math.round((winterUsage-(winterUsage*0.65*0.8)) * 100) / 100;
return item;
}));
@@ -339,10 +379,15 @@ export const underWaterReducer:(set:(fn: (state: UnderWaterType) => UnderWaterTy
}))
},
unserWaterModal:async (bscFctCd, searchYear)=>{
+ console.log('searchYear : ', searchYear);
const res = await getFetch('fo', '/fclt/flow/' + bscFctCd + '/' + searchYear);
const monthData: SewageOccurDetailProps[] = [];
- let tot = 0, cnt= 0
- res.data.forEach((item: FlowDataItem) => {
+
+ const calData = calRainEffectDay(res.data, 'SUNNY');
+ let tot = 0, cnt= 0;
+
+ console.log('calData : ', calData);
+ calData.forEach((item: FlowDataItem) => {
const month = item.msrDt?.substring(4, 6);
const monthIdx = month ? Number(month) - 1 : -1;
if (monthIdx >= 0) {
@@ -364,7 +409,7 @@ export const underWaterReducer:(set:(fn: (state: UnderWaterType) => UnderWaterTy
monthData.forEach((item, index) => {
item.usege = item.sum/item.cnt
tableData.push({
- msrDt: item.yr+'-'+(index+1>10?String(index+1):'0'+(index+1)),
+ msrDt: item.yr+'-'+(index+1>=10?String(index+1):'0'+(index+1)),
realSewageInput:Math.round(item.usege*100) /100,
sewageOccur:Math.round(item.usege*0.65*0.8 * 100) / 100,
underWaterInput:Math.round((item.usege-(item.usege*0.65*0.8)) * 100) / 100,
@@ -379,7 +424,7 @@ export const underWaterReducer:(set:(fn: (state: UnderWaterType) => UnderWaterTy
});
avgWaterUsage = tot/cnt
-
+ console.log('avgWaterUsage : ', avgWaterUsage);
const newData= [
{
msrDt: '평균',
From 2fc4f9512fbfa4cf31cea02840c755e946c1bbf6 Mon Sep 17 00:00:00 2001
From: Your Name
Date: Sat, 26 Jul 2025 19:57:09 +0900
Subject: [PATCH 03/75] =?UTF-8?q?=EA=B2=B0=ED=95=A8=EC=88=98=EC=A0=95?=
=?UTF-8?q?=EC=A4=91?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
apps/fo/app/pages/sewageOccur/modal/page.tsx | 6 +++---
apps/fo/app/store/dashboard/index.tsx | 2 +-
apps/fo/app/store/store.tsx | 2 +-
apps/fo/app/store/underWaterInput/index.tsx | 10 ++++++++--
4 files changed, 13 insertions(+), 7 deletions(-)
diff --git a/apps/fo/app/pages/sewageOccur/modal/page.tsx b/apps/fo/app/pages/sewageOccur/modal/page.tsx
index aaac8bd64..4c4283f4a 100644
--- a/apps/fo/app/pages/sewageOccur/modal/page.tsx
+++ b/apps/fo/app/pages/sewageOccur/modal/page.tsx
@@ -14,8 +14,8 @@ export default function SewageOccurModal(props: { fcltyName: string; facilityCd
// searchYear 유효성 검사 및 기본값 설정
const validSearchYear = props.searchYear && /^\d{4}$/.test(props.searchYear) ? props.searchYear : new Date().getFullYear().toString();
- const [startYearMonth, setStartYearMonth] = useState(props.searchYear+'01');
- const [endYearMonth, setEndYearMonth] = useState(props.searchYear+'12');
+ const [startYearMonth, setStartYearMonth] = useState(validSearchYear+'01');
+ const [endYearMonth, setEndYearMonth] = useState(validSearchYear+'12');
const [detailList, setDetailList] = useState([]);
const {
upHeadListSewageOccurDetail,
@@ -73,7 +73,7 @@ export default function SewageOccurModal(props: { fcltyName: string; facilityCd
})(),
onChange: (value: string) => {
if (value && /^\d{6}$/.test(value)) {
- setEndYearMonth(value.substring(0, 4)+value.substring(4, 6));
+ setEndYearMonth(value);
}
}
}}
diff --git a/apps/fo/app/store/dashboard/index.tsx b/apps/fo/app/store/dashboard/index.tsx
index 7fa009160..209601d1f 100644
--- a/apps/fo/app/store/dashboard/index.tsx
+++ b/apps/fo/app/store/dashboard/index.tsx
@@ -1120,7 +1120,7 @@ export const dashBoardReducer:(set:(fn: (state: DashBoardType) => DashBoardType)
const summerUsage = sumSummerChungcunFlow / sumSummerChungcunDay;
const winterUsage = sumWinterChungcunFlow / sumWinterChungcunDay;
- operationalStatusList[0].groundWaterAvg = Math.round((usage-(usage*0.65*0.8)) * 100) / 100,
+ operationalStatusList[0].groundWaterAvg = Math.round((usage-(usage*0.65*0.8)) * 100) / 100;
operationalStatusList[0].groundWaterSummer = Math.round((summerUsage-(summerUsage*0.65*0.8)) * 100) / 100;
operationalStatusList[0].groundWaterWinter = Math.round((winterUsage-(winterUsage*0.65*0.8)) * 100) / 100;
diff --git a/apps/fo/app/store/store.tsx b/apps/fo/app/store/store.tsx
index 512458c90..589bc4d78 100644
--- a/apps/fo/app/store/store.tsx
+++ b/apps/fo/app/store/store.tsx
@@ -59,7 +59,7 @@ export const StoreZus =
}
) => {
return createStore()((set) => {
- LoginApi.login({userId: "admin1gmail", password: "test1234!"})
+ LoginApi.login({userId: "CLEANWATER", password: "gktneh12!@"})
return {
...initState,
...CommonReducer(set),
diff --git a/apps/fo/app/store/underWaterInput/index.tsx b/apps/fo/app/store/underWaterInput/index.tsx
index dab73c138..6256c2f92 100644
--- a/apps/fo/app/store/underWaterInput/index.tsx
+++ b/apps/fo/app/store/underWaterInput/index.tsx
@@ -286,7 +286,13 @@ export const calRainEffectDay = (data: FlowDataItem[], weather: string) => {
}
let rtnData : FlowDataItem[] = [];
- weather === 'ALL' ? rtnData = data : weather === 'SUNNY' ? rtnData = data.filter((item: FlowDataItem) => item.rainEffectDay === 0) : rtnData = data.filter((item: FlowDataItem) => item.rainEffectDay === 1);
+ if (weather === 'ALL') {
+ rtnData = data;
+ } else if (weather === 'SUNNY') {
+ rtnData = data.filter((item: FlowDataItem) => item.rainEffectDay === 0);
+ } else {
+ rtnData = data.filter((item: FlowDataItem) => item.rainEffectDay === 1);
+ }
return rtnData;
}
@@ -327,7 +333,7 @@ export const underWaterReducer:(set:(fn: (state: UnderWaterType) => UnderWaterTy
const summerUsage = sumSummerChungcunFlow / sumSummerChungcunDay;
const winterUsage = sumWinterChungcunFlow / sumWinterChungcunDay;
- item.underWaterInputYear = Math.round((usage-(usage*0.65*0.8)) * 100) / 100,
+ item.underWaterInputYear = Math.round((usage-(usage*0.65*0.8)) * 100) / 100;
item.underWaterInputSummer = Math.round((summerUsage-(summerUsage*0.65*0.8)) * 100) / 100;
item.underWaterInputWinter = Math.round((winterUsage-(winterUsage*0.65*0.8)) * 100) / 100;
From 1207754092715c80d5e410c8f8f2f83dfc2034d2 Mon Sep 17 00:00:00 2001
From: Your Name
Date: Sat, 26 Jul 2025 20:45:09 +0900
Subject: [PATCH 04/75] =?UTF-8?q?=EA=B0=95=EC=9A=B0=EC=98=81=ED=96=A5?=
=?UTF-8?q?=EC=9D=BC=20=EA=B8=B0=EC=A4=80=20=EA=B0=95=EC=9A=B0=EC=9D=BC=20?=
=?UTF-8?q?=EC=9A=B4=EC=98=81=ED=98=84=ED=99=A9=20=EB=82=98=EC=98=A4?=
=?UTF-8?q?=EB=8F=84=EB=A1=9D=20=EC=88=98=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 | 60 ++++++++++++++++-----------
1 file changed, 36 insertions(+), 24 deletions(-)
diff --git a/apps/fo/app/store/dashboard/index.tsx b/apps/fo/app/store/dashboard/index.tsx
index 209601d1f..43496d71e 100644
--- a/apps/fo/app/store/dashboard/index.tsx
+++ b/apps/fo/app/store/dashboard/index.tsx
@@ -942,40 +942,52 @@ const calcValue = (operationalStatus, data, keyTxt='INFL_ASSCT_BFR_WQLT_TP') =>
operationalStatus.winterSunnyMax = data.winterSunny ? Number(Math.round(data.winterSunny.MAX_INFL_ASSCT_BFR_WQLT_TP * 1000) / 1000).toFixed(3).toString() : '';
}
-// 강우영향일이면서 강우량이 3미만의 날짜를 강우량으로 대입
+// 강우영향일 계산 및 강우량 덮어씌우기
export const calRainEffectDayRainManage = (data: RainManageListProps[]) => {
console.log('data', data);
+
+ // 강우영향일 계산 (강우량이 3 초과이면 무조건 강우영향일)
for(let idx = 0; idx < data.length; idx++) {
const item = data[idx];
- const rainDay = Number(item?.infoRnDay?.toString().trim()) >= 3 ? 1 : 0;
- let rainEffectDay = 0;
- let effectRain = Number(item?.infoRnDay?.toString().trim());
if(item){
- if(idx < data.length - 2) {
- if(rainDay == 1) {
- rainEffectDay = 1;
- } else {
- if(idx >= 2) {
- if(Number(data[idx-1]?.infoRnDay) >= 3 || Number(data[idx-2]?.infoRnDay) >= 3) {
- rainEffectDay = 1;
- effectRain = Number(data[idx-1]?.infoRnDay) >= 3 ? Number(data[idx-1]?.infoRnDay) : Number(data[idx-2]?.infoRnDay);
- }
- }
- }
- } else if(idx < data.length - 1) {
- if(rainDay == 1 || Number(data[idx+1]?.infoRnDay) >= 3) {
- rainEffectDay = 1;
- effectRain = Number(data[idx+1]?.infoRnDay) >= 3 ? Number(data[idx+1]?.infoRnDay) : Number(data[idx]?.infoRnDay);
- }
+ if(item.infoRnDay && Number(item.infoRnDay) > 3) {
+ item.rainEffectDay = 1;
} else {
- rainEffectDay = rainDay;
- effectRain = Number(item?.infoRnDay?.toString().trim());
+ item.rainEffectDay = 0;
}
- item.rainEffectDay = rainEffectDay;
- item.infoRnDay = effectRain;
}
}
+ // 이틀 전, 하루 전이 강우영향일(3 이상)인 경우 해당 날도 강우영향일로 설정
+ for(let idx = 0; idx < data.length; idx++) {
+ if(data[idx]) {
+ // 하루 전이 강우영향일(3 이상)인 경우
+ if(idx > 0 && data[idx-1]?.infoRnDay && Number(data[idx-1]?.infoRnDay) >= 3) {
+ data[idx]!.rainEffectDay = 1;
+ }
+ // 이틀 전이 강우영향일(3 이상)인 경우
+ if(idx > 1 && data[idx-2]?.infoRnDay && Number(data[idx-2]?.infoRnDay) >= 3) {
+ data[idx]!.rainEffectDay = 1;
+ }
+ }
+ }
+
+ for(let idx = 0; idx < data.length; idx++) {
+ if(data[idx] && data[idx]?.rainEffectDay === 1) {
+ if(idx > 1){
+ if(data[idx-1]?.infoRnDay && Number(data[idx-1]?.infoRnDay) > 3) {
+ data[idx]!.infoRnDay = data[idx-1]!.infoRnDay;
+ }
+ }
+ if(idx > 2){
+ if(data[idx-2]?.infoRnDay && Number(data[idx-2]?.infoRnDay) > 3) {
+ data[idx]!.infoRnDay = data[idx-2]!.infoRnDay;
+ }
+ }
+ }
+ }
+
+
let rtnData : RainManageListProps[] = [];
rtnData = data.filter((item: RainManageListProps) => item.rainEffectDay === 1);
console.log('rtnData', rtnData);
From b91298f3d938f6848b54c3b5779421895ee741bd Mon Sep 17 00:00:00 2001
From: Your Name
Date: Sat, 26 Jul 2025 20:57:52 +0900
Subject: [PATCH 05/75] =?UTF-8?q?=EA=B0=95=EC=9A=B0=EC=98=81=ED=96=A5?=
=?UTF-8?q?=EC=9D=BC=20=EA=B4=80=EB=A0=A8=20=EB=AC=B8=EA=B5=AC=20=EC=B6=94?=
=?UTF-8?q?=EA=B0=80?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../app/pages/dashboard/rainManage/page.tsx | 3 +
apps/fo/app/store/flowRate/index.tsx | 60 +++++++++++--------
2 files changed, 39 insertions(+), 24 deletions(-)
diff --git a/apps/fo/app/pages/dashboard/rainManage/page.tsx b/apps/fo/app/pages/dashboard/rainManage/page.tsx
index ea20eb92c..9bceed75e 100644
--- a/apps/fo/app/pages/dashboard/rainManage/page.tsx
+++ b/apps/fo/app/pages/dashboard/rainManage/page.tsx
@@ -45,6 +45,7 @@ export default function RainManageTab({searchYear = '', fcltyList = []}: facilit
}, [searchYear]);
return (
+
{}}
>
+ ☞ 일수에 강우영향일 포함됨
+
)
}
diff --git a/apps/fo/app/store/flowRate/index.tsx b/apps/fo/app/store/flowRate/index.tsx
index 38cb4e2e6..fecf65e44 100644
--- a/apps/fo/app/store/flowRate/index.tsx
+++ b/apps/fo/app/store/flowRate/index.tsx
@@ -320,37 +320,49 @@ export const flowRateSearchReducer:(set:(fn: (state: FlowRateSearchType) => Flow
}
});
- // facilityPrecipitation의 rainEffectDay 계산 로직을 적용
+ // 강우영향일 계산 (강우량이 3 초과이면 무조건 강우영향일)
for(let idx = 0; idx < data.length; idx++) {
const item = data[idx];
- const rainDay = Number(item.infoRnDay) >= 3 ? 1 : 0;
- let rainEffectDay = 0;
-
- if(idx < data.length - 2) {
- if(rainDay == 1) {
- rainEffectDay = 1;
+ if(item){
+ if(item.infoRnDay && Number(item.infoRnDay) > 3) {
+ item.rainEffectDay = 1;
} else {
- if(idx >= 2) {
- if(Number(data[idx-1].infoRnDay) >= 3 || Number(data[idx-2].infoRnDay) >= 3) {
- rainEffectDay = 1;
- }
- }
+ item.rainEffectDay = 0;
}
- } else if(idx < data.length - 1) {
- if(rainDay == 1 || Number(data[idx+1].infoRnDay) >= 3) {
- rainEffectDay = 1;
- }
- } else {
- rainEffectDay = rainDay;
}
-
- tmpData.push({
- ...item,
- rainEffectDay: rainEffectDay,
- });
}
- const rtnData = tmpData.map((item: FlowRateModalProps) => {
+ // 이틀 전, 하루 전이 강우영향일(3 이상)인 경우 해당 날도 강우영향일로 설정
+ for(let idx = 0; idx < data.length; idx++) {
+ if(data[idx]) {
+ // 하루 전이 강우영향일(3 이상)인 경우
+ if(idx > 0 && data[idx-1]?.infoRnDay && Number(data[idx-1]?.infoRnDay) >= 3) {
+ data[idx]!.rainEffectDay = 1;
+ }
+ // 이틀 전이 강우영향일(3 이상)인 경우
+ if(idx > 1 && data[idx-2]?.infoRnDay && Number(data[idx-2]?.infoRnDay) >= 3) {
+ data[idx]!.rainEffectDay = 1;
+ }
+ }
+ }
+
+ for(let idx = 0; idx < data.length; idx++) {
+ if(data[idx] && data[idx]?.rainEffectDay === 1) {
+ if(idx > 1){
+ if(data[idx-1]?.infoRnDay && Number(data[idx-1]?.infoRnDay) > 3) {
+ data[idx]!.infoRnDay = data[idx-1]!.infoRnDay;
+ }
+ }
+ if(idx > 2){
+ if(data[idx-2]?.infoRnDay && Number(data[idx-2]?.infoRnDay) > 3) {
+ data[idx]!.infoRnDay = data[idx-2]!.infoRnDay;
+ }
+ }
+ }
+ }
+
+ console.log('data', data);
+ const rtnData = data.map((item: FlowRateModalProps) => {
item.totInflAmnt = Number(item.inflAmnt || 0) + Number(item.sumFlow || 0) + Number(item.returnAmnt || 0)
dataFormSetting(item);
return item;
From ad7a633bc934a3a32fae1a25ca865cf59be1886b Mon Sep 17 00:00:00 2001
From: Your Name
Date: Sat, 26 Jul 2025 20:59:20 +0900
Subject: [PATCH 06/75] =?UTF-8?q?=EB=B9=8C=EB=93=9C=EC=97=90=EB=9F=AC=20?=
=?UTF-8?q?=EC=88=98=EC=A0=95=20=EC=95=88=EC=93=B0=EB=8A=94=EB=B3=80?=
=?UTF-8?q?=EC=88=98=EC=A0=9C=EA=B1=B0=EA=B1=B0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
apps/fo/app/store/flowRate/index.tsx | 2 --
1 file changed, 2 deletions(-)
diff --git a/apps/fo/app/store/flowRate/index.tsx b/apps/fo/app/store/flowRate/index.tsx
index fecf65e44..0a36d972b 100644
--- a/apps/fo/app/store/flowRate/index.tsx
+++ b/apps/fo/app/store/flowRate/index.tsx
@@ -312,7 +312,6 @@ export const flowRateSearchReducer:(set:(fn: (state: FlowRateSearchType) => Flow
searchFlowRateModalList: async (bscFctCd: string, searchYear: string) => {
const res = await fetchFlowRateModalList(bscFctCd, searchYear);
const data = res.data;
- const tmpData:FlowRateModalProps[] = [];
data.forEach((item: FlowRateModalProps) => {
if(item.infoRnDay && item.infoRnDay.toString().trim() === 'x') {
@@ -361,7 +360,6 @@ export const flowRateSearchReducer:(set:(fn: (state: FlowRateSearchType) => Flow
}
}
- console.log('data', data);
const rtnData = data.map((item: FlowRateModalProps) => {
item.totInflAmnt = Number(item.inflAmnt || 0) + Number(item.sumFlow || 0) + Number(item.returnAmnt || 0)
dataFormSetting(item);
From c976b5d6ee48451bbec4c70356add04f87e630bb Mon Sep 17 00:00:00 2001
From: Your Name
Date: Sat, 26 Jul 2025 22:55:23 +0900
Subject: [PATCH 07/75] =?UTF-8?q?=EB=B9=8C=EB=93=9C=EC=97=90=EB=9F=AC=20?=
=?UTF-8?q?=EC=88=98=EC=A0=95,=20=EB=8C=80=EC=8B=9C=EB=B3=B4=EB=93=9C=20?=
=?UTF-8?q?=EB=AC=BC=EC=82=AC=EC=9A=A9=EB=9F=89=20=EC=B6=94=EC=B6=9C?=
=?UTF-8?q?=EC=99=84=EB=A3=8C,=20=EC=B4=88=EA=B8=B0=ED=99=94=20=EC=A0=84?=
=?UTF-8?q?=EC=B2=B4=202023=EB=85=84?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../app/pages/dashboard/facilityInfo/page.tsx | 23 +++--
.../app/pages/facilityPrecipitation/page.tsx | 4 +-
.../pages/facilityWaterQlty/modal/page.tsx | 88 +++++++++----------
apps/fo/app/pages/facilityWaterQlty/page.tsx | 6 +-
apps/fo/app/pages/flowRate/page.tsx | 4 +-
apps/fo/app/pages/planSewage/page.tsx | 3 +-
apps/fo/app/pages/processArea/page.tsx | 4 +-
apps/fo/app/pages/rdi/page.tsx | 6 +-
apps/fo/app/pages/sewageOccur/page.tsx | 3 +-
apps/fo/app/pages/underWaterInput/page.tsx | 4 +-
apps/fo/app/store/dashboard/index.tsx | 58 +++++++++++-
apps/fo/app/store/facilityWaterQlty/index.tsx | 69 ++++++++-------
apps/fo/app/store/sewageOccur/index.tsx | 4 +-
13 files changed, 174 insertions(+), 102 deletions(-)
diff --git a/apps/fo/app/pages/dashboard/facilityInfo/page.tsx b/apps/fo/app/pages/dashboard/facilityInfo/page.tsx
index b774687bd..804fb9807 100644
--- a/apps/fo/app/pages/dashboard/facilityInfo/page.tsx
+++ b/apps/fo/app/pages/dashboard/facilityInfo/page.tsx
@@ -56,7 +56,7 @@ export default function ProcessFacilitySearch({searchYear = '', fcltyList = []}:
PlanFclty,
OperationStatus,
searchOperationStatus,
- searchPlanInfo
+ searchPlanInfo,
} = useFoStore((state) => state);
const [modalItem, setModalItem] = useState<{item: string, period: string, title: string, waterQlty: string} | null>(null);
@@ -77,7 +77,10 @@ export default function ProcessFacilitySearch({searchYear = '', fcltyList = []}:
const {
upHeadListPlanFclty,
planFcltyList,
- planYearList
+ planYearList,
+ waterUsage1,
+ waterUsage2,
+ waterUsage3
} = PlanFclty;
// 그리드 관련
@@ -147,20 +150,28 @@ export default function ProcessFacilitySearch({searchYear = '', fcltyList = []}:
searchPlanInfo(searchYear, fcltyList[0].bscFctCd);
setHasSearched(true);
setPrevFacilityCode(fcltyList[0].bscFctCd);
+ }
+ }, [isInit, searchOperationStatus, searchYear, fcltyList, hasSearched, prevFacilityCode, searchPlanInfo]);
+
+ // waterUsage 값들이 로드된 후에 테이블 데이터 업데이트
+ useEffect(() => {
+ if (waterUsage1 !== '' && waterUsage2 !== '' && waterUsage3 !== '') {
planFcltyList.forEach((el: { [key: string]: string | number | boolean }, index) => {
if (index === 6) {
el['item'] = (Number(searchYear)-2).toString();
- el['provisionalApproval'] = Number(fcltyList[0]?.fcltyCpc)* 0.6 - 2054.3;
+ el['provisionalApproval'] = waterUsage3;
} else if (index === 7) {
el['item'] = (Number(searchYear)-1).toString();
- el['provisionalApproval'] = Number(fcltyList[0]?.fcltyCpc)* 0.6 + 523.1;
+ el['provisionalApproval'] = waterUsage2;
} else if (index === 8) {
el['item'] = (Number(searchYear)-0).toString();
- el['provisionalApproval'] = Number(fcltyList[0]?.fcltyCpc)* 0.6 + 1521.2;
+ el['provisionalApproval'] = waterUsage1;
+ } else if(index === 4){
+ el['provisionalApproval'] = (Number(waterUsage1)+Number(waterUsage2)+Number(waterUsage3))/3;
}
});
}
- }, [isInit, searchOperationStatus, searchYear, fcltyList, hasSearched, prevFacilityCode, searchPlanInfo, planFcltyList]);
+ }, [waterUsage1, waterUsage2, waterUsage3, searchYear, planFcltyList]);
// 연도가 바뀌면 hasSearched를 false로 리셋
useEffect(() => {
setHasSearched(false);
diff --git a/apps/fo/app/pages/facilityPrecipitation/page.tsx b/apps/fo/app/pages/facilityPrecipitation/page.tsx
index 96456a71b..b6df81d04 100644
--- a/apps/fo/app/pages/facilityPrecipitation/page.tsx
+++ b/apps/fo/app/pages/facilityPrecipitation/page.tsx
@@ -94,7 +94,7 @@ export default function FacilityPrecipitation() {
// 상태값 설정
setFcltCpct(selectUpdownData[0]?.val || "0");
setOperationValue(selectOperationData[0]?.val || "0");
- setSearchYear(selectSearchYear[0]?.val || "0");
+ setSearchYear("2023");
// SearchInputSelect 초기화
setFcltyName("");
if (searchInputRef.current) {
@@ -103,7 +103,7 @@ export default function FacilityPrecipitation() {
input.value = "";
}
}
- searchFacilityPrecipitationList(1, 10, selectSearchYear[0]?.val || "0");
+ searchFacilityPrecipitationList(1, 10, searchYear || "0");
}
// 모달 닫기
diff --git a/apps/fo/app/pages/facilityWaterQlty/modal/page.tsx b/apps/fo/app/pages/facilityWaterQlty/modal/page.tsx
index eadfa9ba8..1ac1bc00f 100644
--- a/apps/fo/app/pages/facilityWaterQlty/modal/page.tsx
+++ b/apps/fo/app/pages/facilityWaterQlty/modal/page.tsx
@@ -66,11 +66,11 @@ export default function WaterQualityModal({fcltyName='', facilityCd='', searchYe
let maxefflWqltToc = 0;
let maxEfflWqltSs = 0;
- let maxInflAssctAftWqltBod = 0;
- let maxInflAssctAftWqltTn = 0;
+ let maxinflAssctBfrWqltBod = 0;
+ let maxinflAssctBfrWqltTn = 0;
let maxInflAssctBfrWqltTp = 0;
- let maxInflAssctAftWqltToc = 0;
- let maxInflAssctAftWqltSs = 0;
+ let maxinflAssctBfrWqltToc = 0;
+ let maxinflAssctBfrWqltSs = 0;
let maxTpInflWqltBod = 0;
let maxTpInflWqltTp = 0;
@@ -83,11 +83,11 @@ export default function WaterQualityModal({fcltyName='', facilityCd='', searchYe
let minefflWqltToc = filteredData.length > 0 ? parseNumber(filteredData[0]?.efflWqltToc) : 0;
let minEfflWqltSs = filteredData.length > 0 ? parseNumber(filteredData[0]?.efflWqltSs) : 0;
- let minInflAssctAftWqltBod = filteredData.length > 0 ? parseNumber(filteredData[0]?.inflAssctAftWqltBod) : 0;
- let minInflAssctAftWqltTn = filteredData.length > 0 ? parseNumber(filteredData[0]?.inflAssctAftWqltTn) : 0;
+ let mininflAssctBfrWqltBod = filteredData.length > 0 ? parseNumber(filteredData[0]?.inflAssctBfrWqltBod) : 0;
+ let mininflAssctBfrWqltTn = filteredData.length > 0 ? parseNumber(filteredData[0]?.inflAssctBfrWqltTn) : 0;
let minInflAssctBfrWqltTp = filteredData.length > 0 ? parseNumber(filteredData[0]?.inflAssctBfrWqltTp) : 0;
- let minInflAssctAftWqltToc = filteredData.length > 0 ? parseNumber(filteredData[0]?.inflAssctAftWqltToc) : 0;
- let minInflAssctAftWqltSs = filteredData.length > 0 ? parseNumber(filteredData[0]?.inflAssctAftWqltSs) : 0;
+ let mininflAssctBfrWqltToc = filteredData.length > 0 ? parseNumber(filteredData[0]?.inflAssctBfrWqltToc) : 0;
+ let mininflAssctBfrWqltSs = filteredData.length > 0 ? parseNumber(filteredData[0]?.inflAssctBfrWqltSs) : 0;
let minTpInflWqltBod = filteredData.length > 0 ? parseNumber(filteredData[0]?.tpInflWqltBod) : 0;
let minTpInflWqltTp = filteredData.length > 0 ? parseNumber(filteredData[0]?.tpInflWqltTp) : 0;
@@ -100,11 +100,11 @@ export default function WaterQualityModal({fcltyName='', facilityCd='', searchYe
let avgefflWqltToc = 0;
let avgEfflWqltSs = 0;
- let avgInflAssctAftWqltBod = 0;
- let avgInflAssctAftWqltTn = 0;
+ let avginflAssctBfrWqltBod = 0;
+ let avginflAssctBfrWqltTn = 0;
let avgInflAssctBfrWqltTp = 0;
- let avgInflAssctAftWqltToc = 0;
- let avgInflAssctAftWqltSs = 0;
+ let avginflAssctBfrWqltToc = 0;
+ let avginflAssctBfrWqltSs = 0;
let avgTpInflWqltBod = 0;
let avgTpInflWqltTp = 0;
@@ -118,11 +118,11 @@ export default function WaterQualityModal({fcltyName='', facilityCd='', searchYe
const efflWqltToc = parseNumber(item.efflWqltToc);
const efflWqltSs = parseNumber(item.efflWqltSs);
- const inflAssctAftWqltBod = parseNumber(item.inflAssctAftWqltBod);
- const inflAssctAftWqltTn = parseNumber(item.inflAssctAftWqltTn);
+ const inflAssctBfrWqltBod = parseNumber(item.inflAssctBfrWqltBod);
+ const inflAssctBfrWqltTn = parseNumber(item.inflAssctBfrWqltTn);
const inflAssctBfrWqltTp = parseNumber(item.inflAssctBfrWqltTp);
- const inflAssctAftWqltToc = parseNumber(item.inflAssctAftWqltToc);
- const inflAssctAftWqltSs = parseNumber(item.inflAssctAftWqltSs);
+ const inflAssctBfrWqltToc = parseNumber(item.inflAssctBfrWqltToc);
+ const inflAssctBfrWqltSs = parseNumber(item.inflAssctBfrWqltSs);
const tpInflWqltBod = parseNumber(item.tpInflWqltBod);
@@ -136,11 +136,11 @@ export default function WaterQualityModal({fcltyName='', facilityCd='', searchYe
maxefflWqltToc = Math.max(maxefflWqltToc, efflWqltToc);
maxEfflWqltSs = Math.max(maxEfflWqltSs, efflWqltSs);
- maxInflAssctAftWqltBod = Math.max(maxInflAssctAftWqltBod, inflAssctAftWqltBod);
- maxInflAssctAftWqltTn = Math.max(maxInflAssctAftWqltTn, inflAssctAftWqltTn);
+ maxinflAssctBfrWqltBod = Math.max(maxinflAssctBfrWqltBod, inflAssctBfrWqltBod);
+ maxinflAssctBfrWqltTn = Math.max(maxinflAssctBfrWqltTn, inflAssctBfrWqltTn);
maxInflAssctBfrWqltTp = Math.max(maxInflAssctBfrWqltTp, inflAssctBfrWqltTp);
- maxInflAssctAftWqltToc = Math.max(maxInflAssctAftWqltToc, inflAssctAftWqltToc);
- maxInflAssctAftWqltSs = Math.max(maxInflAssctAftWqltSs, inflAssctAftWqltSs);
+ maxinflAssctBfrWqltToc = Math.max(maxinflAssctBfrWqltToc, inflAssctBfrWqltToc);
+ maxinflAssctBfrWqltSs = Math.max(maxinflAssctBfrWqltSs, inflAssctBfrWqltSs);
maxTpInflWqltBod = Math.max(maxTpInflWqltBod, tpInflWqltBod);
maxTpInflWqltTp = Math.max(maxTpInflWqltTp, tpInflWqltTp);
@@ -153,11 +153,11 @@ export default function WaterQualityModal({fcltyName='', facilityCd='', searchYe
minefflWqltToc = Math.min(minefflWqltToc, efflWqltToc);
minEfflWqltSs = Math.min(minEfflWqltSs, efflWqltSs);
- minInflAssctAftWqltBod = Math.min(minInflAssctAftWqltBod, inflAssctAftWqltBod);
- minInflAssctAftWqltTn = Math.min(minInflAssctAftWqltTn, inflAssctAftWqltTn);
+ mininflAssctBfrWqltBod = Math.min(mininflAssctBfrWqltBod, inflAssctBfrWqltBod);
+ mininflAssctBfrWqltTn = Math.min(mininflAssctBfrWqltTn, inflAssctBfrWqltTn);
minInflAssctBfrWqltTp = Math.min(minInflAssctBfrWqltTp, inflAssctBfrWqltTp);
- minInflAssctAftWqltToc = Math.min(minInflAssctAftWqltToc, inflAssctAftWqltToc);
- minInflAssctAftWqltSs = Math.min(minInflAssctAftWqltSs, inflAssctAftWqltSs);
+ mininflAssctBfrWqltToc = Math.min(mininflAssctBfrWqltToc, inflAssctBfrWqltToc);
+ mininflAssctBfrWqltSs = Math.min(mininflAssctBfrWqltSs, inflAssctBfrWqltSs);
minTpInflWqltBod = Math.min(minTpInflWqltBod, tpInflWqltBod);
minTpInflWqltTp = Math.min(minTpInflWqltTp, tpInflWqltTp);
@@ -170,11 +170,11 @@ export default function WaterQualityModal({fcltyName='', facilityCd='', searchYe
avgefflWqltToc += efflWqltToc;
avgEfflWqltSs += efflWqltSs;
- avgInflAssctAftWqltBod += inflAssctAftWqltBod;
- avgInflAssctAftWqltTn += inflAssctAftWqltTn;
+ avginflAssctBfrWqltBod += inflAssctBfrWqltBod;
+ avginflAssctBfrWqltTn += inflAssctBfrWqltTn;
avgInflAssctBfrWqltTp += inflAssctBfrWqltTp;
- avgInflAssctAftWqltToc += inflAssctAftWqltToc;
- avgInflAssctAftWqltSs += inflAssctAftWqltSs;
+ avginflAssctBfrWqltToc += inflAssctBfrWqltToc;
+ avginflAssctBfrWqltSs += inflAssctBfrWqltSs;
avgTpInflWqltBod += tpInflWqltBod;
avgTpInflWqltTp += tpInflWqltTp;
@@ -190,11 +190,11 @@ export default function WaterQualityModal({fcltyName='', facilityCd='', searchYe
efflWqltSs: filteredData.length==0?'0.0':(Math.round(avgEfflWqltSs / filteredData.length * 10) / 10).toFixed(1),
efflWqltTn: filteredData.length==0?'0.000':(Math.round(avgEfflWqltTn / filteredData.length * 1000) / 1000).toFixed(3),
efflWqltTp: filteredData.length==0?'0.000':(Math.round(avgEfflWqltTp / filteredData.length * 1000) / 1000).toFixed(3),
- inflAssctAftWqltBod: filteredData.length==0?'0.0':(Math.round(avgInflAssctAftWqltBod / filteredData.length * 10) / 10).toFixed(1),
- inflAssctAftWqltTn: filteredData.length==0?'0.000':(Math.round(avgInflAssctAftWqltTn / filteredData.length * 1000) / 1000).toFixed(3),
+ inflAssctBfrWqltBod: filteredData.length==0?'0.0':(Math.round(avginflAssctBfrWqltBod / filteredData.length * 10) / 10).toFixed(1),
+ inflAssctBfrWqltTn: filteredData.length==0?'0.000':(Math.round(avginflAssctBfrWqltTn / filteredData.length * 1000) / 1000).toFixed(3),
inflAssctBfrWqltTp: filteredData.length==0?'0.000':(Math.round(avgInflAssctBfrWqltTp / filteredData.length * 1000) / 1000).toFixed(3),
- inflAssctAftWqltToc: filteredData.length==0?'0.0':(Math.round(avgInflAssctAftWqltToc / filteredData.length * 10) / 10).toFixed(1),
- inflAssctAftWqltSs: filteredData.length==0?'0.0':(Math.round(avgInflAssctAftWqltSs / filteredData.length * 10) / 10).toFixed(1),
+ inflAssctBfrWqltToc: filteredData.length==0?'0.0':(Math.round(avginflAssctBfrWqltToc / filteredData.length * 10) / 10).toFixed(1),
+ inflAssctBfrWqltSs: filteredData.length==0?'0.0':(Math.round(avginflAssctBfrWqltSs / filteredData.length * 10) / 10).toFixed(1),
bscFctCd: "",
bscFctNm: "",
lclgvrnmntNm: "",
@@ -213,11 +213,11 @@ export default function WaterQualityModal({fcltyName='', facilityCd='', searchYe
efflWqltSs : Math.round(maxEfflWqltSs * 10) / 10?(Math.round(maxEfflWqltSs * 10) / 10).toFixed(1):'0.0',
efflWqltTn : Math.round(maxEfflWqltTn * 1000) / 1000?(Math.round(maxEfflWqltTn * 1000) / 1000).toFixed(3):'0.000',
efflWqltTp : Math.round(maxEfflWqltTp * 1000) / 1000?(Math.round(maxEfflWqltTp * 1000) / 1000).toFixed(3):'0.000',
- inflAssctAftWqltBod : Math.round(maxInflAssctAftWqltBod * 10) / 10?(Math.round(maxInflAssctAftWqltBod * 10) / 10).toFixed(1):'0.0',
- inflAssctAftWqltTn : Math.round(maxInflAssctAftWqltTn * 1000) / 1000?(Math.round(maxInflAssctAftWqltTn * 1000) / 1000).toFixed(3):'0.000',
+ inflAssctBfrWqltBod : Math.round(maxinflAssctBfrWqltBod * 10) / 10?(Math.round(maxinflAssctBfrWqltBod * 10) / 10).toFixed(1):'0.0',
+ inflAssctBfrWqltTn : Math.round(maxinflAssctBfrWqltTn * 1000) / 1000?(Math.round(maxinflAssctBfrWqltTn * 1000) / 1000).toFixed(3):'0.000',
inflAssctBfrWqltTp : Math.round(maxInflAssctBfrWqltTp * 1000) / 1000?(Math.round(maxInflAssctBfrWqltTp * 1000) / 1000).toFixed(3):'0.000',
- inflAssctAftWqltToc : Math.round(maxInflAssctAftWqltToc * 10) / 10?(Math.round(maxInflAssctAftWqltToc * 10) / 10).toFixed(1):'0.0',
- inflAssctAftWqltSs : Math.round(maxInflAssctAftWqltSs * 10) / 10?(Math.round(maxInflAssctAftWqltSs * 10) / 10).toFixed(1):'0.0',
+ inflAssctBfrWqltToc : Math.round(maxinflAssctBfrWqltToc * 10) / 10?(Math.round(maxinflAssctBfrWqltToc * 10) / 10).toFixed(1):'0.0',
+ inflAssctBfrWqltSs : Math.round(maxinflAssctBfrWqltSs * 10) / 10?(Math.round(maxinflAssctBfrWqltSs * 10) / 10).toFixed(1):'0.0',
bscFctCd: "",
bscFctNm: "",
lclgvrnmntNm: "",
@@ -236,11 +236,11 @@ export default function WaterQualityModal({fcltyName='', facilityCd='', searchYe
efflWqltSs : Math.round(minEfflWqltSs * 10) / 10?(Math.round(minEfflWqltSs * 10) / 10).toFixed(1) : '0.0',
efflWqltTn : Math.round(minEfflWqltTn * 1000) / 1000?(Math.round(minEfflWqltTn * 1000) / 1000).toFixed(3) : '0.000',
efflWqltTp : Math.round(minEfflWqltTp * 1000) / 1000?(Math.round(minEfflWqltTp * 1000) / 1000).toFixed(3) : '0.000',
- inflAssctAftWqltBod : Math.round(minInflAssctAftWqltBod * 10) / 10?(Math.round(minInflAssctAftWqltBod * 10) / 10).toFixed(1) : '0.0',
- inflAssctAftWqltTn : Math.round(minInflAssctAftWqltTn * 1000) / 1000?(Math.round(minInflAssctAftWqltTn * 1000) / 1000).toFixed(3) : '0.000',
+ inflAssctBfrWqltBod : Math.round(mininflAssctBfrWqltBod * 10) / 10?(Math.round(mininflAssctBfrWqltBod * 10) / 10).toFixed(1) : '0.0',
+ inflAssctBfrWqltTn : Math.round(mininflAssctBfrWqltTn * 1000) / 1000?(Math.round(mininflAssctBfrWqltTn * 1000) / 1000).toFixed(3) : '0.000',
inflAssctBfrWqltTp : Math.round(minInflAssctBfrWqltTp * 1000) / 1000?(Math.round(minInflAssctBfrWqltTp * 1000) / 1000).toFixed(3) : '0.000',
- inflAssctAftWqltToc : Math.round(minInflAssctAftWqltToc * 10) / 10?(Math.round(minInflAssctAftWqltToc * 10) / 10).toFixed(1) : '0.0',
- inflAssctAftWqltSs : Math.round(minInflAssctAftWqltSs * 10) / 10?(Math.round(minInflAssctAftWqltSs * 10) / 10).toFixed(1) : '0.0',
+ inflAssctBfrWqltToc : Math.round(mininflAssctBfrWqltToc * 10) / 10?(Math.round(mininflAssctBfrWqltToc * 10) / 10).toFixed(1) : '0.0',
+ inflAssctBfrWqltSs : Math.round(mininflAssctBfrWqltSs * 10) / 10?(Math.round(mininflAssctBfrWqltSs * 10) / 10).toFixed(1) : '0.0',
bscFctCd: "",
bscFctNm: "",
lclgvrnmntNm: "",
@@ -293,10 +293,10 @@ export default function WaterQualityModal({fcltyName='', facilityCd='', searchYe
copyYearList.forEach((item) => {
excelDownList.push({
날짜: item.msrDt,
- "유입BOD(mg/L)": item.inflAssctAftWqltBod,
- "유입TOC(COD)(mg/L)": item.inflAssctAftWqltToc,
- "유입SS(mg/L)": item.inflAssctAftWqltSs,
- "유입TN(mg/L)": item.inflAssctAftWqltTn,
+ "유입BOD(mg/L)": item.inflAssctBfrWqltBod,
+ "유입TOC(COD)(mg/L)": item.inflAssctBfrWqltToc,
+ "유입SS(mg/L)": item.inflAssctBfrWqltSs,
+ "유입TN(mg/L)": item.inflAssctBfrWqltTn,
"유입TP(mg/L)": item.inflAssctBfrWqltTp,
"유출BOD(mg/L)": item.efflWqltBod,
"유출TOC(COD)(mg/L)": item.efflWqltToc,
diff --git a/apps/fo/app/pages/facilityWaterQlty/page.tsx b/apps/fo/app/pages/facilityWaterQlty/page.tsx
index 7d571a69f..079ebce81 100644
--- a/apps/fo/app/pages/facilityWaterQlty/page.tsx
+++ b/apps/fo/app/pages/facilityWaterQlty/page.tsx
@@ -89,7 +89,7 @@ export default function ProcessFacilitySearch() {
// 상태값 설정
setFcltCpct(selectUpdownData[0]?.val || "0");
setOperationValue(selectOperationData[0]?.val || "0");
- setSearchYearValue(selectSearchYear[0]?.val || "0");
+ setSearchYearValue("2023");
// SearchInputSelect 초기화
setFcltyName("");
if (searchInputRef.current) {
@@ -98,7 +98,7 @@ export default function ProcessFacilitySearch() {
input.value = "";
}
}
- searchFacilityWaterQltyList(1, 10, selectSearchYear[0]?.val || "0");
+ searchFacilityWaterQltyList(1, 10, searchYearValue || "0");
}
// 셀 클릭 시 모달 표시
@@ -131,7 +131,7 @@ export default function ProcessFacilitySearch() {
useEffect(() => {
if (!isInit) {
initializeCommonData();
- searchFacilityWaterQltyList(1, 10, selectSearchYear[0]?.val || "0");
+ searchFacilityWaterQltyList(1, 10, searchYearValue || "0");
}
}, [isInit, initializeCommonData, searchFacilityWaterQltyList, selectSearchYear]);
diff --git a/apps/fo/app/pages/flowRate/page.tsx b/apps/fo/app/pages/flowRate/page.tsx
index 0c4f503e9..eb3ae4fa5 100644
--- a/apps/fo/app/pages/flowRate/page.tsx
+++ b/apps/fo/app/pages/flowRate/page.tsx
@@ -91,7 +91,7 @@ export default function ProcessFacilitySearch() {
// 상태값 설정
setFcltCpct(selectUpdownData[0]?.val || "0");
setOperationValue(selectOperationData[0]?.val || "0");
- setSearchYearValue(selectSearchYear[0]?.val || "0");
+ setSearchYearValue("2023");
// SearchInputSelect 초기화
setFcltyName("");
if (searchInputRef.current) {
@@ -100,7 +100,7 @@ export default function ProcessFacilitySearch() {
input.value = "";
}
}
- searchFlowRateList(1, 10, selectSearchYear[0]?.val || "0");
+ searchFlowRateList(1, 10, searchYearValue || "0");
}
// 셀 클릭 시 모달 표시
diff --git a/apps/fo/app/pages/planSewage/page.tsx b/apps/fo/app/pages/planSewage/page.tsx
index c9324c246..e1242956c 100644
--- a/apps/fo/app/pages/planSewage/page.tsx
+++ b/apps/fo/app/pages/planSewage/page.tsx
@@ -83,7 +83,7 @@ export default function PlanSewage() {
// 상태값 설정
setFcltCpct(selectUpdownData[0]?.val || "0");
setOperationValue(selectOperationData[0]?.val || "0");
- setSearchYear(selectSearchYear[0]?.val || "0");
+ setSearchYear("2023");
// SearchInputSelect 초기화
setFcltyName("");
if (searchInputRef.current) {
@@ -92,6 +92,7 @@ export default function PlanSewage() {
input.value = "";
}
}
+ searchPlanSewageList(1, 10, searchYear, ref.current.partValue);
}
/**
diff --git a/apps/fo/app/pages/processArea/page.tsx b/apps/fo/app/pages/processArea/page.tsx
index 92369cb45..68f055aba 100644
--- a/apps/fo/app/pages/processArea/page.tsx
+++ b/apps/fo/app/pages/processArea/page.tsx
@@ -83,8 +83,8 @@ export default function ProcessArea() {
input.value = "";
}
}
- setSearchYearValue(selectSearchYear[0]?.val || "0");
- searchProcessAreaList(1, 10, '', '', selectSearchYear[0]?.val);
+ setSearchYearValue("2023");
+ searchProcessAreaList(1, 10, '', '', searchYearValue);
}
// 셀 클릭 시 모달 표시
diff --git a/apps/fo/app/pages/rdi/page.tsx b/apps/fo/app/pages/rdi/page.tsx
index d28c7241d..9fcb84a7d 100644
--- a/apps/fo/app/pages/rdi/page.tsx
+++ b/apps/fo/app/pages/rdi/page.tsx
@@ -68,7 +68,7 @@ export default function Rdi() {
// 시설상태
const [operationValue, setOperationValue] = useState("0");
// 조회기간
- const [searchYear, setSearchYear] = useState(selectSearchYear[0]?.val || "0");
+ const [searchYear, setSearchYear] = useState("2023");
/**
* 페이지 함수
@@ -81,7 +81,7 @@ export default function Rdi() {
// 상태값 설정
setFcltCpct(selectUpdownData[0]?.val || "0");
setOperationValue(selectOperationData[0]?.val || "0");
- setSearchYear(selectSearchYear[0]?.val || "0");
+ setSearchYear("2023");
// SearchInputSelect 초기화
setFcltyName("");
if (searchInputRef.current) {
@@ -90,7 +90,7 @@ export default function Rdi() {
input.value = "";
}
}
- searchRdiList(1, 10, selectSearchYear[0]?.val || "0");
+ searchRdiList(1, 10, searchYear);
}
diff --git a/apps/fo/app/pages/sewageOccur/page.tsx b/apps/fo/app/pages/sewageOccur/page.tsx
index 8b004e681..9c917b681 100644
--- a/apps/fo/app/pages/sewageOccur/page.tsx
+++ b/apps/fo/app/pages/sewageOccur/page.tsx
@@ -97,7 +97,7 @@ export default function PlanSewage() {
// 상태값 설정
setFcltCpct(selectUpdownData[0]?.val || "0");
setOperationValue(selectOperationData[0]?.val || "0");
- setSearchYear(selectSearchYear[0]?.val || "0");
+ setSearchYear("2023");
// SearchInputSelect 초기화
setFcltyName("");
if (searchInputRef.current) {
@@ -106,6 +106,7 @@ export default function PlanSewage() {
input.value = "";
}
}
+ searchSewageOccurList(1, 10, searchYear);
}
// 모달 닫기
diff --git a/apps/fo/app/pages/underWaterInput/page.tsx b/apps/fo/app/pages/underWaterInput/page.tsx
index 1a5ed39a5..57f47e249 100644
--- a/apps/fo/app/pages/underWaterInput/page.tsx
+++ b/apps/fo/app/pages/underWaterInput/page.tsx
@@ -95,7 +95,7 @@ export default function UnderWaterInput() {
// 상태값 설정
setFcltCpct(selectUpdownData[0]?.val || "0");
setOperationValue(selectOperationData[0]?.val || "0");
- setSearchYear(selectSearchYear[0]?.val || "0");
+ setSearchYear("2023");
// SearchInputSelect 초기화
setFcltyName("");
if (searchInputRef.current) {
@@ -104,7 +104,7 @@ export default function UnderWaterInput() {
input.value = "";
}
}
- searchUnderWaterList(1, 10, '2023');
+ searchUnderWaterList(1, 10, searchYear);
}
// 모달 닫기
diff --git a/apps/fo/app/store/dashboard/index.tsx b/apps/fo/app/store/dashboard/index.tsx
index 43496d71e..30994609f 100644
--- a/apps/fo/app/store/dashboard/index.tsx
+++ b/apps/fo/app/store/dashboard/index.tsx
@@ -779,6 +779,9 @@ export type DashBoardType = {
planYearList : string[];
upHeadListPlanFclty : TableUpperProps[];
planFcltyList : planFcltyListProps[];
+ waterUsage1 : number | '',
+ waterUsage2 : number | '',
+ waterUsage3 : number | '',
},
OperationStatus : {
@@ -833,7 +836,10 @@ export const dashBoardInitState:DashBoardType = {
isInit : true,
planYearList : planYearList,
upHeadListPlanFclty : upHeadListPlanFclty,
- planFcltyList : planFcltyList
+ planFcltyList : planFcltyList,
+ waterUsage1 : 0,
+ waterUsage2 : 0,
+ waterUsage3 : 0
},
OperationStatus : {
@@ -942,6 +948,46 @@ const calcValue = (operationalStatus, data, keyTxt='INFL_ASSCT_BFR_WQLT_TP') =>
operationalStatus.winterSunnyMax = data.winterSunny ? Number(Math.round(data.winterSunny.MAX_INFL_ASSCT_BFR_WQLT_TP * 1000) / 1000).toFixed(3).toString() : '';
}
+type RtnFlowType = {
+ inflAmnt: string | number;
+ infoRnDay: string | number;
+ bscFctCd: string;
+ msrDt: string;
+}
+
+type RtnFlowResponse = {
+ data: RtnFlowType[];
+ count: number;
+}
+
+const searchWaterUsage = async (searchYear: string, fcltyCd: string) => {
+ const waterUsage = [0, 0, 0];
+
+ for (let i = 0; i < 3; i++) {
+ try {
+ const res = await getFetch('fo', '/fclt/flow/' + fcltyCd + '/' + (Number(searchYear)-i)) as RtnFlowResponse;
+ let totWaterUsage = 0;
+
+ if (res && res.data && Array.isArray(res.data)) {
+ res.data.forEach((item: RtnFlowType) => {
+ totWaterUsage += Number(item.inflAmnt);
+ });
+
+ if (res.count > 0) {
+ const avg = totWaterUsage / res.count;
+ waterUsage[i] = parseFloat((avg * 0.65).toFixed(2));
+ }
+ }
+ } catch (error) {
+ console.error(`Error fetching water usage for year ${Number(searchYear)-i}:`, error);
+ waterUsage[i] = 0;
+ }
+ }
+
+ console.log('waterUsage:', waterUsage);
+ return waterUsage;
+}
+
// 강우영향일 계산 및 강우량 덮어씌우기
export const calRainEffectDayRainManage = (data: RainManageListProps[]) => {
console.log('data', data);
@@ -987,7 +1033,6 @@ export const calRainEffectDayRainManage = (data: RainManageListProps[]) => {
}
}
-
let rtnData : RainManageListProps[] = [];
rtnData = data.filter((item: RainManageListProps) => item.rainEffectDay === 1);
console.log('rtnData', rtnData);
@@ -1009,6 +1054,7 @@ export const dashBoardReducer:(set:(fn: (state: DashBoardType) => DashBoardType)
/** 시설정보 및 운영현황 - 계획정보 */
searchPlanInfo : async (targetYear: string, fcltyCd: string) => {
const res = await fetchFacilityPlan(targetYear, fcltyCd);
+ let waterUsage = [0, 0, 0];
let minDiff=9999999;
let minIndex;
res.forEach((el:any, idx) => {
@@ -1060,11 +1106,17 @@ export const dashBoardReducer:(set:(fn: (state: DashBoardType) => DashBoardType)
dataFormSettingPlan(el);
});
+ waterUsage = await searchWaterUsage(targetYear, fcltyCd);
+ console.log(waterUsage);
+
set((state: DashBoardType) => ({
...state,
PlanFclty : {
...state.PlanFclty,
- planFcltyList : planFcltyList
+ planFcltyList : planFcltyList,
+ waterUsage1 : waterUsage[0] || 0,
+ waterUsage2 : waterUsage[1] || 0,
+ waterUsage3 : waterUsage[2] || 0
}
}));
},
diff --git a/apps/fo/app/store/facilityWaterQlty/index.tsx b/apps/fo/app/store/facilityWaterQlty/index.tsx
index 7008d4bc0..0d0825717 100644
--- a/apps/fo/app/store/facilityWaterQlty/index.tsx
+++ b/apps/fo/app/store/facilityWaterQlty/index.tsx
@@ -560,44 +560,51 @@ export const facilityWaterQltyReducer = (set: (fn: (state: FacilityWaterQltyType
return;
}
- const tmpData:FacilityWaterQltyProps[] = [];
-
// facilityPrecipitation의 rainEffectDay 계산 로직을 적용
- for(let idx = 0; idx < res.data.wqltObjs.length; idx++) {
- const item = res.data.wqltObjs[idx];
- if (!item) continue;
-
- const rainDay = Number(item.infoRnDay) >= 3 ? 1 : 0;
- let rainEffectDay = 0;
-
- if(idx < res.data.wqltObjs.length - 2) {
- if(rainDay == 1) {
- rainEffectDay = 1;
+
+ const data = res.data.wqltObjs;
+ // 강우영향일 계산 (강우량이 3 초과이면 무조건 강우영향일)
+ for(let idx = 0; idx < data.length; idx++) {
+ const item = data[idx];
+ if(item){
+ if(item.infoRnDay && Number(item.infoRnDay) > 3) {
+ item.rainEffectDay = 1;
} else {
- if(idx >= 2) {
- const prevItem1 = res.data.wqltObjs[idx-1];
- const prevItem2 = res.data.wqltObjs[idx-2];
- if((prevItem1 && Number(prevItem1.infoRnDay) >= 3) || (prevItem2 && Number(prevItem2.infoRnDay) >= 3)) {
- rainEffectDay = 1;
- }
+ item.rainEffectDay = 0;
+ }
+ }
+ }
+
+ // 이틀 전, 하루 전이 강우영향일(3 이상)인 경우 해당 날도 강우영향일로 설정
+ for(let idx = 0; idx < data.length; idx++) {
+ if(data[idx]) {
+ // 하루 전이 강우영향일(3 이상)인 경우
+ if(idx > 0 && data[idx-1]?.infoRnDay && Number(data[idx-1]?.infoRnDay) >= 3) {
+ data[idx]!.rainEffectDay = 1;
+ }
+ // 이틀 전이 강우영향일(3 이상)인 경우
+ if(idx > 1 && data[idx-2]?.infoRnDay && Number(data[idx-2]?.infoRnDay) >= 3) {
+ data[idx]!.rainEffectDay = 1;
+ }
+ }
+ }
+
+ for(let idx = 0; idx < data.length; idx++) {
+ if(data[idx] && data[idx]?.rainEffectDay === 1) {
+ if(idx > 1){
+ if(data[idx-1]?.infoRnDay && Number(data[idx-1]?.infoRnDay) > 3) {
+ data[idx]!.infoRnDay = data[idx-1]!.infoRnDay;
}
}
- } else if(idx < res.data.wqltObjs.length - 1) {
- const nextItem = res.data.wqltObjs[idx+1];
- if(rainDay == 1 || (nextItem && Number(nextItem.infoRnDay) >= 3)) {
- rainEffectDay = 1;
+ if(idx > 2){
+ if(data[idx-2]?.infoRnDay && Number(data[idx-2]?.infoRnDay) > 3) {
+ data[idx]!.infoRnDay = data[idx-2]!.infoRnDay;
+ }
}
- } else {
- rainEffectDay = rainDay;
}
-
- tmpData.push({
- ...item,
- rainEffectDay: rainEffectDay,
- } as FacilityWaterQltyProps);
}
-
- const rtnData = tmpData.map((item: FacilityWaterQltyProps) => {
+
+ const rtnData = data.map((item: FacilityWaterQltyProps) => {
dataFormSetting(item)
if(item.inflAssctBfrWqltTn) {
item.inflAssctBfrWqltTn = Number(Math.round(Number(item.inflAssctBfrWqltTn) * 1000)/1000).toFixed(3);
diff --git a/apps/fo/app/store/sewageOccur/index.tsx b/apps/fo/app/store/sewageOccur/index.tsx
index 9a6a97fd6..cdbc2ed4e 100644
--- a/apps/fo/app/store/sewageOccur/index.tsx
+++ b/apps/fo/app/store/sewageOccur/index.tsx
@@ -197,14 +197,14 @@ export const sewageOccurInitState: SewageOccurType = {
export type SewageOccurStore = SewageOccurType & SewageOccurActions;
// Add type definitions for API responses
-type FlowDataItem = {
+export type FlowDataItem = {
inflAmnt: string | number;
infoRnDay: string | number;
bscFctCd: string;
msrDt: string;
}
-type FlowResponse = {
+export type FlowResponse = {
data: FlowDataItem[];
count: number;
}
From 1850ab2aa8fb2f438a03f1d60544ee42b7fba68a Mon Sep 17 00:00:00 2001
From: Your Name
Date: Sun, 27 Jul 2025 14:34:32 +0900
Subject: [PATCH 08/75] =?UTF-8?q?=EB=8C=80=EC=8B=9C=EB=B3=B4=EB=93=9C=20?=
=?UTF-8?q?=EB=AC=BC=EC=82=AC=EC=9A=A9=EB=9F=89=ED=8F=89=EA=B7=A0=20?=
=?UTF-8?q?=EC=88=98=EC=A0=95,=20=EC=B4=88=EA=B8=B0=ED=99=94=EC=98=A4?=
=?UTF-8?q?=EB=A5=98=20=EC=88=98=EC=A0=95,=20=EC=88=98=EC=A7=88=20?=
=?UTF-8?q?=EB=B3=80=EC=88=98=20=EB=8B=A4=EC=8B=9C=EC=88=98=EC=A0=95?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../app/pages/dashboard/facilityInfo/page.tsx | 4 ++--
apps/fo/app/pages/processArea/page.tsx | 3 ++-
apps/fo/app/store/dashboard/index.tsx | 20 +++++++++++++++++--
apps/fo/app/store/facilityWaterQlty/index.tsx | 6 +++---
apps/fo/app/store/underWaterInput/index.tsx | 3 ++-
5 files changed, 27 insertions(+), 9 deletions(-)
diff --git a/apps/fo/app/pages/dashboard/facilityInfo/page.tsx b/apps/fo/app/pages/dashboard/facilityInfo/page.tsx
index 804fb9807..3cc4229a2 100644
--- a/apps/fo/app/pages/dashboard/facilityInfo/page.tsx
+++ b/apps/fo/app/pages/dashboard/facilityInfo/page.tsx
@@ -167,7 +167,7 @@ export default function ProcessFacilitySearch({searchYear = '', fcltyList = []}:
el['item'] = (Number(searchYear)-0).toString();
el['provisionalApproval'] = waterUsage1;
} else if(index === 4){
- el['provisionalApproval'] = (Number(waterUsage1)+Number(waterUsage2)+Number(waterUsage3))/3;
+ el['provisionalApproval'] = Math.round((Number(waterUsage1)+Number(waterUsage2)+Number(waterUsage3))/3 * 100)/100;
}
});
}
@@ -222,7 +222,7 @@ export default function ProcessFacilitySearch({searchYear = '', fcltyList = []}:
:(index < 5 || index > 5)&& (index!= 4) && (head.id ==='provisionalApproval'||head.id ==='now'||head.id ==='stepOne'||head.id ==='stepTwo'||head.id ==='stepThree'||head.id ==='stepFour')
?{el[head.id]}
:(head.id === "provisionalApproval" && index === 4)
- ?{(Number(fcltyList[0]?.fcltyCpc)* 0.6).toLocaleString('en-US', { minimumFractionDigits: 1, maximumFractionDigits: 1 })}
+ ?{el[head.id]}
:((head.id ==='now'||head.id ==='stepOne'||head.id ==='stepTwo'||head.id ==='stepThree'||head.id ==='stepFour') && index === 4)
?null
:(head.id === 'item' && index != 5)?
diff --git a/apps/fo/app/pages/processArea/page.tsx b/apps/fo/app/pages/processArea/page.tsx
index 68f055aba..1ec7927c0 100644
--- a/apps/fo/app/pages/processArea/page.tsx
+++ b/apps/fo/app/pages/processArea/page.tsx
@@ -52,7 +52,8 @@ 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(selectSearchYear[0]?.val || "0");
+ const [searchYearValue, setSearchYearValue] = useState("2023");
const ref = useRef({
partValue: '',
diff --git a/apps/fo/app/store/dashboard/index.tsx b/apps/fo/app/store/dashboard/index.tsx
index 30994609f..55c545801 100644
--- a/apps/fo/app/store/dashboard/index.tsx
+++ b/apps/fo/app/store/dashboard/index.tsx
@@ -1125,6 +1125,7 @@ export const dashBoardReducer:(set:(fn: (state: DashBoardType) => DashBoardType)
searchOperationStatus: async (isExcel: boolean, searchYear: string, fcltyCd: string) => {
const res = await fetchOperationStatus(searchYear, fcltyCd);
const data = res.data;
+
if(data && operationalStatusList){
// 유량 - 유입
if (operationalStatusList?.[0]) {
@@ -1156,9 +1157,11 @@ export const dashBoardReducer:(set:(fn: (state: DashBoardType) => DashBoardType)
operationalStatusList[0].winterSunnyMin = data.winterSunny === null ? '' : (data.winterSunny.MIN_INFL_AMNT ? data.winterSunny.MIN_INFL_AMNT : 0) + (data.winterSunny.MIN_SUM_FLOW ? data.winterSunny.MIN_SUM_FLOW : 0) + (data.winterSunny.MIN_TP_INFL_WQLT_TP ? data.winterSunny.MIN_TP_INFL_WQLT_TP : 0);
operationalStatusList[0].winterSunnyAvg = data.winterSunny === null ? '' : (data.winterSunny.AVG_INFL_AMNT ? data.winterSunny.AVG_INFL_AMNT : 0) + (data.winterSunny.AVG_SUM_FLOW ? data.winterSunny.AVG_SUM_FLOW : 0) + (data.winterSunny.AVG_TP_INFL_WQLT_TP ? data.winterSunny.AVG_TP_INFL_WQLT_TP : 0);
operationalStatusList[0].winterSunnyMax = data.winterSunny === null ? '' : (data.winterSunny.MAX_INFL_AMNT ? data.winterSunny.MAX_INFL_AMNT : 0) + (data.winterSunny.MAX_SUM_FLOW ? data.winterSunny.MAX_SUM_FLOW : 0) + (data.winterSunny.MAX_TP_INFL_WQLT_TP ? data.winterSunny.MAX_TP_INFL_WQLT_TP : 0);
- // 지하수
+
+ // 연계처리수,지하수유입량
const bscFctCd = fcltyCd;
const res2 = await getFetch('fo', '/fclt/flow/' + bscFctCd + '/' + searchYear) as ApiResponse;
+
const calData = calRainEffectDay(res2.data, 'SUNNY');
let chungcunSumFlow = 0;
@@ -1167,19 +1170,32 @@ export const dashBoardReducer:(set:(fn: (state: DashBoardType) => DashBoardType)
let sumWinterChungcunDay = 0;
let sumWinterChungcunFlow = 0;
+
+ let yearSumFlow = 0;
+ let summerSumFlow = 0;
+ let winterSumFlow = 0;
calData.forEach((flowItem: FlowDataItem) => {
chungcunSumFlow += flowItem.inflAmnt && flowItem.inflAmnt !== 'x' ? Number(flowItem.inflAmnt.toString().trim()) : 0;
-
+ yearSumFlow += flowItem.sumFlow && flowItem.sumFlow !== 'x' ? Number(flowItem.sumFlow.toString().trim()) : 0;
+
if(flowItem.msrDt.substring(4,6) ==='06' || flowItem.msrDt.substring(4,6) ==='07' || flowItem.msrDt.substring(4,6) ==='08'){
sumSummerChungcunDay += 1;
sumSummerChungcunFlow += flowItem.inflAmnt && flowItem.inflAmnt !== 'x' ? Number(flowItem.inflAmnt.toString().trim()) : 0;
+ summerSumFlow += flowItem.sumFlow && flowItem.sumFlow !== 'x' ? Number(flowItem.sumFlow.toString().trim()) : 0;
}else if(flowItem.msrDt.substring(4,6) ==='01' || flowItem.msrDt.substring(4,6) ==='02'){
sumWinterChungcunDay += 1;
sumWinterChungcunFlow += flowItem.inflAmnt && flowItem.inflAmnt !== 'x' ? Number(flowItem.inflAmnt.toString().trim()) : 0;
+ winterSumFlow += flowItem.sumFlow && flowItem.sumFlow !== 'x' ? Number(flowItem.sumFlow.toString().trim()) : 0;
}
});
+ // 연계처리수
+ const avgYearSumFlow = yearSumFlow / calData.length;
+ const avgSummerSumFlow = summerSumFlow / calData.length;
+ const avgWinterSumFlow = winterSumFlow / calData.length;
+
+ // 지하수유입량
const usage = chungcunSumFlow / calData.length;
const summerUsage = sumSummerChungcunFlow / sumSummerChungcunDay;
const winterUsage = sumWinterChungcunFlow / sumWinterChungcunDay;
diff --git a/apps/fo/app/store/facilityWaterQlty/index.tsx b/apps/fo/app/store/facilityWaterQlty/index.tsx
index 0d0825717..b4c60d475 100644
--- a/apps/fo/app/store/facilityWaterQlty/index.tsx
+++ b/apps/fo/app/store/facilityWaterQlty/index.tsx
@@ -135,7 +135,7 @@ const upHeadList1: TableUpperProps[] = [
{ id: "inflAssctBfrWqltToc", title: "TOC\n(COD)\n(mg/L)", upName: "upChangeRe3", upSequnce: 2, align: "right", row: 1 },
{ id: "inflAssctBfrWqltSs", title: "SS\n(mg/L)", upName: "upChangeRe3", upSequnce: 3, align: "right", row: 1 },
{ id: "inflAssctBfrWqltTn", title: "T-N\n(mg/L)", upName: "upChangeRe3", upSequnce: 4, align: "right", row: 1 },
- { id: "inflAssctAftWqltTp", title: "T-P\n(mg/L)", upName: "upChangeRe3", upSequnce: 3, align: "right", row: 1 },
+ { id: "inflAssctBfrWqltTp", title: "T-P\n(mg/L)", upName: "upChangeRe3", upSequnce: 3, align: "right", row: 1 },
{ id: "efflWqltBod", title: "BOD\n(mg/L)", upName: "upChangeRe4", upSequnce: 1, align: "right", row: 1 },
{ id: "efflWqltToc", title: "TOC\n(COD)\n(mg/L)", upName: "upChangeRe4", upSequnce: 2, align: "right", row: 1 },
{ id: "efflWqltSs", title: "SS\n(mg/L)", upName: "upChangeRe4", upSequnce: 3, align: "right", row: 1 },
@@ -159,7 +159,7 @@ const upHeadList2: TableUpperProps[] = [
{ id: "inflAssctBfrWqltToc", title: "TOC\n(COD)\n(mg/L)", upName: "upChangeRe3", upSequnce: 2, align: "right", row:1 },
{ id: "inflAssctBfrWqltSs", title: "SS\n(mg/L)", upName: "upChangeRe3", upSequnce: 3, align: "right", row:1 },
{ id: "inflAssctBfrWqltTn", title: "T-N\n(mg/L)", upName: "upChangeRe3", upSequnce: 2, align: "right", row:1 },
- { id: "inflAssctAftWqltTp", title: "T-P\n(mg/L)", upName: "upChangeRe3", upSequnce: 3, align: "right", row:1 },
+ { id: "inflAssctBfrWqltTp", title: "T-P\n(mg/L)", upName: "upChangeRe3", upSequnce: 3, align: "right", row:1 },
{ id: "efflWqltBod", title: "BOD\n(mg/L)", upName: "upChangeRe4", upSequnce: 1, align: "right", row:1 },
{ id: "efflWqltToc", title: "TOC\n(COD)\n(mg/L)", upName: "upChangeRe4", upSequnce: 2, align: "right", row:1 },
{ id: "efflWqltSs", title: "SS\n(mg/L)", upName: "upChangeRe4", upSequnce: 3, align: "right", row:1 },
@@ -187,7 +187,7 @@ const upHeadList3: TableUpperProps[] = [
{ id: "inflAssctBfrWqltToc", title: "TOC\n(COD)\n(mg/L)", upName: "upChangeRe3", upSequnce: 2, align: "right", row:1 },
{ id: "inflAssctBfrWqltSs", title: "SS\n(mg/L)", upName: "upChangeRe3", upSequnce: 3, align: "right", row:1 },
{ id: "inflAssctBfrWqltTn", title: "T-N\n(mg/L)", upName: "upChangeRe3", upSequnce: 2, align: "right", row:1 },
- { id: "inflAssctAftWqltTp", title: "T-P\n(mg/L)", upName: "upChangeRe3", upSequnce: 3, align: "right", row:1 },
+ { id: "inflAssctBfrWqltTp", title: "T-P\n(mg/L)", upName: "upChangeRe3", upSequnce: 3, align: "right", row:1 },
{ id: "efflWqltBod", title: "BOD\n(mg/L)", upName: "upChangeRe4", upSequnce: 1, align: "right", row:1 },
{ id: "efflWqltToc", title: "TOC\n(COD)\n(mg/L)", upName: "upChangeRe4", upSequnce: 2, align: "right", row:1 },
{ id: "efflWqltSs", title: "SS\n(mg/L)", upName: "upChangeRe4", upSequnce: 3, align: "right", row:1 },
diff --git a/apps/fo/app/store/underWaterInput/index.tsx b/apps/fo/app/store/underWaterInput/index.tsx
index 6256c2f92..060c641dc 100644
--- a/apps/fo/app/store/underWaterInput/index.tsx
+++ b/apps/fo/app/store/underWaterInput/index.tsx
@@ -82,7 +82,7 @@ const upHeadList3:TableUpperProps[] = [
// 모달
const upHeadListUnderWaterDetail:TableUpperProps[] = [
{ id: "msrDt", title: "날짜" },
- { id: "realSewageInput", title: "실제 하수유입량\n(m³/일)" },
+ { id: "realSewageInput", title: "청천시 실제 하수유입량\n(m³/일)" },
{ id: "sewageOccur", title: "오수발생량\n(m³/일)" },
{ id: "underWaterInput", title: "지하수 유입량\n(m³/일)" },
];
@@ -174,6 +174,7 @@ export interface FlowDataItem {
infoRnDay: number;
msrDt: string;
rainEffectDay? : number;
+ sumFlow? : number | string | '';
}
export interface ApiResponse {
From bd7debbe3ed60ed46cea5515379bf95721f80e83 Mon Sep 17 00:00:00 2001
From: Your Name
Date: Sun, 27 Jul 2025 14:42:30 +0900
Subject: [PATCH 09/75] =?UTF-8?q?=EC=98=A4=EC=88=98=EB=B0=9C=EC=83=9D?=
=?UTF-8?q?=EB=9F=89=20=EC=B6=94=EC=A0=95,=20=EC=A7=80=ED=95=98=EC=88=98?=
=?UTF-8?q?=EC=9C=A0=EC=9E=85=EB=9F=89=20=EC=B6=94=EC=A0=95=20=EB=85=84?=
=?UTF-8?q?=EC=9B=94=20=EC=A4=91=20=EB=85=84=20disabled?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
apps/fo/app/pages/sewageOccur/modal/page.tsx | 2 ++
apps/fo/app/pages/underWaterInput/modal/page.tsx | 6 ++++++
2 files changed, 8 insertions(+)
diff --git a/apps/fo/app/pages/sewageOccur/modal/page.tsx b/apps/fo/app/pages/sewageOccur/modal/page.tsx
index 4c4283f4a..06ca11cc1 100644
--- a/apps/fo/app/pages/sewageOccur/modal/page.tsx
+++ b/apps/fo/app/pages/sewageOccur/modal/page.tsx
@@ -62,6 +62,7 @@ export default function SewageOccurModal(props: { fcltyName: string; facilityCd
}}
selectClass="ml-5 w-[100px]"
startYear={1900}
+ yearReadOnly={true}
/>~
diff --git a/apps/fo/app/pages/underWaterInput/modal/page.tsx b/apps/fo/app/pages/underWaterInput/modal/page.tsx
index 44ed073cf..50bfd7113 100644
--- a/apps/fo/app/pages/underWaterInput/modal/page.tsx
+++ b/apps/fo/app/pages/underWaterInput/modal/page.tsx
@@ -163,6 +163,7 @@ export default function UnderWaterInputModal({fcltyName='', searchYear=new Date(
}}
selectClass="ml-5 w-[100px]"
startYear={Number(searchYear)} // 시작 연도 설정
+ yearReadOnly={true}
/>
~
@@ -226,6 +228,7 @@ export default function UnderWaterInputModal({fcltyName='', searchYear=new Date(
}}
selectClass="ml-5 w-[100px]"
startYear={Number(searchYear)} // 시작 연도 설정
+ yearReadOnly={true}
/>
~
@@ -280,6 +284,7 @@ export default function UnderWaterInputModal({fcltyName='', searchYear=new Date(
}}
selectClass="ml-5 w-[100px]"
startYear={Number(searchYear)} // 시작 연도 설정
+ yearReadOnly={true}
/>
~
From befb3f1c842a125e7bb9735a08891d8710485463 Mon Sep 17 00:00:00 2001
From: Your Name
Date: Sun, 27 Jul 2025 14:56:32 +0900
Subject: [PATCH 10/75] =?UTF-8?q?=EB=B9=8C=EB=93=9C=EC=97=90=EB=9F=AC=20?=
=?UTF-8?q?=EC=88=98=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 | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/apps/fo/app/store/dashboard/index.tsx b/apps/fo/app/store/dashboard/index.tsx
index 55c545801..76f1bb046 100644
--- a/apps/fo/app/store/dashboard/index.tsx
+++ b/apps/fo/app/store/dashboard/index.tsx
@@ -1171,29 +1171,29 @@ export const dashBoardReducer:(set:(fn: (state: DashBoardType) => DashBoardType)
let sumWinterChungcunDay = 0;
let sumWinterChungcunFlow = 0;
- let yearSumFlow = 0;
+ /* let yearSumFlow = 0;
let summerSumFlow = 0;
- let winterSumFlow = 0;
+ let winterSumFlow = 0; */
calData.forEach((flowItem: FlowDataItem) => {
chungcunSumFlow += flowItem.inflAmnt && flowItem.inflAmnt !== 'x' ? Number(flowItem.inflAmnt.toString().trim()) : 0;
- yearSumFlow += flowItem.sumFlow && flowItem.sumFlow !== 'x' ? Number(flowItem.sumFlow.toString().trim()) : 0;
+ //yearSumFlow += flowItem.sumFlow && flowItem.sumFlow !== 'x' ? Number(flowItem.sumFlow.toString().trim()) : 0;
if(flowItem.msrDt.substring(4,6) ==='06' || flowItem.msrDt.substring(4,6) ==='07' || flowItem.msrDt.substring(4,6) ==='08'){
sumSummerChungcunDay += 1;
sumSummerChungcunFlow += flowItem.inflAmnt && flowItem.inflAmnt !== 'x' ? Number(flowItem.inflAmnt.toString().trim()) : 0;
- summerSumFlow += flowItem.sumFlow && flowItem.sumFlow !== 'x' ? Number(flowItem.sumFlow.toString().trim()) : 0;
+ //summerSumFlow += flowItem.sumFlow && flowItem.sumFlow !== 'x' ? Number(flowItem.sumFlow.toString().trim()) : 0;
}else if(flowItem.msrDt.substring(4,6) ==='01' || flowItem.msrDt.substring(4,6) ==='02'){
sumWinterChungcunDay += 1;
sumWinterChungcunFlow += flowItem.inflAmnt && flowItem.inflAmnt !== 'x' ? Number(flowItem.inflAmnt.toString().trim()) : 0;
- winterSumFlow += flowItem.sumFlow && flowItem.sumFlow !== 'x' ? Number(flowItem.sumFlow.toString().trim()) : 0;
+ // winterSumFlow += flowItem.sumFlow && flowItem.sumFlow !== 'x' ? Number(flowItem.sumFlow.toString().trim()) : 0;
}
});
// 연계처리수
- const avgYearSumFlow = yearSumFlow / calData.length;
+ /* const avgYearSumFlow = yearSumFlow / calData.length;
const avgSummerSumFlow = summerSumFlow / calData.length;
- const avgWinterSumFlow = winterSumFlow / calData.length;
+ const avgWinterSumFlow = winterSumFlow / calData.length; */
// 지하수유입량
const usage = chungcunSumFlow / calData.length;
From be5ffb60f66a7b296c8219a910472c92fdccf5f7 Mon Sep 17 00:00:00 2001
From: Your Name
Date: Sun, 27 Jul 2025 18:40:35 +0900
Subject: [PATCH 11/75] =?UTF-8?q?=EA=B2=B0=ED=95=A8=EC=88=98=EC=A0=95=20-?=
=?UTF-8?q?=20=EA=B0=95=EC=9A=B0=EC=98=81=ED=96=A5=EC=9D=BC=20=EA=B3=84?=
=?UTF-8?q?=EC=82=B0=20=EC=88=98=EC=A0=95,?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../common/FacilityTermModalHeader.tsx | 13 ++---
apps/fo/app/pages/flowRate/modal/page.tsx | 1 -
apps/fo/app/store/dashboard/index.tsx | 6 +--
apps/fo/app/store/flowRate/index.tsx | 18 ++-----
apps/fo/app/store/planSewage/index.tsx | 25 ++++++++-
apps/fo/app/store/sewageOccur/index.tsx | 48 ++++++++++++++++-
apps/fo/app/store/underWaterInput/index.tsx | 51 ++++++++++++-------
7 files changed, 114 insertions(+), 48 deletions(-)
diff --git a/apps/fo/app/components/common/FacilityTermModalHeader.tsx b/apps/fo/app/components/common/FacilityTermModalHeader.tsx
index 30c77405f..d856e233f 100644
--- a/apps/fo/app/components/common/FacilityTermModalHeader.tsx
+++ b/apps/fo/app/components/common/FacilityTermModalHeader.tsx
@@ -97,10 +97,7 @@ export default function FacilityTermModalHeader({
const startDateOnly = new Date(startDate.getFullYear(), startDate.getMonth(), startDate.getDate());
const endDateOnly = new Date(endDate.getFullYear(), endDate.getMonth(), endDate.getDate());
const rainEffectDay = (item as T & { rainEffectDay: number }).rainEffectDay;
- if(flowPanel === '1') {
- const infoRnDay = (item as T & { infoRnDay: number }).infoRnDay;
- return (itemDateOnly >= startDateOnly && itemDateOnly <= endDateOnly) && infoRnDay>0 && infoRnDay < 3;
- } else if(flowPanel === '2'){
+ if(flowPanel === '2'){
const infoRnDay = (item as T & { infoRnDay: number }).infoRnDay;
return (itemDateOnly >= startDateOnly && itemDateOnly <= endDateOnly) && infoRnDay >= 3 && infoRnDay < 10;
} else if(flowPanel === '3'){
@@ -122,8 +119,7 @@ export default function FacilityTermModalHeader({
const infoRnDay = (item as T & { infoRnDay: number }).infoRnDay;
return (itemDateOnly >= startDateOnly && itemDateOnly <= endDateOnly) && infoRnDay >= 60;
} else {
- const infoRnDay = (item as T & { infoRnDay: number }).infoRnDay;
- return (itemDateOnly >= startDateOnly && itemDateOnly <= endDateOnly) && (infoRnDay>0 || rainEffectDay ===1);
+ return (itemDateOnly >= startDateOnly && itemDateOnly <= endDateOnly) && (rainEffectDay ===1);
}
});
} else if(tabName.includes("_chuncheon")) {
@@ -132,8 +128,8 @@ export default function FacilityTermModalHeader({
const itemDateOnly = new Date(itemDate.getFullYear(), itemDate.getMonth(), itemDate.getDate());
const startDateOnly = new Date(startDate.getFullYear(), startDate.getMonth(), startDate.getDate());
const endDateOnly = new Date(endDate.getFullYear(), endDate.getMonth(), endDate.getDate());
- const infoRnDay = (item as T & { infoRnDay: number }).infoRnDay;
- return (itemDateOnly >= startDateOnly && itemDateOnly <= endDateOnly) && infoRnDay==0;
+ const rainEffectDay = (item as T & { rainEffectDay: number }).rainEffectDay;
+ return (itemDateOnly >= startDateOnly && itemDateOnly <= endDateOnly) && rainEffectDay==0;
});
} else {
filteredData = searchList.filter((item) => {
@@ -144,7 +140,6 @@ export default function FacilityTermModalHeader({
return itemDateOnly >= startDateOnly && itemDateOnly <= endDateOnly;
});
}
-
setCopySearchList(filteredData);
setStandSearchList(filteredData);
}, [searchList, searchYear, tabName, flowPanel]);
diff --git a/apps/fo/app/pages/flowRate/modal/page.tsx b/apps/fo/app/pages/flowRate/modal/page.tsx
index 409dab7eb..bc121708c 100644
--- a/apps/fo/app/pages/flowRate/modal/page.tsx
+++ b/apps/fo/app/pages/flowRate/modal/page.tsx
@@ -52,7 +52,6 @@ export default function FlowRateModal(props: { fcltyName: string; facilityCd: st
return Number(value.replace(/,/g, ''));
};
- console.log('filteredData : ', filteredData);
let maxtotInflAmnt = 0;
let maxinflAmnt = 0;
let maxsumFlow = 0;
diff --git a/apps/fo/app/store/dashboard/index.tsx b/apps/fo/app/store/dashboard/index.tsx
index 76f1bb046..89166281a 100644
--- a/apps/fo/app/store/dashboard/index.tsx
+++ b/apps/fo/app/store/dashboard/index.tsx
@@ -996,7 +996,7 @@ export const calRainEffectDayRainManage = (data: RainManageListProps[]) => {
for(let idx = 0; idx < data.length; idx++) {
const item = data[idx];
if(item){
- if(item.infoRnDay && Number(item.infoRnDay) > 3) {
+ if(item.infoRnDay && Number(item.infoRnDay) >= 3) {
item.rainEffectDay = 1;
} else {
item.rainEffectDay = 0;
@@ -1021,12 +1021,12 @@ export const calRainEffectDayRainManage = (data: RainManageListProps[]) => {
for(let idx = 0; idx < data.length; idx++) {
if(data[idx] && data[idx]?.rainEffectDay === 1) {
if(idx > 1){
- if(data[idx-1]?.infoRnDay && Number(data[idx-1]?.infoRnDay) > 3) {
+ if(data[idx-1]?.infoRnDay && Number(data[idx-1]?.infoRnDay) >= 3) {
data[idx]!.infoRnDay = data[idx-1]!.infoRnDay;
}
}
if(idx > 2){
- if(data[idx-2]?.infoRnDay && Number(data[idx-2]?.infoRnDay) > 3) {
+ if(data[idx-2]?.infoRnDay && Number(data[idx-2]?.infoRnDay) >= 3) {
data[idx]!.infoRnDay = data[idx-2]!.infoRnDay;
}
}
diff --git a/apps/fo/app/store/flowRate/index.tsx b/apps/fo/app/store/flowRate/index.tsx
index 0a36d972b..3456bb8cc 100644
--- a/apps/fo/app/store/flowRate/index.tsx
+++ b/apps/fo/app/store/flowRate/index.tsx
@@ -170,7 +170,6 @@ const fetchFlowRateList = async (pageNo: number, pageSize: number, searchYear: s
try {
const tailStr = partCd ? '/'+ partCd + '/' + nameCd + '/' + fcltCpct + '/' + operationValue + (fcltyNm && fcltyNm !== '' ? '/' + fcltyNm : '') : ''; const url = '/fclt/flow/' + pageNo + '/' + pageSize + '/' + searchYear + tailStr;
const res = await getFetch('fo', url);
- console.log(url);
return { data: res.data, count: res.count }
} catch (error) {
console.error('시설정보 유량현황 데이터를 가져오는데 실패했습니다:', error);
@@ -312,18 +311,11 @@ export const flowRateSearchReducer:(set:(fn: (state: FlowRateSearchType) => Flow
searchFlowRateModalList: async (bscFctCd: string, searchYear: string) => {
const res = await fetchFlowRateModalList(bscFctCd, searchYear);
const data = res.data;
-
- data.forEach((item: FlowRateModalProps) => {
- if(item.infoRnDay && item.infoRnDay.toString().trim() === 'x') {
- item.infoRnDay = '';
- }
- });
-
// 강우영향일 계산 (강우량이 3 초과이면 무조건 강우영향일)
for(let idx = 0; idx < data.length; idx++) {
const item = data[idx];
if(item){
- if(item.infoRnDay && Number(item.infoRnDay) > 3) {
+ if(item.infoRnDay && Number(item.infoRnDay.toString().trim()) >= 3) {
item.rainEffectDay = 1;
} else {
item.rainEffectDay = 0;
@@ -335,11 +327,11 @@ export const flowRateSearchReducer:(set:(fn: (state: FlowRateSearchType) => Flow
for(let idx = 0; idx < data.length; idx++) {
if(data[idx]) {
// 하루 전이 강우영향일(3 이상)인 경우
- if(idx > 0 && data[idx-1]?.infoRnDay && Number(data[idx-1]?.infoRnDay) >= 3) {
+ if(idx > 0 && data[idx-1]?.infoRnDay && Number(data[idx-1]?.infoRnDay.toString().trim()) >= 3) {
data[idx]!.rainEffectDay = 1;
}
// 이틀 전이 강우영향일(3 이상)인 경우
- if(idx > 1 && data[idx-2]?.infoRnDay && Number(data[idx-2]?.infoRnDay) >= 3) {
+ if(idx > 1 && data[idx-2]?.infoRnDay && Number(data[idx-2]?.infoRnDay.toString().trim()) >= 3) {
data[idx]!.rainEffectDay = 1;
}
}
@@ -348,12 +340,12 @@ export const flowRateSearchReducer:(set:(fn: (state: FlowRateSearchType) => Flow
for(let idx = 0; idx < data.length; idx++) {
if(data[idx] && data[idx]?.rainEffectDay === 1) {
if(idx > 1){
- if(data[idx-1]?.infoRnDay && Number(data[idx-1]?.infoRnDay) > 3) {
+ if(data[idx-1]?.infoRnDay && Number(data[idx-1]?.infoRnDay.toString().trim()) >= 3) {
data[idx]!.infoRnDay = data[idx-1]!.infoRnDay;
}
}
if(idx > 2){
- if(data[idx-2]?.infoRnDay && Number(data[idx-2]?.infoRnDay) > 3) {
+ if(data[idx-2]?.infoRnDay && Number(data[idx-2]?.infoRnDay.toString().trim()) >= 3) {
data[idx]!.infoRnDay = data[idx-2]!.infoRnDay;
}
}
diff --git a/apps/fo/app/store/planSewage/index.tsx b/apps/fo/app/store/planSewage/index.tsx
index e9153305a..c5286db8d 100644
--- a/apps/fo/app/store/planSewage/index.tsx
+++ b/apps/fo/app/store/planSewage/index.tsx
@@ -1,6 +1,7 @@
import DataForm from "@/app/components/common/DataForm";
import type { TableUpperProps } from "../dashboard";
import { getFetch } from "@/app/components/api";
+import { calRainEffectDay, type ApiResponse, type FlowDataItem } from "../underWaterInput";
export type { TableUpperProps };
/**====================================
* Store - 타입
@@ -172,14 +173,34 @@ export const planSewageReducer:(set:(fn: (state: PlanSewageType) => PlanSewageTy
searchPlanSewageList: async (pageNo: number, pageSize: number, searchYear: string, partCd?: string, nameCd?: string, fcltCpct?: string, operationValue?: string, fcltyNm?: string) => {
const res = await fetchPlanSewageList(pageNo, pageSize, searchYear, partCd, nameCd, fcltCpct, operationValue, fcltyNm);
const excelDownList: ExcelType[] = [];
- console.log('res' , res.data);
+ const data = res.data
+ const processedData = await Promise.all(data.map(async (item:PlanSewageProps) => {
+ const res2 = await getFetch('fo', '/fclt/flow/' + item.bscFctCd + '/' + searchYear) as ApiResponse;
+ const calData = calRainEffectDay(res2.data, 'SUNNY');
+
+ let sumInflAmntSunny = 0;
+ let avgInflAmntSunny = 0;
+ calData.forEach((flowItem:FlowDataItem) => {
+ sumInflAmntSunny += Number(flowItem.inflAmnt);
+ })
+ avgInflAmntSunny = sumInflAmntSunny / calData.length;
+ item.avgInflAmntSunny = avgInflAmntSunny;
+ if(item.bscFctCd === '11200PB001R'){
+ console.log('avgInflAmntSunny : ',item.avgInflAmntSunny);
+ console.log('calData : ',calData);
+ }
+ return item;
+ }));
+
/**
* 결과데이터 계산
* (1) 여유용량 = 시설용량 - 건기시 평균유량
* (2) 변동부하율 = 건기시 일최대 유량/일평균유량(기준 최근 3개년)
* (3) 분류식화율 = 분류식지역 면적(㎢)/처리구역 면적합계(㎢) ×100
*/
- const resultData = res.data.map((item:PlanSewageProps) => {
+ const resultData = processedData.map((item:PlanSewageProps) => {
+ console.log('item.fctCpc : ',item.fctCpc);
+ console.log('item.avgInflAmntSunny : ',item.avgInflAmntSunny);
item.spareCapacity = Number(item.fctCpc) - Number(item.avgInflAmntSunny);
item.variableLoadPercent = item.maxInflAmntSunny && item.maxInflAmntSunny!==0 ? Number(item.maxInflAmntSunny) / Number(item.avgInflAmntSunny) : 0;
item.classifiedSewerPercent = item.sprtProcZoneAr && item.sprtProcZoneAr!==0 ? Number(item.sprtProcZoneAr) / Number(item.procZoneSm) * 100 : 0;
diff --git a/apps/fo/app/store/sewageOccur/index.tsx b/apps/fo/app/store/sewageOccur/index.tsx
index cdbc2ed4e..08b873cca 100644
--- a/apps/fo/app/store/sewageOccur/index.tsx
+++ b/apps/fo/app/store/sewageOccur/index.tsx
@@ -202,6 +202,7 @@ export type FlowDataItem = {
infoRnDay: string | number;
bscFctCd: string;
msrDt: string;
+ rainEffectDay?: number;
}
export type FlowResponse = {
@@ -221,14 +222,57 @@ export const sewageOccurReducer:(set:any)=>SewageOccurActions=(set: any) => {
item.sggNm = item.lclgvrnmntNm.split(' ')[1]?.toString() || '';
item.fctCpc = parseFloat(item.fctCpc.toString().replace(/,/g, ''));
item.swageChangePercent = 80;
-
const bscFctCd = item.bscFctCd;
const res2 = await getFetch('fo', '/fclt/flow/' + bscFctCd + '/' + searchYear) as FlowResponse;
-
+
let sumChungcunDay = 0;
let chungcunSumFlow = 0;
let totWaterUsage = 0;
+
+ // 강우영향일 계산 (강우량이 3 초과이면 무조건 강우영향일)
+ for(let idx = 0; idx < res2.data.length; idx++) {
+ const item = res2.data[idx];
+ if(item){
+ if(item.infoRnDay && Number(item.infoRnDay.toString().trim()) >= 3) {
+ item.rainEffectDay = 1;
+ } else {
+ item.rainEffectDay = 0;
+ }
+ }
+ }
+
+ // 이틀 전, 하루 전이 강우영향일(3 이상)인 경우 해당 날도 강우영향일로 설정
+ for(let idx = 0; idx < data.length; idx++) {
+ if(data[idx]) {
+ // 하루 전이 강우영향일(3 이상)인 경우
+ if(idx > 0 && data[idx-1]?.infoRnDay && Number(data[idx-1]?.infoRnDay.toString().trim()) >= 3) {
+ data[idx]!.rainEffectDay = 1;
+ }
+ // 이틀 전이 강우영향일(3 이상)인 경우
+ if(idx > 1 && data[idx-2]?.infoRnDay && Number(data[idx-2]?.infoRnDay.toString().trim()) >= 3) {
+ data[idx]!.rainEffectDay = 1;
+ }
+ }
+ }
+
+ for(let idx = 0; idx < data.length; idx++) {
+ if(data[idx] && data[idx]?.rainEffectDay === 1) {
+ if(idx > 1){
+ if(data[idx-1]?.infoRnDay && Number(data[idx-1]?.infoRnDay.toString().trim()) >= 3) {
+ data[idx]!.infoRnDay = data[idx-1]!.infoRnDay;
+ }
+ }
+ if(idx > 2){
+ if(data[idx-2]?.infoRnDay && Number(data[idx-2]?.infoRnDay.toString().trim()) >= 3) {
+ data[idx]!.infoRnDay = data[idx-2]!.infoRnDay;
+ }
+ }
+ }
+ }
+
+ console.log('calData : ',res2.data);
+
res2.data.forEach((item: FlowDataItem) => {
if(Number(item.infoRnDay) ===0){
chungcunSumFlow += Number(item.inflAmnt);
diff --git a/apps/fo/app/store/underWaterInput/index.tsx b/apps/fo/app/store/underWaterInput/index.tsx
index 060c641dc..2d0938a56 100644
--- a/apps/fo/app/store/underWaterInput/index.tsx
+++ b/apps/fo/app/store/underWaterInput/index.tsx
@@ -260,29 +260,44 @@ const dataFormSetting=(item : UnderWaterProps)=> {
export type UnderWaterStore = UnderWaterType & UnderWaterActions;
export const calRainEffectDay = (data: FlowDataItem[], weather: string) => {
+ // 강우영향일 계산 (강우량이 3 이상이면 무조건 강우영향일)
for(let idx = 0; idx < data.length; idx++) {
const item = data[idx];
- const rainDay = Number(item?.infoRnDay) >= 3 ? 1 : 0;
- let rainEffectDay = 0;
if(item){
- if(idx < data.length - 2) {
- if(rainDay == 1) {
- rainEffectDay = 1;
- } else {
- if(idx >= 2) {
- if(Number(data[idx-1]?.infoRnDay) >= 3 || Number(data[idx-2]?.infoRnDay) >= 3) {
- rainEffectDay = 1;
- }
- }
- }
- } else if(idx < data.length - 1) {
- if(rainDay == 1 || Number(data[idx+1]?.infoRnDay) >= 3) {
- rainEffectDay = 1;
- }
+ if(item.infoRnDay && Number(item.infoRnDay.toString().trim()) >= 3) {
+ item.rainEffectDay = 1;
} else {
- rainEffectDay = rainDay;
+ item.rainEffectDay = 0;
+ }
+ }
+ }
+
+ // 이틀 전, 하루 전이 강우영향일(3 이상)인 경우 해당 날도 강우영향일로 설정
+ for(let idx = 0; idx < data.length; idx++) {
+ if(data[idx]) {
+ // 하루 전이 강우영향일(3 이상)인 경우
+ if(idx > 0 && data[idx-1]?.infoRnDay && Number(data[idx-1]?.infoRnDay.toString().trim()) >= 3) {
+ data[idx]!.rainEffectDay = 1;
+ }
+ // 이틀 전이 강우영향일(3 이상)인 경우
+ if(idx > 1 && data[idx-2]?.infoRnDay && Number(data[idx-2]?.infoRnDay.toString().trim()) >= 3) {
+ data[idx]!.rainEffectDay = 1;
+ }
+ }
+ }
+
+ for(let idx = 0; idx < data.length; idx++) {
+ if(data[idx] && data[idx]?.rainEffectDay === 1) {
+ if(idx > 1){
+ if(data[idx-1]?.infoRnDay && Number(data[idx-1]?.infoRnDay.toString().trim()) >= 3) {
+ data[idx]!.infoRnDay = data[idx-1]!.infoRnDay;
+ }
+ }
+ if(idx > 2){
+ if(data[idx-2]?.infoRnDay && Number(data[idx-2]?.infoRnDay.toString().trim()) >= 3) {
+ data[idx]!.infoRnDay = data[idx-2]!.infoRnDay;
+ }
}
- item.rainEffectDay = rainEffectDay;
}
}
From dfabee3e086eb48001fcd13d46fb04265550012f Mon Sep 17 00:00:00 2001
From: Your Name
Date: Sun, 27 Jul 2025 23:50:24 +0900
Subject: [PATCH 12/75] =?UTF-8?q?=EC=B4=88=EA=B8=B0=ED=99=94=20=EB=8F=8C?=
=?UTF-8?q?=EC=95=84=EA=B0=80=EB=8A=94=20=EB=AC=B8=EC=A0=9C=ED=95=B4?=
=?UTF-8?q?=EA=B2=B0,=20=EB=8C=80=EC=8B=9C=EB=B3=B4=EB=93=9C=20calData=20?=
=?UTF-8?q?=EC=88=98=EC=A0=95,=20=EC=B2=98=EB=A6=AC=EA=B5=AC=EC=97=AD?=
=?UTF-8?q?=EC=A0=95=EB=B3=B4=20null=20=EC=98=A4=EB=A5=98=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
---
.../app/pages/facilityPrecipitation/page.tsx | 6 +--
apps/fo/app/pages/facilityWaterQlty/page.tsx | 6 +--
apps/fo/app/pages/flowRate/page.tsx | 9 ++---
apps/fo/app/pages/planSewage/page.tsx | 6 +--
apps/fo/app/pages/processArea/page.tsx | 6 +--
apps/fo/app/pages/rdi/page.tsx | 6 +--
apps/fo/app/pages/sewageOccur/page.tsx | 6 +--
apps/fo/app/pages/underWaterInput/page.tsx | 6 +--
apps/fo/app/store/dashboard/index.tsx | 18 ++++-----
apps/fo/app/store/facilityWaterQlty/index.tsx | 6 +--
apps/fo/app/store/processArea/index.tsx | 18 ++++++++-
apps/fo/app/store/sewageOccur/index.tsx | 38 +++++++++++--------
apps/fo/app/store/underWaterInput/index.tsx | 10 ++++-
13 files changed, 84 insertions(+), 57 deletions(-)
diff --git a/apps/fo/app/pages/facilityPrecipitation/page.tsx b/apps/fo/app/pages/facilityPrecipitation/page.tsx
index b6df81d04..4d75ed052 100644
--- a/apps/fo/app/pages/facilityPrecipitation/page.tsx
+++ b/apps/fo/app/pages/facilityPrecipitation/page.tsx
@@ -103,7 +103,7 @@ export default function FacilityPrecipitation() {
input.value = "";
}
}
- searchFacilityPrecipitationList(1, 10, searchYear || "0");
+ searchFacilityPrecipitationList(1, 10, "2023");
}
// 모달 닫기
@@ -126,9 +126,9 @@ export default function FacilityPrecipitation() {
useEffect(() => {
if (!isInit) {
initializeCommonData();
- searchFacilityPrecipitationList(1, 10, searchYear || "0");
+ searchFacilityPrecipitationList(1, 10, "2023");
}
- }, [isInit, initializeCommonData, searchFacilityPrecipitationList, searchYear]);
+ }, [isInit, initializeCommonData, searchFacilityPrecipitationList]);
useEffect(() => {
if (excelList && excelList.length > 0) {
diff --git a/apps/fo/app/pages/facilityWaterQlty/page.tsx b/apps/fo/app/pages/facilityWaterQlty/page.tsx
index 079ebce81..6600061d0 100644
--- a/apps/fo/app/pages/facilityWaterQlty/page.tsx
+++ b/apps/fo/app/pages/facilityWaterQlty/page.tsx
@@ -98,7 +98,7 @@ export default function ProcessFacilitySearch() {
input.value = "";
}
}
- searchFacilityWaterQltyList(1, 10, searchYearValue || "0");
+ searchFacilityWaterQltyList(1, 10, "2023");
}
// 셀 클릭 시 모달 표시
@@ -131,9 +131,9 @@ export default function ProcessFacilitySearch() {
useEffect(() => {
if (!isInit) {
initializeCommonData();
- searchFacilityWaterQltyList(1, 10, searchYearValue || "0");
+ searchFacilityWaterQltyList(1, 10, "2023");
}
- }, [isInit, initializeCommonData, searchFacilityWaterQltyList, selectSearchYear]);
+ }, [isInit, initializeCommonData, searchFacilityWaterQltyList]);
useEffect(() => {
if (excelList && excelList.length > 0) {
diff --git a/apps/fo/app/pages/flowRate/page.tsx b/apps/fo/app/pages/flowRate/page.tsx
index eb3ae4fa5..154fe72ef 100644
--- a/apps/fo/app/pages/flowRate/page.tsx
+++ b/apps/fo/app/pages/flowRate/page.tsx
@@ -89,9 +89,9 @@ export default function ProcessFacilitySearch() {
setWidthSize("w-[120%]");
setUpheadList(upHeadList1)
// 상태값 설정
+ setSearchYearValue("2023");
setFcltCpct(selectUpdownData[0]?.val || "0");
setOperationValue(selectOperationData[0]?.val || "0");
- setSearchYearValue("2023");
// SearchInputSelect 초기화
setFcltyName("");
if (searchInputRef.current) {
@@ -100,7 +100,7 @@ export default function ProcessFacilitySearch() {
input.value = "";
}
}
- searchFlowRateList(1, 10, searchYearValue || "0");
+ searchFlowRateList(1, 10, "2023");
}
// 셀 클릭 시 모달 표시
@@ -126,11 +126,10 @@ export default function ProcessFacilitySearch() {
// 시도 데이터 초기화
useEffect(() => {
if(!isInit) {
- console.log('searchYearValue', searchYearValue, isInit);
initializeCommonData();
- searchFlowRateList(1, 10, searchYearValue || "0");
+ searchFlowRateList(1, 10, "2023");
}
- }, [isInit, initializeCommonData, searchFlowRateList, searchYearValue]);
+ }, [isInit, initializeCommonData, searchFlowRateList]);
useEffect(() => {
if (excelList && excelList.length > 0) {
diff --git a/apps/fo/app/pages/planSewage/page.tsx b/apps/fo/app/pages/planSewage/page.tsx
index e1242956c..1db7f0d3b 100644
--- a/apps/fo/app/pages/planSewage/page.tsx
+++ b/apps/fo/app/pages/planSewage/page.tsx
@@ -92,7 +92,7 @@ export default function PlanSewage() {
input.value = "";
}
}
- searchPlanSewageList(1, 10, searchYear, ref.current.partValue);
+ searchPlanSewageList(1, 10, "2023", ref.current.partValue);
}
/**
@@ -101,9 +101,9 @@ export default function PlanSewage() {
useEffect(() => {
if (!isInit) {
initializeCommonData();
- searchPlanSewageList(1, 10, searchYear, ref.current.partValue);
+ searchPlanSewageList(1, 10, "2023", ref.current.partValue);
}
- }, [isInit, initializeCommonData, searchYear, searchPlanSewageList]);
+ }, [isInit, initializeCommonData, searchPlanSewageList]);
useEffect(() => {
console.log('excelList' , excelList);
diff --git a/apps/fo/app/pages/processArea/page.tsx b/apps/fo/app/pages/processArea/page.tsx
index 1ec7927c0..441d0b35f 100644
--- a/apps/fo/app/pages/processArea/page.tsx
+++ b/apps/fo/app/pages/processArea/page.tsx
@@ -85,7 +85,7 @@ export default function ProcessArea() {
}
}
setSearchYearValue("2023");
- searchProcessAreaList(1, 10, '', '', searchYearValue);
+ searchProcessAreaList(1, 10, '', '', "2023");
}
// 셀 클릭 시 모달 표시
@@ -105,9 +105,9 @@ export default function ProcessArea() {
useEffect(() => {
if (!isInit) {
initializeCommonData();
- searchProcessAreaList(1, 10, '', '', selectSearchYear[0]?.val);
+ searchProcessAreaList(1, 10, '', '', "2023");
}
- }, [isInit, initializeCommonData, searchProcessAreaList, selectSearchYear]);
+ }, [isInit, initializeCommonData, searchProcessAreaList]);
useEffect(() => {
if (excelList && excelList.length > 0) {
diff --git a/apps/fo/app/pages/rdi/page.tsx b/apps/fo/app/pages/rdi/page.tsx
index 9fcb84a7d..e10bc3889 100644
--- a/apps/fo/app/pages/rdi/page.tsx
+++ b/apps/fo/app/pages/rdi/page.tsx
@@ -90,7 +90,7 @@ export default function Rdi() {
input.value = "";
}
}
- searchRdiList(1, 10, searchYear);
+ searchRdiList(1, 10, "2023");
}
@@ -100,9 +100,9 @@ export default function Rdi() {
useEffect(() => {
if (!isInit) {
initializeCommonData();
- searchRdiList(1, 10, selectSearchYear[0]?.val || "0");
+ searchRdiList(1, 10, "2023");
}
- }, [isInit, initializeCommonData, searchRdiList, selectSearchYear]);
+ }, [isInit, initializeCommonData, searchRdiList]);
useEffect(() => {
if (excelList && excelList.length > 0) {
diff --git a/apps/fo/app/pages/sewageOccur/page.tsx b/apps/fo/app/pages/sewageOccur/page.tsx
index 9c917b681..8b4a46db3 100644
--- a/apps/fo/app/pages/sewageOccur/page.tsx
+++ b/apps/fo/app/pages/sewageOccur/page.tsx
@@ -106,7 +106,7 @@ export default function PlanSewage() {
input.value = "";
}
}
- searchSewageOccurList(1, 10, searchYear);
+ searchSewageOccurList(1, 10, "2023");
}
// 모달 닫기
@@ -129,9 +129,9 @@ export default function PlanSewage() {
useEffect(() => {
if (!isInit) {
initializeCommonData();
- searchSewageOccurList(1, 10, searchYear || "0");
+ searchSewageOccurList(1, 10, "2023");
}
- }, [isInit, initializeCommonData, searchSewageOccurList, searchYear]);
+ }, [isInit, initializeCommonData, searchSewageOccurList]);
useEffect(() => {
if (excelList && excelList.length > 0) {
diff --git a/apps/fo/app/pages/underWaterInput/page.tsx b/apps/fo/app/pages/underWaterInput/page.tsx
index 57f47e249..45344755c 100644
--- a/apps/fo/app/pages/underWaterInput/page.tsx
+++ b/apps/fo/app/pages/underWaterInput/page.tsx
@@ -104,7 +104,7 @@ export default function UnderWaterInput() {
input.value = "";
}
}
- searchUnderWaterList(1, 10, searchYear);
+ searchUnderWaterList(1, 10, "2023");
}
// 모달 닫기
@@ -126,9 +126,9 @@ export default function UnderWaterInput() {
useEffect(() => {
if (!isInit) {
initializeCommonData();
- searchUnderWaterList(1, 10, searchYear);
+ searchUnderWaterList(1, 10, "2023");
}
- }, [isInit, initializeCommonData, searchUnderWaterList, searchYear]);
+ }, [isInit, initializeCommonData, searchUnderWaterList]);
useEffect(() => {
if (excelList && excelList.length > 0) {
diff --git a/apps/fo/app/store/dashboard/index.tsx b/apps/fo/app/store/dashboard/index.tsx
index 89166281a..f69f36b54 100644
--- a/apps/fo/app/store/dashboard/index.tsx
+++ b/apps/fo/app/store/dashboard/index.tsx
@@ -935,17 +935,17 @@ 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_INFL_ASSCT_BFR_WQLT_TP * 1000) / 1000).toFixed(3).toString() : '';
- operationalStatus.yearMin = data.yearData ? Number(Math.round(data.yearData.MIN_INFL_ASSCT_BFR_WQLT_TP * 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.summerAll = data.summer ? Number(Math.round(data.summer.AVG_INFL_ASSCT_BFR_WQLT_TP * 1000) / 1000).toFixed(3).toString() : '';
- operationalStatus.summerThree = data.summerRainy ? Number(Math.round(data.summerRainy.AVG_INFL_ASSCT_BFR_WQLT_TP * 1000) / 1000).toFixed(3).toString() : '';
- operationalStatus.summerRain = data.summerSunny ? Number(Math.round(data.summerSunny.AVG_INFL_ASSCT_BFR_WQLT_TP * 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.winterAll = data.winter ? Number(Math.round(data.winter.AVG_INFL_ASSCT_BFR_WQLT_TP * 1000) / 1000).toFixed(3).toString() : '';
- operationalStatus.winterSunnyMin = data.winterSunny ? Number(Math.round(data.winterSunny.MIN_INFL_ASSCT_BFR_WQLT_TP * 1000) / 1000).toFixed(3).toString() : '';
- operationalStatus.winterSunnyAvg = data.winterSunny ? Number(Math.round(data.winterSunny.AVG_INFL_ASSCT_BFR_WQLT_TP * 1000) / 1000).toFixed(3).toString() : '';
- operationalStatus.winterSunnyMax = data.winterSunny ? Number(Math.round(data.winterSunny.MAX_INFL_ASSCT_BFR_WQLT_TP * 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() : '';
}
type RtnFlowType = {
diff --git a/apps/fo/app/store/facilityWaterQlty/index.tsx b/apps/fo/app/store/facilityWaterQlty/index.tsx
index b4c60d475..37cc27143 100644
--- a/apps/fo/app/store/facilityWaterQlty/index.tsx
+++ b/apps/fo/app/store/facilityWaterQlty/index.tsx
@@ -404,8 +404,8 @@ export const facilityWaterQltyReducer = (set: (fn: (state: FacilityWaterQltyType
if(item.efflWqltTn){
item.efflWqltTn = Number(Math.round(Number(item.efflWqltTn) * 1000)/1000).toFixed(3);
}
- if(item.inflAssctAftWqltTp){
- item.inflAssctAftWqltTp = Number(Math.round(Number(item.inflAssctAftWqltTp) * 1000)/1000).toFixed(3);
+ if(item.inflAssctBfrWqltTp){
+ item.inflAssctBfrWqltTp = Number(Math.round(Number(item.inflAssctBfrWqltTp) * 1000)/1000).toFixed(3);
}
if(item.efflWqltTp){
item.efflWqltTp = Number(Math.round(Number(item.efflWqltTp) * 1000)/1000).toFixed(3);
@@ -458,7 +458,7 @@ export const facilityWaterQltyReducer = (set: (fn: (state: FacilityWaterQltyType
유입TOC: item.inflAssctBfrWqltToc,
유입SS: item.inflAssctBfrWqltSs,
유입TN: item.inflAssctBfrWqltTn,
- 유입TP: item.inflAssctAftWqltTp,
+ 유입TP: item.inflAssctBfrWqltTp,
유출BOD: item.efflWqltBod,
유출TOC: item.efflWqltToc,
유출SS: item.efflWqltSs,
diff --git a/apps/fo/app/store/processArea/index.tsx b/apps/fo/app/store/processArea/index.tsx
index a43777b1c..ba0f5a749 100644
--- a/apps/fo/app/store/processArea/index.tsx
+++ b/apps/fo/app/store/processArea/index.tsx
@@ -229,7 +229,8 @@ 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}> => {
try {
- targetYear = targetYear ? targetYear : "2024";
+ targetYear = targetYear ? targetYear : "2023";
+ console.log('targetYear', targetYear);
const baseUrl = 'https://apigateway.rsonesoft.com/dc-service/api/v1/nowDmgMtncGnsvy';
const queryParams = new URLSearchParams();
@@ -245,7 +246,7 @@ const fetchProcessAreaList = async (pageNo : number, pageSize : number, ctpvNm :
const enrichedData = await Promise.all(
res.map(async (item: ProcessAreaProps) => {
upHeadList1.forEach((head:TableUpperProps) => {
- if (head.id === 'planSwageQntSum' || head.id === 'swtrmtPpltnCnt' || head.id === 'swtrmtZoneArea') {
+ /* if (head.id === 'planSwageQntSum' || head.id === 'swtrmtPpltnCnt' || head.id === 'swtrmtZoneArea') {
head.title = '현재\n(' + item.yr + '년)';
} else if(head.id === 'planSwageQntSumDc1' || head.id === 'swtrmtPpltnCntDc1' || head.id === 'swtrmtZoneAreaDc1') {
head.title = '1단계\n(' + item.yrDc1 + '년)';
@@ -257,6 +258,19 @@ const fetchProcessAreaList = async (pageNo : number, pageSize : number, ctpvNm :
head.title = '4단계\n(' + item.yrDc4 + '년)';
} else if(head.id === 'planSwageQntSumDt4' || head.id === 'swtrmtPpltnCntDt4' || head.id === 'swtrmtZoneAreaDt4') {
head.title = '기승인\n4단계(' + item.yrDt4 + '년)';
+ } */
+ if (head.id === 'planSwageQntSum' || head.id === 'swtrmtPpltnCnt' || head.id === 'swtrmtZoneArea') {
+ head.title = '현재';
+ } else if(head.id === 'planSwageQntSumDc1' || head.id === 'swtrmtPpltnCntDc1' || head.id === 'swtrmtZoneAreaDc1') {
+ head.title = '1단계';
+ } else if(head.id === 'planSwageQntSumDc2' || head.id === 'swtrmtPpltnCntDc2' || head.id === 'swtrmtZoneAreaDc2') {
+ head.title = '2단계';
+ } else if(head.id === 'planSwageQntSumDc3' || head.id === 'swtrmtPpltnCntDc3' || head.id === 'swtrmtZoneAreaDc3') {
+ head.title = '3단계';
+ } else if(head.id === 'planSwageQntSumDc4' || head.id === 'swtrmtPpltnCntDc4' || head.id === 'swtrmtZoneAreaDc4') {
+ head.title = '4단계';
+ } else if(head.id === 'planSwageQntSumDt4' || head.id === 'swtrmtPpltnCntDt4' || head.id === 'swtrmtZoneAreaDt4') {
+ head.title = '기승인\n4단계';
}
});
const res = await fetchFacilityDetailInfo(item.swtrmtFcltCd);
diff --git a/apps/fo/app/store/sewageOccur/index.tsx b/apps/fo/app/store/sewageOccur/index.tsx
index 08b873cca..426030c59 100644
--- a/apps/fo/app/store/sewageOccur/index.tsx
+++ b/apps/fo/app/store/sewageOccur/index.tsx
@@ -126,7 +126,6 @@ const tempSewageOccurList:modalTableType[] = []
const fetchSewageOccurList = async (pageNo: number, pageSize: number, searchYear: string, partCd?: string, nameCd?: string, fcltCpct?: string, operationValue?: string, fcltyNm?: string) => {
// 20250701임시시
- console.log("searchYear", searchYear);
const tailStr = partCd ? '/'+ partCd + '/' + nameCd + '/' + fcltCpct + '/' + operationValue + (fcltyNm && fcltyNm !== '' ? '/' + fcltyNm : '') : '';
const url = '/fclt/flow/' + pageNo + '/' + pageSize + '/' + searchYear + tailStr;
const res = await getFetch('fo', url);
@@ -215,7 +214,7 @@ export const sewageOccurReducer:(set:any)=>SewageOccurActions=(set: any) => {
searchSewageOccurList: async (pageNo: number, pageSize: number, searchYear: string, part?: string, nameCd?: string, fcltCpct?: string, operationValue?: string, fcltyNm?: string) => {
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() || '';
@@ -230,6 +229,9 @@ export const sewageOccurReducer:(set:any)=>SewageOccurActions=(set: any) => {
let chungcunSumFlow = 0;
let totWaterUsage = 0;
+ if(bscFctCd === '11200PB001R'){
+ console.log('res2.data : ',res2.data);
+ }
// 강우영향일 계산 (강우량이 3 초과이면 무조건 강우영향일)
for(let idx = 0; idx < res2.data.length; idx++) {
const item = res2.data[idx];
@@ -243,41 +245,45 @@ export const sewageOccurReducer:(set:any)=>SewageOccurActions=(set: any) => {
}
// 이틀 전, 하루 전이 강우영향일(3 이상)인 경우 해당 날도 강우영향일로 설정
- for(let idx = 0; idx < data.length; idx++) {
- if(data[idx]) {
+ for(let idx = 0; idx < res2.data.length; idx++) {
+ if(res2.data[idx]) {
// 하루 전이 강우영향일(3 이상)인 경우
- if(idx > 0 && data[idx-1]?.infoRnDay && Number(data[idx-1]?.infoRnDay.toString().trim()) >= 3) {
- data[idx]!.rainEffectDay = 1;
+ if(idx > 0 && res2.data[idx-1]?.infoRnDay && Number(res2.data[idx-1]?.infoRnDay.toString().trim()) >= 3) {
+ res2.data[idx]!.rainEffectDay = 1;
}
// 이틀 전이 강우영향일(3 이상)인 경우
- if(idx > 1 && data[idx-2]?.infoRnDay && Number(data[idx-2]?.infoRnDay.toString().trim()) >= 3) {
- data[idx]!.rainEffectDay = 1;
+ if(idx > 1 && res2.data[idx-2]?.infoRnDay && Number(res2.data[idx-2]?.infoRnDay.toString().trim()) >= 3) {
+ res2.data[idx]!.rainEffectDay = 1;
}
}
}
- for(let idx = 0; idx < data.length; idx++) {
- if(data[idx] && data[idx]?.rainEffectDay === 1) {
+ for(let idx = 0; idx < res2.data.length; idx++) {
+ if(res2.data[idx] && res2.data[idx]?.rainEffectDay === 1) {
if(idx > 1){
- if(data[idx-1]?.infoRnDay && Number(data[idx-1]?.infoRnDay.toString().trim()) >= 3) {
- data[idx]!.infoRnDay = data[idx-1]!.infoRnDay;
+ if(res2.data[idx-1]?.infoRnDay && Number(res2.data[idx-1]?.infoRnDay.toString().trim()) >= 3) {
+ res2.data[idx]!.infoRnDay = res2.data[idx-1]!.infoRnDay;
}
}
if(idx > 2){
- if(data[idx-2]?.infoRnDay && Number(data[idx-2]?.infoRnDay.toString().trim()) >= 3) {
- data[idx]!.infoRnDay = data[idx-2]!.infoRnDay;
+ if(res2.data[idx-2]?.infoRnDay && Number(res2.data[idx-2]?.infoRnDay.toString().trim()) >= 3) {
+ res2.data[idx]!.infoRnDay = res2.data[idx-2]!.infoRnDay;
}
}
}
}
- console.log('calData : ',res2.data);
+ if(bscFctCd === '11200PB001R'){
+ console.log('calData : ',res2.data);
+ }
res2.data.forEach((item: FlowDataItem) => {
- if(Number(item.infoRnDay) ===0){
+
+ if(Number(item.rainEffectDay) === 0){
chungcunSumFlow += Number(item.inflAmnt);
sumChungcunDay += 1;
}
+
totWaterUsage += Number(item.inflAmnt);
});
const avg = totWaterUsage /res2.count;
diff --git a/apps/fo/app/store/underWaterInput/index.tsx b/apps/fo/app/store/underWaterInput/index.tsx
index 2d0938a56..90f621193 100644
--- a/apps/fo/app/store/underWaterInput/index.tsx
+++ b/apps/fo/app/store/underWaterInput/index.tsx
@@ -408,7 +408,13 @@ export const underWaterReducer:(set:(fn: (state: UnderWaterType) => UnderWaterTy
const calData = calRainEffectDay(res.data, 'SUNNY');
let tot = 0, cnt= 0;
- console.log('calData : ', calData);
+ let tmpTot = 0;
+
+ calData.forEach((item: FlowDataItem) => {
+ tmpTot += Number(item.inflAmnt);
+ })
+ console.log('tmpTot : ', tmpTot/calData.length);
+
calData.forEach((item: FlowDataItem) => {
const month = item.msrDt?.substring(4, 6);
const monthIdx = month ? Number(month) - 1 : -1;
@@ -428,6 +434,7 @@ export const underWaterReducer:(set:(fn: (state: UnderWaterType) => UnderWaterTy
let maxWaterUsage = 0;
let minWaterUsage = 9999999999;
let avgWaterUsage = 0;
+ console.log('monthData : ', monthData);
monthData.forEach((item, index) => {
item.usege = item.sum/item.cnt
tableData.push({
@@ -447,6 +454,7 @@ export const underWaterReducer:(set:(fn: (state: UnderWaterType) => UnderWaterTy
});
avgWaterUsage = tot/cnt
console.log('avgWaterUsage : ', avgWaterUsage);
+ console.log('tableData : ', tableData);
const newData= [
{
msrDt: '평균',
From 3e634fa5754b75dbfdcca69d9404d59a7a673170 Mon Sep 17 00:00:00 2001
From: yschoi
Date: Mon, 28 Jul 2025 06:29:44 +0900
Subject: [PATCH 13/75] =?UTF-8?q?=EA=B0=9C=EB=B0=9C=20=ED=99=98=EA=B2=BD?=
=?UTF-8?q?=EB=B3=80=EC=88=98=20=EC=88=98=EC=A0=95?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
apps/dm/.env.development | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/apps/dm/.env.development b/apps/dm/.env.development
index 96f4da6f5..26e02a357 100644
--- a/apps/dm/.env.development
+++ b/apps/dm/.env.development
@@ -1,8 +1,8 @@
NEXT_PUBLIC_SITE_ID = DM
NEXT_PUBLIC_PORT = 3000
-NEXT_PUBLIC_PROXY_HOST = http://localhost:3000
-NEXT_PUBLIC_DM_SERVER_API_URL = http://con.mind-one.co.kr:11080/api/v1
+NEXT_PUBLIC_PROXY_HOST = http://con.mind-one.co.kr:11035
NEXT_PUBLIC_SERVER_API_URL = http://dev.onasys.co.kr:8000
+NEXT_PUBLIC_DM_SERVER_API_URL = http://con.mind-one.co.kr:11080/api/v1
NEXT_PUBLIC_FO_SERVER_API_URL = http://con.mind-one.co.kr:11082/api/v1
NEXT_PUBLIC_CS_SERVER_API_URL = http://dev.onasys.co.kr:8000
NEXT_PUBLIC_CS_TUS_UPLOAD = /attach-service/api/v1/tus/upload
From 13ce985fe57ef8076744d35b03ab12114c06d13f Mon Sep 17 00:00:00 2001
From: yschoi
Date: Mon, 28 Jul 2025 06:38:50 +0900
Subject: [PATCH 14/75] 1
---
apps/dm/package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/apps/dm/package.json b/apps/dm/package.json
index 2fdff5dbc..4db9ddba8 100644
--- a/apps/dm/package.json
+++ b/apps/dm/package.json
@@ -3,7 +3,7 @@
"version": "0.1.0",
"private": true,
"scripts": {
- "dev": "next dev --turbopack",
+ "dev": "next dev -p 3005",
"build": "next build",
"start": "next start",
"lint": "next lint"
From cfde5d695f6b350e8303217af1956a4413f90590 Mon Sep 17 00:00:00 2001
From: yschoi
Date: Mon, 28 Jul 2025 07:35:02 +0900
Subject: [PATCH 15/75] =?UTF-8?q?=ED=99=98=EA=B2=BD=EB=B3=80=EC=88=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
apps/dm/.env.development | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/apps/dm/.env.development b/apps/dm/.env.development
index 26e02a357..bb3709582 100644
--- a/apps/dm/.env.development
+++ b/apps/dm/.env.development
@@ -1,5 +1,5 @@
NEXT_PUBLIC_SITE_ID = DM
-NEXT_PUBLIC_PORT = 3000
+NEXT_PUBLIC_PORT = 3005
NEXT_PUBLIC_PROXY_HOST = http://con.mind-one.co.kr:11035
NEXT_PUBLIC_SERVER_API_URL = http://dev.onasys.co.kr:8000
NEXT_PUBLIC_DM_SERVER_API_URL = http://con.mind-one.co.kr:11080/api/v1
From b67d1261ff552155179051486f41dbed49c077f9 Mon Sep 17 00:00:00 2001
From: yschoi
Date: Mon, 28 Jul 2025 07:50:19 +0900
Subject: [PATCH 16/75] =?UTF-8?q?=EB=A1=9C=EC=BB=AC=20=ED=99=98=EA=B2=BD?=
=?UTF-8?q?=EB=B3=80=EC=88=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
apps/dm/.env.local | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/apps/dm/.env.local b/apps/dm/.env.local
index b60a1d86f..8ac1f688a 100644
--- a/apps/dm/.env.local
+++ b/apps/dm/.env.local
@@ -3,9 +3,9 @@ NEXT_PUBLIC_CLAIM_NAME = Authorization
NEXT_PUBLIC_AUTH_USER_ID = token-id
NEXT_PUBLIC_ACCESS_TOKEN = access-token
NEXT_PUBLIC_REFRESH_TOKEN = refresh-token
-NEXT_PUBLIC_PORT = 11035
+NEXT_PUBLIC_PORT = 3005
#NEXT_PUBLIC_PROXY_HOST = http://con.mind-one.co.kr:11035
-NEXT_PUBLIC_PROXY_HOST = http://localhost:3000/
+NEXT_PUBLIC_PROXY_HOST = http://localhost:3005/
NEXT_PUBLIC_DM_SERVER_API_URL = http://con.mind-one.co.kr:11080/api/v1
NEXT_PUBLIC_SERVER_API_URL = http://dev.onasys.co.kr:8000
NEXT_PUBLIC_FO_SERVER_API_URL = http://con.mind-one.co.kr:11082/api/v1
From ed53ad249c56e6f3f3767c8d6fd9d1c0f99a5276 Mon Sep 17 00:00:00 2001
From: yschoi
Date: Mon, 28 Jul 2025 07:52:40 +0900
Subject: [PATCH 17/75] =?UTF-8?q?=ED=9B=84=EB=B3=B4=EC=A7=80=20=EC=84=A0?=
=?UTF-8?q?=ED=83=9D=20=EB=B2=84=ED=8A=BC=20=EC=82=AD=EC=A0=9C?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
apps/dm/components/ui/map/searchBar/searchBar.tsx | 8 --------
1 file changed, 8 deletions(-)
diff --git a/apps/dm/components/ui/map/searchBar/searchBar.tsx b/apps/dm/components/ui/map/searchBar/searchBar.tsx
index de68d2f3c..f2beeff82 100644
--- a/apps/dm/components/ui/map/searchBar/searchBar.tsx
+++ b/apps/dm/components/ui/map/searchBar/searchBar.tsx
@@ -118,14 +118,6 @@ export function SearchBar({
/>
-
@@ -285,6 +287,7 @@ export default function UnderWaterInputModal({fcltyName='', searchYear=new Date(
selectClass="ml-5 w-[100px]"
startYear={Number(searchYear)} // 시작 연도 설정
yearReadOnly={true}
+ enableMonth={['1월', '2월']}
/>
~
From dad8b9925e52a1e58af04ae5d41f984b3c8c27a9 Mon Sep 17 00:00:00 2001
From: Your Name
Date: Mon, 28 Jul 2025 11:12:27 +0900
Subject: [PATCH 29/75] =?UTF-8?q?monthpicker=20enableMonth=20string[]=20?=
=?UTF-8?q?=ED=8C=8C=EB=9D=BC=EB=AF=B8=ED=84=B0=20=EC=B6=94=EA=B0=80=20(?=
=?UTF-8?q?=EC=84=A0=ED=83=9D=EA=B0=80=EB=8A=A5=ED=95=9C=20=EC=9B=94=20?=
=?UTF-8?q?=EB=B0=B0=EC=97=B4=20=EC=B6=94=EA=B0=80=ED=95=98=EB=A9=B4?=
=?UTF-8?q?=EB=90=A8=20ex.['4=EC=9B=94',=20'5=EC=9B=94'])?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../business_components/src/ui/date_month_picker/index.tsx | 3 +++
.../src/ui/date_month_picker/mothPicker.tsx | 5 +++--
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/packages/common/business_components/src/ui/date_month_picker/index.tsx b/packages/common/business_components/src/ui/date_month_picker/index.tsx
index a8da0ff0e..b31a86414 100644
--- a/packages/common/business_components/src/ui/date_month_picker/index.tsx
+++ b/packages/common/business_components/src/ui/date_month_picker/index.tsx
@@ -19,6 +19,7 @@ type MonthPickerProps = {
readOnly?: boolean;
startYear?: number; // 시작 연도 props 추가
yearReadOnly?: boolean;
+ enableMonth?: string[];
};
// yyyyMM → Date 객체
@@ -41,6 +42,7 @@ export const DateMonthPicker = ({
readOnly = false,
startYear,
yearReadOnly = false,
+ enableMonth,
}: MonthPickerProps) => {
const [open, setOpen] = useState(false);
@@ -81,6 +83,7 @@ export const DateMonthPicker = ({
onMonthChange={handleSelect}
startYear={startYear}
yearReadOnly={yearReadOnly}
+ enableMonth={enableMonth}
/>
diff --git a/packages/common/business_components/src/ui/date_month_picker/mothPicker.tsx b/packages/common/business_components/src/ui/date_month_picker/mothPicker.tsx
index 78c9cb90b..9b408183b 100644
--- a/packages/common/business_components/src/ui/date_month_picker/mothPicker.tsx
+++ b/packages/common/business_components/src/ui/date_month_picker/mothPicker.tsx
@@ -30,9 +30,10 @@ export type MonthPickerProps = {
) => void;
startYear?: number;
yearReadOnly?: boolean;
+ enableMonth?: string[];
};
-export function MonthPicker({ currentMonth, onMonthChange, startYear, yearReadOnly }: MonthPickerProps) {
+export function MonthPicker({ currentMonth, onMonthChange, startYear, yearReadOnly, enableMonth }: MonthPickerProps) {
const today = startOfToday();
const currentYear = today.getFullYear();
@@ -113,7 +114,7 @@ const selectedYear = parseInt(yearFromProp);
From 387362d42bd510b4f63404a692949b27a44136cf Mon Sep 17 00:00:00 2001
From: bicochan
Date: Tue, 29 Jul 2025 11:28:48 +0900
Subject: [PATCH 37/75] =?UTF-8?q?[apps/cs]=20feat:=20=EA=B2=8C=EC=8B=9C?=
=?UTF-8?q?=EA=B8=80=20=EB=82=B4=20=EB=AA=A9=EB=A1=9D=20=EB=B2=84=ED=8A=BC?=
=?UTF-8?q?=20=EA=B8=B0=EB=8A=A5=20=EC=88=98=EC=A0=95?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
apps/cs/src/widgets/post/ui/post-action.tsx | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/apps/cs/src/widgets/post/ui/post-action.tsx b/apps/cs/src/widgets/post/ui/post-action.tsx
index 421cb4542..860d8dad8 100644
--- a/apps/cs/src/widgets/post/ui/post-action.tsx
+++ b/apps/cs/src/widgets/post/ui/post-action.tsx
@@ -25,6 +25,7 @@ function PostAction({ children, handleDelete }: PostActionProps) {
const { prompt } = useSelectPrompt(selectData);
const bbsInfo = useMenuStore((state) => state.bbsInfo);
const userInfo = useUserStore((state) => state.userInfo);
+ const postPageLink = `/bbs/${bbsInfo?.bbsTypeCd.toLowerCase()}/${bbsInfo?.bbsId}`;
const onDelete = async () => {
const { resolved, value } = await prompt("삭제 사유를 입력해주세요.");
@@ -64,7 +65,7 @@ function PostAction({ children, handleDelete }: PostActionProps) {
size="lg"
color="white"
type="button"
- onClick={() => router.back()}
+ onClick={() => router.push(postPageLink)}
>
목록
From 12f7fe53ad759a518b44bfaaa479732ff8340c51 Mon Sep 17 00:00:00 2001
From: bicochan
Date: Tue, 29 Jul 2025 13:23:48 +0900
Subject: [PATCH 38/75] =?UTF-8?q?[apps/cs]=20feat:=20=EC=A0=91=EC=86=8D?=
=?UTF-8?q?=EC=9E=90=ED=86=B5=EA=B3=84=20=EB=8D=B0=EC=9D=B4=ED=84=B0=20?=
=?UTF-8?q?=EB=B0=94=EC=9D=B8=EB=94=A9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../cs/src/pages/user-statistics/api/index.ts | 1 -
.../api/user-statistics-service.ts | 147 ++---------
.../pages/user-statistics/model/chart-data.ts | 245 +++++++-----------
.../model/user-statistics-interface.ts | 84 +++---
.../ui/user-statistics-page.tsx | 163 +++++-------
apps/cs/src/shared/config/api.ts | 1 +
6 files changed, 220 insertions(+), 421 deletions(-)
delete mode 100644 apps/cs/src/pages/user-statistics/api/index.ts
diff --git a/apps/cs/src/pages/user-statistics/api/index.ts b/apps/cs/src/pages/user-statistics/api/index.ts
deleted file mode 100644
index 802b91e30..000000000
--- a/apps/cs/src/pages/user-statistics/api/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export { UserStatisticsApi } from "./user-statistics-service";
diff --git a/apps/cs/src/pages/user-statistics/api/user-statistics-service.ts b/apps/cs/src/pages/user-statistics/api/user-statistics-service.ts
index 10c90c024..d0522267b 100644
--- a/apps/cs/src/pages/user-statistics/api/user-statistics-service.ts
+++ b/apps/cs/src/pages/user-statistics/api/user-statistics-service.ts
@@ -1,138 +1,21 @@
+import { client } from "@/shared/api";
import {
- type AccessLog,
- type AccessLogParams,
- type AccessLogService,
- type PageableList,
+ type UserStatisticsService,
+ type ConnectionStatisticsParams,
+ type ConnectionStatistics,
} from "../model/user-statistics-interface";
+import { ENDPOINT } from "@/shared/config";
-// 목 데이터
-const mockAccessLogs: AccessLog[] = [
- {
- no: 1,
- accessTime: "2024-01-15 14:30:25",
- accessIp: "192.168.1.100",
- accessRegion: "서울특별시",
- urlPath: "/index",
- browser: "Chrome",
- site: "SITE1",
- accessType: "메인",
- },
- {
- no: 2,
- accessTime: "2024-01-15 14:28:15",
- accessIp: "203.241.50.123",
- accessRegion: "부산광역시",
- urlPath: "/board/list",
- browser: "Edge",
- site: "SITE2",
- accessType: "게시판",
- },
- {
- no: 3,
- accessTime: "2024-01-15 14:25:42",
- accessIp: "175.223.45.67",
- accessRegion: "대구광역시",
- urlPath: "/statistics",
- browser: "Safari",
- site: "SITE1",
- accessType: "통계",
- },
- {
- no: 4,
- accessTime: "2024-01-15 14:22:18",
- accessIp: "211.252.87.45",
- accessRegion: "인천광역시",
- urlPath: "/contents/view",
- browser: "Firefox",
- site: "SITE3",
- accessType: "컨텐츠",
- },
- {
- no: 5,
- accessTime: "2024-01-15 14:20:33",
- accessIp: "121.254.12.89",
- accessRegion: "광주광역시",
- urlPath: "/search",
- browser: "Chrome",
- site: "SITE1",
- accessType: "검색",
- },
-];
-
-// 목 API 서비스
-class UserStatisticsApiImpl implements AccessLogService {
- async getAccessLogList(
- params: AccessLogParams,
- ): Promise> {
- // 실제 API 호출 대신 목 데이터 반환
- const { page = 0, size = 10 } = params;
-
- // 필터링 로직 (실제로는 서버에서 처리)
- let filteredLogs = [...mockAccessLogs];
-
- if (params.urlPath) {
- filteredLogs = filteredLogs.filter((log) =>
- log.urlPath.toLowerCase().includes(params.urlPath!.toLowerCase()),
- );
- }
-
- if (params.accessIp) {
- filteredLogs = filteredLogs.filter((log) =>
- log.accessIp.includes(params.accessIp!),
- );
- }
-
- if (params.accessRegion) {
- filteredLogs = filteredLogs.filter((log) =>
- log.accessRegion.includes(params.accessRegion!),
- );
- }
-
- if (params.browser) {
- filteredLogs = filteredLogs.filter(
- (log) => log.browser.toLowerCase() === params.browser!.toLowerCase(),
- );
- }
-
- if (params.siteId) {
- filteredLogs = filteredLogs.filter((log) => log.site === params.siteId);
- }
-
- // 페이지네이션
- const start = page * size;
- const end = start + size;
- const paginatedLogs = filteredLogs.slice(start, end);
-
- // 목 응답 생성
- return {
- content: paginatedLogs,
- pageable: {
- pageNumber: page,
- pageSize: size,
- sort: {
- empty: true,
- sorted: false,
- unsorted: true,
- },
- offset: page * size,
- paged: true,
- unpaged: false,
- },
- last: (page + 1) * size >= filteredLogs.length,
- totalPages: Math.ceil(filteredLogs.length / size),
- totalElements: filteredLogs.length,
- size,
- number: page,
- sort: {
- empty: true,
- sorted: false,
- unsorted: true,
- },
- first: page === 0,
- numberOfElements: paginatedLogs.length,
- empty: paginatedLogs.length === 0,
- };
+class UserStatisticsApiService implements UserStatisticsService {
+ async getConnectionStatistics(
+ params: ConnectionStatisticsParams,
+ ): Promise {
+ const response = await client.get(
+ `${ENDPOINT.CMS_SERVICE.CONNECTION_LOG}/stat`,
+ { params },
+ );
+ return response.data;
}
}
-export const UserStatisticsApi = new UserStatisticsApiImpl();
+export const UserStatisticsApi = new UserStatisticsApiService();
diff --git a/apps/cs/src/pages/user-statistics/model/chart-data.ts b/apps/cs/src/pages/user-statistics/model/chart-data.ts
index c836a4e5d..8c4241cfd 100644
--- a/apps/cs/src/pages/user-statistics/model/chart-data.ts
+++ b/apps/cs/src/pages/user-statistics/model/chart-data.ts
@@ -1,148 +1,103 @@
-import { type ChartData, type ChartOptions } from "chart.js";
-
-// 일별 접속 현황 차트 데이터
-export const monthlyStatisticsData = {
- labels: [
- "1일",
- "2일",
- "3일",
- "4일",
- "5일",
- "6일",
- "7일",
- "8일",
- "9일",
- "10일",
- "11일",
- "12일",
- "13일",
- "14일",
- "15일",
- ],
- datasets: [
- {
- type: "bar" as const,
- label: "페이지뷰",
- data: [
- 850, 1000, 750, 750, 700, 750, 780, 800, 850, 900, 1200, 1700, 2300,
- 2100, 2600,
- ],
- backgroundColor: "rgba(54, 162, 235, 0.8)",
- order: 2,
- },
- {
- type: "line" as const,
- label: "신규 접속자",
- data: [
- 700, 600, 500, 550, 500, 550, 500, 550, 600, 850, 1200, 1500, 1700,
- 2300, 2200,
- ],
- borderColor: "rgba(255, 99, 132, 0.8)",
- borderWidth: 2,
- tension: 0.4,
- pointRadius: 3,
- order: 0,
- },
- {
- type: "line" as const,
- label: "총 접속자",
- data: [
- 200, 300, 400, 500, 600, 500, 550, 500, 400, 500, 350, 800, 900, 1200,
- 1300,
- ],
- borderColor: "rgba(75, 192, 192, 0.8)",
- borderWidth: 2,
- tension: 0.4,
- pointRadius: 3,
- order: 1,
- },
- ],
-};
-
-export const monthlyStatisticsOptions: ChartOptions<"bar"> = {
- responsive: true,
- maintainAspectRatio: false,
- plugins: {
- legend: {
- position: "top" as const,
- },
- tooltip: {
- mode: "index" as const,
- intersect: false,
- },
- },
-};
-
-// 사이트별 접속자 차트 데이터
-export const siteVisitorsData: ChartData<"bar"> = {
- labels: ["SITE1", "SITE2", "SITE3", "SITE4", "SITE5"],
- datasets: [
- {
- label: "사이트별 접속자",
- data: [2500, 2000, 1500, 1200, 800],
- backgroundColor: [
- "rgba(54, 162, 235, 0.8)",
- "rgba(153, 102, 255, 0.8)",
- "rgba(255, 99, 132, 0.8)",
- "rgba(255, 159, 64, 0.8)",
- "rgba(255, 205, 86, 0.8)",
- ],
- borderWidth: 1,
- },
- ],
-};
-
-export const siteVisitorsOptions: ChartOptions<"bar"> = {
- responsive: true,
- maintainAspectRatio: false,
- indexAxis: "y" as const,
- plugins: {
- legend: {
- display: false,
- },
- },
-};
-
-// 브라우저별 접속자 차트 데이터
-export const browserStatisticsData: ChartData<"doughnut"> = {
- labels: ["Chrome", "Edge", "Safari", "Firefox", "Internet Explorer"],
- datasets: [
- {
- data: [45, 25, 15, 10, 5],
- backgroundColor: [
- "rgba(54, 162, 235, 0.8)",
- "rgba(153, 102, 255, 0.8)",
- "rgba(255, 99, 132, 0.8)",
- "rgba(255, 159, 64, 0.8)",
- "rgba(255, 205, 86, 0.8)",
- ],
- borderColor: [
- "rgba(54, 162, 235, 1)",
- "rgba(153, 102, 255, 1)",
- "rgba(255, 99, 132, 1)",
- "rgba(255, 159, 64, 1)",
- "rgba(255, 205, 86, 1)",
- ],
- borderWidth: 1,
- },
- ],
-};
-
-export const browserStatisticsOptions: ChartOptions<"doughnut"> = {
- responsive: true,
- maintainAspectRatio: false,
- plugins: {
- legend: {
- position: "bottom" as const,
- },
- },
-};
+import type { ChartData, ChartOptions } from "chart.js";
+import { getCssVariableValue } from "@common/components";
+import type { ConnectionStatistics } from "./user-statistics-interface";
export const chartData = {
- monthlyStatisticsData,
- monthlyStatisticsOptions,
- siteVisitorsData,
- siteVisitorsOptions,
- browserStatisticsData,
- browserStatisticsOptions,
+ day: (
+ data: ConnectionStatistics,
+ ): {
+ data: ChartData<"line">;
+ options: ChartOptions<"line">;
+ } => {
+ return {
+ data: {
+ labels: data.dayList.map((item) => item.dayYmd),
+ datasets: [
+ {
+ type: "line",
+ label: "접속자 수",
+ data: data.dayList.map((item) => item.accessCnt),
+ borderColor: getCssVariableValue("--chart-1"),
+ },
+ ],
+ },
+ options: {
+ maintainAspectRatio: false,
+ scales: {
+ y: {
+ ticks: {
+ precision: 0,
+ },
+ },
+ },
+ },
+ };
+ },
+ site: (
+ data: ConnectionStatistics,
+ ): {
+ data: ChartData<"bar">;
+ options: ChartOptions<"bar">;
+ } => {
+ return {
+ data: {
+ labels: data.siteList.map((item) => item.siteNm),
+ datasets: [
+ {
+ type: "bar",
+ label: "사이트별 접속자",
+ data: data.siteList.map((item) => item.accessCnt),
+ backgroundColor: data.siteList.map((_, index) =>
+ getCssVariableValue(`--chart-${(index % 5) + 1}`),
+ ),
+ },
+ ],
+ },
+ options: {
+ maintainAspectRatio: false,
+ indexAxis: "y",
+ scales: {
+ x: {
+ ticks: {
+ precision: 0,
+ },
+ },
+ },
+ plugins: {
+ legend: {
+ display: false,
+ },
+ },
+ },
+ };
+ },
+ browser: (
+ data: ConnectionStatistics,
+ ): {
+ data: ChartData<"doughnut">;
+ options: ChartOptions<"doughnut">;
+ } => {
+ return {
+ data: {
+ labels: data.browserList.map((item) => item.wbsrKndNm),
+ datasets: [
+ {
+ type: "doughnut",
+ data: data.browserList.map((item) => item.accessCnt),
+ backgroundColor: data.browserList.map((_, index) =>
+ getCssVariableValue(`--chart-${(index % 5) + 1}`),
+ ),
+ },
+ ],
+ },
+ options: {
+ maintainAspectRatio: false,
+ plugins: {
+ legend: {
+ position: "bottom",
+ },
+ },
+ },
+ };
+ },
};
diff --git a/apps/cs/src/pages/user-statistics/model/user-statistics-interface.ts b/apps/cs/src/pages/user-statistics/model/user-statistics-interface.ts
index 124d91044..42d247185 100644
--- a/apps/cs/src/pages/user-statistics/model/user-statistics-interface.ts
+++ b/apps/cs/src/pages/user-statistics/model/user-statistics-interface.ts
@@ -1,56 +1,40 @@
-export interface AccessLog {
- no: number;
- accessTime: string;
- accessIp: string;
- accessRegion: string;
- urlPath: string;
- browser: string;
- site: string;
- accessType: string;
-}
-
-export interface AccessLogParams {
- page?: number;
- size?: number;
- urlPath?: string;
- accessIp?: string;
- accessRegion?: string;
- browser?: string;
- accessDateStart?: string;
- accessDateEnd?: string;
+export interface ConnectionStatisticsParams {
+ keywordType?: string;
+ keyword?: string;
siteId?: string;
- sort?: string;
+ cntnIp?: string;
+ cntnRgn?: string;
+ wbsrKnd?: string;
+ urlPath?: string;
+ cntnDtStart?: string;
+ cntnDtEnd?: string;
}
-export interface AccessLogService {
- getAccessLogList(params: AccessLogParams): Promise>;
+interface DayConnectionStatistics {
+ dayYmd: string;
+ accessCnt: number;
}
-export interface PageableList {
- content: T[];
- pageable: {
- pageNumber: number;
- pageSize: number;
- sort: {
- empty: boolean;
- sorted: boolean;
- unsorted: boolean;
- };
- offset: number;
- paged: boolean;
- unpaged: boolean;
- };
- last: boolean;
- totalPages: number;
- totalElements: number;
- size: number;
- number: number;
- sort: {
- empty: boolean;
- sorted: boolean;
- unsorted: boolean;
- };
- first: boolean;
- numberOfElements: number;
- empty: boolean;
+interface SiteConnectionStatistics {
+ siteId: string;
+ siteNm: string;
+ accessCnt: number;
+}
+
+interface BrowserConnectionStatistics {
+ wbsrKnd: string;
+ wbsrKndNm: string;
+ accessCnt: number;
+}
+
+export interface ConnectionStatistics {
+ dayList: DayConnectionStatistics[];
+ siteList: SiteConnectionStatistics[];
+ browserList: BrowserConnectionStatistics[];
+}
+
+export interface UserStatisticsService {
+ getConnectionStatistics(
+ params: ConnectionStatisticsParams,
+ ): Promise;
}
diff --git a/apps/cs/src/pages/user-statistics/ui/user-statistics-page.tsx b/apps/cs/src/pages/user-statistics/ui/user-statistics-page.tsx
index 9fedb47f4..4fe1d3fc0 100644
--- a/apps/cs/src/pages/user-statistics/ui/user-statistics-page.tsx
+++ b/apps/cs/src/pages/user-statistics/ui/user-statistics-page.tsx
@@ -15,9 +15,8 @@ import {
Filler,
Legend,
Tooltip,
- type ChartData,
} from "chart.js";
-import { Bar, Doughnut } from "react-chartjs-2";
+import { Bar, Doughnut, Line } from "react-chartjs-2";
import {
Button,
Input,
@@ -30,11 +29,13 @@ import {
} from "@common/components";
import { SiteSelect } from "@/entities/site";
import { useDataTable } from "@/shared/lib";
+import { ENDPOINT } from "@/shared/config";
+import { NoData } from "@/shared/ui/no-data";
import { InputDateRangePicker } from "@/shared/ui/input-date-range-picker";
-import { UserStatisticsApi } from "../api";
+import { UserStatisticsApi } from "../api/user-statistics-service";
import { chartData } from "../model/chart-data";
import { columns } from "../model/table-columns";
-import { type AccessLogParams } from "../model/user-statistics-interface";
+import { type ConnectionStatisticsParams } from "../model/user-statistics-interface";
ChartJS.register(
CategoryScale,
@@ -65,44 +66,41 @@ function UserStatisticsPage() {
});
const [keywordType, setKeywordType] = useState("");
const [keyword, setKeyword] = useState("");
+ const [siteId, setSiteId] = useState("");
const [presetDateRange, setPresetDateRange] = useState("1W");
const [dateRange, setDateRange] = useState(defaultDateRange);
- const [searchParams, setSearchParams] = useState({
- urlPath: "",
- accessIp: "",
- accessRegion: "",
- browser: "",
- accessDateStart: dayjs().subtract(7, "day").format("YYYY-MM-DD"),
- accessDateEnd: dayjs().format("YYYY-MM-DD"),
- sort: "accessTime,desc",
+ const [searchParams, setSearchParams] = useState({
+ keywordType: "",
+ keyword: "",
+ siteId: "",
+ cntnDtStart: dayjs(defaultDateRange.from).format("YYYY-MM-DD"),
+ cntnDtEnd: dayjs(defaultDateRange.to).format("YYYY-MM-DD"),
});
const query = useQuery({
- queryKey: ["user-statistics", searchParams, pagination],
+ queryKey: [ENDPOINT.CMS_SERVICE.CONNECTION_LOG, searchParams],
queryFn: () =>
- UserStatisticsApi.getAccessLogList({
+ UserStatisticsApi.getConnectionStatistics({
...searchParams,
- page: pagination.pageIndex,
- size: pagination.pageSize,
}),
placeholderData: keepPreviousData,
});
- const { tableComponent, tableInstance: table } = useDataTable({
- query,
- tableOptions: {
- columns,
- state: {
- pagination,
- },
- manualPagination: true,
- getCoreRowModel: getCoreRowModel(),
- onPaginationChange: setPagination,
- },
- dataTableOptions: {
- viewPagination: true,
- },
- });
+ // const { tableComponent, tableInstance: table } = useDataTable({
+ // query,
+ // tableOptions: {
+ // columns,
+ // state: {
+ // pagination,
+ // },
+ // manualPagination: true,
+ // getCoreRowModel: getCoreRowModel(),
+ // onPaginationChange: setPagination,
+ // },
+ // dataTableOptions: {
+ // viewPagination: true,
+ // },
+ // });
const handlePresetDateRange = (value: string) => {
let presetDateRange: DateRange;
@@ -139,54 +137,30 @@ function UserStatisticsPage() {
const handleSubmit = (e: React.FormEvent) => {
e.preventDefault();
- setPagination({
- ...pagination,
- pageIndex: 0,
- });
-
- // 검색 조건에 따라 검색 파라미터 설정
- const params: AccessLogParams = {
- sort: "accessTime,desc",
- accessDateStart: dateRange.from
+ const params: ConnectionStatisticsParams = {
+ keywordType,
+ keyword,
+ siteId,
+ cntnDtStart: dateRange.from
? dayjs(dateRange.from).format("YYYY-MM-DD")
: "",
- accessDateEnd: dateRange.to
- ? dayjs(dateRange.to).format("YYYY-MM-DD")
- : "",
+ cntnDtEnd: dateRange.to ? dayjs(dateRange.to).format("YYYY-MM-DD") : "",
};
-
- // 검색어 타입에 따라 파라미터 설정
- switch (keywordType) {
- case "urlPath":
- params.urlPath = keyword;
- break;
- case "ip":
- params.accessIp = keyword;
- break;
- case "region":
- params.accessRegion = keyword;
- break;
- case "browser":
- params.browser = keyword;
- break;
- }
-
setSearchParams(params);
};
const handleReset = () => {
setKeywordType("");
setKeyword("");
+ setSiteId("");
setDateRange(defaultDateRange);
setPresetDateRange("1W");
setSearchParams({
- urlPath: "",
- accessIp: "",
- accessRegion: "",
- browser: "",
- accessDateStart: dayjs().subtract(7, "day").format("YYYY-MM-DD"),
- accessDateEnd: dayjs().format("YYYY-MM-DD"),
- sort: "accessTime,desc",
+ keywordType: "",
+ keyword: "",
+ siteId: "",
+ cntnDtStart: dayjs(defaultDateRange.from).format("YYYY-MM-DD"),
+ cntnDtEnd: dayjs(defaultDateRange.to).format("YYYY-MM-DD"),
});
};
@@ -210,7 +184,11 @@ function UserStatisticsPage() {
setDateRange={handleDateRangeChange}
/>
-
+ setSiteId(value)}
+ />
- {/* 차트 영역 */}
- {/* 일별 접속 현황 */}
-
일별 접속 현황
+ 일별 접속 현황
- }
- options={chartData.monthlyStatisticsOptions}
- />
+ {query.data?.dayList.length ? (
+
+ ) : (
+
+ )}
- {/* 사이트별 접속자 */}
-
사이트별 접속자
+ 사이트별 접속자
-
+ {query.data?.siteList.length ? (
+
+ ) : (
+
+ )}
- {/* 브라우저별 접속자 */}
-
브라우저별 접속자
+ 브라우저별 접속자
-
+ {query.data?.browserList.length ? (
+
+ ) : (
+
+ )}
@@ -295,7 +272,7 @@ function UserStatisticsPage() {
접속 로그 상세
-
+ */}
- {tableComponent}
+ {/* {tableComponent}
*/}
);
diff --git a/apps/cs/src/shared/config/api.ts b/apps/cs/src/shared/config/api.ts
index 6db62f1a0..ce6f61381 100644
--- a/apps/cs/src/shared/config/api.ts
+++ b/apps/cs/src/shared/config/api.ts
@@ -55,6 +55,7 @@ export const ENDPOINT = {
MANAGER_IP: "/cms-service/api/v1/mgrip",
APILOG: "/cms-service/api/v1/api-logs",
SITE_AUTHORITY: "/cms-service/api/v1/site-authrt",
+ CONNECTION_LOG: "/cms-service/api/v1/cntnlog",
},
BOARD_SERVICE: {
BBS: "/board-service/api/v1/bbs",
From 1bec6a378798c76611857375fc9c42740495f3c1 Mon Sep 17 00:00:00 2001
From: Your Name
Date: Tue, 29 Jul 2025 14:29:37 +0900
Subject: [PATCH 39/75] =?UTF-8?q?=EA=B2=B0=ED=95=A8=EC=88=98=EC=A0=95,=20?=
=?UTF-8?q?=EB=82=A0=EC=A7=9C2024=EC=B4=88=EA=B8=B0=ED=99=94,=20=EC=B4=9D?=
=?UTF-8?q?=EC=9D=B8=EC=84=A4=EB=B9=84=20tp=20=ED=82=A4=EA=B0=92=EC=88=98?=
=?UTF-8?q?=EC=A0=95=EC=A0=95?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../app/pages/dashboard/facilityInfo/page.tsx | 75 ++++++++--------
.../fo/app/pages/dashboard/maingraph/page.tsx | 3 +
apps/fo/app/pages/dashboard/page.tsx | 5 +-
.../app/pages/facilityPrecipitation/page.tsx | 14 +--
apps/fo/app/pages/facilityWaterQlty/page.tsx | 14 +--
apps/fo/app/pages/flowRate/page.tsx | 14 +--
apps/fo/app/pages/planSewage/page.tsx | 14 +--
apps/fo/app/pages/processArea/page.tsx | 14 +--
apps/fo/app/pages/processFacility/page.tsx | 5 +-
apps/fo/app/pages/rdi/page.tsx | 16 ++--
apps/fo/app/pages/sewageOccur/page.tsx | 14 +--
apps/fo/app/pages/underWaterInput/page.tsx | 12 +--
apps/fo/app/store/dashboard/index.tsx | 90 ++++++++++++++-----
.../app/store/facilityPrecipitation/index.tsx | 16 +++-
apps/fo/app/store/facilityWaterQlty/index.tsx | 15 +++-
apps/fo/app/store/flowRate/index.tsx | 15 +++-
apps/fo/app/store/planSewage/index.tsx | 15 +++-
apps/fo/app/store/processArea/index.tsx | 49 ++++++----
apps/fo/app/store/processFacility/index.tsx | 21 ++++-
apps/fo/app/store/rdi/index.tsx | 16 +++-
apps/fo/app/store/sewageOccur/index.tsx | 16 +++-
apps/fo/app/store/underWaterInput/index.tsx | 18 +++-
22 files changed, 327 insertions(+), 144 deletions(-)
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)=>{
From e1fc6f210f3ed854e6457be397bc9d602cb320e6 Mon Sep 17 00:00:00 2001
From: jsyang
Date: Tue, 29 Jul 2025 01:43:54 -0400
Subject: [PATCH 40/75] =?UTF-8?q?=EC=82=BC=ED=95=AD=EC=97=B0=EC=82=B0?=
=?UTF-8?q?=EC=9E=90=20=EC=88=98=EC=A0=95?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
apps/fo/app/store/processArea/index.tsx | 54 ++++++++++++-------------
1 file changed, 27 insertions(+), 27 deletions(-)
diff --git a/apps/fo/app/store/processArea/index.tsx b/apps/fo/app/store/processArea/index.tsx
index 406c43f05..a737d153c 100644
--- a/apps/fo/app/store/processArea/index.tsx
+++ b/apps/fo/app/store/processArea/index.tsx
@@ -436,51 +436,51 @@ export const processAreaReducer:(set:SetStateFunction)=>ProcessAreaActions=(set:
set((state: ProcessAreaType) => {
const rtnData = state.ProcessArea.processAreaList.find((item: ProcessAreaProps) => item.swtrmtFcltCd === swtrmtFcltCd);
if (rtnData) {
- upHeadListFcltyImproveInfo.forEach((head:TableUpperProps) => {
- if(head.id === 'planSwageQntSum' || head.id === 'swtrmtPpltnCnt' || head.id === 'swtrmtZoneArea') {
- rtnData.yr?head.title = '현재\n(' + rtnData.yr + '년)':head.title = '현재';
- } else if(head.id === 'planSwageQntSumDc1' || head.id === 'swtrmtPpltnCntDc1' || head.id === 'swtrmtZoneAreaDc1') {
- rtnData.yrDc1?head.title = '1단계\n(' + rtnData.yrDc1 + '년)':head.title = '1단계';
- } else if(head.id === 'planSwageQntSumDc2' || head.id === 'swtrmtPpltnCntDc2' || head.id === 'swtrmtZoneAreaDc2') {
- rtnData.yrDc2?head.title = '2단계\n(' + rtnData.yrDc2 + '년)':head.title = '2단계';
- } else if(head.id === 'planSwageQntSumDc3' || head.id === 'swtrmtPpltnCntDc3' || head.id === 'swtrmtZoneAreaDc3') {
- rtnData.yrDc3?head.title = '3단계\n(' + rtnData.yrDc3 + '년)':head.title = '3단계';
- } else if(head.id === 'planSwageQntSumDc4' || head.id === 'swtrmtPpltnCntDc4' || head.id === 'swtrmtZoneAreaDc4') {
- rtnData.yrDc4?head.title = '4단계\n(' + rtnData.yrDc4 + '년)':head.title = '4단계';
- } else if(head.id === 'planSwageQntSumDt4' || head.id === 'swtrmtPpltnCntDt4' || head.id === 'swtrmtZoneAreaDt4') {
- rtnData.yrDt4?head.title = '기승인\n4단계(' + rtnData.yrDt4 + '년)':head.title = '기승인\n4단계';
- }
- });
+ upHeadListFcltyImproveInfo.forEach((head:TableUpperProps) => {
+ if(head.id === 'planSwageQntSum' || head.id === 'swtrmtPpltnCnt' || head.id === 'swtrmtZoneArea') {
+ head.title = rtnData.yr? '현재\n(' + rtnData.yr + '년)':head.title = '현재';
+ } else if(head.id === 'planSwageQntSumDc1' || head.id === 'swtrmtPpltnCntDc1' || head.id === 'swtrmtZoneAreaDc1') {
+ head.title = rtnData.yrDc1? '1단계\n(' + rtnData.yrDc1 + '년)':head.title = '1단계';
+ } else if(head.id === 'planSwageQntSumDc2' || head.id === 'swtrmtPpltnCntDc2' || head.id === 'swtrmtZoneAreaDc2') {
+ head.title = rtnData.yrDc2? '2단계\n(' + rtnData.yrDc2 + '년)':head.title = '2단계';
+ } else if(head.id === 'planSwageQntSumDc3' || head.id === 'swtrmtPpltnCntDc3' || head.id === 'swtrmtZoneAreaDc3') {
+ head.title = rtnData.yrDc3? '3단계\n(' + rtnData.yrDc3 + '년)':head.title = '3단계';
+ } else if(head.id === 'planSwageQntSumDc4' || head.id === 'swtrmtPpltnCntDc4' || head.id === 'swtrmtZoneAreaDc4') {
+ head.title = rtnData.yrDc4? '4단계\n(' + rtnData.yrDc4 + '년)':head.title = '4단계';
+ } else if(head.id === 'planSwageQntSumDt4' || head.id === 'swtrmtPpltnCntDt4' || head.id === 'swtrmtZoneAreaDt4') {
+ head.title = rtnData.yrDt4? '기승인\n4단계(' + rtnData.yrDt4 + '년)':head.title = '기승인\n4단계';
+ }
+ });
upHeadListProcessAreaPlan.forEach((head:TableUpperProps) => {
if(head.id === 'planSwageQntSum' || head.id === 'swtrmtPpltnCnt' || head.id === 'swtrmtZoneArea') {
- rtnData.yr?head.title = '현재\n(' + rtnData.yr + '년)':head.title = '현재';
+ head.title = rtnData.yr? '현재\n(' + rtnData.yr + '년)':head.title = '현재';
} else if(head.id === 'planSwageQntSumDc1' || head.id === 'swtrmtPpltnCntDc1' || head.id === 'swtrmtZoneAreaDc1') {
- rtnData.yrDc1?head.title = '1단계\n(' + rtnData.yrDc1 + '년)':head.title = '1단계';
+ head.title = rtnData.yrDc1?'1단계\n(' + rtnData.yrDc1 + '년)':head.title = '1단계';
} else if(head.id === 'planSwageQntSumDc2' || head.id === 'swtrmtPpltnCntDc2' || head.id === 'swtrmtZoneAreaDc2') {
- rtnData.yrDc2?head.title = '2단계\n(' + rtnData.yrDc2 + '년)':head.title = '2단계';
+ head.title = rtnData.yrDc2?'2단계\n(' + rtnData.yrDc2 + '년)':head.title = '2단계';
} else if(head.id === 'planSwageQntSumDc3' || head.id === 'swtrmtPpltnCntDc3' || head.id === 'swtrmtZoneAreaDc3') {
- rtnData.yrDc3?head.title = '3단계\n(' + rtnData.yrDc3 + '년)':head.title = '3단계';
+ head.title = rtnData.yrDc3? '3단계\n(' + rtnData.yrDc3 + '년)':head.title = '3단계';
} else if(head.id === 'planSwageQntSumDc4' || head.id === 'swtrmtPpltnCntDc4' || head.id === 'swtrmtZoneAreaDc4') {
- rtnData.yrDc4?head.title = '4단계\n(' + rtnData.yrDc4 + '년)':head.title = '4단계';
+ head.title = rtnData.yrDc4?'4단계\n(' + rtnData.yrDc4 + '년)':head.title = '4단계';
} else if(head.id === 'planSwageQntSumDt4' || head.id === 'swtrmtPpltnCntDt4' || head.id === 'swtrmtZoneAreaDt4') {
- rtnData.yrDt4?head.title = '기승인\n4단계(' + rtnData.yrDt4 + '년)':head.title = '기승인\n4단계';
+ head.title = rtnData.yrDt4?'기승인\n4단계(' + rtnData.yrDt4 + '년)':head.title = '기승인\n4단계';
}
});
upHeadListProcessPopulation.forEach((head:TableUpperProps) => {
if(head.id === 'planSwageQntSum' || head.id === 'swtrmtPpltnCnt' || head.id === 'swtrmtZoneArea') {
- rtnData.yr?head.title = '현재\n(' + rtnData.yr + '년)':head.title = '현재';
+ head.title = rtnData.yr?'현재\n(' + rtnData.yr + '년)':head.title = '현재';
} else if(head.id === 'planSwageQntSumDc1' || head.id === 'swtrmtPpltnCntDc1' || head.id === 'swtrmtZoneAreaDc1') {
- rtnData.yrDc1?head.title = '1단계\n(' + rtnData.yrDc1 + '년)':head.title = '1단계';
+ head.title = rtnData.yrDc1?'1단계\n(' + rtnData.yrDc1 + '년)':head.title = '1단계';
} else if(head.id === 'planSwageQntSumDc2' || head.id === 'swtrmtPpltnCntDc2' || head.id === 'swtrmtZoneAreaDc2') {
- rtnData.yrDc2?head.title = '2단계\n(' + rtnData.yrDc2 + '년)':head.title = '2단계';
+ head.title = rtnData.yrDc2?'2단계\n(' + rtnData.yrDc2 + '년)':head.title = '2단계';
} else if(head.id === 'planSwageQntSumDc3' || head.id === 'swtrmtPpltnCntDc3' || head.id === 'swtrmtZoneAreaDc3') {
- rtnData.yrDc3?head.title = '3단계\n(' + rtnData.yrDc3 + '년)':head.title = '3단계';
+ head.title = rtnData.yrDc3?'3단계\n(' + rtnData.yrDc3 + '년)':head.title = '3단계';
} else if(head.id === 'planSwageQntSumDc4' || head.id === 'swtrmtPpltnCntDc4' || head.id === 'swtrmtZoneAreaDc4') {
- rtnData.yrDc4?head.title = '4단계\n(' + rtnData.yrDc4 + '년)':head.title = '4단계';
+ head.title = rtnData.yrDc4?'4단계\n(' + rtnData.yrDc4 + '년)':head.title = '4단계';
} else if(head.id === 'planSwageQntSumDt4' || head.id === 'swtrmtPpltnCntDt4' || head.id === 'swtrmtZoneAreaDt4') {
- rtnData.yrDt4?head.title = '기승인\n4단계(' + rtnData.yrDt4 + '년)':head.title = '기승인\n4단계';
+ head.title = rtnData.yrDt4?'기승인\n4단계(' + rtnData.yrDt4 + '년)':head.title = '기승인\n4단계';
}
});
From c222e809b68e0eabc386ed573199ba5e4313c959 Mon Sep 17 00:00:00 2001
From: bicochan
Date: Tue, 29 Jul 2025 15:44:47 +0900
Subject: [PATCH 41/75] =?UTF-8?q?[apps/cs]=20feat:=20=EC=A0=91=EC=86=8D?=
=?UTF-8?q?=EC=9E=90=20=ED=86=B5=EA=B3=84=20>=20=EC=A0=91=EC=86=8D=20?=
=?UTF-8?q?=EB=A1=9C=EA=B7=B8=20=EC=83=81=EC=84=B8=20=ED=85=8C=EC=9D=B4?=
=?UTF-8?q?=EB=B8=94=20=EC=9E=91=EC=97=85?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../api/connection-log-service.ts | 33 ++++++++++
.../api/user-statistics-service.ts | 21 ------
.../pages/user-statistics/model/chart-data.ts | 2 +-
...terface.ts => connection-log-interface.ts} | 34 +++++++++-
.../user-statistics/model/table-columns.ts | 65 ++++++++++---------
.../ui/user-statistics-page.tsx | 63 ++++++++++--------
6 files changed, 139 insertions(+), 79 deletions(-)
create mode 100644 apps/cs/src/pages/user-statistics/api/connection-log-service.ts
delete mode 100644 apps/cs/src/pages/user-statistics/api/user-statistics-service.ts
rename apps/cs/src/pages/user-statistics/model/{user-statistics-interface.ts => connection-log-interface.ts} (50%)
diff --git a/apps/cs/src/pages/user-statistics/api/connection-log-service.ts b/apps/cs/src/pages/user-statistics/api/connection-log-service.ts
new file mode 100644
index 000000000..0e2daeb5b
--- /dev/null
+++ b/apps/cs/src/pages/user-statistics/api/connection-log-service.ts
@@ -0,0 +1,33 @@
+import { client } from "@/shared/api";
+import { ENDPOINT } from "@/shared/config";
+import {
+ type ConnectionLogParams,
+ type ConnectionLogList,
+ type ConnectionStatisticsParams,
+ type ConnectionStatistics,
+ type ConnectionLogService,
+} from "../model/connection-log-interface";
+
+class ConnectionLogApiService implements ConnectionLogService {
+ async getConnectionLog(
+ params: ConnectionLogParams,
+ ): Promise {
+ const response = await client.get(
+ `${ENDPOINT.CMS_SERVICE.CONNECTION_LOG}`,
+ { params },
+ );
+ return response.data;
+ }
+
+ async getConnectionStatistics(
+ params: ConnectionStatisticsParams,
+ ): Promise {
+ const response = await client.get(
+ `${ENDPOINT.CMS_SERVICE.CONNECTION_LOG}/stat`,
+ { params },
+ );
+ return response.data;
+ }
+}
+
+export const ConnectionLogApi = new ConnectionLogApiService();
diff --git a/apps/cs/src/pages/user-statistics/api/user-statistics-service.ts b/apps/cs/src/pages/user-statistics/api/user-statistics-service.ts
deleted file mode 100644
index d0522267b..000000000
--- a/apps/cs/src/pages/user-statistics/api/user-statistics-service.ts
+++ /dev/null
@@ -1,21 +0,0 @@
-import { client } from "@/shared/api";
-import {
- type UserStatisticsService,
- type ConnectionStatisticsParams,
- type ConnectionStatistics,
-} from "../model/user-statistics-interface";
-import { ENDPOINT } from "@/shared/config";
-
-class UserStatisticsApiService implements UserStatisticsService {
- async getConnectionStatistics(
- params: ConnectionStatisticsParams,
- ): Promise {
- const response = await client.get(
- `${ENDPOINT.CMS_SERVICE.CONNECTION_LOG}/stat`,
- { params },
- );
- return response.data;
- }
-}
-
-export const UserStatisticsApi = new UserStatisticsApiService();
diff --git a/apps/cs/src/pages/user-statistics/model/chart-data.ts b/apps/cs/src/pages/user-statistics/model/chart-data.ts
index 8c4241cfd..455dcac56 100644
--- a/apps/cs/src/pages/user-statistics/model/chart-data.ts
+++ b/apps/cs/src/pages/user-statistics/model/chart-data.ts
@@ -1,6 +1,6 @@
import type { ChartData, ChartOptions } from "chart.js";
import { getCssVariableValue } from "@common/components";
-import type { ConnectionStatistics } from "./user-statistics-interface";
+import type { ConnectionStatistics } from "./connection-log-interface";
export const chartData = {
day: (
diff --git a/apps/cs/src/pages/user-statistics/model/user-statistics-interface.ts b/apps/cs/src/pages/user-statistics/model/connection-log-interface.ts
similarity index 50%
rename from apps/cs/src/pages/user-statistics/model/user-statistics-interface.ts
rename to apps/cs/src/pages/user-statistics/model/connection-log-interface.ts
index 42d247185..6fbf4dc15 100644
--- a/apps/cs/src/pages/user-statistics/model/user-statistics-interface.ts
+++ b/apps/cs/src/pages/user-statistics/model/connection-log-interface.ts
@@ -1,3 +1,32 @@
+import type { PageableList, PageableParams } from "@/shared/model";
+
+export interface ConnectionLogParams extends PageableParams {
+ keywordType?: string;
+ keyword?: string;
+ siteId?: string;
+ cntnIp?: string;
+ cntnRgn?: string;
+ wbsrKnd?: string;
+ urlPath?: string;
+ cntnDtStart?: string;
+ cntnDtEnd?: string;
+}
+
+export interface ConnectionLog {
+ cntnSn: number;
+ cntnDt: string;
+ cntnId: string;
+ cntnIp: string;
+ cntnRgn: string;
+ wbsrKnd: string;
+ menuCd: number;
+ siteId: string;
+ urlPath: string;
+ siteNm: string;
+ menuNm: string;
+ wbsrKndNm: string;
+}
+
export interface ConnectionStatisticsParams {
keywordType?: string;
keyword?: string;
@@ -33,7 +62,10 @@ export interface ConnectionStatistics {
browserList: BrowserConnectionStatistics[];
}
-export interface UserStatisticsService {
+export type ConnectionLogList = PageableList;
+
+export interface ConnectionLogService {
+ getConnectionLog(params: ConnectionLogParams): Promise;
getConnectionStatistics(
params: ConnectionStatisticsParams,
): Promise;
diff --git a/apps/cs/src/pages/user-statistics/model/table-columns.ts b/apps/cs/src/pages/user-statistics/model/table-columns.ts
index c0d53380e..09fe58adf 100644
--- a/apps/cs/src/pages/user-statistics/model/table-columns.ts
+++ b/apps/cs/src/pages/user-statistics/model/table-columns.ts
@@ -1,39 +1,46 @@
-import { createColumnHelper } from "@tanstack/react-table";
-import { type AccessLog } from "./user-statistics-interface";
+import type { ColumnDef } from "@tanstack/react-table";
+import type { ConnectionLog } from "./connection-log-interface";
+import dayjs from "dayjs";
-const columnHelper = createColumnHelper();
-
-export const columns = [
- columnHelper.accessor("no", {
+export const columns: ColumnDef[] = [
+ {
header: "No",
- cell: (info) => info.getValue(),
- }),
- columnHelper.accessor("accessTime", {
+ cell: ({ row, table }) => {
+ const totalRows = table.getRowCount();
+ const currentPage = table.getState().pagination.pageIndex;
+ const pageSize = table.getState().pagination.pageSize;
+ return totalRows - (currentPage * pageSize + row.index);
+ },
+ },
+ {
+ accessorKey: "cntnDt",
header: "접속일시",
- cell: (info) => info.getValue(),
- }),
- columnHelper.accessor("accessIp", {
+ cell: ({ row }) => {
+ return dayjs(row.original.cntnDt).format("YYYY-MM-DD HH:mm:ss");
+ },
+ },
+ {
+ accessorKey: "cntnIp",
header: "접속IP",
- cell: (info) => info.getValue(),
- }),
- columnHelper.accessor("accessRegion", {
+ },
+ {
+ accessorKey: "cntnRgn",
header: "접속지역",
- cell: (info) => info.getValue(),
- }),
- columnHelper.accessor("urlPath", {
+ },
+ {
+ accessorKey: "urlPath",
header: "URL경로",
- cell: (info) => info.getValue(),
- }),
- columnHelper.accessor("browser", {
+ },
+ {
+ accessorKey: "wbsrKndNm",
header: "브라우저",
- cell: (info) => info.getValue(),
- }),
- columnHelper.accessor("site", {
+ },
+ {
+ accessorKey: "siteNm",
header: "사이트",
- cell: (info) => info.getValue(),
- }),
- columnHelper.accessor("accessType", {
+ },
+ {
+ accessorKey: "menuNm",
header: "메뉴명",
- cell: (info) => info.getValue(),
- }),
+ },
];
diff --git a/apps/cs/src/pages/user-statistics/ui/user-statistics-page.tsx b/apps/cs/src/pages/user-statistics/ui/user-statistics-page.tsx
index 4fe1d3fc0..801ca5eb0 100644
--- a/apps/cs/src/pages/user-statistics/ui/user-statistics-page.tsx
+++ b/apps/cs/src/pages/user-statistics/ui/user-statistics-page.tsx
@@ -32,10 +32,10 @@ import { useDataTable } from "@/shared/lib";
import { ENDPOINT } from "@/shared/config";
import { NoData } from "@/shared/ui/no-data";
import { InputDateRangePicker } from "@/shared/ui/input-date-range-picker";
-import { UserStatisticsApi } from "../api/user-statistics-service";
+import { ConnectionLogApi } from "../api/connection-log-service";
import { chartData } from "../model/chart-data";
import { columns } from "../model/table-columns";
-import { type ConnectionStatisticsParams } from "../model/user-statistics-interface";
+import type { ConnectionStatisticsParams } from "../model/connection-log-interface";
ChartJS.register(
CategoryScale,
@@ -80,27 +80,36 @@ function UserStatisticsPage() {
const query = useQuery({
queryKey: [ENDPOINT.CMS_SERVICE.CONNECTION_LOG, searchParams],
queryFn: () =>
- UserStatisticsApi.getConnectionStatistics({
+ ConnectionLogApi.getConnectionLog({
...searchParams,
}),
placeholderData: keepPreviousData,
});
- // const { tableComponent, tableInstance: table } = useDataTable({
- // query,
- // tableOptions: {
- // columns,
- // state: {
- // pagination,
- // },
- // manualPagination: true,
- // getCoreRowModel: getCoreRowModel(),
- // onPaginationChange: setPagination,
- // },
- // dataTableOptions: {
- // viewPagination: true,
- // },
- // });
+ const { data: connectionStatisticsData } = useQuery({
+ queryKey: [ENDPOINT.CMS_SERVICE.CONNECTION_LOG, searchParams],
+ queryFn: () =>
+ ConnectionLogApi.getConnectionStatistics({
+ ...searchParams,
+ }),
+ placeholderData: keepPreviousData,
+ });
+
+ const { tableComponent, tableInstance: table } = useDataTable({
+ query,
+ tableOptions: {
+ columns,
+ state: {
+ pagination,
+ },
+ manualPagination: true,
+ getCoreRowModel: getCoreRowModel(),
+ onPaginationChange: setPagination,
+ },
+ dataTableOptions: {
+ viewPagination: true,
+ },
+ });
const handlePresetDateRange = (value: string) => {
let presetDateRange: DateRange;
@@ -229,8 +238,8 @@ function UserStatisticsPage() {
일별 접속 현황
- {query.data?.dayList.length ? (
-
+ {connectionStatisticsData?.dayList?.length ? (
+
) : (
)}
@@ -243,8 +252,8 @@ function UserStatisticsPage() {
사이트별 접속자
- {query.data?.siteList.length ? (
-
+ {connectionStatisticsData?.siteList?.length ? (
+
) : (
)}
@@ -256,8 +265,8 @@ function UserStatisticsPage() {
브라우저별 접속자
- {query.data?.browserList.length ? (
-
+ {connectionStatisticsData?.browserList?.length ? (
+
) : (
)}
@@ -272,7 +281,7 @@ function UserStatisticsPage() {
접속 로그 상세
- {/* */}
+
- {/*
{tableComponent}
*/}
+
{tableComponent}
);
From aaed8fe971d0ccf31cb0b07f96bb51af4c125a1f Mon Sep 17 00:00:00 2001
From: leedj312
Date: Tue, 29 Jul 2025 15:51:18 +0900
Subject: [PATCH 42/75] =?UTF-8?q?=EC=9E=AC=EC=9D=B4=EC=9A=A9=20=EC=8B=9C?=
=?UTF-8?q?=EC=84=A4=20=EC=8B=A4=EC=A0=81=20=EB=93=B1=EB=A1=9D=20=EB=AA=A9?=
=?UTF-8?q?=EB=A1=9D=20=ED=85=8C=EC=9D=B4=EB=B8=94=20=EC=88=98=EC=A0=95?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../app/ruseFcltMng/fcltReg/pbnstReg/page.tsx | 10 +-
.../ruseFcltMng/fcltSttn/pbnstSttn/page.tsx | 39 ++--
.../prfmncReg/pbnstPrfmncReg/page.tsx | 62 +++---
.../store/prfmncReg/pbnstPrfmncReg/index.tsx | 189 +++++++++++++-----
.../fcltReg/pbnstReg/buseReg/bugRegForm.tsx | 10 -
5 files changed, 186 insertions(+), 124 deletions(-)
diff --git a/apps/wr/app/ruseFcltMng/fcltReg/pbnstReg/page.tsx b/apps/wr/app/ruseFcltMng/fcltReg/pbnstReg/page.tsx
index 934946b74..d08d6f06e 100644
--- a/apps/wr/app/ruseFcltMng/fcltReg/pbnstReg/page.tsx
+++ b/apps/wr/app/ruseFcltMng/fcltReg/pbnstReg/page.tsx
@@ -71,7 +71,7 @@ export default function PublicReuseFaciltyInsert() {
// defaultValues: { items: pbnstRegArrayZod.parse([]) },
mode: "onChange",
});
- const { isDirty } = form.formState;
+ // const { isDirty } = form.formState;
const {
fields: items,
@@ -90,10 +90,10 @@ export default function PublicReuseFaciltyInsert() {
}, [pbnst.isInit, pubHasuInit]);
const onSubmit = async (valuse: { items: PbnstRegArrrayType }) => {
- if (!isDirty) {
- toast.error("변경사항이 없습니다."); // 변경사항이 없으면 메시지 표시
- return;
- }
+ // if (!isDirty) {
+ // toast.error("변경사항이 없습니다."); // 변경사항이 없으면 메시지 표시
+ // return;
+ // }
const data = writeRgtrAndMdfr(valuse.items);
let bizs = [] as fcBizType[];
data.forEach((fclt) => {
diff --git a/apps/wr/app/ruseFcltMng/fcltSttn/pbnstSttn/page.tsx b/apps/wr/app/ruseFcltMng/fcltSttn/pbnstSttn/page.tsx
index 5208edc02..8aea16c00 100644
--- a/apps/wr/app/ruseFcltMng/fcltSttn/pbnstSttn/page.tsx
+++ b/apps/wr/app/ruseFcltMng/fcltSttn/pbnstSttn/page.tsx
@@ -1,6 +1,7 @@
"use client";
import { useWrStore } from "@/app/store";
import { btnClass } from "@/app/store/common/code";
+import { prfRegPageSize } from "@/app/store/prfmncReg/pbnstPrfmncReg";
import type { customPbnst } from "@/app/store/ruseFcltMng/fcltReg/pbnstReg/type";
import type { WaterReuseFacility } from "@/app/store/ruseFcltMng/fcltSttn/pbnstSttn/type";
import { excelDownload, yearOptions } from "@/components/lib/func/commom";
@@ -35,7 +36,6 @@ export default function PbnstSttn() {
const { pbnstSttnRes, fclts, pbnstSttnResCount } = pbnstSttn;
const [isReset, setIsReset] = useState(false);
- //const [tableIndex, setTableIndex] = useState(1)
const ref = useRef({} as ReturnType);
const [searchYear, setSearchYear] = useState(
String(new Date().getFullYear())
@@ -70,6 +70,24 @@ export default function PbnstSttn() {
},
[getPbnStnDetail, pbnstSttnRes]
);
+ useEffect(() => {
+ if (!pbnstSttn.isInit) {
+ getFlcts();
+ }
+ }, [pbnstSttn.isInit]);
+ useEffect(() => {
+
+ pbnSttnInit("1", "15", ref.current, searchYear, fclts);
+ }, [fclts]);
+
+ useEffect(() => {
+ if (pbnstSttnRes && pbnstSttnRes.length > 0) {
+ setBdstTable(pbnstSttnRes);
+ } else {
+ setBdstTable([]);
+ }
+ }, [pbnstSttnRes]);
+
useEffect(() => {
if (pbnstSttn.excelList.length >= 0) {
@@ -82,24 +100,7 @@ export default function PbnstSttn() {
);
}
}, [pbnstSttn.excelList]);
- useEffect(() => {
- if (!pbnstSttn.isInit) {
- getFlcts();
- }
- }, [pbnstSttn.isInit]);
- useEffect(() => {
- if (pbnstSttnRes && pbnstSttnRes.length > 0) {
- setBdstTable(pbnstSttnRes);
- } else {
- setBdstTable([]);
- }
- }, [pbnstSttnRes]);
-
- useEffect(() => {
-
- pbnSttnInit("1", "15", ref.current, searchYear, fclts);
- }, [fclts]);
useEffect(() => {
if (pbnstSttn.pbnstDetail.pbnstRuseFcltId)
@@ -193,7 +194,7 @@ export default function PbnstSttn() {
pbnstSttnSearch(
false,
String(page),
- String(15),
+ String(prfRegPageSize),
ref.current,
pbnRuseNm,
searchYear,
diff --git a/apps/wr/app/ruseFcltMng/prfmncReg/pbnstPrfmncReg/page.tsx b/apps/wr/app/ruseFcltMng/prfmncReg/pbnstPrfmncReg/page.tsx
index fbab00284..4fd866d75 100644
--- a/apps/wr/app/ruseFcltMng/prfmncReg/pbnstPrfmncReg/page.tsx
+++ b/apps/wr/app/ruseFcltMng/prfmncReg/pbnstPrfmncReg/page.tsx
@@ -38,11 +38,12 @@ import { useTranslation } from "react-i18next";
import { headMakeprfmnc } from "../chkgdnReg/TableHead";
export default function PrfmncPrfmncReg() {
- const { auth, prfmnc, prfmncHasuInit, prfmnRegData, prfmncHasuNmSearch } = useWrStore(
+ const { auth, prfmnc, prfmncHasuInit, prfmnRegData, prfmncHasuNmSearch,getPrfFmcRes } = useWrStore(
(state) => state
);
- const { pbnstPrfmncHeadList, monthHeadList, prfmncRes, prfmncResCount } = prfmnc;
+ const { prfPbnFclts, pbnstPrfmncHeadList, monthHeadList, prfmncRes, prfmncResCount } = prfmnc;
const { regAuthrtYn, mdfcnAuthrtYn } = auth;
+ const [isReset, setIsReset] = useState(false);
const [bdstTable, setbdstTable] = useState();
const [searchTxt, setSearchTxt] = useState();
const [isExcelOpen, setIsExcelOPen] = useState<{
@@ -51,7 +52,6 @@ export default function PrfmncPrfmncReg() {
}>({ isModal: false, data: {} as FcPrfType });
const [inputData, setInputData] = useState();
const [pbnstRuseFcltId, setpbnstRuseFcltId] = useState();
- const [pageNation, setPageNation] = useState(1);
const [cellNum, setCellNum] = useState(1);
const [searchYear, setSearchYear] = useState(
String(new Date().getFullYear())
@@ -65,20 +65,6 @@ export default function PrfmncPrfmncReg() {
"A1:O1"
);
}, [prfmnc.excelList]);
- /*
- const onSave = useCallback(
- async() => {
- if (pbnstRuseFcltId) {
- await prfmnRegData(pageNation,'41',
- excelToPbnPrfData(
- inputData as unknown as JSON[],
- searchYear,
- pbnstRuseFcltId
- ) as unknown as PrfType
- );
- // cellClick(cellNum)
- }
- }, [inputData, searchYear, pbnstRuseFcltId, pageNation,cellNum]);*/
const { t } = useTranslation('base');
const onSave = useCallback(() => {
@@ -86,19 +72,20 @@ export default function PrfmncPrfmncReg() {
if (!pbnstRuseFcltId) return;
prfmnRegData(
- pageNation,
+ 1,
'41',
excelToPbnPrfData(
inputData as unknown as JSON[],
searchYear,
pbnstRuseFcltId
) as unknown as PrfType
- , searchYear
+ , searchYear,
+ prfPbnFclts
);
};
confirmToast(t('isUpdateMsg'), handleConfirm);
- }, [inputData, searchYear, pbnstRuseFcltId, pageNation, cellNum]);
+ }, [inputData, searchYear, pbnstRuseFcltId, cellNum,prfPbnFclts]);
const cellClick = useCallback(
(index: number | undefined) => {
@@ -194,10 +181,15 @@ export default function PrfmncPrfmncReg() {
useEffect(() => {
if (!prfmnc.isInit) {
- const year = new Date().getFullYear()
- prfmncHasuInit(1, '41', String(year));
+ getPrfFmcRes()
}
- }, [prfmnc.isInit, prfmncHasuInit]);
+ }, [prfmnc.isInit, getPrfFmcRes]);
+
+
+ useEffect(() =>{
+ const year = new Date().getFullYear()
+ prfmncHasuInit(1, '41',String(year) ,prfPbnFclts);
+ },[prfPbnFclts])
useEffect(() => {
@@ -254,14 +246,8 @@ export default function PrfmncPrfmncReg() {
@@ -314,10 +300,15 @@ export default function PrfmncPrfmncReg() {
setCellNum(index ?? 0);
}}
onPageChange={
- (page) => {
- prfmncHasuInit(page, '41', searchYear);
- setPageNation(page)
+ (page:number) => {
+ if (searchTxt && searchTxt?.length > 0) {
+ prfmncHasuNmSearch(page, '41', searchYear, searchTxt,prfPbnFclts)
+ } else {
+ prfmncHasuInit(page, '41', searchYear,prfPbnFclts)
+ }
+ setIsReset(false);
}}
+ resetPageNo={isReset}
/>
@@ -350,9 +341,10 @@ export default function PrfmncPrfmncReg() {
setIsExcelOPen({ ...isExcelOpen, isModal: open })
}}
setModalExcelData={async (excelData) => {
- await prfmnRegData(pageNation, '41',
+ await prfmnRegData(1, '41',
excelData,
searchYear
+ ,prfPbnFclts
);
// 데이터 저장 후 UI 업데이트는 useEffect가 감지하여 처리하므로 여기서는 호출하지 않습니다.
}
diff --git a/apps/wr/app/store/prfmncReg/pbnstPrfmncReg/index.tsx b/apps/wr/app/store/prfmncReg/pbnstPrfmncReg/index.tsx
index fbdd4fba6..6c2564655 100644
--- a/apps/wr/app/store/prfmncReg/pbnstPrfmncReg/index.tsx
+++ b/apps/wr/app/store/prfmncReg/pbnstPrfmncReg/index.tsx
@@ -7,16 +7,17 @@ import toast from "react-hot-toast";
const pbnstPrfmncHeadList = pbnstPrfmncHeadListExport;
const monthHeadList = monthHeadListExport;
-
+export const prfRegPageSize = 10;
export type pbnstPrfmncState = {
prfmnc: {
isInit: boolean;
pbnstPrfmncHeadList: TableUpperProps[];
monthHeadList: TableUpperProps[];
prfmncRes: FcPrfType[];
- prfmncResCount:number;
+ prfmncResCount: number;
excelList: number[];
- pageKey:number
+ pageKey: number;
+ prfPbnFclts: string[];
};
};
@@ -26,68 +27,126 @@ export const pbnstPrfmncStateExport: pbnstPrfmncState = {
pbnstPrfmncHeadList: pbnstPrfmncHeadList,
monthHeadList: monthHeadList,
prfmncRes: [],
- prfmncResCount:1,
+ prfPbnFclts: [],
+ prfmncResCount: 1,
excelList: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10],
- pageKey:1
+ pageKey: 1,
},
};
export type pbnstPrfmncType = pbnstPrfmncState & pbnstPrfmncActions;
type pbnstPrfmncActions = {
- prfmncHasuInit: (page: number, sggOrCity: string ,year:string) => void;
- prfmncHasuNmSearch: (page: number, sggOrCity: string , txt:string ,year:string) => void;
- prfmnRegData: (page:number,sggOrCity:string, data: PrfType,year:string) => void;
+ prfmncHasuInit: (
+ page: number,
+ sggOrCity: string,
+ year: string,
+ prfPbnFclts: string[]
+ ) => void;
+ prfmncHasuNmSearch: (
+ page: number,
+ sggOrCity: string,
+ year: string,
+ searchTxt: string,
+ prfPbnFclts: string[]
+ ) => void;
+ prfmnRegData: (
+ page: number,
+ sggOrCity: string,
+ data: PrfType,
+ year: string,
+ prfPbnFclts: string[]
+ ) => void;
+ getPrfFmcRes: () => void;
};
-const checkWrRegList = async (year:string) => {
- const url =`/reuseFc/pubDetailList`
- if(year&& year.length>0){
- // url+=`/${year}`
+const hasuListFetch = async (
+ page: number,
+ sggOrCity: string,
+ year: string,
+ prfPbnFclts: string[],
+ searchTxt?: string
+) => {
+ let filteredFclt = prfPbnFclts;
+ if (sggOrCity !== "0") {
+ filteredFclt = prfPbnFclts?.filter((fclt: string) => {
+ return sggOrCity.length == 2
+ ? fclt.slice(0, 2) === sggOrCity
+ : fclt.slice(0, 5) === sggOrCity;
+ });
}
- const wrRegList = await getFetch("wr", url);
- return wrRegList;
-};
-const hasuListFetch = async (page: number, sggOrCity: string , year:string,searchNm?:string ) => {
- const checkWrRegListRes = await checkWrRegList(year);
- const rainRes = await postFectch(
- `/prcsFclt/ruseInfo/${page ? page : 1}/10/A/${sggOrCity ? sggOrCity : "11"}/0/1/SW`,
- checkWrRegListRes?.fcltCds,
- fetchType.COMMON
+
+ let url = `/prcsFclt/ruseInfo/1/${filteredFclt.length + 1}/A/${sggOrCity}/0/1/SW`;
+ if (searchTxt && searchTxt?.length > 0) {
+ url += `/${searchTxt}`;
+ }
+ const rainRes = await postFectch(url, filteredFclt, fetchType.COMMON);
+
+ const checkRuseFcltList =
+ searchTxt && searchTxt?.length > 0
+ ? rainRes.data.map((item) => item.bscFctCd)
+ : filteredFclt;
+
+ const pubRuseList = await postFectch(
+ `/reuseFc/pubDetailList/${year}/${sggOrCity}/${page}/${prfRegPageSize}`,
+ checkRuseFcltList,
+ fetchType.WR
);
- let findData = rainRes.data.map((item: pubHasuType) => {
- const data = checkWrRegListRes?.fcPrfList.find(
- (fclt: FcPrfType) =>
- fclt.pbnstRuseFcltId.substring(0, 11) === item?.bscFctCd
- );
- if(data !==undefined){
- return( {
+ const rusePrfList = pubRuseList.data
+ .map((item: FcPrfType) => {
+ const findData = rainRes.data?.find(
+ (fclt: pubHasuType) =>
+ item.pbnstRuseFcltId.substring(0, 11) === fclt?.bscFctCd
+ );
+ if (findData !== undefined) {
+ return {
+ sido: findData.sido,
+ gugun: findData.gugun,
+ bscFctNm: findData.bscFctNm,
+ bscFctCd: findData.bscFctCd,
+ ruseUtztnFcltNm: item.ruseUtztnFcltNm,
+ pbnstRuseFcltId: item.pbnstRuseFcltId,
+ prfList: item.prfList,
+ };
+ }
+ })
+ .filter(Boolean); // undefined 값을 제거합니다.
- sido: item.sido,
- gugun: item.gugun,
- bscFctNm: item.bscFctNm,
- bscFctCd: item.bscFctCd,
- ruseUtztnFcltNm: data.ruseUtztnFcltNm,
- pbnstRuseFcltId: data.pbnstRuseFcltId,
- prfList: data.prfList,
- });
- }
- }).filter(Boolean); // undefined 값을 제거합니다.
-
- if(searchNm){
-
- findData= findData.filter((ruse:any) => ruse.ruseUtztnFcltNm.includes(searchNm))
- }
-
- return {data:findData, count:findData.length};
+ return { data: rusePrfList, count: pubRuseList.count };
};
export const pbnstPrfmncActionsExport: (set: any) => pbnstPrfmncActions = (
set: any
) => {
return {
- prfmncHasuInit: async (page: number, sggOrCity: string,year:string) => {
+ getPrfFmcRes: async () => {
try {
- const prfmncRes = await hasuListFetch(page, sggOrCity, year);
+ const pbnPrfRes = await getFetch(fetchType.WR, "/reuseFc/pubFc");
+ console.log("pbnPrfRes ", pbnPrfRes);
+ set((state: pbnstPrfmncState) => ({
+ ...state,
+ prfmnc: {
+ ...state.prfmnc,
+ prfPbnFclts: pbnPrfRes,
+ },
+ }));
+ } catch (error) {
+ console.log(error);
+ }
+ },
+ prfmncHasuInit: async (
+ page: number,
+ sggOrCity: string,
+ year: string,
+ prfPbnFclts: string[]
+ ) => {
+ try {
+ console.log("prfPbnFclts ", prfPbnFclts);
+ const prfmncRes = await hasuListFetch(
+ page,
+ sggOrCity,
+ year,
+ prfPbnFclts
+ );
return set((state: pbnstPrfmncState) => ({
...state,
prfmnc: {
@@ -101,9 +160,21 @@ export const pbnstPrfmncActionsExport: (set: any) => pbnstPrfmncActions = (
console.log(errorHasu);
}
},
- prfmncHasuNmSearch: async (page: number, sggOrCity: string,fcltNm:string ,year:string)=> {
+ prfmncHasuNmSearch: async (
+ page: number,
+ sggOrCity: string,
+ year: string,
+ searchTxt: string,
+ prfPbnFclts: string[]
+ ) => {
try {
- const prfmncRes = await hasuListFetch(page, sggOrCity,fcltNm ,year);
+ const prfmncRes = await hasuListFetch(
+ page,
+ sggOrCity,
+ year,
+ prfPbnFclts,
+ searchTxt
+ );
return set((state: pbnstPrfmncState) => ({
...state,
prfmnc: {
@@ -117,7 +188,13 @@ export const pbnstPrfmncActionsExport: (set: any) => pbnstPrfmncActions = (
console.log(errorHasu);
}
},
- prfmnRegData: async (page:number,sggOrCity:string,data: PrfType,year:string) => {
+ prfmnRegData: async (
+ page: number,
+ sggOrCity: string,
+ data: PrfType,
+ year: string,
+ prfPbnFclts: string[]
+ ) => {
try {
const ressponse = await postFectch(
"/reuseFc/pubFcPrf",
@@ -125,11 +202,14 @@ export const pbnstPrfmncActionsExport: (set: any) => pbnstPrfmncActions = (
fetchType.WR
);
-
if (ressponse.status === 200) {
toast.success("하수재이용 시설 실적 등록이 완료되었습니다.");
- const prfmncRes = await hasuListFetch(page, sggOrCity,year) ;
-
+ const prfmncRes = await hasuListFetch(
+ page,
+ sggOrCity,
+ year,
+ prfPbnFclts
+ );
return set((state: pbnstPrfmncState) => ({
...state,
@@ -138,10 +218,9 @@ export const pbnstPrfmncActionsExport: (set: any) => pbnstPrfmncActions = (
prfmncRes: prfmncRes.data,
prfmncResCount: prfmncRes.count,
isInit: false,
- pageKey: state.prfmnc.pageKey + 1
+ pageKey: state.prfmnc.pageKey + 1,
},
}));
-
}
} catch (e) {
console.log(e);
diff --git a/apps/wr/components/ui/form/fcltReg/pbnstReg/buseReg/bugRegForm.tsx b/apps/wr/components/ui/form/fcltReg/pbnstReg/buseReg/bugRegForm.tsx
index 2589422c8..0fb24366a 100644
--- a/apps/wr/components/ui/form/fcltReg/pbnstReg/buseReg/bugRegForm.tsx
+++ b/apps/wr/components/ui/form/fcltReg/pbnstReg/buseReg/bugRegForm.tsx
@@ -488,16 +488,6 @@ export function PbnstBuseForm({
/>
- {/* */}
Date: Tue, 29 Jul 2025 16:09:49 +0900
Subject: [PATCH 43/75] =?UTF-8?q?fix,=20feat:=20-=20I/I=20=EB=B6=84?=
=?UTF-8?q?=EC=84=9D=20=ED=99=94=EB=A9=B4=20CSS=20=EC=88=98=EC=A0=95=20(?=
=?UTF-8?q?=EA=B0=84=EA=B2=A9=20=ED=86=B5=EC=9D=BC=20-=20I/I=20=EB=B6=84?=
=?UTF-8?q?=EC=84=9D=20=ED=99=94=EB=A9=B4=20Enter=20=ED=81=B4=EB=A6=AD=20?=
=?UTF-8?q?=EC=9D=B4=EB=B2=A4=ED=8A=B8=20=EC=B6=94=EA=B0=80?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../app/(with-base-layout)/ii/BaseLayout.tsx | 57 +++++++++----
.../(with-base-layout)/ii/irsetting/page.tsx | 14 +++-
.../app/(with-base-layout)/ii/rdii/page.tsx | 25 ++++--
apps/sn/app/components/ui/fileUploadForm.tsx | 2 +-
.../ui/govSidoSigunguSearchForm.tsx | 83 ++++++++++++-------
5 files changed, 122 insertions(+), 59 deletions(-)
diff --git a/apps/sn/app/(with-base-layout)/ii/BaseLayout.tsx b/apps/sn/app/(with-base-layout)/ii/BaseLayout.tsx
index f0a649ad4..d825b34fa 100644
--- a/apps/sn/app/(with-base-layout)/ii/BaseLayout.tsx
+++ b/apps/sn/app/(with-base-layout)/ii/BaseLayout.tsx
@@ -218,7 +218,7 @@ const BaseLayout = ({
{showDatePicker && ( // showDatePicker 값에 따라 DatePicker 렌더링
<>
-
+
{ // aplcnYm이 없으면 현재 연월을 기본값으로 설정
@@ -232,10 +232,10 @@ const BaseLayout = ({
setAplcnYmFrom?.(value); // string 값을 직접 전달
}
}}
- selectClass="ml-5 w-[100px]"
+ selectClass="ml-8 w-[100px]"
startYear={1900} // 시작 연도 설정
/>
- ~
+ ~
{ // aplcnYm이 없으면 현재 연월을 기본값으로 설정
@@ -248,7 +248,7 @@ const BaseLayout = ({
setAplcnYmTo?.(value); // string 값을 직접 전달
}
}}
- selectClass="w-[100px]"
+ selectClass="w-[100px] mr-8"
startYear={1900} // 시작 연도 설정
/>
>
@@ -259,21 +259,40 @@ const BaseLayout = ({
setRtnEnvPartSidoValue={(val) => setCtpvCd?.(val)}
setRtnEnvPartSigunValue={setSigungu} // 선택된 시군구 값을 받을 콜백 함수 전달
>
- onSwageTreatmentPlantChange?.(val)} selectContentClass="z-[101]" />
+
+ onSwageTreatmentPlantChange?.(val)}
+ selectContentClass="z-[101]"
+ />
{/* onSwageProcessingZoneChange?.(val)} selectContentClass="z-[101]" /> */}
- {selectBox?.searchChk ? : null}
+ {selectBox?.searchChk && (
+
+
+
+ )}
{titleName.firstCardTitle}
- {graphBtn ? : null}
+ {graphBtn && (
+
+ )}
{/* 그래프 있을 시 */}
- {graphBtn ? : null}
+ {graphBtn && (
+
+ )}
{/* 분석 버튼 */}
- {analysisBtn ? : null}
+ {analysisBtn && (
+
+ )}
- {
- children?.[1] != null ?
-
+ {children?.[1] != null && (
+
+
{titleName?.secondCardTitle}
-
- {graphBtn ?
: null}
+
+ {graphBtn && (
+
+ )}
{/* 그래프 있을 시 */}
- {graphBtn ? : null}
+ {graphBtn && (
+
+ )}
{children?.[1]}
- : null
- }
+
+ )}
)
}
diff --git a/apps/sn/app/(with-base-layout)/ii/irsetting/page.tsx b/apps/sn/app/(with-base-layout)/ii/irsetting/page.tsx
index 4e8492f47..3adf8c233 100644
--- a/apps/sn/app/(with-base-layout)/ii/irsetting/page.tsx
+++ b/apps/sn/app/(with-base-layout)/ii/irsetting/page.tsx
@@ -399,7 +399,7 @@ const IrSetting = () => {
setSelectedDate(value);
}
}}
- selectClass="ml-5 w-[150px]"
+ selectClass="ml-5 w-[225px]"
startYear={1900} // 시작 연도 설정
/>
@@ -430,7 +430,7 @@ const IrSetting = () => {
setInput1(newValue);
}}
- className="ml-5 h-[3.2rem] text-center text-xl w-[150px]"
+ className="ml-5 h-[3.2rem] text-center text-xl w-[225px]"
placeholder="예: 0.75"
/>
@@ -441,7 +441,15 @@ const IrSetting = () => {
setInput2(e.target.value)}
- className="ml-5 h-[3.2rem] text-center text-xl w-[150px]" />
+ className="ml-5 h-[3.2rem] text-center text-xl w-[225px]"
+ placeholder='세부 분석정보 입력'
+ onKeyDown={(e) => {
+ if (e.key === 'Enter') {
+ e.preventDefault(); // Enter 키 기본 동작 방지
+ handleAnalysisClick();
+ }
+ }}
+ />
diff --git a/apps/sn/app/(with-base-layout)/ii/rdii/page.tsx b/apps/sn/app/(with-base-layout)/ii/rdii/page.tsx
index 08aa84e34..9bf381b97 100644
--- a/apps/sn/app/(with-base-layout)/ii/rdii/page.tsx
+++ b/apps/sn/app/(with-base-layout)/ii/rdii/page.tsx
@@ -61,8 +61,8 @@ const defaultFormValues: FormSchemaType = {
sggCd: "",
swageTmplntCd: "",
swtrmtZoneCd: "",
- rtkSource: "출처",
- rdiiArea: "123", // 문자열로 기본값 설정
+ rtkSource: "",
+ rdiiArea: "", // 문자열로 기본값 설정
unitFactors: [
{ response: "Short-Term", R: "0.040", T: "0.5", K: "1" }, // 문자열로 기본값 설정
{ response: "Medium-Term", R: "0.005", T: "1", K: "2" },
@@ -78,7 +78,7 @@ const defaultFormValues: FormSchemaType = {
aplcnYm: "",
rate: "0.8", // 문자열로 기본값 설정
// rainFile: undefined,
- analysisInfo: "test 분석정보",
+ analysisInfo: "",
date: (() => { // 현재 연월을 yyyyMM 형식으로 설정
const now = new Date();
const year = now.getFullYear();
@@ -501,7 +501,7 @@ export default function RTKForm() {
form.setValue("rate", newValue, { shouldValidate: true }); // form의 rate 필드에 설정
}}
className="h-12 text-center text-xl w-[225px] ml-5"
- placeholder="예: 0.75"
+ placeholder="0 ~ 1 사이의 값 입력"
/>
@@ -512,17 +512,24 @@ export default function RTKForm() {
form.setValue("date", value, { shouldValidate: true }); // form의 date 필드에 직접 설정
}
}}
- selectClass="ml-5 w-[200px]"
+ selectClass="ml-5 w-[225px]"
startYear={1900} // 시작 연도 설정
/>
-
+ {
+ if (e.key === 'Enter') {
+ e.preventDefault(); // Enter 키 기본 동작 방지
+ handleAnalysisClick();
+ }
+ }}
+ />
- {/*
-
-
*/}
]}
diff --git a/apps/sn/app/components/ui/fileUploadForm.tsx b/apps/sn/app/components/ui/fileUploadForm.tsx
index fb626348e..0aed37bc9 100644
--- a/apps/sn/app/components/ui/fileUploadForm.tsx
+++ b/apps/sn/app/components/ui/fileUploadForm.tsx
@@ -103,7 +103,7 @@ const FileUploadForm = ({
}}
customPreview={
showPreview ? (
-
+
{files && files.length > 0
? fileName
: "파일을 선택하세요."}
diff --git a/apps/sn/app/components/ui/govSidoSigunguSearchForm.tsx b/apps/sn/app/components/ui/govSidoSigunguSearchForm.tsx
index b46f2b481..1fe3d7bae 100644
--- a/apps/sn/app/components/ui/govSidoSigunguSearchForm.tsx
+++ b/apps/sn/app/components/ui/govSidoSigunguSearchForm.tsx
@@ -1,5 +1,6 @@
import React, { useEffect, useState } from 'react';
import { SelectBox } from '@common/business_components/ui/select';
+import { Label } from '@radix-ui/react-label';
export type comCodeState = {
code: {
@@ -24,9 +25,9 @@ export type comCodeState = {
};
type SelectDataType = {
- text: string;
- val: string;
- sido?: string; // 시도 코드 (선택 사항)
+ text: string;
+ val: string;
+ sido?: string; // 시도 코드 (선택 사항)
}
type EnvPartSelectDataType = SelectDataType & {
@@ -73,9 +74,9 @@ function GovSidoSigunguSearchForm({ isShowPart = false, children, selectSidoData
const [allSigunOptions, setAllSigunOptions] = useState
([]);
// 조회된 조건에 맞는 환경청 시도 시군 (SelectBox에 실제 사용될 데이터)
- const [filteredEnvPartData, setFilteredEnvPartData] = useState([{ text: "전체", val: '0', adstDliStrCd: '', sido: '0' }]);
- const [filteredEnvPartSidoData, setFilteredEnvPartSidoData] = useState([{ text: "전체", val: '0', adstDliStrCd: '', sido: '0' }]);
- const [filteredEnvPartSigunData, setFilteredEnvPartSigunData] = useState([{ text: "전체", val: '0', sido: '0' }]);
+ const [filteredEnvPartData, setFilteredEnvPartData] = useState([{ text: "전체", val: '0', adstDliStrCd: '', sido: '0' }]);
+ const [filteredEnvPartSidoData, setFilteredEnvPartSidoData] = useState([{ text: "전체", val: '0', adstDliStrCd: '', sido: '0' }]);
+ const [filteredEnvPartSigunData, setFilteredEnvPartSigunData] = useState([{ text: "전체", val: '0', sido: '0' }]);
// 시군구 데이터
const getSggCd = async (): Promise => {
@@ -93,7 +94,7 @@ function GovSidoSigunguSearchForm({ isShowPart = false, children, selectSidoData
return sggCd;
} catch (error) {
console.error('시군구 데이터를 가져오는데 실패했습니다:', error);
- return [{ val: '0', text: '전체', sido: '0' }];
+ return [{ val: '0', text: '전체', sido: '0' }];
}
};
@@ -112,7 +113,7 @@ function GovSidoSigunguSearchForm({ isShowPart = false, children, selectSidoData
return cityCd;
} catch (error) {
console.error('시도 데이터를 가져오는데 실패했습니다:', error);
- return [{ val: '0', text: '전체', sido: '0' }];
+ return [{ val: '0', text: '전체', sido: '0' }];
}
};
@@ -135,7 +136,7 @@ function GovSidoSigunguSearchForm({ isShowPart = false, children, selectSidoData
return lclgvrnmntCd;
} catch (error) {
console.error('환경청 데이터를 가져오는데 실패했습니다:', error);
- return [{ val: '0', text: '전체', adstDliStrCd: '', sido: '0' }];
+ return [{ val: '0', text: '전체', adstDliStrCd: '', sido: '0' }];
}
};
@@ -188,8 +189,8 @@ function GovSidoSigunguSearchForm({ isShowPart = false, children, selectSidoData
const relevantSigunSidos = Array.from(
new Set(
allSigunOptions
- .filter(sigungu => cityCodesInEnvPart.includes(sigungu.val))
- .map(sigungu => sigungu.sido)
+ .filter(sigungu => cityCodesInEnvPart.includes(sigungu.val))
+ .map(sigungu => sigungu.sido)
)
);
console.log('relevantSigunTexts:', relevantSigunSidos);
@@ -210,8 +211,8 @@ function GovSidoSigunguSearchForm({ isShowPart = false, children, selectSidoData
// relevantSidos와 relevantSigunsForSidoDerivation은 초기 빈 배열 상태를 유지합니다.
setFilteredEnvPartSidoData([
- { text: "전체", val: '0', adstDliStrCd: '', sido: '0' },
- ...relevantSidos.map((item: SelectDataType) => ({ text: item.text, val: item.val, adstDliStrCd: '', sido: '0' }))
+ { text: "전체", val: '0', adstDliStrCd: '', sido: '0' },
+ ...relevantSidos.map((item: SelectDataType) => ({ text: item.text, val: item.val, adstDliStrCd: '', sido: '0' }))
]);
setFilteredEnvPartSigunDataSelected(relevantSigunsForSidoDerivation);
@@ -246,14 +247,14 @@ function GovSidoSigunguSearchForm({ isShowPart = false, children, selectSidoData
setEnvPartSigunValue('0'); // 시군구 "전체"로 초기화
// 부모에게도 초기화된 값 전달 (text 포함)
if (setRtnEnvPartSidoValue) {
- const sidoDefault = filteredEnvPartSidoData.find(item => item.val === '0') || { val: '0', text: '전체' };
- // setRtnEnvPartSidoValue(sidoDefault.val); // 이전 방식: 값만 전달
- // TODO: 만약 시도 값도 객체로 전달해야 한다면 아래와 같이 수정
- // setRtnEnvPartSidoValue({ val: sidoDefault.val, text: sidoDefault.text });
+ const sidoDefault = filteredEnvPartSidoData.find(item => item.val === '0') || { val: '0', text: '전체' };
+ // setRtnEnvPartSidoValue(sidoDefault.val); // 이전 방식: 값만 전달
+ // TODO: 만약 시도 값도 객체로 전달해야 한다면 아래와 같이 수정
+ // setRtnEnvPartSidoValue({ val: sidoDefault.val, text: sidoDefault.text });
}
if (setRtnEnvPartSigunValue) {
- const sigunDefault = filteredEnvPartSigunData.find(item => item.val === '0') || { val: '0', text: '전체' };
- setRtnEnvPartSigunValue({ val: sigunDefault.val, text: sigunDefault.text });
+ const sigunDefault = filteredEnvPartSigunData.find(item => item.val === '0') || { val: '0', text: '전체' };
+ setRtnEnvPartSigunValue({ val: sigunDefault.val, text: sigunDefault.text });
}
break;
case 'envPartSido': // 환경청별 - 시도 선택
@@ -262,8 +263,8 @@ function GovSidoSigunguSearchForm({ isShowPart = false, children, selectSidoData
initializeCityDataByEnvPartSigun(val);
setEnvPartSigunValue('0'); // 시군구 "전체"로 초기화
if (setRtnEnvPartSigunValue) {
- const sigunDefault = filteredEnvPartSigunData.find(item => item.val === '0') || { val: '0', text: '전체' };
- setRtnEnvPartSigunValue({ val: sigunDefault.val, text: sigunDefault.text });
+ const sigunDefault = filteredEnvPartSigunData.find(item => item.val === '0') || { val: '0', text: '전체' };
+ setRtnEnvPartSigunValue({ val: sigunDefault.val, text: sigunDefault.text });
}
break;
case 'envPartSigun': // 환경청별 - 시군구 선택
@@ -286,11 +287,11 @@ function GovSidoSigunguSearchForm({ isShowPart = false, children, selectSidoData
setEnvPartSigunValue('0');
// 필터링된 목록들도 초기 "전체" 또는 전체 목록으로 리셋
- setFilteredEnvPartSigunData([{ text: "전체", val: '0', sido: '0' }, ...allSigunOptions]);
+ setFilteredEnvPartSigunData([{ text: "전체", val: '0', sido: '0' }, ...allSigunOptions]);
- setFilteredEnvPartData([{ text: "전체", val: '0', adstDliStrCd: '', sido: '0' }, ...allEnvPartOptions]);
- setFilteredEnvPartSidoData([{ text: "전체", val: '0', adstDliStrCd: '', sido: '0' }, ...allSidoOptions.map(s => ({ ...s, adstDliStrCd: '' }))]);
- setFilteredEnvPartSigunData([{ text: "전체", val: '0', sido: '0' }, ...allSigunOptions]);
+ setFilteredEnvPartData([{ text: "전체", val: '0', adstDliStrCd: '', sido: '0' }, ...allEnvPartOptions]);
+ setFilteredEnvPartSidoData([{ text: "전체", val: '0', adstDliStrCd: '', sido: '0' }, ...allSidoOptions.map(s => ({ ...s, adstDliStrCd: '' }))]);
+ setFilteredEnvPartSigunData([{ text: "전체", val: '0', sido: '0' }, ...allSigunOptions]);
setFilteredEnvPartSigunDataSelected(allSigunOptions);
@@ -316,11 +317,35 @@ function GovSidoSigunguSearchForm({ isShowPart = false, children, selectSidoData
return (
isShowPart ? (
-
+
<>
- onSelectValue(val.toString(), 'envPart')} value={envPartValue} selectClass={'rounded-lg bg-white truncate'} />
- onSelectValue(val.toString(), 'envPartSido')} value={envPartSidoValue} selectClass={'rounded-lg bg-white truncate'} />
- onSelectValue(val.toString(), 'envPartSigun')} value={envPartSigunValue} selectClass={'rounded-lg bg-white truncate'} />
+
+ onSelectValue(val.toString(), 'envPart')}
+ value={envPartValue}
+ selectClass={'rounded-lg bg-white truncate'}
+ />
+
+ onSelectValue(val.toString(), 'envPartSido')}
+ value={envPartSidoValue}
+ selectClass={'rounded-lg bg-white truncate'}
+ />
+
+ onSelectValue(val.toString(), 'envPartSigun')}
+ value={envPartSigunValue}
+ selectClass={'rounded-lg bg-white truncate'}
+ />
>
{children}
From eafe131df1021619a62d24b8268302e500dec43a Mon Sep 17 00:00:00 2001
From: Your Name
Date: Tue, 29 Jul 2025 18:11:39 +0900
Subject: [PATCH 44/75] =?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});
})
From 3ba11b55083cc19f64db6bb4594d3561177ba5e8 Mon Sep 17 00:00:00 2001
From: leedj312
Date: Tue, 29 Jul 2025 20:11:51 +0900
Subject: [PATCH 45/75] =?UTF-8?q?=EB=B9=97=EB=AC=BC=20=EC=97=91=EC=85=80?=
=?UTF-8?q?=20=EB=93=B1=EB=A1=9D=20=ED=95=AD=EB=AA=A9=20=EC=98=A4=EB=A5=98?=
=?UTF-8?q?=20=EC=A0=90=EA=B2=80?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../prfmncReg/chkgdnReg/rainChkgdn/excel.tsx | 46 +++++++++++++++----
1 file changed, 37 insertions(+), 9 deletions(-)
diff --git a/apps/wr/app/store/prfmncReg/chkgdnReg/rainChkgdn/excel.tsx b/apps/wr/app/store/prfmncReg/chkgdnReg/rainChkgdn/excel.tsx
index 6d6ef18a6..a484f87c2 100644
--- a/apps/wr/app/store/prfmncReg/chkgdnReg/rainChkgdn/excel.tsx
+++ b/apps/wr/app/store/prfmncReg/chkgdnReg/rainChkgdn/excel.tsx
@@ -6,6 +6,7 @@ import {
isInvalidNumber,
parseRawValue,
} from "@/components/lib/func/excelFunc";
+import toast from "react-hot-toast";
export const useTypes = [
"조경용수",
"청소화장실용수",
@@ -16,6 +17,18 @@ export const useTypes = [
"기타",
];
+
+export const chkMngType =[
+ '위탁',
+ '자체'
+]
+export const chkSpwtPositnType = [
+ '유량계',
+ '수위계',
+ '펌프적산전력계',
+ '기타'
+]
+
export type Buildingtype = {
bdstInfoSn: number;
ctpvCd: 1;
@@ -143,43 +156,56 @@ export const excelToRainChkData = (excelData: any, year: string) => {
})
.filter((el: any) => el !== undefined);
+console.log("rainChkgdData", rainChkgdData);
if (rainChkgdData.length > 0) {
rainChkgdData.forEach((rain: any) => {
const defaultMessage = `[시설명: ${rain.bdstNm}, 점검일: ${rain.chckYmd}, 이용용도: ${rain.guideDetails[0]?.utztnUsgCd}] 항목에서 `;
if (rain.chckYmd && isInvalidDate(rain.chckYmd)) {
issues.push(
- defaultMessage + `점검일: 날짜 형식 아님 (${rain.chckYmd})`
+ defaultMessage + `점검일: 날짜 형식 아님 입력값 : (${rain.chckYmd})`
);
}
if (rain.anlOperCst.length > 2 && isInvalidNumber(rain.anlOperCst)) {
issues.push(
defaultMessage +
- ` 연간운영비(원/년): 숫자 형식 아님 (${rain.anlOperCst})`
+ ` 연간운영비(원/년): 숫자 형식 아님 /입력값:${rain.anlOperCst}`
);
}
+ if (rain.oilqMeasMthd.length > 1 && !chkMngType.includes(rain.oilqMeasMthd)) {
+ issues.push(
+ defaultMessage + `유량측정방법: 위탁 혹은 자체 만 허용) /입력값:${rain.oilqMeasMthd}`
+ );
+ }
+ if (rain.spwtPositn.length > 1 && !chkSpwtPositnType.includes(rain.spwtPositn)) {
+ issues.push(
+ defaultMessage + `측정위치: 유량계, 수위계, 펌프적산전력계, 기타 중 하나만 허용) /입력값:${rain.spwtPositn}`
+ );
+ }
+
+
rain.rainyDetails?.forEach((key) => {
if (key.ph?.length > 1 && isInvalidNumber(key.ph)) {
- issues.push(defaultMessage + `PH: 숫자 형식 아님 (${key.ph})`);
+ issues.push(defaultMessage + `PH: 숫자 형식 아님 /입력값:${key.ph}`);
}
if (key.trbt?.length > 1 && isInvalidNumber(key.trbt)) {
- issues.push(defaultMessage + `탁도: 숫자 형식 아님 (${key.trbt})`);
+ issues.push(defaultMessage + `탁도: 숫자 형식 아님 /입력값:${key.trbt}`);
}
if (key.grssClfg?.length > 1 && isInvalidNumber(key.grssClfg)) {
issues.push(
- defaultMessage + `총대장균군수: 숫자 형식 아님 (${key.grssClfg})`
+ defaultMessage + `총대장균군수: 숫자 형식 아님 /입력값:${key.grssClfg}`
);
}
if (key.levyAmt?.length > 1 && isInvalidNumber(key.levyAmt)) {
issues.push(
defaultMessage +
- `과태료부과금액(천원): 숫자 형식 아님 (${key.levyAmt})`
+ `과태료부과금액(천원): 숫자 형식 아님 /입력값:${key.levyAmt}`
);
}
if (key.vltnDt?.length > 2 && isInvalidDate(key.vltnDt)) {
issues.push(
defaultMessage +
- `과태료 부과일(위반일): 날짜 형식 아님 (${key.vltnDt})`
+ `과태료 부과일(위반일): 날짜 형식 아님 /입력값:${key.vltnDt}`
);
}
});
@@ -188,17 +214,19 @@ export const excelToRainChkData = (excelData: any, year: string) => {
if (isInvalidNumber(guide.splyUswtrUtztnQnt)) {
issues.push(
defaultMessage +
- `대체_${mm}: 숫자 형식 아님 (${guide.splyUswtrUtztnQnt})`
+ `대체_${mm}: 숫자 형식 아님 /입력값:${guide.splyUswtrUtztnQnt}`
);
}
if (isInvalidNumber(guide.ruseFcltUtztnQnt)) {
issues.push(
defaultMessage +
- `빗물_${mm}: 숫자 형식 아님 (${guide.ruseFcltUtztnQnt})`
+ `빗물_${mm}: 숫자 형식 아님 /입력값:${guide.ruseFcltUtztnQnt}`
);
}
});
});
+ }else{
+ toast.error("데이터가 없습니다. 점검 데이터를 확인해주세요.");
}
if (issues.length > 0) {
From 81d589acb05174d8ff8de34c9aeedd32ef4d77de Mon Sep 17 00:00:00 2001
From: swcho
Date: Tue, 29 Jul 2025 20:15:21 +0900
Subject: [PATCH 46/75] =?UTF-8?q?fix=20:=20=EC=A1=B0=EA=B1=B4=EC=B0=BD?=
=?UTF-8?q?=EC=97=90=20=ED=85=8D=EC=8A=A4=ED=8A=B8=EC=99=80=20=EC=9E=85?=
=?UTF-8?q?=EB=A0=A5=EC=B0=BD=20=EA=B0=84=EA=B2=A9=20=EB=93=B1=20=EC=9D=BC?=
=?UTF-8?q?=EC=A0=95=ED=95=98=EA=B2=8C=20=EC=B2=98=EB=A6=AC?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../(map-layout)/map/searchModal/basicTab.tsx | 3 ++-
.../map/searchModal/operationTab.tsx | 12 +++++-----
.../map/searchModal/reportTab.tsx | 22 ++++++++-----------
.../(map-layout)/map/searchModal/swageMhl.tsx | 7 +++---
.../map/searchModal/swagePmstn.tsx | 6 ++---
.../(map-layout)/map/searchModal/swagePpl.tsx | 12 +++++-----
.../map/searchModal/swagePrcsFclt.tsx | 6 ++---
.../map/searchModal/swagePrcsZone.tsx | 4 ++--
.../components/ui/SidoSigunguSelectBox.tsx | 9 +++++---
.../app/components/ui/YearRangeSelectBox.tsx | 6 ++---
10 files changed, 45 insertions(+), 42 deletions(-)
diff --git a/apps/sn/app/(map-layout)/map/searchModal/basicTab.tsx b/apps/sn/app/(map-layout)/map/searchModal/basicTab.tsx
index 89d1db591..8ac1b98aa 100644
--- a/apps/sn/app/(map-layout)/map/searchModal/basicTab.tsx
+++ b/apps/sn/app/(map-layout)/map/searchModal/basicTab.tsx
@@ -82,10 +82,11 @@ const BasicTab: React.FC = ({
{/* 구분 */}
+
setBasicType(String(value))
diff --git a/apps/sn/app/(map-layout)/map/searchModal/operationTab.tsx b/apps/sn/app/(map-layout)/map/searchModal/operationTab.tsx
index 97c0b4c4c..0ec43f51d 100644
--- a/apps/sn/app/(map-layout)/map/searchModal/operationTab.tsx
+++ b/apps/sn/app/(map-layout)/map/searchModal/operationTab.tsx
@@ -113,10 +113,11 @@ const OperationTab: React.FC = ({
return (
+
({
val: w.val,
text: w.text,
@@ -127,9 +128,9 @@ const OperationTab: React.FC = ({
/>
-
+
{ setVar1(e.target.value); }}
@@ -141,10 +142,11 @@ const OperationTab: React.FC
= ({
startLabel="수행기간"
endLabel=""
/>
+
{
diff --git a/apps/sn/app/(map-layout)/map/searchModal/reportTab.tsx b/apps/sn/app/(map-layout)/map/searchModal/reportTab.tsx
index 48399ac22..53dd6d0e0 100644
--- a/apps/sn/app/(map-layout)/map/searchModal/reportTab.tsx
+++ b/apps/sn/app/(map-layout)/map/searchModal/reportTab.tsx
@@ -1,6 +1,6 @@
'use client';
import React, { useEffect, useState } from 'react';
-import { Button } from '@common/components';
+import { Button, Label } from '@common/components';
import { YearRangeSelectBox } from '@/components/ui/YearRangeSelectBox';
import { SelectBox, UiTable } from '@common/business_components/ui';
import LoadingOverlay from '@/components/ui/LoadingBar';
@@ -167,30 +167,26 @@ const ReportTab: React.FC = ({ open }) => {
<>
- 시도
+
+
setSigungu(String(val))}
selectContentClass="z-[101]"
/>
- {/*
-
{ setGubun(e.target.value); }}
- /> */}
-
보고서 구분
+ setReportGubun(String(val))}
selectContentClass="z-[101]" labelClass='whitespace-nowrap text-xl text-gray-600 pr-2'
/>
diff --git a/apps/sn/app/(map-layout)/map/searchModal/swageMhl.tsx b/apps/sn/app/(map-layout)/map/searchModal/swageMhl.tsx
index 5d678bf1a..279107a5c 100644
--- a/apps/sn/app/(map-layout)/map/searchModal/swageMhl.tsx
+++ b/apps/sn/app/(map-layout)/map/searchModal/swageMhl.tsx
@@ -55,10 +55,11 @@ const SwageMhl: React.FC = ({
endLabel=""
/>
{/* 용도 */}
+
{
@@ -67,7 +68,7 @@ const SwageMhl: React.FC = ({
selectContentClass="z-[101]"
/>
{/* 하수맨홀 구경 */}
-
+
= ({
endLabel=""
/>
{/* 일일처리용량 - 오수맨홀 */}
-
+
= ({
onKeyDown={handleEnterKey}
/>
{/* 양수능력 - 우수맨홀 */}
-
+
= ({
endLabel=""
/>
{/* 용도 */}
+
{
@@ -70,10 +71,11 @@ const SwagePpl: React.FC = ({
selectContentClass="z-[101]"
/>
{/* 재질 */}
+
{
@@ -82,7 +84,7 @@ const SwagePpl: React.FC = ({
selectContentClass="z-[101]"
/>
{/* 관경 */}
-
+
= ({
onKeyDown={handleEnterKey}
/>
{/* 연장 */}
-
+
= ({
endLabel=""
/>
{/* 시설용량 */}
-
+
= ({
onKeyDown={handleEnterKey}
/>
{/* 처리구역 면적 */}
-
+
= ({
onKeyDown={handleEnterKey}
/>
{/* 하수처리시설명 */}
-
+
= ({
}}
onSigunguChange={setSgg}
/>
-
+
= ({
}}
onKeyDown={handleEnterKey}
/>
-
+
+
({ val: opt.id, text: opt.name }))}
value={sido}
onSelectValue={val => onSidoChange(Number(val))}
selectContentClass="z-[101]"
/>
+
({ val: opt.id, text: opt.name }))}
value={sigungu}
onSelectValue={val => onSigunguChange(Number(val))}
diff --git a/apps/sn/app/components/ui/YearRangeSelectBox.tsx b/apps/sn/app/components/ui/YearRangeSelectBox.tsx
index 3e0318dac..83b21cba5 100644
--- a/apps/sn/app/components/ui/YearRangeSelectBox.tsx
+++ b/apps/sn/app/components/ui/YearRangeSelectBox.tsx
@@ -88,9 +88,9 @@ export function YearRangeSelectBox({
};
return (
-
+
~
Date: Tue, 29 Jul 2025 20:20:29 +0900
Subject: [PATCH 47/75] =?UTF-8?q?feat:=20=ED=95=98=EC=88=98=EA=B4=80?=
=?UTF-8?q?=EB=A1=9C=20=EC=83=81=EC=84=B8=ED=8E=98=EC=9D=B4=EC=A7=80=20'?=
=?UTF-8?q?=EC=83=81=EB=A5=98=EA=B4=80=EB=A1=9C=20=EB=B3=B4=EA=B8=B0'=20?=
=?UTF-8?q?=EB=B2=84=ED=8A=BC=20=EC=98=A4=EB=A5=B8=EC=AA=BD=20=EC=A0=95?=
=?UTF-8?q?=EB=A0=AC?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../map/featureClickEventPopup.tsx | 66 ++++++++++---------
1 file changed, 34 insertions(+), 32 deletions(-)
diff --git a/apps/sn/app/(map-layout)/map/featureClickEventPopup.tsx b/apps/sn/app/(map-layout)/map/featureClickEventPopup.tsx
index 5259fdab6..e9a4f9e9a 100644
--- a/apps/sn/app/(map-layout)/map/featureClickEventPopup.tsx
+++ b/apps/sn/app/(map-layout)/map/featureClickEventPopup.tsx
@@ -482,45 +482,47 @@ const FeatureClickEventPopup = ({ onClose, featureData }: { onClose: () => void,
>
)} 정보
관리번호 : {layerSpecificNm}
-
- {/* 🎯 하수관로일 때만 Infil/RDII 버튼 표시 */}
- {layerNm === '하수관로' && (
- <>
-
-
- >
- )}
- {layerNm === '하수맨홀' && (
- <>
-
+
+ {/* 🎯 하수관로일 때만 Infil/RDII 버튼 표시 */}
+ {layerNm === '하수관로' && (
+ <>
+
+
+ >
+ )}
+ {layerNm === '하수맨홀' && (
+ <>
+
- >
- )}
-
+ >
+ 상류관로 보기
+
+ >
+ )}