초기화 돌아가는 문제해결, 대시보드 calData 수정, 처리구역정보 null 오류 수정
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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 = {
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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: '평균',
|
||||
|
||||
Reference in New Issue
Block a user