Merge remote-tracking branch 'origin/iipbs/fo/dev'
This commit is contained in:
@@ -4,6 +4,26 @@
|
||||
item: Record<string, unknown>;
|
||||
}
|
||||
|
||||
export const roundNumber = (value : any, decimals: number) => {
|
||||
if (typeof value === 'number') {
|
||||
return addCommas((Math.round(value * Math.pow(10, decimals)) / Math.pow(10, decimals)).toFixed(decimals));
|
||||
} else if (typeof value === 'string' && !isNaN(Number(value))) {
|
||||
return addCommas(Number(value).toFixed(decimals));
|
||||
}
|
||||
}
|
||||
|
||||
export const addCommas = (value: string | number): any => {
|
||||
if (typeof value === 'number') {
|
||||
return value.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",").split('.').map((part, index) =>
|
||||
index === 0 ? part : part.replace(/(\d{3})/g, '$1,')
|
||||
).join('.');
|
||||
} else if (typeof value === 'string') {
|
||||
return value.includes('.')?value.split('.').map((part, index) =>
|
||||
index === 0 ? part.replace(/\B(?=(\d{3})+(?!\d))/g, ",") : part
|
||||
).join('.'):String(value).replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
||||
}
|
||||
}
|
||||
|
||||
export default function DataForm({ type, column, item }: DataFormProps) {
|
||||
if(item) {
|
||||
const value = item[column];
|
||||
@@ -27,28 +47,19 @@ export default function DataForm({ type, column, item }: DataFormProps) {
|
||||
break;
|
||||
case 'float1':
|
||||
if(value) {
|
||||
item[column] = String(value).includes('.')?String(Math.round(parseFloat(value.toString().replace(/,/g, '')) * 10) / 10).split('.').map((part, index) =>
|
||||
index === 0 ? part.replace(/\B(?=(\d{3})+(?!\d))/g, ",") : part
|
||||
).join('.')
|
||||
: String(value).replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
||||
item[column] = roundNumber(value, 1);
|
||||
}
|
||||
break;
|
||||
case 'float2':
|
||||
if(value) {
|
||||
item[column] = String(value).includes('.')?String(Math.round(parseFloat(value.toString().replace(/,/g, '')) * 100) / 100).split('.').map((part, index) =>
|
||||
index === 0 ? part.replace(/\B(?=(\d{3})+(?!\d))/g, ",") : part
|
||||
).join('.')
|
||||
: String(value).replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
||||
item[column] = roundNumber(value, 2);
|
||||
}
|
||||
break;
|
||||
case 'float3':
|
||||
if(value) {
|
||||
item[column] = String(value).includes('.')?String(Math.round(parseFloat(value.toString().replace(/,/g, '')) * 1000) / 1000).split('.').map((part, index) =>
|
||||
index === 0 ? part.replace(/\B(?=(\d{3})+(?!\d))/g, ",") : part
|
||||
).join('.')
|
||||
: String(value).replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
||||
item[column] = roundNumber(value, 3);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,11 +1,12 @@
|
||||
"use client"
|
||||
import { roundNumber } from "@/app/components/common/DataForm";
|
||||
import { useFoStore } from "@/app/store";
|
||||
import type { TableUpperProps } from "@/app/store/processFacility";
|
||||
import { ContentsDiv, UiModal, UiTable } from "@common/business_components";
|
||||
import LoadingOverlay from "@common/business_components/ui/loadingBar";
|
||||
import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "@common/components";
|
||||
import { useEffect, useState } from "react";
|
||||
import DashBoardChartModal from "./modal/page";
|
||||
import LoadingOverlay from "@common/business_components/ui/loadingBar";
|
||||
|
||||
export type facilityInfoProps = {
|
||||
searchYear?: string;
|
||||
@@ -224,7 +225,7 @@ export default function ProcessFacilitySearch({searchYear = '', fcltyList = []}:
|
||||
:(index < 5 || index > 5)&& (index!= 4) && (head.id ==='provisionalApproval'||head.id ==='now'||head.id ==='stepOne'||head.id ==='stepTwo'||head.id ==='stepThree'||head.id ==='stepFour')
|
||||
?<TableCell className="text-right" style={{ whiteSpace: 'pre-line' }} key={head.id+index}>{el[head.id]}</TableCell>
|
||||
:(head.id === "provisionalApproval" && index === 4)
|
||||
?<TableCell colSpan={6} className="text-right border border-[var(--border)] text-[rgb(100,119,132)]" style={{ whiteSpace: 'pre-line' }} key={head.id+index}>{Math.round((Number(waterUsage1)+Number(waterUsage2)+Number(waterUsage3))/3 * 100)/100}</TableCell>
|
||||
?<TableCell colSpan={6} className="text-right border border-[var(--border)] text-[rgb(100,119,132)]" style={{ whiteSpace: 'pre-line' }} key={head.id+index}>{roundNumber(String((Number(waterUsage1)+Number(waterUsage2)+Number(waterUsage3))/3), 0)}</TableCell>
|
||||
:((head.id ==='now'||head.id ==='stepOne'||head.id ==='stepTwo'||head.id ==='stepThree'||head.id ==='stepFour') )
|
||||
?null
|
||||
:(head.id === 'item' && index != 5)?
|
||||
|
||||
@@ -148,8 +148,8 @@ export default function PrecipitationModal(props: PrecipitationModalProps) {
|
||||
|
||||
return (
|
||||
<>
|
||||
<ListDiv className="!h-[80px] !mt-10">
|
||||
<div className="card !m-[1.2rem] max-h-[40rem] overflow-auto !p-0r">
|
||||
<ListDiv className="!mt-5 !h-[80px]">
|
||||
<div className="!m-[0.5rem] max-h-[40rem] overflow-auto">
|
||||
<Table>
|
||||
<thead>
|
||||
<TableRow>
|
||||
@@ -186,7 +186,7 @@ export default function PrecipitationModal(props: PrecipitationModalProps) {
|
||||
</Table>
|
||||
</div>
|
||||
</ListDiv>
|
||||
<ListDiv className="h-[450px] overflow-y-auto">
|
||||
<ListDiv className="h-[550px] overflow-y-auto">
|
||||
<UiTable
|
||||
headName={"강수현황"}
|
||||
tableData={getTableData()}
|
||||
|
||||
@@ -226,7 +226,7 @@ export default function FacilityPrecipitation() {
|
||||
queryClick={chkVal}
|
||||
excelClick={excelDownload}
|
||||
initClick={resetVal}
|
||||
ref={ref} isAdmin={false} />
|
||||
ref={ref} isAdmin={false}/>
|
||||
<ListDiv>
|
||||
<LoadingOverlay isLoading={isLoading} />
|
||||
<div className="h-full w-full overflow-x-scroll">
|
||||
@@ -240,7 +240,7 @@ export default function FacilityPrecipitation() {
|
||||
{selectedRow !== null && (
|
||||
<UiModal
|
||||
body={<PrecipitationModal searchYear={searchYear} fcltyName={fcltyNm} facilityCd={fcltyCd} detailList={gridListPrecipitationDetail}></PrecipitationModal>}
|
||||
bodyClass="sm:max-w-[90vw] w-[72vw] h-[40vw]"
|
||||
bodyClass="sm:max-w-[90vw] w-[1150px] h-[700px]"
|
||||
open={selectedRow !== null}
|
||||
onOpenChange={(open) => !open && closeModal()}
|
||||
noHeaderYn="Y"
|
||||
|
||||
@@ -6,6 +6,7 @@ import { downloadExcel, UITab, UiTable } from "@common/business_components/ui";
|
||||
import { Button, TabsContent } from "@common/components/ui";
|
||||
import { useCallback, useEffect, useRef, useState } from "react";
|
||||
import type { ReturnType } from "../../../../components/common/FacilityTermModalHeader";
|
||||
import { roundUp } from "@/app/store/common";
|
||||
|
||||
const tabList = [
|
||||
{ value: 'tab_term_year', label: '연간' },
|
||||
@@ -104,39 +105,35 @@ export default function FlowRateModal(props: { fcltyName: string; facilityCd: st
|
||||
avginfoRnDay += infoRnDay;
|
||||
});
|
||||
|
||||
console.log('maxtotInflAmnt', maxtotInflAmnt, 'maxinflAmnt', maxinflAmnt, 'maxsumFlow', maxsumFlow, 'maxreturnAmnt', maxreturnAmnt, 'maxefflAmnt', maxefflAmnt, 'maxinfoRnDay', maxinfoRnDay);
|
||||
console.log('mintotInflAmnt', mintotInflAmnt, 'mininflAmnt', mininflAmnt, 'minsumFlow', minsumFlow, 'minreturnAmnt', minreturnAmnt, 'minefflAmnt', minefflAmnt, 'mininfoRnDay', mininfoRnDay);
|
||||
console.log('avgtotInflAmnt', avgtotInflAmnt, 'avginflAmnt', avginflAmnt, 'avgsumFlow', avgsumFlow, 'avgreturnAmnt', avgreturnAmnt, 'avgefflAmnt', avgefflAmnt, 'avginfoRnDay', avginfoRnDay);
|
||||
|
||||
const newFilteredData = [
|
||||
{
|
||||
msrDt: '평균',
|
||||
totInflAmnt: Math.round(avgtotInflAmnt / filteredData.length * 10) / 10,
|
||||
inflAmnt: Math.round(avginflAmnt / filteredData.length * 10) / 10,
|
||||
sumFlow: Math.round(avgsumFlow / filteredData.length * 10) / 10,
|
||||
returnAmnt: Math.round(avgreturnAmnt / filteredData.length * 10) / 10,
|
||||
efflAmnt: Math.round(avgefflAmnt / filteredData.length * 10) / 10,
|
||||
infoRnDay: avginfoRnDay > 0 ? Math.round(avginfoRnDay / filteredData.length * 10) / 10 : 0,
|
||||
totInflAmnt: roundUp((avgtotInflAmnt / filteredData.length), 0),
|
||||
inflAmnt: roundUp((avginflAmnt / filteredData.length), 0),
|
||||
sumFlow: roundUp((avgsumFlow / filteredData.length), 0),
|
||||
returnAmnt: roundUp((avgreturnAmnt / filteredData.length), 0),
|
||||
efflAmnt: roundUp((avgefflAmnt / filteredData.length), 0),
|
||||
infoRnDay: avginfoRnDay > 0 ? roundUp((avginfoRnDay / filteredData.length), 1) : '0.0',
|
||||
rainEffectDay: 0,
|
||||
},
|
||||
{
|
||||
msrDt: '최대',
|
||||
totInflAmnt: Math.round(maxtotInflAmnt * 10) / 10,
|
||||
inflAmnt: Math.round(maxinflAmnt * 10) / 10,
|
||||
sumFlow: Math.round(maxsumFlow * 10) / 10,
|
||||
returnAmnt: Math.round(maxreturnAmnt * 10) / 10,
|
||||
efflAmnt: Math.round(maxefflAmnt * 10) / 10,
|
||||
infoRnDay: maxinfoRnDay > 0 ? (Math.round(maxinfoRnDay * 10) / 10).toFixed(1) : '0.0',
|
||||
totInflAmnt: roundUp(maxtotInflAmnt, 0),
|
||||
inflAmnt: roundUp(maxinflAmnt, 0),
|
||||
sumFlow: roundUp(maxsumFlow, 0),
|
||||
returnAmnt: roundUp(maxreturnAmnt, 0),
|
||||
efflAmnt: roundUp(maxefflAmnt, 0),
|
||||
infoRnDay: maxinfoRnDay > 0 ? roundUp(maxinfoRnDay, 1) : '0.0',
|
||||
rainEffectDay: 0,
|
||||
},
|
||||
{
|
||||
msrDt: '최소',
|
||||
totInflAmnt: Math.round(mintotInflAmnt * 10) / 10,
|
||||
inflAmnt: Math.round(mininflAmnt * 10) / 10,
|
||||
sumFlow: Math.round(minsumFlow * 10) / 10,
|
||||
returnAmnt: Math.round(minreturnAmnt * 10) / 10,
|
||||
efflAmnt: Math.round(minefflAmnt * 10) / 10,
|
||||
infoRnDay: mininfoRnDay > 0 ? (Math.round(mininfoRnDay * 10) / 10).toFixed(1) : '0.0',
|
||||
totInflAmnt: roundUp(mintotInflAmnt, 0),
|
||||
inflAmnt: roundUp(mininflAmnt, 0),
|
||||
sumFlow: roundUp(minsumFlow, 0),
|
||||
returnAmnt: roundUp(minreturnAmnt, 0),
|
||||
efflAmnt: roundUp(minefflAmnt, 0),
|
||||
infoRnDay: mininfoRnDay > 0 ? roundUp(mininfoRnDay, 1) : '0.0',
|
||||
rainEffectDay: 0,
|
||||
},
|
||||
...filteredData
|
||||
|
||||
@@ -130,7 +130,7 @@ export default function ProcessFacilitySearch() {
|
||||
initializeCommonData();
|
||||
searchFlowRateList(1, 10, selectSearchYear[0]?.val || "0");
|
||||
}
|
||||
}, [isInit, initializeCommonData, searchFlowRateList]);
|
||||
}, [isInit, initializeCommonData, searchFlowRateList, selectSearchYear]);
|
||||
|
||||
useEffect(() => {
|
||||
if (excelList && excelList.length > 0) {
|
||||
@@ -187,7 +187,7 @@ export default function ProcessFacilitySearch() {
|
||||
queryClick={chkVal}
|
||||
excelClick={excelDownload}
|
||||
initClick={resetVal}
|
||||
ref={ref} isAdmin={false} />
|
||||
ref={ref} isAdmin={false}/>
|
||||
<ListDiv>
|
||||
<LoadingOverlay isLoading={isLoading} />
|
||||
<div className="h-full w-full overflow-x-scroll">
|
||||
|
||||
@@ -24,7 +24,6 @@ export default function ProcessFacilitySearch() {
|
||||
isInit,
|
||||
selectUpdownData,
|
||||
selectOperationData,
|
||||
selectFacilityPartData,
|
||||
selectSidoData,
|
||||
selectSigunData,
|
||||
selectRegionData,
|
||||
@@ -249,7 +248,6 @@ export default function ProcessFacilitySearch() {
|
||||
<SelectBox className="col-span-3" label={processFacilityLabelArray[3] as string} selectArray={selectUpdownData} onSelectValue={val => setFcltCpct(val.toString())} value={fcltCpct} selectClass={undefined} />
|
||||
<SearchInput className="col-span-3" label={processFacilityLabelArray[4] as string} textValue={fcltyName} setText={setFcltyName} />
|
||||
<SelectBox className="col-span-3" label={processFacilityLabelArray[5] as string} selectArray={selectOperationData} onSelectValue={val => setOperationValue(val.toString())} value={operationValue} selectClass={undefined} />
|
||||
<SelectBox className="col-span-3" label={processFacilityLabelArray[6] as string} selectArray={selectFacilityPartData} onSelectValue={val => setFacilityPartValue(val.toString())} value={facilityPartValue} selectClass={undefined} />
|
||||
</>}
|
||||
rightChildren={undefined}
|
||||
selectSidoData={selectSidoData}
|
||||
|
||||
@@ -7,8 +7,9 @@ import { Table, TableCell, TableHead, TableRow, TabsContent } from "@common/comp
|
||||
import { useEffect, useState } from "react";
|
||||
|
||||
type ModalProps ={
|
||||
fcltyName: string;
|
||||
searchYear : string;
|
||||
fcltyCd?: string;
|
||||
fcltyName?: string;
|
||||
searchYear? : string;
|
||||
}
|
||||
|
||||
const tabList1 = [
|
||||
@@ -17,7 +18,7 @@ const tabList1 = [
|
||||
{ value: 'tab_term_winter', label: '동절기' },
|
||||
];
|
||||
|
||||
export default function UnderWaterInputModal({fcltyName='', searchYear=new Date().getFullYear().toString()} : ModalProps) {
|
||||
export default function UnderWaterInputModal({fcltyCd='', fcltyName='',searchYear=new Date().getFullYear().toString()} : ModalProps) {
|
||||
// 그리드 관련
|
||||
const {UnderWaterDetail, unserWaterModal} = useFoStore((state) => state);
|
||||
|
||||
@@ -64,8 +65,8 @@ export default function UnderWaterInputModal({fcltyName='', searchYear=new Date(
|
||||
}, [searchYear, tabTerm]);
|
||||
|
||||
useEffect(()=>{
|
||||
unserWaterModal(fcltyName, searchYear, searchYear+'01', searchYear+'12');
|
||||
}, [fcltyName, searchYear, unserWaterModal]);
|
||||
unserWaterModal(fcltyCd, searchYear, searchYear+'01', searchYear+'12');
|
||||
}, [fcltyCd, searchYear, unserWaterModal]);
|
||||
|
||||
useEffect(() => {
|
||||
if(endYmDate < startYmDate) {
|
||||
@@ -83,8 +84,8 @@ export default function UnderWaterInputModal({fcltyName='', searchYear=new Date(
|
||||
}, [startYmDate, endYmDate, gridListUnderWaterDetail, prevStartYmDate, prevEndYmDate]);
|
||||
|
||||
useEffect(() => {
|
||||
unserWaterModal(fcltyName, searchYear, prevStartYmDate, prevEndYmDate);
|
||||
} , [fcltyName, searchYear, unserWaterModal, prevStartYmDate, prevEndYmDate]);
|
||||
unserWaterModal(fcltyCd, searchYear, prevStartYmDate, prevEndYmDate);
|
||||
} , [fcltyCd, searchYear, unserWaterModal, prevStartYmDate, prevEndYmDate]);
|
||||
|
||||
return (
|
||||
<>
|
||||
|
||||
@@ -66,11 +66,11 @@ export default function UnderWaterInput() {
|
||||
|
||||
// 모달 상태 추가
|
||||
const [selectedRow, setSelectedRow] = useState<number | null>(null);
|
||||
const [fcltyCd, setFcltyCd] = useState<string>("");
|
||||
const [fcltyNm, setFcltyNm] = useState<string>("");
|
||||
|
||||
// 그리드 관련
|
||||
const searchInputRef = useRef<HTMLDivElement & HTMLInputElement>(null);
|
||||
|
||||
// 초기화 변수
|
||||
const [resetPage, setResetPage] = useState<boolean>(false);
|
||||
// 표 너비
|
||||
@@ -116,7 +116,8 @@ export default function UnderWaterInput() {
|
||||
// 셀 클릭 시 모달 표시
|
||||
const cellClick = (index: number) => {
|
||||
if (underWater[index]) {
|
||||
setFcltyNm(underWater[index].bscFctCd);
|
||||
setFcltyCd(underWater[index].bscFctCd || "");
|
||||
setFcltyNm(underWater[index].bscFctNm || "");
|
||||
setSelectedRow(index); // 클릭한 행의 index 저장
|
||||
}
|
||||
};
|
||||
@@ -129,7 +130,7 @@ export default function UnderWaterInput() {
|
||||
initializeCommonData();
|
||||
searchUnderWaterList(1, 10, selectSearchYear[0]?.val || "0");
|
||||
}
|
||||
}, [isInit, initializeCommonData, searchUnderWaterList]);
|
||||
}, [isInit, initializeCommonData, searchUnderWaterList, selectSearchYear]);
|
||||
|
||||
useEffect(() => {
|
||||
if (excelList && excelList.length > 0) {
|
||||
@@ -227,7 +228,7 @@ export default function UnderWaterInput() {
|
||||
</ContentsDiv>
|
||||
{selectedRow !== null && (
|
||||
<UiModal
|
||||
body={<UnderWaterInputModal fcltyName={fcltyNm} searchYear={searchYear}></UnderWaterInputModal>}
|
||||
body={<UnderWaterInputModal fcltyCd={fcltyCd} fcltyName={fcltyNm} searchYear={searchYear}></UnderWaterInputModal>}
|
||||
bodyClass="sm:max-w-[90vw] w-[1000px] h-[770px]"
|
||||
open={selectedRow !== null}
|
||||
onOpenChange={(open) => !open && closeModal()}
|
||||
|
||||
@@ -131,7 +131,7 @@ const selectEnvPartSigunData: SelectDataType[] = [
|
||||
// 상향 하향 데이터
|
||||
const selectUpdownData:SelectDataType[] = [
|
||||
{ text: "전체", val: '0' },
|
||||
{ text: "500이하", val: '400' },
|
||||
{ text: "500미만", val: '400' },
|
||||
{ text: "500이상", val: '500' },
|
||||
];
|
||||
|
||||
|
||||
@@ -355,29 +355,29 @@ const upHeadListOperationStatus : TableUpperProps[] = [
|
||||
|
||||
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: "rainRate", title: "강우조건\n비율(%)", row:0, rowSpan:2, align: "right" },
|
||||
{ id: "rainDay", title: "일수", row:0, rowSpan:2, align: "right" },
|
||||
{ id: "A", title: "유입(㎥/일)", row:0, colSpan:2 },
|
||||
{ id: "inflAmnt", title: "유입유량", row:1 },
|
||||
{ id: "fctCpc", title: "시설용량대비", row:1 },
|
||||
{ id: "inflAmnt", title: "유입유량", row:1, align: "right" },
|
||||
{ id: "fctCpc", title: "시설용량대비", row:1, align: "right" },
|
||||
{ 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: "dsInflWqltBod", title: "BOD", row:1, align: "right" },
|
||||
{ id: "dsInflWqltCod", title: "TOC\n(COD)", row:1, align: "right" },
|
||||
{ id: "dsInflWqltSs", title: "SS", row:1, align: "right" },
|
||||
{ id: "dsInflWqltTn", title: "T-N", row:1, align: "right" },
|
||||
{ id: "dsInflWqltTp", title: "T-P", row:1, align: "right" },
|
||||
{ id: "C", title: "유입수질(㎎/L)", row:0, colSpan:5 },
|
||||
{ id: "inflAssctBfrWqltBod", title: "BOD", row:1 },
|
||||
{ id: "inflAssctBfrWqltToc", title: "TOC\n(COD)", row:1 },
|
||||
{ id: "inflAssctBfrWqltSs", title: "SS", row:1 },
|
||||
{ id: "inflAssctBfrWqltTn", title: "T-N", row:1 },
|
||||
{ id: "inflAssctBfrWqltTp", title: "T-P", row:1 },
|
||||
{ id: "inflAssctBfrWqltBod", title: "BOD", row:1, align: "right" },
|
||||
{ id: "inflAssctBfrWqltToc", title: "TOC\n(COD)", row:1, align: "right" },
|
||||
{ id: "inflAssctBfrWqltSs", title: "SS", row:1, align: "right" },
|
||||
{ id: "inflAssctBfrWqltTn", title: "T-N", row:1, align: "right" },
|
||||
{ id: "inflAssctBfrWqltTp", title: "T-P", row:1, align: "right" },
|
||||
{ id: "D", title: "방류수질(㎎/L)", row:0, colSpan:5 },
|
||||
{ id: "efflWqltBod", title: "BOD", row:1 },
|
||||
{ id: "efflWqltToc", title: "TOC\n(COD)", row:1 },
|
||||
{ id: "efflWqltSs", title: "SS", row:1 },
|
||||
{ id: "efflWqltTn", title: "T-N", row:1 },
|
||||
{ id: "efflWqltTp", title: "T-P", row:1 },
|
||||
{ id: "efflWqltBod", title: "BOD", row:1, align: "right" },
|
||||
{ id: "efflWqltToc", title: "TOC\n(COD)", row:1, align: "right" },
|
||||
{ id: "efflWqltSs", title: "SS", row:1, align: "right" },
|
||||
{ id: "efflWqltTn", title: "T-N", row:1, align: "right" },
|
||||
{ id: "efflWqltTp", title: "T-P", row:1, align: "right" },
|
||||
]
|
||||
|
||||
const upHeadListDrainageEquipment : TableUpperProps[] = [
|
||||
@@ -401,7 +401,7 @@ const upHeadListDrainageEquipment : TableUpperProps[] = [
|
||||
{ id: "etc", title: "비고", row:0, upName:"upChangeRe7", upSequnce:1 },
|
||||
]
|
||||
|
||||
const operationalStatusList : OperationalStatusListProps[] = [
|
||||
let operationalStatusList : OperationalStatusListProps[] = [
|
||||
{
|
||||
flowRate : '유량\n(㎥/일)',
|
||||
waterQlty : '유입',
|
||||
@@ -872,13 +872,13 @@ export const dashBoardInitState:DashBoardType = {
|
||||
/**
|
||||
* 데이터 폼 포맷설정
|
||||
*/
|
||||
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 dataFormSettingPlan=(item : planFcltyListProps, decmials : number) => {
|
||||
DataForm({ type: 'float'+decmials, column: 'provisionalApproval', item: item as unknown as Record<string, unknown> });
|
||||
DataForm({ type: 'float'+decmials, column: 'now', item: item as unknown as Record<string, unknown>});
|
||||
DataForm({ type: 'float'+decmials, column: 'stepOne', item: item as unknown as Record<string, unknown>});
|
||||
DataForm({ type: 'float'+decmials, column: 'stepTwo', item: item as unknown as Record<string, unknown>});
|
||||
DataForm({ type: 'float'+decmials, column: 'stepThree', item: item as unknown as Record<string, unknown>});
|
||||
DataForm({ type: 'float'+decmials, column: 'stepFour', item: item as unknown as Record<string, unknown>});
|
||||
}
|
||||
|
||||
export const dataFormSetting=(item : OperationalStatusListProps)=> {
|
||||
@@ -896,23 +896,25 @@ export const dataFormSetting=(item : OperationalStatusListProps)=> {
|
||||
DataForm({ type: 'float0', column: 'groundWaterSummer', item: item as unknown as Record<string, unknown>});
|
||||
DataForm({ type: 'float0', column: 'groundWaterWinter', item: item as unknown as Record<string, unknown>});
|
||||
DataForm({ type: 'float0', column: 'rainRate', item: item as unknown as Record<string, unknown>});
|
||||
DataForm({ type: 'float0', column: 'rdi', item: item as unknown as Record<string, unknown>});
|
||||
};
|
||||
|
||||
export const dataFormSettingWqlty=(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>});
|
||||
DataForm({ type: 'float1', column: 'yearAvg', item: item as unknown as Record<string, unknown> });
|
||||
DataForm({ type: 'float1', column: 'yearMax', item: item as unknown as Record<string, unknown>});
|
||||
DataForm({ type: 'float1', column: 'yearMin', item: item as unknown as Record<string, unknown>});
|
||||
DataForm({ type: 'float1', column: 'summerAll', item: item as unknown as Record<string, unknown>});
|
||||
DataForm({ type: 'float1', column: 'summerThree', item: item as unknown as Record<string, unknown>});
|
||||
DataForm({ type: 'float1', column: 'summerRain', item: item as unknown as Record<string, unknown>});
|
||||
DataForm({ type: 'float1', column: 'winterAll', item: item as unknown as Record<string, unknown>});
|
||||
DataForm({ type: 'float1', column: 'winterSunnyAvg', item: item as unknown as Record<string, unknown>});
|
||||
DataForm({ type: 'float1', column: 'winterSunnyMax', item: item as unknown as Record<string, unknown>});
|
||||
DataForm({ type: 'float1', column: 'winterSunnyMin', item: item as unknown as Record<string, unknown>});
|
||||
DataForm({ type: 'float1', column: 'groundWaterAvg', item: item as unknown as Record<string, unknown>});
|
||||
DataForm({ type: 'float1', column: 'groundWaterSummer', item: item as unknown as Record<string, unknown>});
|
||||
DataForm({ type: 'float1', column: 'groundWaterWinter', item: item as unknown as Record<string, unknown>});
|
||||
DataForm({ type: 'float1', column: 'rainRate', item: item as unknown as Record<string, unknown>});
|
||||
DataForm({ type: 'float1', column: 'rdi', item: item as unknown as Record<string, unknown>});
|
||||
};
|
||||
|
||||
const changeValue=(operationalStatus, data, keyTxt = 'INFL_AMNT')=>{
|
||||
@@ -938,7 +940,7 @@ const changeValue=(operationalStatus, data, keyTxt = 'INFL_AMNT')=>{
|
||||
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.rdi = winterAvgBod === 0 ? 0 : roundUp(summerLowFlow * ((winterAvgBod - summerLowBod) / winterAvgBod), 1);
|
||||
operationalStatus.rdiRain = summerLowRain;
|
||||
}
|
||||
|
||||
@@ -1029,12 +1031,12 @@ export const calRainEffectDayRainManage = (data: RainManageListProps[]) => {
|
||||
for(let idx = 0; idx < data.length; idx++) {
|
||||
if(data[idx] && data[idx]?.rainEffectDay === 1) {
|
||||
if(idx > 1){
|
||||
if(data[idx-1]?.infoRnDay && Number(data[idx-1]?.infoRnDay) >= 3) {
|
||||
if(data[idx-1]?.infoRnDay && Number(data[idx]?.infoRnDay) < 3 && Number(data[idx-1]?.infoRnDay) >= 3) {
|
||||
data[idx]!.infoRnDay = data[idx-1]!.infoRnDay;
|
||||
}
|
||||
}
|
||||
if(idx > 2){
|
||||
if(data[idx-2]?.infoRnDay && Number(data[idx-2]?.infoRnDay) >= 3) {
|
||||
if(data[idx-2]?.infoRnDay && Number(data[idx]?.infoRnDay) < 3 && Number(data[idx-2]?.infoRnDay) >= 3) {
|
||||
data[idx]!.infoRnDay = data[idx-2]!.infoRnDay;
|
||||
}
|
||||
}
|
||||
@@ -1128,9 +1130,15 @@ export const dashBoardReducer:(set:(fn: (state: DashBoardType) => DashBoardType)
|
||||
if(index === 4){
|
||||
el.provisionalApproval = rtnPlanData?rtnPlanData.ugwtUseSum:'';
|
||||
}
|
||||
|
||||
if(index == 0 || index === 2){
|
||||
dataFormSettingPlan(el, 1);
|
||||
}else if(index == 4){
|
||||
}else{
|
||||
dataFormSettingPlan(el, 0);
|
||||
}
|
||||
|
||||
|
||||
// 임시시
|
||||
dataFormSettingPlan(el);
|
||||
set((state: DashBoardType) => ({
|
||||
...state,
|
||||
PlanFclty: {
|
||||
@@ -1173,6 +1181,7 @@ export const dashBoardReducer:(set:(fn: (state: DashBoardType) => DashBoardType)
|
||||
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;
|
||||
@@ -1193,11 +1202,26 @@ export const dashBoardReducer:(set:(fn: (state: DashBoardType) => DashBoardType)
|
||||
(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].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)
|
||||
);
|
||||
// 연계처리수
|
||||
let yearDay = 0;
|
||||
let summerDay = 0;
|
||||
@@ -1317,19 +1341,19 @@ export const dashBoardReducer:(set:(fn: (state: DashBoardType) => DashBoardType)
|
||||
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].rdi = winterAvgBod===0?0:roundUp(summerLowFlow * ((winterAvgBod - summerLowBod) / winterAvgBod), 2);
|
||||
operationalStatusList[0].rdiRain = summerLowRain;
|
||||
dataFormSetting(operationalStatusList[0]);
|
||||
}
|
||||
|
||||
if(operationalStatusList[0] && operationalStatusList[7]){
|
||||
operationalStatusList[7].groundWaterAvg = operationalStatusList[0].groundWaterAvg === null ? '' : data.yearData && data.yearData.AVG_INFL_AMNT === 0 ? '' : Math.round((Number(operationalStatusList[0].groundWaterAvg) / (data.yearData && data.yearData.AVG_INFL_AMNT ? Number(data.yearData.AVG_INFL_AMNT) : 0) * 100) * 10) / 10+'%';
|
||||
operationalStatusList[7].groundWaterSummer = operationalStatusList[0].groundWaterSummer === null ? '' : data.summer && data.summer.AVG_INFL_AMNT === 0 ? '' : Math.round((Number(operationalStatusList[0].groundWaterSummer) / (data.summer && data.summer.AVG_INFL_AMNT ? Number(data.summer.AVG_INFL_AMNT) : 0) * 100) * 10) / 10+'%';
|
||||
operationalStatusList[7].groundWaterWinter = operationalStatusList[0].groundWaterWinter === null ? '' : data.winter && data.winter.AVG_INFL_AMNT === 0 ? '' : Math.round((Number(operationalStatusList[0].groundWaterWinter) / (data.winter && data.winter.AVG_INFL_AMNT ? Number(data.winter.AVG_INFL_AMNT) : 0) * 100) * 10) / 10+'%';
|
||||
operationalStatusList[7].rdi = operationalStatusList[0].rdi === null ? '' : data.summerBod && data.summerBod.INFL_AMNT === 0 ? '' : Math.round((Number(operationalStatusList[0].rdi) / (data.summerBod&&data.summerBod.INFL_AMNT&&data.summerBod.INFL_AMNT!='null'?Number(data.summerBod.INFL_AMNT):0) * 100) * 10) / 10+'%';
|
||||
/* operationalStatusList[7].groundWaterAvg = operationalStatusList[0].groundWaterAvg === null ? '' : Number(Number(operationalStatusList[0].groundWaterAvg) / Number(data.yearData.AVG_INFL_AMNT)) * 100;
|
||||
operationalStatusList[7].groundWaterAvg = operationalStatusList[0].groundWaterAvg === null ? '' : data.yearData && data.yearData.AVG_INFL_AMNT === 0 ? '' : Math.round((Number(operationalStatusList[0].groundWaterAvg.toString().replaceAll(',', '')) / (data.yearData && data.yearData.AVG_INFL_AMNT ? Number(data.yearData.AVG_INFL_AMNT.toString().replaceAll(',','')) : 0) * 100) * 10) / 10+'%';
|
||||
operationalStatusList[7].groundWaterSummer = operationalStatusList[0].groundWaterSummer === null ? '' : data.summer && data.summer.AVG_INFL_AMNT === 0 ? '' : Math.round((Number(operationalStatusList[0].groundWaterSummer.toString().replaceAll(',','')) / (data.summer && data.summer.AVG_INFL_AMNT ? Number(data.summer.AVG_INFL_AMNT.toString().replaceAll(',','')) : 0) * 100) * 10) / 10+'%';
|
||||
operationalStatusList[7].groundWaterWinter = operationalStatusList[0].groundWaterWinter === null ? '' : data.winter && data.winter.AVG_INFL_AMNT === 0 ? '' : Math.round((Number(operationalStatusList[0].groundWaterWinter.toString().replaceAll(',','')) / (data.winter && data.winter.AVG_INFL_AMNT ? Number(data.winter.AVG_INFL_AMNT.toString().replaceAll(',','')) : 0) * 100) * 10) / 10+'%';
|
||||
operationalStatusList[7].rdi = operationalStatusList[0].rdi === null ? '' : data.summerBod && data.summerBod.INFL_AMNT === 0 ? '' : Math.round((Number(operationalStatusList[0].rdi.toString().replaceAll(',','')) / (data.summerBod&&data.summerBod.INFL_AMNT&&data.summerBod.INFL_AMNT!='null'?Number(data.summerBod.INFL_AMNT.toString().replaceAll(',','')):0) * 100) * 10) / 10+'%';
|
||||
/* operationalStatusList[7].groundWaterAvg = operationalStatusList[0].groundWaterAvg === null ? '' : Number(Number(operationalStatusList[0].groundWaterAvg) / Number(data.yearData.AVG_INFL_AMNT)) * 100;
|
||||
operationalStatusList[7].groundWaterSummer = operationalStatusList[0].groundWaterSummer === null ? '' : Number(Number(operationalStatusList[0].groundWaterSummer) / Number(data.summer.AVG_INFL_AMNT)) * 100;
|
||||
operationalStatusList[7].groundWaterWinter = operationalStatusList[0].groundWaterWinter === null ? '' : Number(Number(operationalStatusList[0].groundWaterWinter) / Number(data.winter.AVG_INFL_AMNT)) * 100;*/
|
||||
dataFormSetting(operationalStatusList[0]);
|
||||
}
|
||||
|
||||
for(let i=1; i<operationalStatusList.length; i++){
|
||||
@@ -1364,37 +1388,10 @@ export const dashBoardReducer:(set:(fn: (state: DashBoardType) => DashBoardType)
|
||||
}
|
||||
}
|
||||
|
||||
//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.inflAssctBfrWqltBod,
|
||||
유입TN: item.inflAssctBfrWqltTn,
|
||||
유입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) => {
|
||||
}); */
|
||||
/* } */
|
||||
//
|
||||
if(data.yearData.TP_INFL_WQLT_TP === null || data.yearData.TP_INFL_WQLT_TP === undefined || data.yearData.TP_INFL_WQLT_TP === 'null') {
|
||||
operationalStatusList = operationalStatusList.slice(0, 10);
|
||||
}
|
||||
set((state: DashBoardType) => ({
|
||||
...state,
|
||||
OperationStatus: {
|
||||
@@ -1405,7 +1402,7 @@ export const dashBoardReducer:(set:(fn: (state: DashBoardType) => DashBoardType)
|
||||
},
|
||||
}))
|
||||
},
|
||||
|
||||
|
||||
searchMainGraph: async (searchYear: string, fcltyCd: string) => {
|
||||
set((state: DashBoardType) => ({
|
||||
...state,
|
||||
@@ -1864,8 +1861,8 @@ export const dashBoardReducer:(set:(fn: (state: DashBoardType) => DashBoardType)
|
||||
const filteredData = itemList.map((item, index) => ({
|
||||
rainItem: item,
|
||||
rainRate: rainRate[index] || '0',
|
||||
rainDay: rainDate[index] ? Number(rainDate[index].toFixed(1)) : '',
|
||||
inflAmnt: inflAmnt[index] ? Number((Math.round(inflAmnt[index] * 10) / 10).toFixed(1)) : '',
|
||||
rainDay: rainDate[index] ? Number(rainDate[index].toFixed(1)) : '0',
|
||||
inflAmnt: inflAmnt[index] ? Number((Math.round(inflAmnt[index] * 1) / 1)) : '',
|
||||
fctCpc: inflAmnt[index] ? (Math.round((inflAmnt[index] / fcltyCpcValue) * 10) / 10).toFixed(1) : '',
|
||||
dsInflWqltBod: dsInflWqltBod[index] ? (Math.round(dsInflWqltBod[index] * 10) / 10).toFixed(1) : '',
|
||||
dsInflWqltCod: dsInflWqltCod[index] ? (Math.round(dsInflWqltCod[index] * 10) / 10).toFixed(1) : '',
|
||||
@@ -1890,8 +1887,8 @@ export const dashBoardReducer:(set:(fn: (state: DashBoardType) => DashBoardType)
|
||||
excelList.push({
|
||||
강우량: item.rainItem,
|
||||
강우조건비율: item.rainRate ? Number(Number(item.rainRate).toFixed(1)) : '',
|
||||
일수: item.rainDay ? Number(Number(item.rainDay).toFixed(1)) : '',
|
||||
유입유량: item.inflAmnt ? Number((Math.round(Number(item.inflAmnt) * 10) / 10).toFixed(1)) : '',
|
||||
일수: item.rainDay ? Number(Number(item.rainDay).toFixed(1)) : 0,
|
||||
유입유량: item.inflAmnt ? Number((Math.round(Number(item.inflAmnt) * 1) / 1)) : '',
|
||||
시설용량대비: item.fctCpc ? (Math.round(Number(item.fctCpc) * 10) / 10).toFixed(1) : '',
|
||||
설계유입수질BOD: item.dsInflWqltBod ? (Math.round(Number(item.dsInflWqltBod) * 10) / 10).toFixed(1) : '',
|
||||
설계유입수질TOC: item.dsInflWqltCod ? (Math.round(Number(item.dsInflWqltCod) * 10) / 10).toFixed(1) : '',
|
||||
|
||||
@@ -73,11 +73,11 @@ const upHeadList1:TableUpperProps[] = [
|
||||
{ id: "gugun", title: "시군구", upName:"upChangeRe",upSequnce:2, row: 1 },
|
||||
{ id: "bscFctNm", title: "시설명", row: 0, rowSpan: 2},
|
||||
{ id: "addr", title: "주소", row: 0, rowSpan: 2},
|
||||
{ id: "fctCpc", title: "시설용량(m³/일)", row: 0, rowSpan: 2},
|
||||
{ id: "fctCpc", title: "시설용량(m³/일)", row: 0, rowSpan: 2, align:"right"},
|
||||
{ id: "stnKo", title: "관측소 정보", row: 0, rowSpan: 2},
|
||||
{ id: "infoRnDay", title: "강우일\n(일)", row: 0, rowSpan: 2},
|
||||
{ id: "rainEffectDay", title: "강우영향일\n(일)", row: 0, rowSpan: 2},
|
||||
{ id: "totalYearRain", title: "연간 총 총강수량\n(mm)", row: 0, rowSpan: 2}
|
||||
{ id: "infoRnDay", title: "강우일\n(일)", row: 0, rowSpan: 2, align:"right"},
|
||||
{ id: "rainEffectDay", title: "강우영향일\n(일)", row: 0, rowSpan: 2, align:"right"},
|
||||
{ id: "totalYearRain", title: "연간 총 총강수량\n(mm)", row: 0, rowSpan: 2, align:"right"}
|
||||
];
|
||||
|
||||
const upHeadList2:TableUpperProps[] = [
|
||||
@@ -87,11 +87,11 @@ const upHeadList2:TableUpperProps[] = [
|
||||
{ id: "mdmbsn", title: "중권역", upName:"upChangeRe", upSequnce:3, row: 1},
|
||||
{ id: "bscFctNm", title: "시설명", row: 0, rowSpan: 2},
|
||||
{ id: "addr", title: "주소", row: 0, rowSpan: 2},
|
||||
{ id: "fctCpc", title: "시설용량(m³/일)", row: 0, rowSpan: 2},
|
||||
{ id: "fctCpc", title: "시설용량(m³/일)", row: 0, rowSpan: 2, align:"right"},
|
||||
{ id: "stnKo", title: "관측소 정보", row: 0, rowSpan: 2},
|
||||
{ id: "infoRnDay", title: "강우일\n(일)", row: 0, rowSpan: 2},
|
||||
{ id: "rainEffectDay", title: "강우영향일\n(일)", row: 0, rowSpan: 2},
|
||||
{ id: "totalYearRain", title: "연간 총 총강수량\n(mm)", row: 0, rowSpan: 2}
|
||||
{ id: "infoRnDay", title: "강우일\n(일)", row: 0, rowSpan: 2, align:"right"},
|
||||
{ id: "rainEffectDay", title: "강우영향일\n(일)", row: 0, rowSpan: 2, align:"right"},
|
||||
{ id: "totalYearRain", title: "연간 총 총강수량\n(mm)", row: 0, rowSpan: 2, align:"right"}
|
||||
];
|
||||
|
||||
const upHeadList3:TableUpperProps[] = [
|
||||
@@ -105,11 +105,11 @@ const upHeadList3:TableUpperProps[] = [
|
||||
{ id: "gugun", title: "시군구", upName:"upChangeRe2",upSequnce:2, row: 1},
|
||||
{ id: "bscFctNm", title: "시설명", row: 0, rowSpan: 2},
|
||||
{ id: "addr", title: "주소", row: 0, rowSpan: 2},
|
||||
{ id: "fctCpc", title: "시설용량(m³/일)", row: 0, rowSpan: 2},
|
||||
{ id: "fctCpc", title: "시설용량(m³/일)", row: 0, rowSpan: 2, align:"right"},
|
||||
{ id: "stnKo", title: "관측소 정보", row: 0, rowSpan: 2},
|
||||
{ id: "infoRnDay", title: "강우일\n(일)", row: 0, rowSpan: 2},
|
||||
{ id: "rainEffectDay", title: "강우영향일\n(일)", row: 0, rowSpan: 2},
|
||||
{ id: "totalYearRain", title: "연간 총 총강수량\n(mm)", row: 0, rowSpan: 2}
|
||||
{ id: "infoRnDay", title: "강우일\n(일)", row: 0, rowSpan: 2, align:"right"},
|
||||
{ id: "rainEffectDay", title: "강우영향일\n(일)", row: 0, rowSpan: 2, align:"right"},
|
||||
{ id: "totalYearRain", title: "연간 총 총강수량\n(mm)", row: 0, rowSpan: 2, align:"right"}
|
||||
];
|
||||
|
||||
const facilityPrecipitation:FacilityPrecipitationProps[] = [
|
||||
@@ -121,9 +121,9 @@ const facilityPrecipitation:FacilityPrecipitationProps[] = [
|
||||
// 강수현황 (헤더)
|
||||
const upHeadListPrecipitationDetail:TableUpperProps[] = [
|
||||
{ id: "rainDt", title: "날짜"},
|
||||
{ id: "infoRnDay", title: "강수량(mm/일)"},
|
||||
{ id: "rainDay", title: "강우일(일)"},
|
||||
{ id: "rainEffectDay", title: "강우영향일(일)"}
|
||||
{ id: "infoRnDay", title: "강수량(mm/일)", align:"right"},
|
||||
{ id: "rainDay", title: "강우일(일)", align:"right"},
|
||||
{ id: "rainEffectDay", title: "강우영향일(일)", align:"right"}
|
||||
]
|
||||
// 강수현황 (리스트)
|
||||
const gridListPrecipitationDetail:PrecipitationPropsDetailProps[] = [
|
||||
|
||||
@@ -449,6 +449,8 @@ export const facilityWaterQltyReducer = (set: (fn: (state: FacilityWaterQltyType
|
||||
item.fctCpc = parseFloat(item.fctCpc.toString().replace(/,/g, ''));
|
||||
item.sidoNm = item.lclgvrnmntNm.split(' ')[0]?.toString() || '';
|
||||
item.sggNm = item.lclgvrnmntNm.split(' ')[1]?.toString() || '';
|
||||
item.inflAssctBfrWqltToc = Number(searchYear)<2021? "("+item.inflAssctBfrWqltToc+")" : item.inflAssctBfrWqltToc;
|
||||
item.efflWqltToc = Number(searchYear)<2021? "("+item.efflWqltToc+")" : item.efflWqltToc;
|
||||
excelDownList.push({
|
||||
시설코드: item.bscFctCd,
|
||||
권역: item.rvbsn,
|
||||
@@ -478,6 +480,8 @@ export const facilityWaterQltyReducer = (set: (fn: (state: FacilityWaterQltyType
|
||||
item.fctCpc = parseFloat(item.fctCpc.toString().replace(/,/g, ''));
|
||||
item.sidoNm = item.lclgvrnmntNm.split(' ')[0]?.toString() || '';
|
||||
item.sggNm = item.lclgvrnmntNm.split(' ')[1]?.toString() || '';
|
||||
item.inflAssctBfrWqltToc = Number(searchYear)<2021? "("+item.inflAssctBfrWqltToc+")" : item.inflAssctBfrWqltToc;
|
||||
item.efflWqltToc = Number(searchYear)<2021? "("+item.efflWqltToc+")" : item.efflWqltToc;
|
||||
});
|
||||
}
|
||||
set((state: FacilityWaterQltyType) => ({
|
||||
@@ -600,12 +604,12 @@ export const facilityWaterQltyReducer = (set: (fn: (state: FacilityWaterQltyType
|
||||
for(let idx = 0; idx < data.length; idx++) {
|
||||
if(data[idx] && data[idx]?.rainEffectDay === 1) {
|
||||
if(idx > 1){
|
||||
if(data[idx-1]?.infoRnDay && Number(data[idx-1]?.infoRnDay) > 3) {
|
||||
if(data[idx-1]?.infoRnDay && Number(data[idx]?.infoRnDay) < 3 && Number(data[idx-1]?.infoRnDay) >= 3) {
|
||||
data[idx]!.infoRnDay = data[idx-1]!.infoRnDay;
|
||||
}
|
||||
}
|
||||
if(idx > 2){
|
||||
if(data[idx-2]?.infoRnDay && Number(data[idx-2]?.infoRnDay) > 3) {
|
||||
if(data[idx-2]?.infoRnDay && Number(data[idx]?.infoRnDay) < 3 && Number(data[idx-2]?.infoRnDay) >= 3) {
|
||||
data[idx]!.infoRnDay = data[idx-2]!.infoRnDay;
|
||||
}
|
||||
}
|
||||
@@ -620,7 +624,6 @@ export const facilityWaterQltyReducer = (set: (fn: (state: FacilityWaterQltyType
|
||||
if(item.efflWqltTn){
|
||||
item.efflWqltTn = Number(Math.round(Number(item.efflWqltTn) * 1000)/1000).toFixed(3);
|
||||
}
|
||||
|
||||
if(item.inflAssctBfrWqltTp){
|
||||
item.inflAssctBfrWqltTp = Number(Math.round(Number(item.inflAssctBfrWqltTp) * 1000)/1000).toFixed(3);
|
||||
}
|
||||
@@ -657,7 +660,6 @@ export const facilityWaterQltyReducer = (set: (fn: (state: FacilityWaterQltyType
|
||||
}else{
|
||||
item.tpInflWqltBod = '';
|
||||
}
|
||||
|
||||
if(item.tpInflWqltTp){
|
||||
item.tpInflWqltTp = item.tpInflWqltTp?Number(Math.round(Number(item.tpInflWqltTp) * 1000)/1000).toFixed(3): Number(item.tpInflWqltTp)===0?'0.000':'';
|
||||
}else{
|
||||
|
||||
@@ -154,7 +154,7 @@ const upHeadListFlowRateModal:TableUpperProps[] = [
|
||||
{ id: "sumFlow", title: "연계처리량(m³/일)", align:"right"},
|
||||
{ id: "returnAmnt", title: "총인 반류수량(m³/일)", align:"right"},
|
||||
{ id: "efflAmnt", title: "방류량(m³/일)", align:"right"},
|
||||
/* { id: "infoRnDay", title: "강우량(mm/일)", align:"right"} */
|
||||
{ id: "infoRnDay", title: "강우량(mm/일)", align:"right"}
|
||||
]
|
||||
|
||||
const modalFlowRateListYear:FlowRateModalProps[] = [
|
||||
@@ -230,12 +230,12 @@ export type FlowRateSearchStore = FlowRateSearchType & FlowRateSearchActions;
|
||||
|
||||
const dataFormSetting=(item : flowRateListProps | FlowRateModalProps)=> {
|
||||
DataForm({ type: 'date', column: 'msrDt', item: item as unknown as Record<string, unknown> });
|
||||
DataForm({ type: 'float1', column: 'totInflAmnt', item: item as unknown as Record<string, unknown>});
|
||||
DataForm({ type: 'float1', column: 'inflAmnt', item: item as unknown as Record<string, unknown>});
|
||||
DataForm({ type: 'float1', column: 'sumFlow', item: item as unknown as Record<string, unknown>});
|
||||
DataForm({ type: 'float1', column: 'efflWqltBod', item: item as unknown as Record<string, unknown>});
|
||||
DataForm({ type: 'float1', column: 'returnAmnt', item: item as unknown as Record<string, unknown>});
|
||||
DataForm({ type: 'float1', column: 'efflAmnt', item: item as unknown as Record<string, unknown>});
|
||||
DataForm({ type: 'float0', column: 'totInflAmnt', item: item as unknown as Record<string, unknown>});
|
||||
DataForm({ type: 'float0', column: 'inflAmnt', item: item as unknown as Record<string, unknown>});
|
||||
DataForm({ type: 'float0', column: 'sumFlow', item: item as unknown as Record<string, unknown>});
|
||||
DataForm({ type: 'float0', column: 'efflWqltBod', item: item as unknown as Record<string, unknown>});
|
||||
DataForm({ type: 'float0', column: 'returnAmnt', item: item as unknown as Record<string, unknown>});
|
||||
DataForm({ type: 'float0', column: 'efflAmnt', item: item as unknown as Record<string, unknown>});
|
||||
}
|
||||
|
||||
export const flowRateSearchInitState:FlowRateSearchType = {
|
||||
@@ -348,12 +348,12 @@ export const flowRateSearchReducer:(set:(fn: (state: FlowRateSearchType) => Flow
|
||||
for(let idx = 0; idx < data.length; idx++) {
|
||||
if(data[idx] && data[idx]?.rainEffectDay === 1) {
|
||||
if(idx > 1){
|
||||
if(data[idx-1]?.infoRnDay && Number(data[idx-1]?.infoRnDay.toString().trim()) >= 3) {
|
||||
if(data[idx-1]?.infoRnDay && Number(data[idx]?.infoRnDay) < 3 && Number(data[idx-1]?.infoRnDay.toString().trim()) >= 3) {
|
||||
data[idx]!.infoRnDay = data[idx-1]!.infoRnDay;
|
||||
}
|
||||
}
|
||||
if(idx > 2){
|
||||
if(data[idx-2]?.infoRnDay && Number(data[idx-2]?.infoRnDay.toString().trim()) >= 3) {
|
||||
if(data[idx-2]?.infoRnDay && Number(data[idx]?.infoRnDay) < 3 && Number(data[idx-2]?.infoRnDay.toString().trim()) >= 3) {
|
||||
data[idx]!.infoRnDay = data[idx-2]!.infoRnDay;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -51,7 +51,7 @@ const upHeadList1:TableUpperProps[] = [
|
||||
{ id: "daddr", title: "주소", row:0, rowSpan:2 },
|
||||
{ id: "fctCpc", title: "시설용량(m³/일)", row:0, rowSpan:2, align:'right' },
|
||||
{ id: "spareCapacity", title: "여유용량(m³/일)", row:0, rowSpan:2, align:'right' },
|
||||
{ id: "variableLoadPercent", title: "변동부하율(%)", row:0, rowSpan:2, align:'right' },
|
||||
{ id: "variableLoadPercent", title: "변동부하율", row:0, rowSpan:2, align:'right' },
|
||||
{ id: "classifiedSewerPercent", title: "분류식화율(%)", row:0, rowSpan:2, align:'right' },
|
||||
];
|
||||
|
||||
@@ -64,7 +64,7 @@ const upHeadList2:TableUpperProps[] = [
|
||||
{ id: "daddr", title: "주소", row:0, rowSpan:2 },
|
||||
{ id: "fctCpc", title: "시설용량(m³/일)", row:0, rowSpan:2, align:'right' },
|
||||
{ id: "spareCapacity", title: "여유용량(m³/일)", row:0, rowSpan:2, align:'right' },
|
||||
{ id: "variableLoadPercent", title: "변동부하율(%)", row:0, rowSpan:2, align:'right' },
|
||||
{ id: "variableLoadPercent", title: "변동부하율", row:0, rowSpan:2, align:'right' },
|
||||
{ id: "classifiedSewerPercent", title: "분류식화율(%)", row:0, rowSpan:2, align:'right' },
|
||||
];
|
||||
|
||||
@@ -81,7 +81,7 @@ const upHeadList3:TableUpperProps[] = [
|
||||
{ id: "daddr", title: "주소", row:0, rowSpan:2 },
|
||||
{ id: "fctCpc", title: "시설용량(m³/일)", row:0, rowSpan:2, align:'right' },
|
||||
{ id: "spareCapacity", title: "여유용량(m³/일)", row:0, rowSpan:2, align:'right' },
|
||||
{ id: "variableLoadPercent", title: "변동부하율(%)", row:0, rowSpan:2, align:'right' },
|
||||
{ id: "variableLoadPercent", title: "변동부하율", row:0, rowSpan:2, align:'right' },
|
||||
{ id: "classifiedSewerPercent", title: "분류식화율(%)", row:0, rowSpan:2, align:'right' },
|
||||
];
|
||||
|
||||
@@ -119,9 +119,9 @@ export type ExcelType = {
|
||||
}
|
||||
|
||||
const dataFormSetting=(item : PlanSewageProps)=> {
|
||||
DataForm({ type: 'float1', column: 'fctCpc', item: item as unknown as Record<string, unknown> });
|
||||
DataForm({ type: 'float1', column: 'spareCapacity', item: item as unknown as Record<string, unknown>});
|
||||
DataForm({ type: 'float1', column: 'variableLoadPercent', item: item as unknown as Record<string, unknown>});
|
||||
DataForm({ type: 'float0', column: 'fctCpc', item: item as unknown as Record<string, unknown> });
|
||||
DataForm({ type: 'float0', column: 'spareCapacity', item: item as unknown as Record<string, unknown>});
|
||||
DataForm({ type: 'float2', column: 'variableLoadPercent', item: item as unknown as Record<string, unknown>});
|
||||
DataForm({ type: 'float1', column: 'classifiedSewerPercent', item: item as unknown as Record<string, unknown>});
|
||||
};
|
||||
|
||||
|
||||
@@ -136,26 +136,26 @@ const upHeadList1:TableUpperProps[] = [
|
||||
{ id: "fctCpc", title: "시설용량(m³/일)", align:"right", rowSpan:3, row:0},
|
||||
{ id: "B", title: "시설계획", colSpan:19, row:0},
|
||||
{ id: "C", title: "증설계획(m³/일)", colSpan:6, row:1},
|
||||
{ id: "planSwageQntSumDt4", title: "기승인\n4단계", row:2},
|
||||
{ id: "planSwageQntSum", title: "현재", row:2},
|
||||
{ id: "planSwageQntSumDc1", title: "1단계", row:2},
|
||||
{ id: "planSwageQntSumDc2", title: "2단계", row:2},
|
||||
{ id: "planSwageQntSumDc3", title: "3단계", row:2},
|
||||
{ id: "planSwageQntSumDc4", title: "4단계", row:2},
|
||||
{ id: "planSwageQntSumDt4", title: "기승인\n4단계", row:2, align:"right"},
|
||||
{ id: "planSwageQntSum", title: "현재", row:2, align:"right"},
|
||||
{ id: "planSwageQntSumDc1", title: "1단계", row:2, align:"right"},
|
||||
{ id: "planSwageQntSumDc2", title: "2단계", row:2, align:"right"},
|
||||
{ id: "planSwageQntSumDc3", title: "3단계", row:2, align:"right"},
|
||||
{ id: "planSwageQntSumDc4", title: "4단계", row:2, align:"right"},
|
||||
{ id: "D", title: "처리인구(인)", colSpan:6, row:1},
|
||||
{ id: "swtrmtPpltnCntDt4", title: "기승인\n4단계", row:2},
|
||||
{ id: "swtrmtPpltnCnt", title: "현재", row:2},
|
||||
{ id: "swtrmtPpltnCntDc1", title: "1단계", row:2},
|
||||
{ id: "swtrmtPpltnCntDc2", title: "2단계", row:2},
|
||||
{ id: "swtrmtPpltnCntDc3", title: "3단계", row:2},
|
||||
{ id: "swtrmtPpltnCntDc4", title: "4단계", row:2},
|
||||
{ id: "swtrmtPpltnCntDt4", title: "기승인\n4단계", row:2, align:"right"},
|
||||
{ id: "swtrmtPpltnCnt", title: "현재", row:2, align:"right"},
|
||||
{ id: "swtrmtPpltnCntDc1", title: "1단계", row:2, align:"right"},
|
||||
{ id: "swtrmtPpltnCntDc2", title: "2단계", row:2, align:"right"},
|
||||
{ id: "swtrmtPpltnCntDc3", title: "3단계", row:2, align:"right"},
|
||||
{ id: "swtrmtPpltnCntDc4", title: "4단계", row:2, align:"right"},
|
||||
{ id: "E", title: "처리구역(km²)", colSpan:7, row:1},
|
||||
{ id: "swtrmtZoneAreaDt4", title: "기승인\n4단계", row:2},
|
||||
{ id: "swtrmtZoneArea", title: "현재", row:2},
|
||||
{ id: "swtrmtZoneAreaDc1", title: "1단계", row:2},
|
||||
{ id: "swtrmtZoneAreaDc2", title: "2단계", row:2},
|
||||
{ id: "swtrmtZoneAreaDc3", title: "3단계", row:2},
|
||||
{ id: "swtrmtZoneAreaDc4", title: "4단계", row:2},
|
||||
{ id: "swtrmtZoneAreaDt4", title: "기승인\n4단계", row:2, align:"right"},
|
||||
{ id: "swtrmtZoneArea", title: "현재", row:2, align:"right"},
|
||||
{ id: "swtrmtZoneAreaDc1", title: "1단계", row:2, align:"right"},
|
||||
{ id: "swtrmtZoneAreaDc2", title: "2단계", row:2, align:"right"},
|
||||
{ id: "swtrmtZoneAreaDc3", title: "3단계", row:2, align:"right"},
|
||||
{ id: "swtrmtZoneAreaDc4", title: "4단계", row:2, align:"right"},
|
||||
{ id: "trtDstr", title: "처리구역", row:2}
|
||||
];
|
||||
|
||||
@@ -167,13 +167,13 @@ const processAreaList:ProcessAreaProps[] = [
|
||||
*/
|
||||
// 시설증설 계획 (헤더)
|
||||
const upHeadListFcltyImproveInfo:TableUpperProps[] = [
|
||||
{ id: "planSwageQntSumDt4", title: "기승인\n4단계(m³/일)", rowSpan:2, row:0},
|
||||
{ id: "planSwageQntSumDt4", title: "기승인\n4단계(m³/일)", rowSpan:2, row:0, align:"right"},
|
||||
{ id: "A", title: "증설계획(m³/일)", colSpan:5, row:0},
|
||||
{ id: "planSwageQntSum", title: "현재", row:1},
|
||||
{ id: "planSwageQntSumDc1", title: "1단계", row:1},
|
||||
{ id: "planSwageQntSumDc2", title: "2단계", row:1},
|
||||
{ id: "planSwageQntSumDc3", title: "3단계", row:1},
|
||||
{ id: "planSwageQntSumDc4", title: "4단계", row:1},
|
||||
{ id: "planSwageQntSum", title: "현재", row:1, align:"right"},
|
||||
{ id: "planSwageQntSumDc1", title: "1단계", row:1, align:"right"},
|
||||
{ id: "planSwageQntSumDc2", title: "2단계", row:1, align:"right"},
|
||||
{ id: "planSwageQntSumDc3", title: "3단계", row:1, align:"right"},
|
||||
{ id: "planSwageQntSumDc4", title: "4단계", row:1, align:"right"},
|
||||
];
|
||||
|
||||
// 시설증설 계획 (리스트)
|
||||
@@ -182,13 +182,13 @@ const gridListFcltyImproveInfo:FcltyImproveInfoProps[] = [
|
||||
|
||||
// 처리인구 계획 (헤더)
|
||||
const upHeadListProcessPopulation:TableUpperProps[] = [
|
||||
{ id: "swtrmtPpltnCntDt4", title: "기승인\n4단계(인)", rowSpan:2, row:0},
|
||||
{ id: "swtrmtPpltnCntDt4", title: "기승인\n4단계(인)", rowSpan:2, row:0, align:"right"},
|
||||
{ id: "A", title: "처리인구(인)", colSpan:5, row:0},
|
||||
{ id: "swtrmtPpltnCnt", title: "현재", row:1},
|
||||
{ id: "swtrmtPpltnCntDc1", title: "1단계", row:1},
|
||||
{ id: "swtrmtPpltnCntDc2", title: "2단계", row:1},
|
||||
{ id: "swtrmtPpltnCntDc3", title: "3단계", row:1},
|
||||
{ id: "swtrmtPpltnCntDc4", title: "4단계", row:1},
|
||||
{ id: "swtrmtPpltnCnt", title: "현재", row:1, align:"right"},
|
||||
{ id: "swtrmtPpltnCntDc1", title: "1단계", row:1, align:"right"},
|
||||
{ id: "swtrmtPpltnCntDc2", title: "2단계", row:1, align:"right"},
|
||||
{ id: "swtrmtPpltnCntDc3", title: "3단계", row:1, align:"right"},
|
||||
{ id: "swtrmtPpltnCntDc4", title: "4단계", row:1, align:"right"},
|
||||
];
|
||||
|
||||
// 처리인구 계획 (리스트)
|
||||
@@ -197,13 +197,13 @@ const gridListProcessPopulation:ProcessPopulationProps[] = [
|
||||
|
||||
// 처리구역 계획 (헤더)
|
||||
const upHeadListProcessAreaPlan:TableUpperProps[] = [
|
||||
{ id: "swtrmtZoneAreaDt4", title: "기승인\n4단계(km²)", rowSpan:2, row:0},
|
||||
{ id: "A", title: "처리면적(km²)", colSpan:6, row:0},
|
||||
{ id: "swtrmtZoneArea", title: "현재", row:1},
|
||||
{ id: "swtrmtZoneAreaDc1", title: "1단계", row:1},
|
||||
{ id: "swtrmtZoneAreaDc2", title: "2단계", row:1},
|
||||
{ id: "swtrmtZoneAreaDc3", title: "3단계", row:1},
|
||||
{ id: "swtrmtZoneAreaDc4", title: "4단계", row:1},
|
||||
{ id: "swtrmtZoneAreaDt4", title: "기승인\n4단계(km²)", rowSpan:2, row:0, align:"right"},
|
||||
{ id: "A", title: "처리면적(km²)", colSpan:6, row:0, align:"right"},
|
||||
{ id: "swtrmtZoneArea", title: "현재", row:1, align:"right"},
|
||||
{ id: "swtrmtZoneAreaDc1", title: "1단계", row:1, align:"right"},
|
||||
{ id: "swtrmtZoneAreaDc2", title: "2단계", row:1, align:"right"},
|
||||
{ id: "swtrmtZoneAreaDc3", title: "3단계", row:1, align:"right"},
|
||||
{ id: "swtrmtZoneAreaDc4", title: "4단계", row:1, align:"right"},
|
||||
{ id: "trtDstr", title: "처리구역", row:1}
|
||||
];
|
||||
|
||||
|
||||
@@ -117,7 +117,8 @@ export type fcltyHistInfoProps = {
|
||||
rnDt : string,
|
||||
sitArea : number,
|
||||
trtDstrArea : number,
|
||||
swrTrtPopl : number
|
||||
swrTrtPopl : number,
|
||||
fcltCpc : number | ''
|
||||
}
|
||||
|
||||
// 시설 수질정보
|
||||
@@ -327,6 +328,7 @@ const upHeadListFcltyHistInfo:TableUpperProps[] = [
|
||||
{ id: "cmplDt", title: "준공일"},
|
||||
{ id: "trlrnCmplDt", title: "시운전완료일"},
|
||||
{ id: "rnDt", title: "가동개시일"},
|
||||
{ id: "fctCpc", title: "시설용량(m³/일)", align: 'right' },
|
||||
];
|
||||
|
||||
// 시설 이력관리 (리스트)
|
||||
@@ -343,6 +345,7 @@ const gridListFcltyHistInfo:fcltyHistInfoProps[] = [
|
||||
sitArea : 0,
|
||||
trtDstrArea : 0,
|
||||
swrTrtPopl : 0,
|
||||
fcltCpc : 860000
|
||||
}
|
||||
];
|
||||
|
||||
@@ -598,7 +601,7 @@ export const processFacilityReducer:(set:SetStateFunction)=>ProcessFacilityActio
|
||||
res.data.forEach((item:facilityListProps) => {
|
||||
DataForm({ type: 'date', column: 'cmplDt', item:item as unknown as Record<string, unknown>});
|
||||
DataForm({ type: 'date', column: 'rnDt', item:item as unknown as Record<string, unknown>});
|
||||
DataForm({ type: 'float1', column: 'fctCpc', item:item as unknown as Record<string, unknown>});
|
||||
DataForm({ type: 'float0', column: 'fctCpc', item:item as unknown as Record<string, unknown>});
|
||||
})
|
||||
|
||||
res.data.forEach(item => {
|
||||
@@ -610,7 +613,6 @@ export const processFacilityReducer:(set:SetStateFunction)=>ProcessFacilityActio
|
||||
|
||||
if(pageSize>5000){
|
||||
res.data.forEach(item => {
|
||||
item.fctCpc = item.fctCpc ? parseFloat(item.fctCpc.toString().replace(/,/g, '')) : '';
|
||||
excelDownList.push({
|
||||
시설코드: item.bscFctCd,
|
||||
권역: item.rvbsn,
|
||||
@@ -630,10 +632,6 @@ export const processFacilityReducer:(set:SetStateFunction)=>ProcessFacilityActio
|
||||
관리대행업자: item.mnstr,
|
||||
})
|
||||
})
|
||||
}else{
|
||||
res.data.forEach(item => {
|
||||
item.fctCpc = item.fctCpc ? parseFloat(item.fctCpc.toString().replace(/,/g, '')) : '';
|
||||
})
|
||||
}
|
||||
set((state:ProcessFacilityType) => ({
|
||||
...state,
|
||||
@@ -779,6 +777,29 @@ export const processFacilityReducer:(set:SetStateFunction)=>ProcessFacilityActio
|
||||
}
|
||||
});
|
||||
|
||||
sortedWaterQltyInfo.forEach(item => {
|
||||
DataForm({ type: 'float1', column: 'plInflWqltBod', item: item as unknown as Record<string, unknown> });
|
||||
DataForm({ type: 'float1', column: 'plInflWqltToc', item: item as unknown as Record<string, unknown> });
|
||||
DataForm({ type: 'float1', column: 'plInflWqltCod', item: item as unknown as Record<string, unknown> });
|
||||
DataForm({ type: 'float1', column: 'plInflWqltSs', item: item as unknown as Record<string, unknown> });
|
||||
DataForm({ type: 'float3', column: 'plInflWqltTn', item: item as unknown as Record<string, unknown> });
|
||||
DataForm({ type: 'float3', column: 'plInflWqltTp', item: item as unknown as Record<string, unknown> });
|
||||
|
||||
DataForm({ type: 'float1', column: 'dsInflWqltBod', item: item as unknown as Record<string, unknown> });
|
||||
DataForm({ type: 'float1', column: 'dsInflWqltToc', item: item as unknown as Record<string, unknown> });
|
||||
DataForm({ type: 'float1', column: 'dsInflWqltCod', item: item as unknown as Record<string, unknown> });
|
||||
DataForm({ type: 'float1', column: 'dsInflWqltSs', item: item as unknown as Record<string, unknown> });
|
||||
DataForm({ type: 'float3', column: 'dsInflWqltTn', item: item as unknown as Record<string, unknown> });
|
||||
DataForm({ type: 'float3', column: 'dsInflWqltTp', item: item as unknown as Record<string, unknown> });
|
||||
|
||||
DataForm({ type: 'float1', column: 'plEfflWqltBod', item: item as unknown as Record<string, unknown> });
|
||||
DataForm({ type: 'float1', column: 'plEfflWqltToc', item: item as unknown as Record<string, unknown> });
|
||||
DataForm({ type: 'float1', column: 'plEfflWqltCod', item: item as unknown as Record<string, unknown> });
|
||||
DataForm({ type: 'float1', column: 'plEfflWqltSs', item: item as unknown as Record<string, unknown> });
|
||||
DataForm({ type: 'float3', column: 'plEfflWqltTn', item: item as unknown as Record<string, unknown> });
|
||||
DataForm({ type: 'float3', column: 'plEfflWqltTp', item: item as unknown as Record<string, unknown> });
|
||||
});
|
||||
|
||||
// 법적수질정보 초기화 및 push
|
||||
gridListLegalWaterQlty = [];
|
||||
|
||||
@@ -791,6 +812,14 @@ export const processFacilityReducer:(set:SetStateFunction)=>ProcessFacilityActio
|
||||
totClfgrpcnt : Number(facilityWaterQltyInfo[0]?.totClfgrpcnt ?? 0),
|
||||
});
|
||||
|
||||
gridListLegalWaterQlty.forEach(item => {
|
||||
DataForm({ type: 'float1', column: 'bod', item: item as unknown as Record<string, unknown> });
|
||||
DataForm({ type: 'float1', column: 'cod', item: item as unknown as Record<string, unknown> });
|
||||
DataForm({ type: 'float1', column: 'ss', item: item as unknown as Record<string, unknown> });
|
||||
DataForm({ type: 'float3', column: 'tn', item: item as unknown as Record<string, unknown> });
|
||||
DataForm({ type: 'float3', column: 'tp', item: item as unknown as Record<string, unknown> });
|
||||
});
|
||||
|
||||
// 마지막 수질 데이터의 값을 gridListPlanInfo에 업데이트
|
||||
if (sortedWaterQltyInfo.length > 0) {
|
||||
const lastWaterQltyInfo = sortedWaterQltyInfo[sortedWaterQltyInfo.length - 1];
|
||||
@@ -814,7 +843,7 @@ export const processFacilityReducer:(set:SetStateFunction)=>ProcessFacilityActio
|
||||
plInflWqltSs: lastWaterQltyInfo?.plInflWqltSs === 'NULL' || lastWaterQltyInfo?.plInflWqltSs === undefined ? '' : lastWaterQltyInfo.plInflWqltSs,
|
||||
plInflWqltTn: lastWaterQltyInfo?.plInflWqltTn === 'NULL' || lastWaterQltyInfo?.plInflWqltTn === undefined ? '' : lastWaterQltyInfo.plInflWqltTn,
|
||||
plInflWqltTp: lastWaterQltyInfo?.plInflWqltTp === 'NULL' || lastWaterQltyInfo?.plInflWqltTp === undefined ? '' : lastWaterQltyInfo.plInflWqltTp
|
||||
}]
|
||||
}],
|
||||
}
|
||||
}));
|
||||
} else {
|
||||
|
||||
@@ -21,7 +21,7 @@ export type RdiProps = {
|
||||
daddr : string,
|
||||
fctCpc : number,
|
||||
summerMinBodValue : number,
|
||||
inflAmnt : number,
|
||||
inflAmnt : number | string | '',
|
||||
winterAvgBodLowRainfall : number,
|
||||
rdiiValue : number,
|
||||
infoRnDay : number,
|
||||
@@ -81,7 +81,7 @@ export interface ExcelType {
|
||||
주소: string,
|
||||
시설용량: number,
|
||||
하절기강우일최저유입BOD: number | '',
|
||||
하절기최저유입BOD유입유량: number | '',
|
||||
하절기최저유입BOD유입유량: number | string | '',
|
||||
동절기청천시유입BOD: number | '',
|
||||
RDII추정 : number | '',
|
||||
RDII추정시일강수량 : number | '',
|
||||
@@ -97,11 +97,11 @@ const upHeadList1:TableUpperProps[] = [
|
||||
{ id: "fctCpc", title: "시설용량\n(m³/일)", align:"right", row:0, rowSpan:2 },
|
||||
{ id: "B", title: "하절기 운영현황(6~8월)", row:0, colSpan:2 },
|
||||
{ id: "summerMinBodValue", title: "3mm 이상 강우일 중 최저 유입BOD\n(mg/L)", align:"right", row:1 },
|
||||
{ id: "inflAmnt", title: "하절기최저유입BOD유입유량\n(m³/일)", row:1 },
|
||||
{ id: "inflAmnt", title: "하절기최저유입BOD유입유량\n(m³/일)", row:1, align:"right" },
|
||||
{ id: "C", title: "동절기 운영현황(1~2월)", row:0 },
|
||||
{ id: "winterAvgBodLowRainfall", title: "청천시 유입BOD\n(mg/L)", row:1 },
|
||||
{ id: "rdiiValue", title: "RDII추정", row:0, rowSpan:2 },
|
||||
{ id: "infoRnDay", title: "RDII추정시일강수량\n(mm)", row:0, rowSpan:2 },
|
||||
{ id: "winterAvgBodLowRainfall", title: "청천시 유입BOD\n(mg/L)", row:1, align:"right" },
|
||||
{ id: "rdiiValue", title: "RDII추정", row:0, rowSpan:2, align:"right" },
|
||||
{ id: "infoRnDay", title: "RDII추정시일강수량\n(mm)", row:0, rowSpan:2, align:"right" },
|
||||
];
|
||||
|
||||
const upHeadList2:TableUpperProps[] = [
|
||||
@@ -114,11 +114,11 @@ const upHeadList2:TableUpperProps[] = [
|
||||
{ id: "fctCpc", title: "시설용량(m³/일)", align:"right", row:0, rowSpan:2 },
|
||||
{ id: "B", title: "하절기 운영현황(6~8월)", row:0, colSpan:2 },
|
||||
{ id: "summerMinBodValue", title: "하절기강우일최저유입BOD", align:"right", row:1 },
|
||||
{ id: "inflAmnt", title: "하절기최저유입BOD유입유량", row:1 },
|
||||
{ id: "inflAmnt", title: "하절기최저유입BOD유입유량", row:1, align:"right" },
|
||||
{ id: "D", title: "동절기 운영현황(1~2월)", row:0 },
|
||||
{ id: "winterAvgBodLowRainfall", title: "동절기청천시유입BOD", row:1 },
|
||||
{ id: "rdiiValue", title: "RDII추정", row:0, rowSpan:2 },
|
||||
{ id: "infoRnDay", title: "RDII추정시일강수량", row:0, rowSpan:2 },
|
||||
{ id: "winterAvgBodLowRainfall", title: "동절기청천시유입BOD", row:1, align:"right" },
|
||||
{ id: "rdiiValue", title: "RDII추정", row:0, rowSpan:2, align:"right" },
|
||||
{ id: "infoRnDay", title: "RDII추정시일강수량", row:0, rowSpan:2, align:"right" },
|
||||
];
|
||||
|
||||
const upHeadList3:TableUpperProps[] = [
|
||||
@@ -135,11 +135,11 @@ const upHeadList3:TableUpperProps[] = [
|
||||
{ id: "fctCpc", title: "시설용량(m³/일)", align:"right", row:0, rowSpan:2 },
|
||||
{ id: "C", title: "하절기 운영현황(6~8월)", row:0, colSpan:2 },
|
||||
{ id: "summerMinBodValue", title: "하절기강우일최저유입BOD", align:"right", row:1 },
|
||||
{ id: "inflAmnt", title: "하절기최저유입BOD유입유량", row:1 },
|
||||
{ id: "inflAmnt", title: "하절기최저유입BOD유입유량", row:1, align:"right" },
|
||||
{ id: "D", title: "동절기 운영현황(1~2월)", row:0 },
|
||||
{ id: "winterAvgBodLowRainfall", title: "동절기청천시유입BOD", row:1 },
|
||||
{ id: "rdiiValue", title: "RDII추정", row:0, rowSpan:2 },
|
||||
{ id: "infoRnDay", title: "RDII추정시일강수량", row:0, rowSpan:2 },
|
||||
{ id: "winterAvgBodLowRainfall", title: "동절기청천시유입BOD", row:1, align:"right" },
|
||||
{ id: "rdiiValue", title: "RDII추정", row:0, rowSpan:2, align:"right" },
|
||||
{ id: "infoRnDay", title: "RDII추정시일강수량", row:0, rowSpan:2, align:"right" },
|
||||
];
|
||||
|
||||
const rdiList:RdiProps[] = [
|
||||
@@ -206,11 +206,12 @@ export const rdiInitState: RdiType = {
|
||||
}
|
||||
|
||||
const dataFormSetting=(item : RdiProps)=> {
|
||||
DataForm({ type: 'float1', column: 'fctCpc', item: item as unknown as Record<string, unknown> });
|
||||
DataForm({ type: 'float0', column: 'fctCpc', item: item as unknown as Record<string, unknown> });
|
||||
DataForm({ type: 'float1', column: 'summerMinBodValue', item: item as unknown as Record<string, unknown>});
|
||||
DataForm({ type: 'float1', column: 'winterAvgBodLowRainfall', item: item as unknown as Record<string, unknown>});
|
||||
DataForm({ type: 'float2', column: 'rdiiValue', item: item as unknown as Record<string, unknown>});
|
||||
DataForm({ type: 'float2', column: 'infoRnDay', item: item as unknown as Record<string, unknown>});
|
||||
DataForm({ type: 'float1', column: 'rdiiValue', item: item as unknown as Record<string, unknown>});
|
||||
DataForm({ type: 'float1', column: 'infoRnDay', item: item as unknown as Record<string, unknown>});
|
||||
DataForm({ type: 'float0', column: 'inflAmnt', item: item as unknown as Record<string, unknown>});
|
||||
}
|
||||
|
||||
// Add type definitions for state setter function
|
||||
@@ -238,7 +239,7 @@ export const rdiReducer:(set:SetStateFunction)=>RdiActions=(set: SetStateFunctio
|
||||
...item,
|
||||
sido: item.lclgvrnmntNm.split(' ')[0]?.toString() || '',
|
||||
sigungo: item.lclgvrnmntNm.split(' ')[1]?.toString() || '',
|
||||
inflAmnt: item.inflAmnt?item.inflAmnt.toFixed(1) : ''
|
||||
inflAmnt: item.inflAmnt?Number(item.inflAmnt).toFixed(1): ''
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import DataForm from "@/app/components/common/DataForm";
|
||||
import type { TableUpperProps } from "../dashboard";
|
||||
import { getFetch } from "@/app/components/api";
|
||||
export type { TableUpperProps };
|
||||
@@ -108,9 +109,9 @@ const upHeadList3:TableUpperProps[] = [
|
||||
|
||||
const upHeadListSewageOccurDetail:TableUpperProps[] = [
|
||||
{ id: "msrDt", title: "년월" },
|
||||
{ id: "waterUsage", title: "물사용량(m³/일)" },
|
||||
{ id: "swageChangePercent", title: "오수전환율(%)" },
|
||||
{ id: "estimationSewage", title: "오수발생량 추정(m³/일)", row:0, rowSpan:2 },
|
||||
{ id: "waterUsage", title: "물사용량(m³/일)", align:"right" },
|
||||
{ id: "swageChangePercent", title: "오수전환율(%)", align:"right" },
|
||||
{ id: "estimationSewage", title: "오수발생량 추정(m³/일)", row:0, rowSpan:2, align:"right" },
|
||||
];
|
||||
|
||||
const sewageOccurList:SewageOccurProps[] = []
|
||||
@@ -225,7 +226,7 @@ export const sewageOccurReducer:(set:any)=>SewageOccurActions=(set: any) => {
|
||||
item.sidoNm = item.lclgvrnmntNm.split(' ')[0]?.toString() || '';
|
||||
item.sggNm = item.lclgvrnmntNm.split(' ')[1]?.toString() || '';
|
||||
item.fctCpc = parseFloat(item.fctCpc.toString().replace(/,/g, ''));
|
||||
item.swageChangePercent = 80;
|
||||
item.swageChangePercent = 90;
|
||||
|
||||
const bscFctCd = item.bscFctCd;
|
||||
const res2 = await getFetch('fo', '/fclt/flow/' + bscFctCd + '/' + searchYear) as FlowResponse;
|
||||
@@ -263,12 +264,12 @@ export const sewageOccurReducer:(set:any)=>SewageOccurActions=(set: any) => {
|
||||
for(let idx = 0; idx < res2.data.length; idx++) {
|
||||
if(res2.data[idx] && res2.data[idx]?.rainEffectDay === 1) {
|
||||
if(idx > 1){
|
||||
if(res2.data[idx-1]?.infoRnDay && Number(res2.data[idx-1]?.infoRnDay.toString().trim()) >= 3) {
|
||||
if(res2.data[idx-1]?.infoRnDay && Number(res2.data[idx]?.infoRnDay) < 3 && Number(res2.data[idx-1]?.infoRnDay.toString().trim()) >= 3) {
|
||||
res2.data[idx]!.infoRnDay = res2.data[idx-1]!.infoRnDay;
|
||||
}
|
||||
}
|
||||
if(idx > 2){
|
||||
if(res2.data[idx-2]?.infoRnDay && Number(res2.data[idx-2]?.infoRnDay.toString().trim()) >= 3) {
|
||||
if(res2.data[idx-2]?.infoRnDay && Number(res2.data[idx]?.infoRnDay) < 3 && Number(res2.data[idx-2]?.infoRnDay.toString().trim()) >= 3) {
|
||||
res2.data[idx]!.infoRnDay = res2.data[idx-2]!.infoRnDay;
|
||||
}
|
||||
}
|
||||
@@ -292,6 +293,15 @@ export const sewageOccurReducer:(set:any)=>SewageOccurActions=(set: any) => {
|
||||
return item;
|
||||
}));
|
||||
|
||||
calData.forEach((item: SewageOccurProps) => {
|
||||
DataForm({ type: 'float0', column: 'fctCpc', item: item as unknown as Record<string, unknown> });
|
||||
DataForm({ type: 'float0', column: 'waterUsage', item: item as unknown as Record<string, unknown> });
|
||||
DataForm({ type: 'float0', column: 'swageChangePercent', item: item as unknown as Record<string, unknown> });
|
||||
DataForm({ type: 'float0', column: 'estimationSewage', item: item as unknown as Record<string, unknown> });
|
||||
DataForm({ type: 'float0', column: 'sewageInputYear', item: item as unknown as Record<string, unknown> });
|
||||
DataForm({ type: 'float0', column: 'sewageInputChungchun', item: item as unknown as Record<string, unknown> });
|
||||
});
|
||||
|
||||
if(pageSize>5000){
|
||||
calData.forEach((item: SewageOccurProps) => {
|
||||
excelDownList.push({
|
||||
@@ -371,9 +381,9 @@ export const sewageOccurReducer:(set:any)=>SewageOccurActions=(set: any) => {
|
||||
item.usege = item.sum/item.cnt *0.65
|
||||
tableData.push({
|
||||
msrDt: item.yr+'-'+(index+1>=10?String(index+1):'0'+(index+1)),
|
||||
waterUsage: Math.round(item.usege*100) /100,
|
||||
swageChangePercent: (Math.round((item.usege/item.usege*0.8) * 100) / 100) * 100,
|
||||
estimationSewage: Math.round(item.usege*0.8 * 100) / 100
|
||||
waterUsage: Math.round(item.usege*1) /1,
|
||||
swageChangePercent: (Math.round((item.usege/item.usege*0.9) * 100) / 100) * 100,
|
||||
estimationSewage: Math.round(item.usege*0.9 * 1) / 1
|
||||
})
|
||||
if (item.usege > maxWaterUsage) {
|
||||
maxWaterUsage = item.usege;
|
||||
@@ -389,21 +399,21 @@ export const sewageOccurReducer:(set:any)=>SewageOccurActions=(set: any) => {
|
||||
const newData= [
|
||||
{
|
||||
msrDt: '평균',
|
||||
waterUsage: Math.round(avgWaterUsage*100) /100,
|
||||
swageChangePercent: 80,
|
||||
estimationSewage: Math.round(avgWaterUsage*0.8*100) /100,
|
||||
waterUsage: Math.round(avgWaterUsage*1) /1,
|
||||
swageChangePercent: 90,
|
||||
estimationSewage: Math.round(avgWaterUsage*0.9*1) /1,
|
||||
},
|
||||
{
|
||||
msrDt: '최대',
|
||||
waterUsage: Math.round(maxWaterUsage*100) /100,
|
||||
swageChangePercent: 80,
|
||||
estimationSewage: Math.round(maxWaterUsage*0.8*100) /100,
|
||||
swageChangePercent: 90,
|
||||
estimationSewage: Math.round(maxWaterUsage*0.9*1) /1,
|
||||
},
|
||||
{
|
||||
msrDt: '최소',
|
||||
waterUsage: Math.round(minWaterUsage*100) /100,
|
||||
swageChangePercent: 80,
|
||||
estimationSewage: Math.round(minWaterUsage*0.8*100) /100,
|
||||
swageChangePercent: 90,
|
||||
estimationSewage: Math.round(minWaterUsage*0.9*1) /1,
|
||||
},
|
||||
...tableData
|
||||
]
|
||||
|
||||
@@ -79,9 +79,9 @@ const upHeadList3:TableUpperProps[] = [
|
||||
// 모달
|
||||
const upHeadListUnderWaterDetail:TableUpperProps[] = [
|
||||
{ id: "msrDt", title: "날짜" },
|
||||
{ id: "realSewageInput", title: "청천시 실제 하수유입량\n(m³/일)" },
|
||||
{ id: "sewageOccur", title: "오수발생량\n(m³/일)" },
|
||||
{ id: "underWaterInput", title: "지하수 유입량\n(m³/일)" },
|
||||
{ id: "realSewageInput", title: "청천시 실제 하수유입량\n(m³/일)", align:"right" },
|
||||
{ id: "sewageOccur", title: "오수발생량\n(m³/일)", align:"right" },
|
||||
{ id: "underWaterInput", title: "지하수 유입량\n(m³/일)", align:"right" },
|
||||
];
|
||||
|
||||
const underWaterList:UnderWaterProps[] = [
|
||||
@@ -250,10 +250,10 @@ export const underWaterInitState: UnderWaterType = {
|
||||
}
|
||||
|
||||
const dataFormSetting=(item : UnderWaterProps)=> {
|
||||
DataForm({ type: 'float1', column: 'fctCpc', item: item as unknown as Record<string, unknown> });
|
||||
DataForm({ type: 'float1', column: 'underWaterInputYear', item: item as unknown as Record<string, unknown>});
|
||||
DataForm({ type: 'float2', column: 'underWaterInputSummer', item: item as unknown as Record<string, unknown>});
|
||||
DataForm({ type: 'float2', column: 'underWaterInputWinter', item: item as unknown as Record<string, unknown>});
|
||||
DataForm({ type: 'float0', column: 'fctCpc', item: item as unknown as Record<string, unknown> });
|
||||
DataForm({ type: 'float0', column: 'underWaterInputYear', item: item as unknown as Record<string, unknown>});
|
||||
DataForm({ type: 'float0', column: 'underWaterInputSummer', item: item as unknown as Record<string, unknown>});
|
||||
DataForm({ type: 'float0', column: 'underWaterInputWinter', item: item as unknown as Record<string, unknown>});
|
||||
}
|
||||
|
||||
export type UnderWaterStore = UnderWaterType & UnderWaterActions;
|
||||
@@ -294,12 +294,12 @@ export const calRainEffectDay = (data: any, weather: string) => {
|
||||
for(let idx = 0; idx < data.length; idx++) {
|
||||
if(data[idx] && data[idx]?.rainEffectDay === 1) {
|
||||
if(idx > 1){
|
||||
if(data[idx-1]?.infoRnDay && Number(data[idx-1]?.infoRnDay.toString().trim()) >= 3) {
|
||||
if(data[idx-1]?.infoRnDay && Number(data[idx]?.infoRnDay) < 3 && Number(data[idx-1]?.infoRnDay.toString().trim()) >= 3) {
|
||||
data[idx]!.infoRnDay = data[idx-1]!.infoRnDay;
|
||||
}
|
||||
}
|
||||
if(idx > 2){
|
||||
if(data[idx-2]?.infoRnDay && Number(data[idx-2]?.infoRnDay.toString().trim()) >= 3) {
|
||||
if(data[idx-2]?.infoRnDay && Number(data[idx]?.infoRnDay) < 3 && Number(data[idx-2]?.infoRnDay.toString().trim()) >= 3) {
|
||||
data[idx]!.infoRnDay = data[idx-2]!.infoRnDay;
|
||||
}
|
||||
}
|
||||
@@ -367,9 +367,9 @@ export const underWaterReducer:(set:(fn: (state: UnderWaterType) => UnderWaterTy
|
||||
console.log('usage : ', usage, 'summerUsage : ', summerUsage, 'winterUsage : ', winterUsage);
|
||||
}
|
||||
|
||||
item.underWaterInputYear = Math.round((usage-(usage*0.65*0.8)) * 100) / 100;
|
||||
item.underWaterInputSummer = Math.round((summerUsage-(summerUsage*0.65*0.8)) * 100) / 100;
|
||||
item.underWaterInputWinter = Math.round((winterUsage-(winterUsage*0.65*0.8)) * 100) / 100;
|
||||
item.underWaterInputYear = Math.round((usage-(usage*0.65*0.9)) * 1) / 1;
|
||||
item.underWaterInputSummer = Math.round((summerUsage-(summerUsage*0.65*0.9)) * 1) / 1;
|
||||
item.underWaterInputWinter = Math.round((winterUsage-(winterUsage*0.65*0.9)) * 1) / 1;
|
||||
|
||||
return item;
|
||||
}));
|
||||
@@ -455,9 +455,9 @@ export const underWaterReducer:(set:(fn: (state: UnderWaterType) => UnderWaterTy
|
||||
item.usege = item.sum/item.cnt
|
||||
tableData.push({
|
||||
msrDt: item.yr+'-'+(index+1>=10?String(index+1):'0'+(index+1)),
|
||||
realSewageInput:Math.round(item.usege*100) /100,
|
||||
sewageOccur:Math.round(item.usege*0.65*0.8 * 100) / 100,
|
||||
underWaterInput:Math.round((item.usege-(item.usege*0.65*0.8)) * 100) / 100,
|
||||
realSewageInput:Math.round(item.usege*1) /1,
|
||||
sewageOccur:Math.round(item.usege*0.65*0.9 * 1) / 1,
|
||||
underWaterInput:Math.round((item.usege-(item.usege*0.65*0.9)) * 1) / 1,
|
||||
})
|
||||
if (item.usege > maxWaterUsage) {
|
||||
maxWaterUsage = item.usege;
|
||||
@@ -474,22 +474,22 @@ export const underWaterReducer:(set:(fn: (state: UnderWaterType) => UnderWaterTy
|
||||
const newData= [
|
||||
{
|
||||
msrDt: '평균',
|
||||
realSewageInput:Math.round(avgWaterUsage*100) /100,
|
||||
sewageOccur:Math.round(avgWaterUsage*0.65*0.8 * 100) / 100,
|
||||
underWaterInput: Math.round((avgWaterUsage-(avgWaterUsage*0.65*0.8)) * 100) / 100
|
||||
realSewageInput:Math.round(avgWaterUsage*1) /1,
|
||||
sewageOccur:Math.round(avgWaterUsage*0.65*0.9 * 1) / 1,
|
||||
underWaterInput: Math.round((avgWaterUsage-(avgWaterUsage*0.65*0.9)) * 1) / 1
|
||||
//underWaterInput:Math.round((avgWaterUsage-(avgWaterUsage*0.65*0.8)) * 100) / 100,
|
||||
},
|
||||
{
|
||||
msrDt: '최대',
|
||||
realSewageInput: Math.round(maxWaterUsage*100) /100,
|
||||
sewageOccur: Math.round(maxWaterUsage*0.65*0.8 * 100) / 100,
|
||||
underWaterInput: Math.round((maxWaterUsage-(maxWaterUsage*0.65*0.8)) * 100) / 100,
|
||||
realSewageInput: Math.round(maxWaterUsage*1) /1,
|
||||
sewageOccur: Math.round(maxWaterUsage*0.65*0.9 * 1) / 1,
|
||||
underWaterInput: Math.round((maxWaterUsage-(maxWaterUsage*0.65*0.9)) * 1) / 1,
|
||||
},
|
||||
{
|
||||
msrDt: '최소',
|
||||
realSewageInput: Math.round(minWaterUsage*100) /100,
|
||||
sewageOccur: Math.round(minWaterUsage*0.65*0.8 * 100) / 100,
|
||||
underWaterInput: Math.round((minWaterUsage-(minWaterUsage*0.65*0.8)) * 100) / 100,
|
||||
realSewageInput: Math.round(minWaterUsage*1) /1,
|
||||
sewageOccur: Math.round(minWaterUsage*0.65*0.9 * 1) / 1,
|
||||
underWaterInput: Math.round((minWaterUsage-(minWaterUsage*0.65*0.9)) * 1) / 1,
|
||||
},
|
||||
...tableData
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user