1663 lines
82 KiB
TypeScript
1663 lines
82 KiB
TypeScript
/**
|
|
* Store - 타입
|
|
*/
|
|
|
|
import { getFetch, getFetchAreaList } from "@/app/components/api";
|
|
import DataForm from "@/app/components/common/DataForm";
|
|
import type { FacilityWaterQltyProps } from "../facilityWaterQlty";
|
|
|
|
// selectBox
|
|
export type SelectDataType = {
|
|
text: string;
|
|
val: string;
|
|
}
|
|
|
|
// grid header
|
|
export type TableUpperProps = {
|
|
id: string;
|
|
title: string;
|
|
upName?: string;
|
|
upSequnce?: number;
|
|
align? : string;
|
|
row? : number;
|
|
rowSpan?: number;
|
|
colSpan?: number;
|
|
}
|
|
|
|
// ===TAB1
|
|
// main fclty
|
|
export type mainFcltyProps = {
|
|
fcltyNm : string,
|
|
facilityCapacity : string,
|
|
publicMethod : string,
|
|
location : string
|
|
}
|
|
|
|
// 시설계획
|
|
export type planFcltyListProps = {
|
|
item : string,
|
|
provisionalApproval : string | number | '',
|
|
now : string | number | '',
|
|
stepOne : string | number | '',
|
|
stepTwo : string | number | '',
|
|
stepThree : string | number | '',
|
|
stepFour : string | number | '',
|
|
}
|
|
|
|
// 운영실태
|
|
export type OperationalStatusListProps = {
|
|
flowRate : string,
|
|
waterQlty : string,
|
|
yearAvg : number | string | '',
|
|
yearMax : number | string | '',
|
|
yearMin : number | string | '',
|
|
summerAll : number | string | '',
|
|
summerThree : number | string | '',
|
|
summerRain : number | string | '',
|
|
winterAll : number | string | '',
|
|
winterSunnyAvg : number | string | '',
|
|
winterSunnyMax : number | string | '',
|
|
winterSunnyMin : number | string | '',
|
|
groundWaterAvg : number | string | '',
|
|
groundWaterSummer : number | string | '',
|
|
groundWaterWinter : number | string | '',
|
|
rdi : number | string | '',
|
|
rdiRain : number | string | '',
|
|
}
|
|
|
|
export interface operationalStatusListProps {
|
|
flowRate : string,
|
|
waterQlty : string,
|
|
yearAvg : number | '',
|
|
yearMax : number | '',
|
|
yearMin : number | '',
|
|
summerAll : number | '',
|
|
summerThree : number | '',
|
|
summerRain : number | '',
|
|
winterAll : number | '',
|
|
winterSunnyAvg : number | '',
|
|
winterSunnyMax : number | '',
|
|
winterSunnyMin : number | '',
|
|
groundWaterAvg : number | string | '',
|
|
groundWaterSummer : number | string | '',
|
|
groundWaterWinter : number | string | '',
|
|
rdi : number | '',
|
|
}
|
|
|
|
// 차트
|
|
export type lineBarChartDataProps = {
|
|
label : string,
|
|
lineVal : number
|
|
barVal : number
|
|
barVal0 : number
|
|
barVal1 : number
|
|
lineVal0 : number
|
|
lineVal1 : number
|
|
}
|
|
|
|
export type lineChartDataProps = {
|
|
label : string,
|
|
val : number
|
|
}
|
|
|
|
export interface RainManageListProps {
|
|
rainItem : string,
|
|
rainRate : string,
|
|
rainDay : number,
|
|
bscFctCd?: string,
|
|
bscFctNm?: string,
|
|
msrDt?: string
|
|
sidoNm?: string,
|
|
sggNm?: string,
|
|
addr?: string,
|
|
fctCpc?: number,
|
|
inflAssctAftWqltBod: number | '',
|
|
inflAssctAftWqltToc: number | '',
|
|
inflAssctAftWqltSs: number | '',
|
|
inflAssctAftWqltTn: number | '',
|
|
inflAssctAftWqltTp: number | '',
|
|
efflWqltBod: number | '',
|
|
efflWqltCod: number | '',
|
|
efflWqltSs: number | '',
|
|
efflWqltTn: number | '',
|
|
efflWqltTp: number | '',
|
|
rgnNm?:string|'',
|
|
rvbsn?:string|'',
|
|
lgbsn?:string|'',
|
|
mdmbsn?:string|'',
|
|
inflAmnt: number | '',
|
|
lclgvrnmntNm?: string,
|
|
infoRnDay?: number | '',
|
|
tpInflWqltTmprtr?: number | '',
|
|
tpInflWqltPh?: number | '',
|
|
tpInflWqltBod?: number | '',
|
|
tpInflWqltCod?: number | '',
|
|
tpInflWqltSs?: number | '',
|
|
tpInflWqltTn?: number | '',
|
|
tpInflWqltTp?: number | '',
|
|
tpInflWqltEclgyTox?: number | '',
|
|
tpInflWqltClfgrpcnt?: number | '',
|
|
dsInflWqltBod: number | '',
|
|
dsInflWqltCod: number | '',
|
|
dsInflWqltSs: number | '',
|
|
dsInflWqltTn: number | '',
|
|
dsInflWqltTp: number | '',
|
|
extnsSeqno?: number | '',
|
|
}
|
|
|
|
export interface RainManageExcelType {
|
|
강우량: string,
|
|
강우조건비율: number | '',
|
|
일수: number | '',
|
|
유입유량: number | '',
|
|
시설용량대비: number | '',
|
|
설계유입수질BOD: number | '',
|
|
설계유입수질TOC: number | '',
|
|
설계유입수질SS: number | '',
|
|
설계유입수질TN: string | number | '',
|
|
설계유입수질TP: string | number | '',
|
|
유입수질BOD: number | '',
|
|
유입수질TOC: number | '',
|
|
유입수질SS: number | '',
|
|
유입수질TN: string | number | '',
|
|
유입수질TP: string | number | '',
|
|
방류수질BOD: number | '',
|
|
방류수질TOC: number | '',
|
|
방류수질SS: number | '',
|
|
방류수질TN: string | number | '',
|
|
방류수질TP: string | number | '',
|
|
}
|
|
|
|
export interface DrainageEquipmentListProps {
|
|
part1 : string | '',
|
|
part2 : string | '',
|
|
nowSum : number | '',
|
|
nowJoin : number | '',
|
|
nowSep : number | '',
|
|
stepOneSum : number | '',
|
|
stepOneJoin : number | '',
|
|
stepOneSep : number | '',
|
|
stepTwoSum : number | '',
|
|
stepTwoJoin : number | '',
|
|
stepTwoSep : number | '',
|
|
stepThreeSum : number | '',
|
|
stepThreeJoin : number | '',
|
|
stepThreeSep : number | '',
|
|
stepFourSum : number | '',
|
|
stepFourJoin : number | '',
|
|
stepFourSep : number | '',
|
|
etc : string | '',
|
|
}
|
|
|
|
export interface DrainageEquipmentExcelType {
|
|
partOne : string | '',
|
|
partTwo : string | '',
|
|
nowSum : number | '',
|
|
nowJoin : number | '',
|
|
nowSep : number | '',
|
|
stepOneSum : number | '',
|
|
stepOneJoin : number | '',
|
|
stepOneSep : number | '',
|
|
stepTwoSum : number | '',
|
|
stepTwoJoin : number | '',
|
|
stepTwoSep : number | '',
|
|
stepThreeSum : number | '',
|
|
stepThreeJoin : number | '',
|
|
stepThreeSep : number | '',
|
|
stepFourSum : number | '',
|
|
stepFourJoin : number | '',
|
|
stepFourSep : number | '',
|
|
}
|
|
|
|
/**
|
|
* Store - data
|
|
*/
|
|
// Main
|
|
const DashBoardTopLabelArray:string[] = ['구분', '시도', '시군구', '년도', '시설명'];
|
|
|
|
// === Tab1
|
|
// grid header
|
|
const upHeadListFclty:TableUpperProps[] = [
|
|
{ id : "fcltyNm", title : "시설명"},
|
|
{ id : "facilityCapacity", title : "시설용량(m³/일)"},
|
|
{ id : "publicMethod", title : "공법"},
|
|
{ id : "location", title : "지역구"},
|
|
]
|
|
|
|
const fcltyList : mainFcltyProps[] = [
|
|
]
|
|
|
|
let planYearList : string[] = [
|
|
"2021",
|
|
"2022",
|
|
"2023",
|
|
"2024",
|
|
"2025",
|
|
"2026"
|
|
]
|
|
|
|
const upHeadListPlanFclty : TableUpperProps[] = [
|
|
{ id: "item", title: "", upName:"upChangeRe", upSequnce:1 },
|
|
{ id: "provisionalApproval", title: "기승인\n4단계", upName:"upChangeRe", upSequnce:2 },
|
|
{ id: "now", title: "현재", upName:"upChangeRe", upSequnce:3 },
|
|
{ id: "stepOne", title: "1단계", upName:"upChangeRe", upSequnce:4 },
|
|
{ id: "stepTwo", title: "2단계", upName:"upChangeRe", upSequnce:5 },
|
|
{ id: "stepThree", title: "3단계", upName:"upChangeRe", upSequnce:6 },
|
|
{ id: "stepFour", title: "4단계", upName:"upChangeRe", upSequnce:7 },
|
|
]
|
|
|
|
const planFcltyList:planFcltyListProps[] = [
|
|
{
|
|
item : "1.증설계획\n(㎥/일)",
|
|
provisionalApproval: "",
|
|
now: "",
|
|
stepOne: "",
|
|
stepTwo: "",
|
|
stepThree: "",
|
|
stepFour : "",
|
|
},
|
|
{
|
|
item : "2.처리인구(인)",
|
|
provisionalApproval: "",
|
|
now: "",
|
|
stepOne: "",
|
|
stepTwo: "",
|
|
stepThree: "",
|
|
stepFour : "",
|
|
},
|
|
{
|
|
item : "3.처리구역\n(km²)",
|
|
provisionalApproval: "",
|
|
now: "",
|
|
stepOne: "",
|
|
stepTwo: "",
|
|
stepThree: "",
|
|
stepFour : "",
|
|
},
|
|
{
|
|
item : "4.분류식화율\n(%)",
|
|
provisionalApproval: "",
|
|
now: "",
|
|
stepOne: "",
|
|
stepTwo: "",
|
|
stepThree: "",
|
|
stepFour : "",
|
|
},
|
|
{
|
|
item : "5.물사용량",
|
|
provisionalApproval: "",
|
|
now: "",
|
|
stepOne: "",
|
|
stepTwo: "",
|
|
stepThree: "",
|
|
stepFour : "",
|
|
},
|
|
{
|
|
item : "년도\n(최근 3개년)",
|
|
provisionalApproval: "물사용량\n(㎥/일)",
|
|
now: "",
|
|
stepOne: "",
|
|
stepTwo: "비고",
|
|
stepThree: "",
|
|
stepFour : "",
|
|
},
|
|
{
|
|
item : "2021",
|
|
provisionalApproval: "",
|
|
now: "",
|
|
stepOne: "",
|
|
stepTwo: "",
|
|
stepThree: "",
|
|
stepFour : "",
|
|
},
|
|
{
|
|
item : "2022",
|
|
provisionalApproval: "",
|
|
now: "",
|
|
stepOne: "",
|
|
stepTwo: "",
|
|
stepThree: "",
|
|
stepFour : "",
|
|
},
|
|
{
|
|
item : "2023",
|
|
provisionalApproval: "",
|
|
now: "",
|
|
stepOne: "",
|
|
stepTwo: "",
|
|
stepThree: "",
|
|
stepFour : "",
|
|
},
|
|
]
|
|
|
|
const upHeadListOperationStatus : TableUpperProps[] = [
|
|
{ id: "flowRate", title: "유량 및 수질", upName:"upChangeRe1", upSequnce:1 },
|
|
{ id: "waterQlty", title: "유량 및 수질", upName:"upChangeRe1", upSequnce:2 },
|
|
{ id: "yearAvg", title: "평균", upName:"upChangeRe2", upSequnce:1 },
|
|
{ id: "yearMax", title: "최대", upName:"upChangeRe2", upSequnce:2 },
|
|
{ id: "yearMin", title: "최소", upName:"upChangeRe2", upSequnce:3 },
|
|
{ id: "summerAll", title: "전기간", upName:"upChangeRe3", upSequnce:1 },
|
|
{ id: "summerThree", title: "강우시\n(3mm이상)", upName:"upChangeRe3", upSequnce:2 },
|
|
{ id: "summerRain", title: "청천시", upName:"upChangeRe3", upSequnce:3 },
|
|
{ id: "winterAll", title: "전기간", upName:"upChangeRe4", upSequnce:1 },
|
|
{ id: "winterSunnyAvg", title: "청천시\n평균", upName:"upChangeRe4", upSequnce:2 },
|
|
{ id: "winterSunnyMax", title: "청천시\n최대", upName:"upChangeRe4", upSequnce:3 },
|
|
{ id: "winterSunnyMin", title: "청천시\n최소", upName:"upChangeRe4", upSequnce:4 },
|
|
{ id: "groundWaterAvg", title: "연평균", upName:"upChangeRe5", upSequnce:1 },
|
|
{ id: "groundWaterSummer", title: "하절기\n평균", upName:"upChangeRe5", upSequnce:2 },
|
|
{ id: "groundWaterWinter", title: "동절기\n평균", upName:"upChangeRe5", upSequnce:3 },
|
|
{ id: "rdi", title: "RDII 추정" },
|
|
{ id: "rdiRain", title: "RDII 추정시\n일강수량(mm)" },
|
|
]
|
|
|
|
const upHeadListRainManage : TableUpperProps[] = [
|
|
{ id: "rainItem", title: "강우량", row:0, rowSpan:2 },
|
|
{ id: "rainRate", title: "강우조건\n비율(%)", row:0, rowSpan:2 },
|
|
{ id: "rainDay", title: "일수", row:0, rowSpan:2 },
|
|
{ id: "A", title: "유입(㎥/일)", row:0, colSpan:2 },
|
|
{ id: "inflAmnt", title: "유입유량", row:1 },
|
|
{ id: "fctCpc", title: "시설용량대비", row:1 },
|
|
{ id: "B", title: "설계유입수질(㎎/L)", row:0, colSpan:5 },
|
|
{ id: "dsInflWqltBod", title: "BOD", row:1 },
|
|
{ id: "dsInflWqltCod", title: "TOC\n(COD)", row:1 },
|
|
{ id: "dsInflWqltSs", title: "SS", row:1 },
|
|
{ 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: "D", title: "방류수질(㎎/L)", row:0, colSpan:5 },
|
|
{ id: "efflWqltBod", title: "BOD", row:1 },
|
|
{ id: "efflWqltCod", 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 },
|
|
]
|
|
|
|
const upHeadListDrainageEquipment : TableUpperProps[] = [
|
|
{ id: "part1", title: "구분", row:0, upName:"upChangeRe1", upSequnce:1 },
|
|
{ id: "part2", title: "구분", row:0, upName:"upChangeRe1", upSequnce:2 },
|
|
{ id: "nowSum", title: "계", row:2, upName:"upChangeRe2", upSequnce:1 },
|
|
{ id: "nowJoin", title: "합류식\n가구수", row:2, upName:"upChangeRe2", upSequnce:2 },
|
|
{ id: "nowSep", title: "분리식\n가구수", row:2, upName:"upChangeRe2", upSequnce:3 },
|
|
{ id: "stepOneSum", title: "계", row:2, upName:"upChangeRe3", upSequnce:1 },
|
|
{ id: "stepOneJoin", title: "합류식\n가구수", row:2, upName:"upChangeRe3", upSequnce:2 },
|
|
{ id: "stepOneSep", title: "분리식\n가구수", row:2, upName:"upChangeRe3", upSequnce:3 },
|
|
{ id: "stepTwoSum", title: "계", row:2, upName:"upChangeRe4", upSequnce:1 },
|
|
{ id: "stepTwoJoin", title: "합류식\n가구수", row:2, upName:"upChangeRe4", upSequnce:2 },
|
|
{ id: "stepTwoSep", title: "분리식\n가구수", row:2, upName:"upChangeRe4", upSequnce:3 },
|
|
{ id: "stepThreeSum", title: "계", row:2, upName:"upChangeRe5", upSequnce:1 },
|
|
{ id: "stepThreeJoin", title: "합류식\n가구수", row:2, upName:"upChangeRe5", upSequnce:2 },
|
|
{ id: "stepThreeSep", title: "분리식\n가구수", row:2, upName:"upChangeRe5", upSequnce:3 },
|
|
{ id: "stepFourSum", title: "계", row:2, upName:"upChangeRe6", upSequnce:1 },
|
|
{ id: "stepFourJoin", title: "합류식\n가구수", row:2, upName:"upChangeRe6", upSequnce:2 },
|
|
{ id: "stepFourSep", title: "분리식\n가구수", row:2, upName:"upChangeRe6", upSequnce:3 },
|
|
{ id: "etc", title: "비고", row:0, upName:"upChangeRe7", upSequnce:1 },
|
|
]
|
|
|
|
const operationalStatusList : OperationalStatusListProps[] = [
|
|
{
|
|
flowRate : '유량\n(㎥/일)',
|
|
waterQlty : '유입',
|
|
yearAvg : '',
|
|
yearMax : '',
|
|
yearMin : '',
|
|
summerAll : '',
|
|
summerThree : '',
|
|
summerRain : '',
|
|
winterAll : '',
|
|
winterSunnyAvg : '',
|
|
winterSunnyMax : '',
|
|
winterSunnyMin : '',
|
|
groundWaterAvg : '',
|
|
groundWaterSummer : '',
|
|
groundWaterWinter : '',
|
|
rdi : '',
|
|
rdiRain : '',
|
|
},
|
|
{
|
|
flowRate : '유량\n(㎥/일)',
|
|
waterQlty : '순수하수',
|
|
yearAvg : '',
|
|
yearMax : '',
|
|
yearMin : '',
|
|
summerAll : '',
|
|
summerThree : '',
|
|
summerRain : '',
|
|
winterAll : '',
|
|
winterSunnyAvg : '',
|
|
winterSunnyMax : '',
|
|
winterSunnyMin : '',
|
|
groundWaterAvg : '',
|
|
groundWaterSummer : '',
|
|
groundWaterWinter : '',
|
|
rdi : '',
|
|
rdiRain : '',
|
|
},
|
|
{
|
|
flowRate : '유량\n(㎥/일)',
|
|
waterQlty : '연계처리수',
|
|
yearAvg : '',
|
|
yearMax : '',
|
|
yearMin : '',
|
|
summerAll : '',
|
|
summerThree : '',
|
|
summerRain : '',
|
|
winterAll : '',
|
|
winterSunnyAvg : '',
|
|
winterSunnyMax : '',
|
|
winterSunnyMin : '',
|
|
groundWaterAvg : '',
|
|
groundWaterSummer : '',
|
|
groundWaterWinter : '',
|
|
rdi : '',
|
|
rdiRain : '',
|
|
},
|
|
{
|
|
flowRate : '유량\n(㎥/일)',
|
|
waterQlty : '총인설비\n반류수',
|
|
yearAvg : '',
|
|
yearMax : '',
|
|
yearMin : '',
|
|
summerAll : '',
|
|
summerThree : '',
|
|
summerRain : '',
|
|
winterAll : '',
|
|
winterSunnyAvg : '',
|
|
winterSunnyMax : '',
|
|
winterSunnyMin : '',
|
|
groundWaterAvg : '',
|
|
groundWaterSummer : '',
|
|
groundWaterWinter : '',
|
|
rdi : '',
|
|
rdiRain : '',
|
|
},
|
|
{
|
|
flowRate : '유량\n(㎥/일)',
|
|
waterQlty : '방류',
|
|
yearAvg : '',
|
|
yearMax : '',
|
|
yearMin : '',
|
|
summerAll : '',
|
|
summerThree : '',
|
|
summerRain : '',
|
|
winterAll : '',
|
|
winterSunnyAvg : '',
|
|
winterSunnyMax : '',
|
|
winterSunnyMin : '',
|
|
groundWaterAvg : '',
|
|
groundWaterSummer : '',
|
|
groundWaterWinter : '',
|
|
rdi : '',
|
|
rdiRain : '',
|
|
},
|
|
{
|
|
flowRate : '수질\n(mg/L)',
|
|
waterQlty : '유입\n(BOD)',
|
|
yearAvg : '',
|
|
yearMax : '',
|
|
yearMin : '',
|
|
summerAll : '',
|
|
summerThree : '',
|
|
summerRain : '',
|
|
winterAll : '',
|
|
winterSunnyAvg : '',
|
|
winterSunnyMax : '',
|
|
winterSunnyMin : '',
|
|
groundWaterAvg : '',
|
|
groundWaterSummer : '',
|
|
groundWaterWinter : '',
|
|
rdi : '',
|
|
rdiRain : '',
|
|
},
|
|
{
|
|
flowRate : '수질\n(mg/L)',
|
|
waterQlty : '방류\n(BOD)',
|
|
yearAvg : '',
|
|
yearMax : '',
|
|
yearMin : '',
|
|
summerAll : '',
|
|
summerThree : '',
|
|
summerRain : '',
|
|
winterAll : '',
|
|
winterSunnyAvg : '',
|
|
winterSunnyMax : '',
|
|
winterSunnyMin : '',
|
|
groundWaterAvg : '',
|
|
groundWaterSummer : '',
|
|
groundWaterWinter : '',
|
|
rdi : '',
|
|
rdiRain : '',
|
|
},
|
|
{
|
|
flowRate : '수질\n(mg/L)',
|
|
waterQlty : '유입\n(T-N)',
|
|
yearAvg : '',
|
|
yearMax : '',
|
|
yearMin : '',
|
|
summerAll : '',
|
|
summerThree : '',
|
|
summerRain : '',
|
|
winterAll : '',
|
|
winterSunnyAvg : '',
|
|
winterSunnyMax : '',
|
|
winterSunnyMin : '',
|
|
groundWaterAvg : '',
|
|
groundWaterSummer : '',
|
|
groundWaterWinter : '',
|
|
rdi : '',
|
|
rdiRain : '',
|
|
},
|
|
{
|
|
flowRate : '수질\n(mg/L)',
|
|
waterQlty : '방류\n(T-N)',
|
|
yearAvg : '',
|
|
yearMax : '',
|
|
yearMin : '',
|
|
summerAll : '',
|
|
summerThree : '',
|
|
summerRain : '',
|
|
winterAll : '',
|
|
winterSunnyAvg : '',
|
|
winterSunnyMax : '',
|
|
winterSunnyMin : '',
|
|
groundWaterAvg : '',
|
|
groundWaterSummer : '',
|
|
groundWaterWinter : '',
|
|
rdi : '',
|
|
rdiRain : '',
|
|
},
|
|
{
|
|
flowRate : '수질\n(mg/L)',
|
|
waterQlty : '유입\n(T-P)',
|
|
yearAvg : '',
|
|
yearMax : '',
|
|
yearMin : '',
|
|
summerAll : '',
|
|
summerThree : '',
|
|
summerRain : '',
|
|
winterAll : '',
|
|
winterSunnyAvg : '',
|
|
winterSunnyMax : '',
|
|
winterSunnyMin : '',
|
|
groundWaterAvg : '',
|
|
groundWaterSummer : '',
|
|
groundWaterWinter : '',
|
|
rdi : '',
|
|
rdiRain : '',
|
|
},
|
|
{
|
|
flowRate : '수질\n(mg/L)',
|
|
waterQlty : '방류\n(T-P)',
|
|
yearAvg : '',
|
|
yearMax : '',
|
|
yearMin : '',
|
|
summerAll : '',
|
|
summerThree : '',
|
|
summerRain : '',
|
|
winterAll : '',
|
|
winterSunnyAvg : '',
|
|
winterSunnyMax : '',
|
|
winterSunnyMin : '',
|
|
groundWaterAvg : '',
|
|
groundWaterSummer : '',
|
|
groundWaterWinter : '',
|
|
rdi : '',
|
|
rdiRain : '',
|
|
},
|
|
{
|
|
flowRate : '총인\n시설\n수질\n(mg/L)',
|
|
waterQlty : '총인설비\n유입(T-P)',
|
|
yearAvg : '',
|
|
yearMax : '',
|
|
yearMin : '',
|
|
summerAll : '',
|
|
summerThree : '',
|
|
summerRain : '',
|
|
winterAll : '',
|
|
winterSunnyAvg : '',
|
|
winterSunnyMax : '',
|
|
winterSunnyMin : '',
|
|
groundWaterAvg : '',
|
|
groundWaterSummer : '',
|
|
groundWaterWinter : '',
|
|
rdi : '',
|
|
rdiRain : '',
|
|
},
|
|
{
|
|
flowRate : '총인\n시설\n수질\n(mg/L)',
|
|
waterQlty : '총인설비\n방류(T-P)',
|
|
yearAvg : '',
|
|
yearMax : '',
|
|
yearMin : '',
|
|
summerAll : '',
|
|
summerThree : '',
|
|
summerRain : '',
|
|
winterAll : '',
|
|
winterSunnyAvg : '',
|
|
winterSunnyMax : '',
|
|
winterSunnyMin : '',
|
|
groundWaterAvg : '',
|
|
groundWaterSummer : '',
|
|
groundWaterWinter : '',
|
|
rdi : '',
|
|
rdiRain : '',
|
|
},
|
|
]
|
|
|
|
const chart_inflowRain : lineBarChartDataProps[] = [];
|
|
const chart_bodRain : lineBarChartDataProps[] = [];
|
|
const chart_inflTp : lineChartDataProps[] = [];
|
|
const chart_chongInTp : lineChartDataProps[] = [];
|
|
const chart_efflTp : lineChartDataProps[] = [];
|
|
const chart_inflTn : lineChartDataProps[] = [];
|
|
const chart_efflTn : lineChartDataProps[] = [];
|
|
const chart_inflBod : lineChartDataProps[] = [];
|
|
const chart_efflBod : lineChartDataProps[] = [];
|
|
|
|
const rainManageList : RainManageListProps[] = [];
|
|
|
|
const drainageEquipmentList : DrainageEquipmentListProps[] = [
|
|
{
|
|
part1 : '청천시청',
|
|
part2 : '청천시청',
|
|
nowSum : 101,
|
|
nowJoin : 102,
|
|
nowSep : 103,
|
|
stepOneSum : 104,
|
|
stepOneJoin : 105,
|
|
stepOneSep : 106,
|
|
stepTwoSum : 107,
|
|
stepTwoJoin : 108,
|
|
stepTwoSep : 109,
|
|
stepThreeSum : 110,
|
|
stepThreeJoin : 111,
|
|
stepThreeSep : 112,
|
|
stepFourSum : 113,
|
|
stepFourJoin : 114,
|
|
stepFourSep : 115,
|
|
etc : '1050',
|
|
}
|
|
];
|
|
|
|
/**====================================
|
|
* Store - api (데이터 호출)
|
|
====================================*/
|
|
/* 시설정보 및 운영현황 - 계획 */
|
|
const fetchFacilityPlan = async (targetYear : string | undefined, fcltyCd : string | undefined) => {
|
|
try {
|
|
targetYear = targetYear ? targetYear : "2024";
|
|
const baseUrl = 'https://apigateway.rsonesoft.com/dc-service/api/v1/nowDmgMtncGnsvy';
|
|
const queryParams = new URLSearchParams();
|
|
|
|
if (fcltyCd) queryParams.append('swtrmtFcltCd', fcltyCd);
|
|
if (targetYear) queryParams.append('targetYear',targetYear);
|
|
const queryString = queryParams.toString();
|
|
const url = queryString ? `${baseUrl}?${queryString}` : baseUrl;
|
|
const res = await getFetchAreaList(url);
|
|
return res
|
|
} catch (error) {
|
|
console.error('시설계획정보를 가져오는데 실패했습니다:', error);
|
|
return {data: [], count: 0};
|
|
}
|
|
};
|
|
|
|
/* 시설정보 및 운영현황 - 운영실태 */
|
|
const fetchOperationStatus = async (searchYear: string|undefined, fcltyCd: string|undefined) => {
|
|
try{
|
|
const url = '/dashBoard/mngInfo/' + (searchYear?searchYear:'2024') + '/' + (fcltyCd?fcltyCd:'');
|
|
const res = await getFetch('fo', url);
|
|
return { data: res.data, count: res.count }
|
|
} catch (error) {
|
|
console.error('운영실태 데이터를 가져오는데 실패했습니다:', error);
|
|
return { data: [], count: 0 };
|
|
}
|
|
}
|
|
|
|
// 주요그래프 데이터
|
|
const fetchMainGraph = async (searchYear: string|undefined, fcltyCd: string|undefined) => {
|
|
try {
|
|
const url = '/fclt/qlty/hist/' + (searchYear?searchYear:'2024') + '/' + (fcltyCd?fcltyCd:'11680PB001R');
|
|
const res = await getFetch('fo', url);
|
|
return { data: res.data, count: res.count }
|
|
} catch (error) {
|
|
console.error('주요그래프 데이터를 가져오는데 실패했습니다:', error);
|
|
return { data: [], count: 0 };
|
|
}
|
|
}
|
|
|
|
// 배수설비 정비현황
|
|
const fetchDrainageEquipment = async (searchYear: string|undefined, fcltyCd: string|undefined) => {
|
|
try{
|
|
/* const url = '/fclt/qlty/hist/' + (searchYear?searchYear:'2024') + '/' + (fcltyCd?fcltyCd:'11680PB001R');
|
|
const res = await getFetch('fo', url);
|
|
return { data: res.data, count: res.count } */
|
|
console.log(searchYear, fcltyCd);
|
|
return { data : drainageEquipmentList, count : drainageEquipmentList.length }
|
|
} catch (error) {
|
|
console.error('배수설비 정비현황 데이터를 가져오는데 실패했습니다:', error);
|
|
return { data: [], count: 0 };
|
|
}
|
|
}
|
|
|
|
/**====================================
|
|
* Store - action
|
|
====================================*/
|
|
export type DashBoardActions = {
|
|
initializeDashBoardData(): Promise<void>;
|
|
/** 시설정보 및 운영현황 - 계획정보 */
|
|
searchPlanInfo(targetYear: string, fcltyCd: string): Promise<void>;
|
|
/** 시설정보 및 운영현황 - 운영실태 */
|
|
searchOperationStatus(isExcel: boolean, searchYear: string, fcltyCd: string): Promise<void>;
|
|
/** 주요그래프 데이터 */
|
|
searchMainGraph(searchYear: string, fcltyCd: string): Promise<void>;
|
|
/**강우일 운영현황 */
|
|
searchRainManage(searchYear: string, fcltyCd: string, isExcel: boolean): Promise<void>;
|
|
/**배수설비 정비현황 */
|
|
searchDrainageEquipment(searchYear: string, fcltyCd: string, isExcel: boolean): Promise<void>;
|
|
}
|
|
|
|
export type DashBoardType = {
|
|
DashboardMain: {
|
|
isInit: boolean;
|
|
topLabelArray:string[];
|
|
},
|
|
|
|
FcltyMain : {
|
|
isInit : boolean;
|
|
upHeadListFclty : TableUpperProps[];
|
|
fcltyList : mainFcltyProps[];
|
|
},
|
|
|
|
PlanFclty : {
|
|
isInit : boolean;
|
|
planYearList : string[];
|
|
upHeadListPlanFclty : TableUpperProps[];
|
|
planFcltyList : planFcltyListProps[];
|
|
},
|
|
|
|
OperationStatus : {
|
|
isInit : boolean;
|
|
upHeadListOperationStatus : TableUpperProps[];
|
|
operationalStatusList : OperationalStatusListProps[];
|
|
}
|
|
|
|
MainGraph : {
|
|
isInit : boolean;
|
|
chart_inflowRain : lineBarChartDataProps[];
|
|
chart_bodRain : lineBarChartDataProps[];
|
|
chart_inflTp : lineChartDataProps[];
|
|
chart_chongInTp : lineChartDataProps[];
|
|
chart_efflTp : lineChartDataProps[];
|
|
chart_inflTn : lineChartDataProps[];
|
|
chart_efflTn : lineChartDataProps[];
|
|
chart_inflBod : lineChartDataProps[];
|
|
chart_efflBod : lineChartDataProps[];
|
|
},
|
|
|
|
RainManage : {
|
|
isInit : boolean;
|
|
upHeadListRainManage : TableUpperProps[];
|
|
rainManageList : RainManageListProps[];
|
|
excelList : RainManageExcelType[];
|
|
},
|
|
|
|
DrainageEquipment : {
|
|
isInit : boolean;
|
|
upHeadListDrainageEquipment : TableUpperProps[];
|
|
drainageEquipmentList : DrainageEquipmentListProps[];
|
|
drainageEquipmentExcelList : DrainageEquipmentExcelType[];
|
|
}
|
|
}
|
|
|
|
export type DashBoardStore = DashBoardType & DashBoardActions;
|
|
|
|
export const dashBoardInitState:DashBoardType = {
|
|
DashboardMain: {
|
|
isInit: false,
|
|
topLabelArray: DashBoardTopLabelArray,
|
|
},
|
|
|
|
FcltyMain : {
|
|
isInit : false,
|
|
upHeadListFclty : upHeadListFclty,
|
|
fcltyList : fcltyList,
|
|
},
|
|
|
|
PlanFclty : {
|
|
isInit : true,
|
|
planYearList : planYearList,
|
|
upHeadListPlanFclty : upHeadListPlanFclty,
|
|
planFcltyList : planFcltyList
|
|
},
|
|
|
|
OperationStatus : {
|
|
isInit : false,
|
|
upHeadListOperationStatus : upHeadListOperationStatus,
|
|
operationalStatusList : operationalStatusList
|
|
},
|
|
|
|
MainGraph : {
|
|
isInit : false,
|
|
chart_inflowRain : chart_inflowRain,
|
|
chart_bodRain : chart_bodRain,
|
|
chart_inflTp : chart_inflTp,
|
|
chart_chongInTp : chart_chongInTp,
|
|
chart_efflTp : chart_efflTp,
|
|
chart_inflTn : chart_inflTn,
|
|
chart_efflTn : chart_efflTn,
|
|
chart_inflBod : chart_inflBod,
|
|
chart_efflBod : chart_efflBod
|
|
},
|
|
|
|
RainManage : {
|
|
isInit : false,
|
|
upHeadListRainManage : upHeadListRainManage,
|
|
rainManageList : rainManageList,
|
|
excelList : []
|
|
},
|
|
|
|
DrainageEquipment : {
|
|
isInit : false,
|
|
upHeadListDrainageEquipment : upHeadListDrainageEquipment,
|
|
drainageEquipmentList : drainageEquipmentList,
|
|
drainageEquipmentExcelList : []
|
|
}
|
|
}
|
|
|
|
/**
|
|
* 데이터 폼 포맷설정
|
|
*/
|
|
export const dataFormSettingPlan=(item : planFcltyListProps) => {
|
|
DataForm({ type: 'float2', column: 'provisionalApproval', item: item as unknown as Record<string, unknown> });
|
|
DataForm({ type: 'float2', column: 'now', item: item as unknown as Record<string, unknown>});
|
|
DataForm({ type: 'float2', column: 'stepOne', item: item as unknown as Record<string, unknown>});
|
|
DataForm({ type: 'float2', column: 'stepTwo', item: item as unknown as Record<string, unknown>});
|
|
DataForm({ type: 'float2', column: 'stepThree', item: item as unknown as Record<string, unknown>});
|
|
DataForm({ type: 'float2', column: 'stepFour', item: item as unknown as Record<string, unknown>});
|
|
}
|
|
|
|
export const dataFormSetting=(item : OperationalStatusListProps)=> {
|
|
DataForm({ type: 'float2', column: 'yearAvg', item: item as unknown as Record<string, unknown> });
|
|
DataForm({ type: 'float2', column: 'yearMax', item: item as unknown as Record<string, unknown>});
|
|
DataForm({ type: 'float2', column: 'yearMin', item: item as unknown as Record<string, unknown>});
|
|
DataForm({ type: 'float2', column: 'summerAll', item: item as unknown as Record<string, unknown>});
|
|
DataForm({ type: 'float2', column: 'summerThree', item: item as unknown as Record<string, unknown>});
|
|
DataForm({ type: 'float2', column: 'summerRain', item: item as unknown as Record<string, unknown>});
|
|
DataForm({ type: 'float2', column: 'winterAll', item: item as unknown as Record<string, unknown>});
|
|
DataForm({ type: 'float2', column: 'winterSunnyAvg', item: item as unknown as Record<string, unknown>});
|
|
DataForm({ type: 'float2', column: 'winterSunnyMax', item: item as unknown as Record<string, unknown>});
|
|
DataForm({ type: 'float2', column: 'winterSunnyMin', item: item as unknown as Record<string, unknown>});
|
|
DataForm({ type: 'float2', column: 'groundWaterAvg', item: item as unknown as Record<string, unknown>});
|
|
DataForm({ type: 'float2', column: 'groundWaterSummer', item: item as unknown as Record<string, unknown>});
|
|
DataForm({ type: 'float2', column: 'groundWaterWinter', item: item as unknown as Record<string, unknown>});
|
|
DataForm({ type: 'float2', column: 'rainRate', item: item as unknown as Record<string, unknown>});
|
|
};
|
|
|
|
const changeValue=(operationalStatus, data, keyTxt = 'INFL_AMNT')=>{
|
|
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] : '';
|
|
// 여름
|
|
operationalStatus.summerAll = data.summer ? (keyTxt.includes('_TP') || keyTxt.includes("_TN"))? data.summer?Number(Math.round(data.summer['AVG_'+keyTxt] * 1000) / 1000).toFixed(3).toString():'': data.summer['AVG_'+keyTxt] : '';
|
|
operationalStatus.summerThree = data.summerRainy ? (keyTxt.includes('_TP') || keyTxt.includes("_TN"))? data.summerRainy?Number(Math.round(data.summerRainy["AVG_" + keyTxt] * 1000) / 1000).toFixed(3).toString():'': data.summerRainy["AVG_" + keyTxt] : '';
|
|
operationalStatus.summerRain = data.summerSunny ? (keyTxt.includes('_TP') || keyTxt.includes("_TN"))? data.summerSunny?Number(Math.round(data.summerSunny["AVG_" + keyTxt] * 1000) / 1000).toFixed(3).toString():'': data.summerSunny["AVG_" + keyTxt] : '';
|
|
// 겨울
|
|
operationalStatus.winterAll = data.winter ? (keyTxt.includes('_TP') || keyTxt.includes("_TN"))? data.winter?Number(Math.round(data.winter["AVG_" + keyTxt] * 1000) / 1000).toFixed(3).toString():'': data.winter["AVG_" + keyTxt] : '';
|
|
operationalStatus.winterSunnyMin = data.winterSunny ? (keyTxt.includes('_TP') || keyTxt.includes("_TN"))? data.winterSunny?Number(Math.round(data.winterSunny["MIN_" + keyTxt] * 1000) / 1000).toFixed(3).toString():'': data.winterSunny["MIN_" + keyTxt] : '';
|
|
operationalStatus.winterSunnyAvg = data.winterSunny ? (keyTxt.includes('_TP') || keyTxt.includes("_TN"))? data.winterSunny?Number(Math.round(data.winterSunny["AVG_" + keyTxt] * 1000) / 1000).toFixed(3).toString():'': data.winterSunny["AVG_" + keyTxt] : '';
|
|
operationalStatus.winterSunnyMax = data.winterSunny ? (keyTxt.includes('_TP') || keyTxt.includes("_TN"))? data.winterSunny?Number(Math.round(data.winterSunny["MAX_" + keyTxt] * 1000) / 1000).toFixed(3).toString():'': data.winterSunny["MAX_" + keyTxt] : '';
|
|
// 지하수
|
|
operationalStatus.groundWaterAvg = 10;
|
|
operationalStatus.groundWaterSummer = 11;
|
|
operationalStatus.groundWaterWinter = 12;
|
|
// 오염물질
|
|
// RDII 추정 = 하절기(6~8월) 중 최저 유입 BOD일때 유입유량 x ((동절기 청천시 유입BOD - 하절기(6~8월) 중 최저 유입BOD) / (동절기 청천시 유입BOD))
|
|
const summerLowFlow = data.summerBod && data.summerBod.INFL_AMNT && data.summerBod.INFL_AMNT != 'null' ? Number(data.summerBod.INFL_AMNT) : 0;
|
|
const winterAvgBod = data.winterSunny && data.winterSunny.AVG_INFL_ASSCT_BFR_WQLT_BOD && data.winterSunny.AVG_INFL_ASSCT_BFR_WQLT_BOD != 'null' ? Number(data.winterSunny.AVG_INFL_ASSCT_BFR_WQLT_BOD) : 0;
|
|
const summerLowBod = data.summerBod && data.summerBod.MIN_INFL_ASSCT_BFR_WQLT_BOD && data.summerBod.MIN_INFL_ASSCT_BFR_WQLT_BOD != 'null' ? Number(data.summerBod.MIN_INFL_ASSCT_BFR_WQLT_BOD) : 0;
|
|
const summerLowRain = data.summerBod && data.summerBod.INFO_RN_DAY && data.summerBod.INFO_RN_DAY != 'null' ? Number(data.summerBod.INFO_RN_DAY) : 0;
|
|
operationalStatus.rdi = winterAvgBod === 0 ? 0 : summerLowFlow * ((winterAvgBod - summerLowBod) / winterAvgBod);
|
|
operationalStatus.rdiRain = summerLowRain;
|
|
}
|
|
|
|
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.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.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() : '';
|
|
}
|
|
|
|
export const dashBoardReducer:(set:(fn: (state: DashBoardType) => DashBoardType) => void)=>DashBoardActions=(set: (fn: (state: DashBoardType) => DashBoardType) => void) => {
|
|
return {
|
|
initializeDashBoardData: async () => {
|
|
set((state: DashBoardType) => ({
|
|
...state,
|
|
DashboardMain: {
|
|
...state.DashboardMain,
|
|
isInit: true,
|
|
}
|
|
}));
|
|
},
|
|
|
|
/** 시설정보 및 운영현황 - 계획정보 */
|
|
searchPlanInfo : async (targetYear: string, fcltyCd: string) => {
|
|
const res = await fetchFacilityPlan(targetYear, fcltyCd);
|
|
|
|
planFcltyList.map((el, index) => {
|
|
planYearList = [];
|
|
planYearList.push(res[0]?res[0].yrDt4.toString():"");
|
|
planYearList.push(res[0]?res[0].yrDc1.toString():"");
|
|
planYearList.push(res[0]?res[0].yrDc2.toString():"");
|
|
planYearList.push(res[0]?res[0].yrDc3.toString():"");
|
|
planYearList.push(res[0]?res[0].yrDc4.toString():"");
|
|
|
|
if(index === 0){
|
|
el.provisionalApproval = res&&res.length>0?res[0].planSwageQntSumDt4:'';
|
|
el.now = res&&res.length>0?res[0].planSwageQntSum:'';
|
|
el.stepOne = res&&res.length>0?res[0].planSwageQntSumDc1:'';
|
|
el.stepTwo = res&&res.length>0?res[0].planSwageQntSumDc2:'';
|
|
el.stepThree = res&&res.length>0?res[0].planSwageQntSumDc3:'';
|
|
el.stepFour = res&&res.length>0?res[0].planSwageQntSumDc4:'';
|
|
}
|
|
if(index === 1){
|
|
el.provisionalApproval = res&&res.length>0?res[0].swtrmtPpltnCntDt4:'';
|
|
el.now = res&&res.length>0?res[0].swtrmtPpltnCnt:'';
|
|
el.stepOne = res&&res.length>0?res[0].swtrmtPpltnCntDc1:'';
|
|
el.stepTwo = res&&res.length>0?res[0].swtrmtPpltnCntDc2:'';
|
|
el.stepThree = res&&res.length>0?res[0].swtrmtPpltnCntDc3:'';
|
|
el.stepFour = res&&res.length>0?res[0].swtrmtPpltnCntDc4:'';
|
|
}
|
|
if(index === 2){
|
|
el.provisionalApproval = res&&res.length>0?res[0].swtrmtZoneAreaDt4:'';
|
|
el.now = res&&res.length>0?res[0].swtrmtZoneArea:'';
|
|
el.stepOne = res&&res.length>0?res[0].swtrmtZoneAreaDc1:'';
|
|
el.stepTwo = res&&res.length>0?res[0].swtrmtZoneAreaDc2:'';
|
|
el.stepThree = res&&res.length>0?res[0].swtrmtZoneAreaDc3:'';
|
|
el.stepFour = res&&res.length>0?res[0].swtrmtZoneAreaDc4:'';
|
|
}
|
|
if(index === 4){
|
|
el.provisionalApproval = res&&res.length>0?res[0].ugwtUseSum:'';
|
|
}
|
|
|
|
// 임시시
|
|
dataFormSettingPlan(el);
|
|
});
|
|
|
|
set((state: DashBoardType) => ({
|
|
...state,
|
|
PlanFclty : {
|
|
...state.PlanFclty,
|
|
planFcltyList : planFcltyList
|
|
}
|
|
}));
|
|
},
|
|
|
|
/** 시설정보 및 운영현황 - 운영실태 */
|
|
searchOperationStatus: async (isExcel: boolean, searchYear: string, fcltyCd: string) => {
|
|
const res = await fetchOperationStatus(searchYear, fcltyCd);
|
|
const data = res.data;
|
|
if(data && operationalStatusList){
|
|
// 유량 - 유입
|
|
if (operationalStatusList?.[0]) {
|
|
// 연간
|
|
const yearAvg = data.yearData===null?'':(data.yearData.AVG_INFL_AMNT?data.yearData.AVG_INFL_AMNT:0)+(data.yearData.AVG_SUM_FLOW?data.yearData.AVG_SUM_FLOW:0)+(data.yearData.AVG_RETURN_AMNT?data.yearData.AVG_RETURN_AMNT:0);
|
|
const yearMax = data.yearData===null?'':(data.yearData.MAX_INFL_AMNT?data.yearData.MAX_INFL_AMNT:0)+(data.yearData.MAX_SUM_FLOW?data.yearData.MAX_SUM_FLOW:0)+(data.yearData.MAX_RETURN_AMNT?data.yearData.MAX_RETURN_AMNT:0);
|
|
const yearMin = data.yearData===null?'':(data.yearData.MIN_INFL_AMNT?data.yearData.MIN_INFL_AMNT:0)+(data.yearData.MIN_SUM_FLOW?data.yearData.MIN_SUM_FLOW:0)+(data.yearData.MIN_RETURN_AMNT?data.yearData.MIN_RETURN_AMNT:0);
|
|
operationalStatusList[0].yearAvg = yearAvg;
|
|
operationalStatusList[0].yearMax = yearMax;
|
|
operationalStatusList[0].yearMin = yearMin;
|
|
// 여름
|
|
operationalStatusList[0].summerAll = data.summer === null ? '' : (
|
|
(data.summer.AVG_INFL_AMNT ? data.summer.AVG_INFL_AMNT : 0) +
|
|
(data.summer.AVG_SUM_FLOW ? data.summer.AVG_SUM_FLOW : 0) +
|
|
(data.summer.AVG_TP_INFL_WQLT_TP ? data.summer.AVG_TP_INFL_WQLT_TP : 0)
|
|
);
|
|
operationalStatusList[0].summerThree = data.summerRainy === null ? '' : (
|
|
(data.summerRainy.AVG_INFL_AMNT ? data.summerRainy.AVG_INFL_AMNT : 0) +
|
|
(data.summerRainy.AVG_SUM_FLOW ? data.summerRainy.AVG_SUM_FLOW : 0) +
|
|
(data.summerRainy.AVG_TP_INFL_WQLT_TP ? data.summerRainy.AVG_TP_INFL_WQLT_TP : 0)
|
|
);
|
|
operationalStatusList[0].summerRain = data.summerSunny === null ? '' : (
|
|
(data.summerSunny.AVG_INFL_AMNT ? data.summerSunny.AVG_INFL_AMNT : 0) +
|
|
(data.summerSunny.AVG_SUM_FLOW ? data.summerSunny.AVG_SUM_FLOW : 0) +
|
|
(data.summerSunny.AVG_TP_INFL_WQLT_TP ? data.summerSunny.AVG_TP_INFL_WQLT_TP : 0)
|
|
);
|
|
// 겨울
|
|
operationalStatusList[0].winterAll = data.winter === null ? '' : (data.winter.AVG_INFL_AMNT ? data.winter.AVG_INFL_AMNT : 0) + (data.winter.AVG_SUM_FLOW ? data.winter.AVG_SUM_FLOW : 0) + (data.winter.AVG_TP_INFL_WQLT_TP ? data.winter.AVG_TP_INFL_WQLT_TP : 0);
|
|
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);
|
|
// 지하수
|
|
operationalStatusList[0].groundWaterAvg = 10;
|
|
operationalStatusList[0].groundWaterSummer = 11;
|
|
operationalStatusList[0].groundWaterWinter = 12;
|
|
// 오염물질
|
|
// RDII 추정 = 하절기(6~8월) 중 최저 유입 BOD일때 유입유량 x ((동절기 청천시 유입BOD - 하절기(6~8월) 중 최저 유입BOD) / (동절기 청천시 유입BOD))
|
|
const summerLowFlow = data.summerBod&&data.summerBod.INFL_AMNT&&data.summerBod.INFL_AMNT!='null'?Number(data.summerBod.INFL_AMNT):0;
|
|
const winterAvgBod = data.winterSunny&&data.winterSunny.AVG_INFL_ASSCT_BFR_WQLT_BOD&&data.winterSunny.AVG_INFL_ASSCT_BFR_WQLT_BOD!='null'?Number(data.winterSunny.AVG_INFL_ASSCT_BFR_WQLT_BOD):0;
|
|
const summerLowBod = data.summerBod&&data.summerBod.MIN_INFL_ASSCT_BFR_WQLT_BOD&&data.summerBod.MIN_INFL_ASSCT_BFR_WQLT_BOD!='null'?Number(data.summerBod.MIN_INFL_ASSCT_BFR_WQLT_BOD):0;
|
|
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]);
|
|
}
|
|
|
|
for(let i=1; i<operationalStatusList.length; i++){
|
|
const txtArray = ['1', 'INFL_AMNT', 'SUM_FLOW', 'RETURN_AMNT', 'EFFL_AMNT', 'INFL_ASSCT_BFR_WQLT_BOD', 'EFFL_WQLT_BOD', 'INFL_ASSCT_BFR_WQLT_TN', 'EFFL_WQLT_TN', 'INFL_ASSCT_BFR_WQLT_TP', 'EFFL_WQLT_TP', 'INFL_ASSCT_BFR_WQLT_TP', 'EFFL_WQLT_TP'];
|
|
if(operationalStatusList[i]){
|
|
if(i < 7){
|
|
changeValue(operationalStatusList[i], data, txtArray[i]);
|
|
dataFormSetting(operationalStatusList[i]!);
|
|
}else{
|
|
calcValue(operationalStatusList[i], data, txtArray[i]);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
//const excelDownList: RainManageExcelType[] = [];
|
|
/* if(isExcel){
|
|
res.data.forEach(item => {
|
|
dataFormSetting(item)
|
|
item.fctCpc = parseFloat(item.fctCpc.toString().replace(/,/g, ''));
|
|
item.sidoNm = item.lclgvrnmntNm.split(' ')[0]?.toString() || '';
|
|
item.sggNm = item.lclgvrnmntNm.split(' ')[1]?.toString() || '';
|
|
excelDownList.push({
|
|
시설코드: item.bscFctCd,
|
|
시설이름: item.bscFctNm,
|
|
측정일자: item.msrDt,
|
|
시도: item.sidoNm,
|
|
시군구: item.sggNm,
|
|
주소: item.addr,
|
|
용량: item.fctCpc,
|
|
유입BOD: item.inflAssctAftWqltBod,
|
|
유입TN: item.inflAssctAftWqltTn,
|
|
유입TP: item.inflAssctBfrWqltTp,
|
|
유출BOD: item.efflWqltBod,
|
|
유출TN: item.efflWqltTn,
|
|
유출TP: item.efflWqltTp,
|
|
환경청: item.rgnNm,
|
|
유역: item.rvbsn,
|
|
대유역: item.lgbsn,
|
|
중유역: item.mdmbsn,
|
|
});
|
|
});
|
|
}else{ */
|
|
/* data.forEach((item: OperationalStatusListProps) => {
|
|
}); */
|
|
/* } */
|
|
set((state: DashBoardType) => ({
|
|
...state,
|
|
OperationStatus: {
|
|
...state.OperationStatus,
|
|
operationalStatusList: operationalStatusList,
|
|
operationalStatusCount: res.count
|
|
}
|
|
}))
|
|
},
|
|
|
|
searchMainGraph: async (searchYear: string, fcltyCd: string) => {
|
|
const res = await fetchMainGraph(searchYear, fcltyCd);
|
|
if(res == null || res.data == null || res.data.length === 0) {
|
|
set((state: DashBoardType) => ({
|
|
...state,
|
|
MainGraph: {
|
|
...state.MainGraph,
|
|
chart_inflowRain: [],
|
|
chart_bodRain: [],
|
|
chart_inflTp: [],
|
|
chart_chongInTp: [],
|
|
chart_efflTp: [],
|
|
chart_inflTn: [],
|
|
chart_efflTn: [],
|
|
chart_inflBod: [],
|
|
chart_efflBod: [],
|
|
}
|
|
}));
|
|
return;
|
|
}
|
|
|
|
const chart_inflowRain = 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.fctCpc ?? 0,
|
|
lineVal1: item.inflAmnt ?? 0,
|
|
}));
|
|
|
|
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,
|
|
}));
|
|
|
|
const chart_inflTp = res.data.wqltObjs.map((item: FacilityWaterQltyProps) => ({
|
|
label: item.msrDt.substring(0, 4)+"-"+item.msrDt.substring(4, 6)+"-"+item.msrDt.substring(6, 8),
|
|
val : item.inflAssctBfrWqltTp ?? 0
|
|
}));
|
|
|
|
const chart_chongInTp = res.data.wqltObjs.map((item: FacilityWaterQltyProps) => ({
|
|
label: item.msrDt.substring(0, 4)+"-"+item.msrDt.substring(4, 6)+"-"+item.msrDt.substring(6, 8),
|
|
val : item.tpInflWqltTp ?? 0
|
|
}));
|
|
|
|
const chart_efflTp = res.data.wqltObjs.map((item: FacilityWaterQltyProps) => ({
|
|
label: item.msrDt.substring(0, 4)+"-"+item.msrDt.substring(4, 6)+"-"+item.msrDt.substring(6, 8),
|
|
val : item.efflWqltTp ?? 0
|
|
}));
|
|
|
|
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
|
|
}));
|
|
|
|
const chart_efflTn = res.data.wqltObjs.map((item: FacilityWaterQltyProps) => ({
|
|
label: item.msrDt.substring(0, 4)+"-"+item.msrDt.substring(4, 6)+"-"+item.msrDt.substring(6, 8),
|
|
val : item.efflWqltTn ?? 0
|
|
}));
|
|
|
|
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
|
|
}));
|
|
|
|
const chart_efflBod = res.data.wqltObjs.map((item: FacilityWaterQltyProps) => ({
|
|
label: item.msrDt.substring(0, 4)+"-"+item.msrDt.substring(4, 6)+"-"+item.msrDt.substring(6, 8),
|
|
val : item.efflWqltBod ?? 0
|
|
}));
|
|
|
|
set((state: DashBoardType) => ({
|
|
...state,
|
|
MainGraph: {
|
|
...state.MainGraph,
|
|
chart_inflowRain: chart_inflowRain,
|
|
chart_bodRain: chart_bodRain,
|
|
chart_inflTp: chart_inflTp,
|
|
chart_chongInTp : chart_chongInTp,
|
|
chart_efflTp: chart_efflTp,
|
|
chart_inflTn: chart_inflTn,
|
|
chart_efflTn: chart_efflTn,
|
|
chart_inflBod: chart_inflBod,
|
|
chart_efflBod: chart_efflBod
|
|
}
|
|
}))
|
|
},
|
|
|
|
searchRainManage: async (searchYear: string, fcltyCd: string, isExcel : boolean) => {
|
|
const res = await fetchMainGraph(searchYear, fcltyCd);
|
|
if(res == null || res.data.wqltObjs == null || res.data.wqltObjs.length === 0) {
|
|
set((state: DashBoardType) => ({
|
|
...state,
|
|
RainManage: {
|
|
...state.RainManage,
|
|
rainManageList: [],
|
|
}
|
|
}));
|
|
return;
|
|
}
|
|
const fcltyCpcValue = res.data.wqltObjs[0].fctCpc;
|
|
|
|
const itemList = ['계', '3~10mm 미만', '10~20mm 미만', '20~30mm 미만', '30~40mm 미만', '40~50mm 미만', '50mm~60mm 미만', '60mm 이상'];
|
|
const rainRate = ['0', '0', '0', '0', '0', '0', '0', '0'];
|
|
const rainDate = [0, 0, 0, 0, 0, 0, 0, 0];
|
|
const inflAmtCnt = [0, 0, 0, 0, 0, 0, 0, 0];
|
|
const inflAmnt = [0, 0, 0, 0, 0, 0, 0, 0];
|
|
const fcltyCpct = [0, 0, 0, 0, 0, 0, 0, 0];
|
|
const dsInflWqltBod: number[] = [0, 0, 0, 0, 0, 0, 0, 0];
|
|
const dsInflWqltCod: number[] = [0, 0, 0, 0, 0, 0, 0, 0];
|
|
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 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 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];
|
|
// 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);
|
|
}*/
|
|
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);
|
|
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);
|
|
}else if(Number(item.infoRnDay) >= 10 && Number(item.infoRnDay) < 20){
|
|
rainDate[2] = Number(rainDate[2] || 0) + 1;
|
|
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);
|
|
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);
|
|
efflWqltSsCnt[2] = Number(efflWqltSsCnt[2] || 0) + 1;
|
|
efflWqltSs[2] = Number(efflWqltSs[2] || 0) + Number(item.efflWqltSs || 0);
|
|
efflWqltTnCnt[2] = Number(efflWqltTnCnt[2] || 0) + 1;
|
|
efflWqltTn[2] = Number(efflWqltTn[2] || 0) + Number(item.efflWqltTn || 0);
|
|
efflWqltTpCnt[2] = Number(efflWqltTpCnt[2] || 0) + 1;
|
|
efflWqltTp[2] = Number(efflWqltTp[2] || 0) + Number(item.efflWqltTp || 0);
|
|
}else if(Number(item.infoRnDay) >= 20 && Number(item.infoRnDay) < 30){
|
|
rainDate[3] = Number(rainDate[3] || 0) + 1;
|
|
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);
|
|
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);
|
|
efflWqltSsCnt[3] = Number(efflWqltSsCnt[3] || 0) + 1;
|
|
efflWqltSs[3] = Number(efflWqltSs[3] || 0) + Number(item.efflWqltSs || 0);
|
|
efflWqltTnCnt[3] = Number(efflWqltTnCnt[3] || 0) + 1;
|
|
efflWqltTn[3] = Number(efflWqltTn[3] || 0) + Number(item.efflWqltTn || 0);
|
|
efflWqltTpCnt[3] = Number(efflWqltTpCnt[3] || 0) + 1;
|
|
efflWqltTp[3] = Number(efflWqltTp[3] || 0) + Number(item.efflWqltTp || 0);
|
|
}else if(Number(item.infoRnDay) >= 30 && Number(item.infoRnDay) < 40){
|
|
rainDate[4] = Number(rainDate[4] || 0) + 1;
|
|
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);
|
|
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);
|
|
efflWqltSsCnt[4] = Number(efflWqltSsCnt[4] || 0) + 1;
|
|
efflWqltSs[4] = Number(efflWqltSs[4] || 0) + Number(item.efflWqltSs || 0);
|
|
efflWqltTnCnt[4] = Number(efflWqltTnCnt[5] || 0) + 1;
|
|
efflWqltTn[4] = Number(efflWqltTn[4] || 0) + Number(item.efflWqltTn || 0);
|
|
efflWqltTpCnt[4] = Number(efflWqltTpCnt[5] || 0) + 1;
|
|
efflWqltTp[4] = Number(efflWqltTp[4] || 0) + Number(item.efflWqltTp || 0);
|
|
}else if(Number(item.infoRnDay) >= 40 && Number(item.infoRnDay) < 50){
|
|
rainDate[5] = Number(rainDate[5] || 0) + 1;
|
|
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);
|
|
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);
|
|
efflWqltSsCnt[5] = Number(efflWqltSsCnt[5] || 0) + 1;
|
|
efflWqltSs[5] = Number(efflWqltSs[5] || 0) + Number(item.efflWqltSs || 0);
|
|
efflWqltTnCnt[5] = Number(efflWqltTnCnt[5] || 0) + 1;
|
|
efflWqltTn[5] = Number(efflWqltTn[5] || 0) + Number(item.efflWqltTn || 0);
|
|
efflWqltTpCnt[5] = Number(efflWqltTpCnt[5] || 0) + 1;
|
|
efflWqltTp[5] = Number(efflWqltTp[5] || 0) + Number(item.efflWqltTp || 0);
|
|
}else if(Number(item.infoRnDay) >= 50 && Number(item.infoRnDay) < 60){
|
|
rainDate[6] = Number(rainDate[6] || 0) + 1;
|
|
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);
|
|
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);
|
|
efflWqltSsCnt[6] = Number(efflWqltSsCnt[6] || 0) + 1;
|
|
efflWqltSs[6] = Number(efflWqltSs[6] || 0) + Number(item.efflWqltSs || 0);
|
|
efflWqltTnCnt[6] = Number(efflWqltTnCnt[6] || 0) + 1;
|
|
efflWqltTn[6] = Number(efflWqltTn[6] || 0) + Number(item.efflWqltTn || 0);
|
|
efflWqltTpCnt[6] = Number(efflWqltTpCnt[6] || 0) + 1;
|
|
efflWqltTp[6] = Number(efflWqltTp[6] || 0) + Number(item.efflWqltTp || 0);
|
|
}else if(Number(item.infoRnDay) >= 60){
|
|
rainDate[7] = Number(rainDate[7] || 0) + 1;
|
|
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);
|
|
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);
|
|
efflWqltSsCnt[7] = Number(efflWqltSsCnt[7] || 0) + 1;
|
|
efflWqltSs[7] = Number(efflWqltSs[7] || 0) + Number(item.efflWqltSs || 0);
|
|
efflWqltTnCnt[7] = Number(efflWqltTnCnt[7] || 0) + 1;
|
|
efflWqltTn[7] = Number(efflWqltTn[7] || 0) + Number(item.efflWqltTn || 0);
|
|
efflWqltTpCnt[7] = Number(efflWqltTpCnt[7] || 0) + 1;
|
|
efflWqltTp[7] = Number(efflWqltTp[7] || 0) + Number(item.efflWqltTp || 0);
|
|
}
|
|
});
|
|
|
|
// Process the data and create rain management list
|
|
if(res.data&&res.data.dsWqltObjs&&res.data.dsWqltObjs.length > 0){
|
|
// 설계 유입수질 데이터 가져오기 - 0값이 있으면 이전 차수에서 가져오기
|
|
const getDesignWaterQualityData = (stepIndex: number, maxPreviousSteps: number = 3) => {
|
|
for (let i = 0; i <= maxPreviousSteps && stepIndex - i >= 0; i++) {
|
|
const currentStep = res.data.dsWqltObjs[stepIndex - i];
|
|
if (currentStep &&
|
|
currentStep.dsInflWqltBod > 0 &&
|
|
currentStep.dsInflWqltCod > 0 &&
|
|
currentStep.dsInflWqltSs > 0 &&
|
|
currentStep.dsInflWqltTn > 0 &&
|
|
currentStep.dsInflWqltTp > 0) {
|
|
return {
|
|
dsInflWqltBod: currentStep.dsInflWqltBod,
|
|
dsInflWqltCod: currentStep.dsInflWqltCod,
|
|
dsInflWqltSs: currentStep.dsInflWqltSs,
|
|
dsInflWqltTn: currentStep.dsInflWqltTn,
|
|
dsInflWqltTp: currentStep.dsInflWqltTp
|
|
};
|
|
}
|
|
}
|
|
// 모든 차수에서 유효한 데이터를 찾지 못한 경우 기본값 반환
|
|
return {
|
|
dsInflWqltBod: 0,
|
|
dsInflWqltCod: 0,
|
|
dsInflWqltSs: 0,
|
|
dsInflWqltTn: 0,
|
|
dsInflWqltTp: 0
|
|
};
|
|
};
|
|
|
|
const lastStepIndex = res.data.dsWqltObjs.length - 1;
|
|
const designData = getDesignWaterQualityData(lastStepIndex);
|
|
|
|
dsInflWqltBod[0] = designData.dsInflWqltBod;
|
|
dsInflWqltCod[0] = designData.dsInflWqltCod;
|
|
dsInflWqltSs[0] = designData.dsInflWqltSs;
|
|
dsInflWqltTn[0] = designData.dsInflWqltTn;
|
|
dsInflWqltTp[0] = designData.dsInflWqltTp;
|
|
}
|
|
|
|
rainDate[0] = (Number(rainDate[1]) || 0) + (Number(rainDate[2]) || 0) + (Number(rainDate[3]) || 0) +
|
|
(Number(rainDate[4]) || 0) + (Number(rainDate[5]) || 0) + (Number(rainDate[6]) || 0) +
|
|
(Number(rainDate[7]) || 0);
|
|
|
|
// 강수비율
|
|
for(let idx=0; idx<rainDate.length; idx++){
|
|
if(Number(rainDate[idx]) > 0){
|
|
rainRate[0] = '100';
|
|
rainRate[idx] = (Math.round(Number(rainDate[idx])/Number(rainDate[0])*100*100)/100).toString();
|
|
}
|
|
}
|
|
|
|
// 평균 및 합계 계산
|
|
const calculateAverage = (value: number, count: number) => {
|
|
return count > 0 ? Number((value / count).toFixed(1)) : 0;
|
|
};
|
|
|
|
// 데이터 있는 항목만 계산
|
|
let dataIsCount = 0;
|
|
for(let idx=0; idx<inflAmnt.length; idx++){
|
|
if(Number(inflAmnt[idx]) > 0){
|
|
dataIsCount++;
|
|
}
|
|
}
|
|
|
|
for(let idx=0; idx<inflAmnt.length; idx++){
|
|
inflAmnt[idx] = calculateAverage(Number(inflAmnt[idx]), Number(inflAmtCnt[idx]));
|
|
inflAssctAftWqltBod[idx] = calculateAverage(Number(inflAssctAftWqltBod[idx]), Number(inflAssctAftWqltBodCnt[idx]));
|
|
inflAssctAftWqltToc[idx] = calculateAverage(Number(inflAssctAftWqltToc[idx]), Number(inflAssctAftWqltTocCnt[idx]));
|
|
inflAssctAftWqltSs[idx] = calculateAverage(Number(inflAssctAftWqltSs[idx]), Number(inflAssctAftWqltSsCnt[idx]));
|
|
inflAssctAftWqltTn[idx] = calculateAverage(Number(inflAssctAftWqltTn[idx]), Number(inflAssctAftWqltTnCnt[idx]));
|
|
inflAssctAftWqltTp[idx] = calculateAverage(Number(inflAssctAftWqltTp[idx]), Number(inflAssctAftWqltTpCnt[idx]));
|
|
efflWqltBod[idx] = calculateAverage(Number(efflWqltBod[idx]), Number(efflWqltBodCnt[idx]));
|
|
efflWqltCod[idx] = calculateAverage(Number(efflWqltCod[idx]), Number(efflWqltCodCnt[idx]));
|
|
efflWqltSs[idx] = calculateAverage(Number(efflWqltSs[idx]), Number(efflWqltSsCnt[idx]));
|
|
efflWqltTn[idx] = calculateAverage(Number(efflWqltTn[idx]), Number(efflWqltTnCnt[idx]));
|
|
efflWqltTp[idx] = calculateAverage(Number(efflWqltTp[idx]), Number(efflWqltTpCnt[idx]));
|
|
}
|
|
|
|
// 합계 계산 (index 0)
|
|
const calculateTotal = (arr: number[]) => {
|
|
return Number((arr.slice(1).reduce((sum, val) => sum + Number(val), 0)).toFixed(1));
|
|
};
|
|
|
|
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));
|
|
efflWqltBod[0] = Number((calculateTotal(efflWqltBod)/7).toFixed(1));
|
|
efflWqltCod[0] = Number((calculateTotal(efflWqltCod)/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));
|
|
|
|
// 최종 리스트
|
|
const filteredData = itemList.map((item, index) => ({
|
|
rainItem: item,
|
|
rainRate: rainRate[index] || '0',
|
|
rainDay: rainDate[index] ? Number(rainDate[index].toFixed(1)) : '',
|
|
inflAmnt: inflAmnt[index] ? Number(inflAmnt[index].toFixed(1)) : '',
|
|
fctCpc: inflAmnt[index] ? Number((inflAmnt[index] / fcltyCpcValue).toFixed(1)) : '',
|
|
dsInflWqltBod: dsInflWqltBod[index] ? Number(dsInflWqltBod[index].toFixed(1)) : '',
|
|
dsInflWqltCod: dsInflWqltCod[index] ? Number(dsInflWqltCod[index].toFixed(1)) : '',
|
|
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) : '',
|
|
efflWqltBod: efflWqltBod[index] ? Number(efflWqltBod[index].toFixed(1)) : '',
|
|
efflWqltCod: efflWqltCod[index] ? Number(efflWqltCod[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) : ''
|
|
}));
|
|
|
|
const excelList : RainManageExcelType[] = [];
|
|
if(isExcel){
|
|
filteredData.forEach((item) => {
|
|
excelList.push({
|
|
강우량: item.rainItem,
|
|
강우조건비율: item.rainRate ? Number(Number(item.rainRate).toFixed(1)) : '',
|
|
일수: item.rainDay ? Number(Number(item.rainDay).toFixed(1)) : '',
|
|
유입유량: item.inflAmnt ? Number(Number(item.inflAmnt).toFixed(1)) : '',
|
|
시설용량대비: item.fctCpc ? Number(Number(item.fctCpc).toFixed(1)) : '',
|
|
설계유입수질BOD: item.dsInflWqltBod ? Number(Number(item.dsInflWqltBod).toFixed(1)) : '',
|
|
설계유입수질TOC: item.dsInflWqltCod ? Number(Number(item.dsInflWqltCod).toFixed(1)) : '',
|
|
설계유입수질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.efflWqltBod ? Number(Number(item.efflWqltBod).toFixed(1)) : '',
|
|
방류수질TOC: item.efflWqltCod ? Number(Number(item.efflWqltCod).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) : '',
|
|
});
|
|
});
|
|
}
|
|
|
|
set((state: DashBoardType) => ({
|
|
...state,
|
|
RainManage: isExcel ? {
|
|
...state.RainManage,
|
|
rainManageList: filteredData as RainManageListProps[],
|
|
excelList: excelList,
|
|
} : {
|
|
...state.RainManage,
|
|
rainManageList: filteredData as RainManageListProps[],
|
|
}
|
|
}));
|
|
},
|
|
|
|
searchDrainageEquipment: async (searchYear: string, fcltyCd: string, isExcel : boolean) => {
|
|
await fetchDrainageEquipment(searchYear, fcltyCd);
|
|
/* if(res == null || res.data.wqltObjs == null || res.data.wqltObjs.length === 0) {
|
|
set((state: DashBoardType) => ({
|
|
...state.RainManage,
|
|
rainManageList: [],
|
|
}));
|
|
return;
|
|
} */
|
|
|
|
/* if(isExcel){
|
|
res.data.wqltObjs.forEach((item) => {
|
|
excelList.push({
|
|
강우량: item.rainItem,
|
|
강우조건비율: item.rainRate || 0,
|
|
일수: item.rainDay || 0,
|
|
유입유량: item.inflAmnt || 0,
|
|
시설용량대비: item.fctCpc || 0,
|
|
설계유입수질BOD: item.dsInflWqltBod || 0,
|
|
설계유입수질TOC: item.dsInflWqltCod || 0,
|
|
설계유입수질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.efflWqltBod || 0,
|
|
방류수질COD: item.efflWqltCod || 0,
|
|
방류수질SS: item.efflWqltSs || 0,
|
|
방류수질TN: item.efflWqltTn || 0,
|
|
방류수질TP: item.efflWqltTp || 0,
|
|
});
|
|
});
|
|
} */
|
|
|
|
set((state: DashBoardType) => ({
|
|
...state,
|
|
DrainageEquipment: isExcel ? {
|
|
...state.DrainageEquipment,
|
|
drainageEquipmentList: drainageEquipmentList,
|
|
drainageEquipmentExcelList: [],
|
|
} : {
|
|
...state.DrainageEquipment,
|
|
drainageEquipmentList: drainageEquipmentList,
|
|
}
|
|
}));
|
|
}
|
|
}
|
|
} |