From c17da8266146ef1bbd77d969f4e44309531cde0f Mon Sep 17 00:00:00 2001 From: jsyang Date: Fri, 12 Sep 2025 13:54:20 +0900 Subject: [PATCH] =?UTF-8?q?=EB=AF=B8=EC=B2=98=EB=A6=AC=ED=95=98=EC=88=98?= =?UTF-8?q?=EB=9F=89=20=EC=A0=9C=EA=B1=B0(=EC=A3=BC=EC=84=9D=ED=8F=AC?= =?UTF-8?q?=ED=95=A8),=20=EA=B0=95=EC=9A=B0=EB=9F=89=20=EB=A9=94=EC=9D=B8,?= =?UTF-8?q?=EB=AA=A8=EB=8B=AC=20=EC=88=98=EC=B9=98=20=EB=8B=A4=EB=A5=B8?= =?UTF-8?q?=EA=B1=B0=20=ED=95=B4=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../facilityPrecipitation/modal/page.tsx | 2 ++ .../facilityWaterQlty/modal/page.tsx | 13 ++----- .../(with-layout)/flowRate/modal/page.tsx | 11 +----- apps/fo/app/store/dashboard/index.tsx | 1 + .../app/store/facilityPrecipitation/index.tsx | 36 ++++++++----------- apps/fo/app/store/facilityWaterQlty/index.tsx | 30 ++++++++-------- apps/fo/app/store/flowRate/index.tsx | 1 - 7 files changed, 35 insertions(+), 59 deletions(-) diff --git a/apps/fo/app/pages/(with-layout)/facilityPrecipitation/modal/page.tsx b/apps/fo/app/pages/(with-layout)/facilityPrecipitation/modal/page.tsx index bb430d0ba..1f50a9ffe 100644 --- a/apps/fo/app/pages/(with-layout)/facilityPrecipitation/modal/page.tsx +++ b/apps/fo/app/pages/(with-layout)/facilityPrecipitation/modal/page.tsx @@ -105,6 +105,8 @@ export default function PrecipitationModal(props: PrecipitationModalProps) { const getTableData = () => { const totals = calculateTotals(); + totals.infoRnDay = roundNumber(totals.infoRnDay, 1); + return [ { bscFctCd: "", diff --git a/apps/fo/app/pages/(with-layout)/facilityWaterQlty/modal/page.tsx b/apps/fo/app/pages/(with-layout)/facilityWaterQlty/modal/page.tsx index 33530a6fd..eedd52b37 100644 --- a/apps/fo/app/pages/(with-layout)/facilityWaterQlty/modal/page.tsx +++ b/apps/fo/app/pages/(with-layout)/facilityWaterQlty/modal/page.tsx @@ -10,18 +10,11 @@ import { HeadMakeColSpan } from "../HeadMakeColSpan"; import { roundNumber } from "@/app/components/common/DataForm"; import UnderComment from "@/app/components/common/UnderComment"; -const commentArrayDefault = [ - "미처리하수량 =[(강우시 일별유입유량*강우시 일별유입BOD)-(청천시 연평균유입유량*청천시 연평균유입BOD)]​ / (강우시 일별유입BOD)​", - "음수값 발생시 제외(null, 평균값 산정시 제외)" -]; - const commentArrayChungchun = [ - ...commentArrayDefault, "청천시 : 강우량이 3mm미만의 날" ]; const commentArrayRain = [ - ...commentArrayDefault, "강우량 3mm 이상만 날과 강우영향일(강우일+2일)의 날" ]; @@ -460,7 +453,6 @@ export default function WaterQualityModal({fcltyName='', facilityCd='', searchYe - @@ -488,7 +480,6 @@ export default function WaterQualityModal({fcltyName='', facilityCd='', searchYe - @@ -516,7 +507,7 @@ export default function WaterQualityModal({fcltyName='', facilityCd='', searchYe - + @@ -544,7 +535,7 @@ export default function WaterQualityModal({fcltyName='', facilityCd='', searchYe - + diff --git a/apps/fo/app/pages/(with-layout)/flowRate/modal/page.tsx b/apps/fo/app/pages/(with-layout)/flowRate/modal/page.tsx index f82f92835..d6166133f 100644 --- a/apps/fo/app/pages/(with-layout)/flowRate/modal/page.tsx +++ b/apps/fo/app/pages/(with-layout)/flowRate/modal/page.tsx @@ -10,11 +10,6 @@ import { roundUp } from "@/app/store/common"; import { roundNumber } from "@/app/components/common/DataForm"; import UnderComment from "@/app/components/common/UnderComment"; -const commentDefault = [ - "미처리하수량 =[(강우시 일별유입유량*강우시 일별유입BOD)-(청천시 연평균유입유량*청천시 연평균유입BOD)]​ / (강우시 일별유입BOD)​" , - "음수값 발생시 제외(null, 평균값 산정시 제외)" -]; - const tabList = [ { value: 'tab_term_year', label: '연간' }, { value: 'tab_term_summer', label: '하절기' }, @@ -231,7 +226,6 @@ export default function FlowRateModal(props: { fcltyName: string; facilityCd: st boldArray={[0,1,2]} /> - @@ -256,7 +250,6 @@ export default function FlowRateModal(props: { fcltyName: string; facilityCd: st boldArray={[0,1,2]} /> - @@ -281,7 +274,6 @@ export default function FlowRateModal(props: { fcltyName: string; facilityCd: st boldArray={[0,1,2]} /> - @@ -306,7 +298,6 @@ export default function FlowRateModal(props: { fcltyName: string; facilityCd: st boldArray={[0,1,2]} /> - @@ -321,7 +312,7 @@ export default function FlowRateModal(props: { fcltyName: string; facilityCd: st
{}} className="h-[370px]" boldArray={[0,1,2]}/>
- +
diff --git a/apps/fo/app/store/dashboard/index.tsx b/apps/fo/app/store/dashboard/index.tsx index 0e0065067..75a8fe3ae 100644 --- a/apps/fo/app/store/dashboard/index.tsx +++ b/apps/fo/app/store/dashboard/index.tsx @@ -26,6 +26,7 @@ export type TableUpperProps = { row? : number; rowSpan?: number; colSpan?: number; + widthPercent? : number; } // ===TAB1 diff --git a/apps/fo/app/store/facilityPrecipitation/index.tsx b/apps/fo/app/store/facilityPrecipitation/index.tsx index 77a053fc5..cbd824ff8 100644 --- a/apps/fo/app/store/facilityPrecipitation/index.tsx +++ b/apps/fo/app/store/facilityPrecipitation/index.tsx @@ -1,6 +1,7 @@ -import DataForm from "@/app/components/common/DataForm"; -import type { TableUpperProps } from "../dashboard"; import { getFetch } from "@/app/components/api"; +import CalcRainEffect from "@/app/components/common/CalcRainEffect"; +import { roundNumber } from "@/app/components/common/DataForm"; +import type { TableUpperProps } from "../dashboard"; export type { TableUpperProps }; /**==================================== * Store - 타입 @@ -155,14 +156,15 @@ const fetchFacilityPrecipitationList = async (pageNo: number, pageSize: number, }) } } - + res.data.map((item: FacilityPrecipitationProps) => { const filteredList = tmpData.filter((gridItem) => { - return gridItem.bscFctCd === item.bscFctCd; + return gridItem.bscFctCd === item.bscFctCd; }); - item.rainEffectDay = filteredList.reduce((acc, curr) => acc + curr.rainEffectDay, 0); - item.totalYearRain = filteredList.reduce((acc, curr) => acc + curr.infoRnDay, 0); + const rtnData = CalcRainEffect(filteredList); + item.rainEffectDay = rtnData.reduce((acc, curr) => acc + curr.rainEffectDay, 0); + item.totalYearRain = rtnData.reduce((acc, curr) => acc + Number(curr.infoRnDay), 0); item.infoRnDay = filteredList.reduce((acc, curr) => acc + curr.rainDay, 0); }); @@ -178,11 +180,6 @@ export type FacilityPrecipitationActions = { searchFacilityPrecipitationList: (pageNo: number, pageSize: number, searchYear: string, part?: string, nameCd?: string, fcltCpct?: string, operationValue?: string, fcltyNm?: string) => void; } -const dataFormSetting=(item : FacilityPrecipitationProps)=> { - DataForm({ type: 'number', column: 'fctCpc', item: item as unknown as Record }); - DataForm({ type: 'float1', column: 'totalYearRain', item: item as unknown as Record}); -}; - export type FacilityPrecipitationType = { FacilityPrecipitationSearch: { isInit: boolean; @@ -246,13 +243,16 @@ export const facilityPrecipitationReducer:(set:(fn: (state: FacilityPrecipitatio const res = await fetchFacilityPrecipitationList(pageNo, pageSize, searchYear, part, nameCd, fcltCpct, operationValue, fcltyNm); const data = res.data; + + data.forEach(item => { + item.fctCpc = roundNumber(item.fctCpc, 0); + item.totalYearRain = roundNumber(item.totalYearRain, 1); + }); + const excelDownList: ExcelType[] = []; if(pageSize>5000){ data.forEach((item: FacilityPrecipitationProps) => { - dataFormSetting(item) - item.fctCpc = item.fctCpc ? parseFloat(item.fctCpc.toString().replace(/,/g, '')) : 0; - item.totalYearRain = item.totalYearRain ? parseFloat(item.totalYearRain.toString().replace(/,/g, '')) : 0; excelDownList.push({ 시설코드: item.bscFctCd, 권역: item.rvbsn, @@ -270,18 +270,12 @@ export const facilityPrecipitationReducer:(set:(fn: (state: FacilityPrecipitatio "연간총강수량(mm)": item.totalYearRain, }) }) - }else{ - data.forEach((item: FacilityPrecipitationProps) => { - dataFormSetting(item) - item.fctCpc = item.fctCpc ? parseFloat(item.fctCpc.toString().replace(/,/g, '')) : 0; - item.totalYearRain = item.totalYearRain ? parseFloat(item.totalYearRain.toString().replace(/,/g, '')) : 0; - }) } set((state:FacilityPrecipitationType) => ({ ...state, FacilityPrecipitation: pageSize<5000?{ ...state.FacilityPrecipitation, - facilityPrecipitation: res.data, + facilityPrecipitation: data, facilityPrecipitationCount: res.count, isLoading : false, }:{ diff --git a/apps/fo/app/store/facilityWaterQlty/index.tsx b/apps/fo/app/store/facilityWaterQlty/index.tsx index bcfb6326c..9c9ed29c6 100644 --- a/apps/fo/app/store/facilityWaterQlty/index.tsx +++ b/apps/fo/app/store/facilityWaterQlty/index.tsx @@ -129,23 +129,23 @@ const mainLabelArray: string[] = ['구분', '시도', '시군구', '용량별', // 시설수질리스트 헤더(행정별) const upHeadList1: TableUpperProps[] = [ { id: "C", title: "행정명", colSpan: 2, row: 0 }, - { id: "sidoNm", title: "시도", row: 1 }, - { id: "sggNm", title: "시군구", row: 1 }, - { id: "bscFctNm", title: "시설명", rowSpan: 2, row: 0 }, + { id: "sidoNm", title: "시도", row: 1, widthPercent:8 }, + { id: "sggNm", title: "시군구", row: 1, widthPercent:8 }, + { id: "bscFctNm", title: "시설명", rowSpan: 2, row: 0, widthPercent: 10 }, { id: "addr", title: "주소", rowSpan: 2, row: 0 }, - { id: "fctCpc", title: "시설용량(m³/일)", align: "right", rowSpan: 2, row: 0 }, + { id: "fctCpc", title: "시설용량(m³/일)", align: "right", rowSpan: 2, row: 0, widthPercent:10 }, { id: "A", title: "유입", colSpan: 5, row: 0 }, { id: "B", title: "방류", colSpan: 5, row: 0 }, - { id: "inflAssctBfrWqltBod", title: "BOD\n(mg/L)", upName: "upChangeRe3", upSequnce: 1, align: "right", row: 1 }, - { id: "inflAssctBfrWqltToc", title: "TOC\n(COD)\n(mg/L)", upName: "upChangeRe3", upSequnce: 2, align: "right", row: 1 }, - { id: "inflAssctBfrWqltSs", title: "SS\n(mg/L)", upName: "upChangeRe3", upSequnce: 3, align: "right", row: 1 }, - { id: "inflAssctBfrWqltTn", title: "T-N\n(mg/L)", upName: "upChangeRe3", upSequnce: 4, align: "right", row: 1 }, - { id: "inflAssctBfrWqltTp", title: "T-P\n(mg/L)", upName: "upChangeRe3", upSequnce: 3, align: "right", row: 1 }, - { id: "efflWqltBod", title: "BOD\n(mg/L)", upName: "upChangeRe4", upSequnce: 1, align: "right", row: 1 }, - { id: "efflWqltToc", title: "TOC\n(COD)\n(mg/L)", upName: "upChangeRe4", upSequnce: 2, align: "right", row: 1 }, - { id: "efflWqltSs", title: "SS\n(mg/L)", upName: "upChangeRe4", upSequnce: 3, align: "right", row: 1 }, - { id: "efflWqltTn", title: "T-N\n(mg/L)", upName: "upChangeRe4", upSequnce: 4, align: "right", row: 1 }, - { id: "efflWqltTp", title: "T-P\n(mg/L)", upName: "upChangeRe4", upSequnce: 3, align: "right", row: 1 }, + { id: "inflAssctBfrWqltBod", title: "BOD\n(mg/L)", upName: "upChangeRe3", upSequnce: 1, align: "right", row: 1, widthPercent:5 }, + { id: "inflAssctBfrWqltToc", title: "TOC\n(COD)\n(mg/L)", upName: "upChangeRe3", upSequnce: 2, align: "right", row: 1, widthPercent:5 }, + { id: "inflAssctBfrWqltSs", title: "SS\n(mg/L)", upName: "upChangeRe3", upSequnce: 3, align: "right", row: 1, widthPercent:5 }, + { id: "inflAssctBfrWqltTn", title: "T-N\n(mg/L)", upName: "upChangeRe3", upSequnce: 4, align: "right", row: 1, widthPercent:5 }, + { id: "inflAssctBfrWqltTp", title: "T-P\n(mg/L)", upName: "upChangeRe3", upSequnce: 3, align: "right", row: 1, widthPercent:5 }, + { id: "efflWqltBod", title: "BOD\n(mg/L)", upName: "upChangeRe4", upSequnce: 1, align: "right", row: 1, widthPercent:5 }, + { id: "efflWqltToc", title: "TOC\n(COD)\n(mg/L)", upName: "upChangeRe4", upSequnce: 2, align: "right", row: 1, widthPercent:5 }, + { id: "efflWqltSs", title: "SS\n(mg/L)", upName: "upChangeRe4", upSequnce: 3, align: "right", row: 1, widthPercent:5 }, + { id: "efflWqltTn", title: "T-N\n(mg/L)", upName: "upChangeRe4", upSequnce: 4, align: "right", row: 1, widthPercent:5 }, + { id: "efflWqltTp", title: "T-P\n(mg/L)", upName: "upChangeRe4", upSequnce: 3, align: "right", row: 1, widthPercent:5 }, ]; // 시설수질리스트 헤더(권역별) @@ -214,7 +214,6 @@ const upHeadListModalYear: TableUpperProps[] = [ { id: "efflWqltSs", title: "SS\n(mg/L)", upName: "upChangeRe2", upSequnce: 3, align: "right" }, { id: "efflWqltTn", title: "T-N\n(mg/L)", upName: "upChangeRe2", upSequnce: 2, align: "right" }, { id: "efflWqltTp", title: "T-P\n(mg/L)", upName: "upChangeRe2", upSequnce: 3, align: "right" }, - { id: "noProcessInflAmnt", title: "미처리하수량\n(m³/일)", align:"right"}, { id: "infoRnDay", title: "강우량\n(mm/일)", align: "right" } ]; @@ -231,7 +230,6 @@ const upHeadListModalYearCod: TableUpperProps[] = [ { id: "efflWqltSs", title: "SS\n(mg/L)", upName: "upChangeRe2", upSequnce: 3, align: "right" }, { id: "efflWqltTn", title: "T-N\n(mg/L)", upName: "upChangeRe2", upSequnce: 2, align: "right" }, { id: "efflWqltTp", title: "T-P\n(mg/L)", upName: "upChangeRe2", upSequnce: 3, align: "right" }, - { id: "noProcessInflAmnt", title: "미처리하수량\n(m³/일)", align:"right"}, { id: "infoRnDay", title: "강우량\n(mm/일)", align: "right" } ]; diff --git a/apps/fo/app/store/flowRate/index.tsx b/apps/fo/app/store/flowRate/index.tsx index f8125e59c..c61eb2d76 100644 --- a/apps/fo/app/store/flowRate/index.tsx +++ b/apps/fo/app/store/flowRate/index.tsx @@ -158,7 +158,6 @@ const upHeadListFlowRateModal:TableUpperProps[] = [ { id: "sumFlow", title: "연계처리량(m³/일)", align:"right"}, { id: "returnAmnt", title: "총인 반류수량(m³/일)", align:"right"}, { id: "efflAmnt", title: "방류량(m³/일)", align:"right"}, - { id: "noProcessInflAmnt", title: "미처리하수량(m³/일)", align:"right"}, { id: "infoRnDay", title: "강우량(mm/일)", align:"right"} ]