주요그래프 시설용량 > 지하수유입량 으로 수정
This commit is contained in:
@@ -63,7 +63,7 @@ export default function DashBoardChart({searchYear = '', fcltyList = []}: facili
|
||||
color: colors[2],
|
||||
},
|
||||
lineVal0: {
|
||||
label: '시설용량',
|
||||
label: '지하수유입량',
|
||||
color: colors[1],
|
||||
},
|
||||
lineVal1: {
|
||||
|
||||
@@ -240,7 +240,7 @@ export default function DashBoard() {
|
||||
|
||||
const sheetParameter = [
|
||||
{
|
||||
data: [['날짜', '강수량', '유입하수량', '시설용량', '유입BOD', '유입T-P','총인유입T-P', '방류T-P', '유입T-N', '방류T-N'],...yearValueData],
|
||||
data: [['날짜', '강수량', '유입하수량', '지하수유입량', '유입BOD', '유입T-P','총인유입T-P', '방류T-P', '유입T-N', '방류T-N'],...yearValueData],
|
||||
headerNum: 1,
|
||||
headerRange: 'A1:J1',
|
||||
sheetName: '주요그래프'
|
||||
|
||||
@@ -1868,6 +1868,20 @@ export const dashBoardReducer:(set:(fn: (state: DashBoardType) => DashBoardType)
|
||||
const res = await fetchMainGraph(searchYear, fcltyCd);
|
||||
const res2 = await fetchFacilityWaterQltyInfo(fcltyCd);
|
||||
|
||||
let chungcunSumFlow = 0;
|
||||
const calData = CalcRainEffect(res.data.wqltObjs, 'SUNNY')
|
||||
calData.forEach((flowItem: any) => {
|
||||
chungcunSumFlow += flowItem.inflAmnt && flowItem.inflAmnt !== 'x' ? Number(flowItem.inflAmnt.toString().trim()) : 0;
|
||||
});
|
||||
const usage = chungcunSumFlow&&chungcunSumFlow>0?chungcunSumFlow / calData.length:0;
|
||||
|
||||
//bscFctCd === '11200PB001R') 중랑 - 테스트할 때 코드넣고 해야 보기편해요~
|
||||
/* if(bscFctCd === '11200PB001R') {
|
||||
console.log('calData.length : ', calData.length);
|
||||
console.log('usage : ', usage, 'summerUsage : ', summerUsage, 'winterUsage : ', winterUsage);
|
||||
} */
|
||||
const underWaterInputYear = Math.round((usage-(usage*0.65*OSU_PERCENT)) * 1) / 1;
|
||||
|
||||
// 법적방류수질 데이터
|
||||
const sortedWaterQltyInfo = [...res2].sort((a, b) => {
|
||||
// 숫자로 변환하여 비교
|
||||
@@ -1908,7 +1922,7 @@ export const dashBoardReducer:(set:(fn: (state: DashBoardType) => DashBoardType)
|
||||
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,
|
||||
lineVal0: underWaterInputYear,
|
||||
lineVal1: item.inflAmnt ?? 0,
|
||||
}));
|
||||
|
||||
|
||||
@@ -288,6 +288,7 @@ export const underWaterReducer:(set:(fn: (state: UnderWaterType) => UnderWaterTy
|
||||
const bscFctCd = item.bscFctCd;
|
||||
const res2 = await getFetch('fo', '/fclt/flow/' + bscFctCd + '/' + searchYear) as ApiResponse;
|
||||
const calData = CalcRainEffect(res2.data, 'SUNNY');
|
||||
|
||||
let chungcunSumFlow = 0;
|
||||
|
||||
let sumSummerChungcunDay = 0;
|
||||
|
||||
Reference in New Issue
Block a user