From 2fc4f9512fbfa4cf31cea02840c755e946c1bbf6 Mon Sep 17 00:00:00 2001 From: Your Name Date: Sat, 26 Jul 2025 19:57:09 +0900 Subject: [PATCH] =?UTF-8?q?=EA=B2=B0=ED=95=A8=EC=88=98=EC=A0=95=EC=A4=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/fo/app/pages/sewageOccur/modal/page.tsx | 6 +++--- apps/fo/app/store/dashboard/index.tsx | 2 +- apps/fo/app/store/store.tsx | 2 +- apps/fo/app/store/underWaterInput/index.tsx | 10 ++++++++-- 4 files changed, 13 insertions(+), 7 deletions(-) diff --git a/apps/fo/app/pages/sewageOccur/modal/page.tsx b/apps/fo/app/pages/sewageOccur/modal/page.tsx index aaac8bd64..4c4283f4a 100644 --- a/apps/fo/app/pages/sewageOccur/modal/page.tsx +++ b/apps/fo/app/pages/sewageOccur/modal/page.tsx @@ -14,8 +14,8 @@ export default function SewageOccurModal(props: { fcltyName: string; facilityCd // searchYear 유효성 검사 및 기본값 설정 const validSearchYear = props.searchYear && /^\d{4}$/.test(props.searchYear) ? props.searchYear : new Date().getFullYear().toString(); - const [startYearMonth, setStartYearMonth] = useState(props.searchYear+'01'); - const [endYearMonth, setEndYearMonth] = useState(props.searchYear+'12'); + const [startYearMonth, setStartYearMonth] = useState(validSearchYear+'01'); + const [endYearMonth, setEndYearMonth] = useState(validSearchYear+'12'); const [detailList, setDetailList] = useState([]); const { upHeadListSewageOccurDetail, @@ -73,7 +73,7 @@ export default function SewageOccurModal(props: { fcltyName: string; facilityCd })(), onChange: (value: string) => { if (value && /^\d{6}$/.test(value)) { - setEndYearMonth(value.substring(0, 4)+value.substring(4, 6)); + setEndYearMonth(value); } } }} diff --git a/apps/fo/app/store/dashboard/index.tsx b/apps/fo/app/store/dashboard/index.tsx index 7fa009160..209601d1f 100644 --- a/apps/fo/app/store/dashboard/index.tsx +++ b/apps/fo/app/store/dashboard/index.tsx @@ -1120,7 +1120,7 @@ export const dashBoardReducer:(set:(fn: (state: DashBoardType) => DashBoardType) const summerUsage = sumSummerChungcunFlow / sumSummerChungcunDay; const winterUsage = sumWinterChungcunFlow / sumWinterChungcunDay; - operationalStatusList[0].groundWaterAvg = Math.round((usage-(usage*0.65*0.8)) * 100) / 100, + operationalStatusList[0].groundWaterAvg = Math.round((usage-(usage*0.65*0.8)) * 100) / 100; operationalStatusList[0].groundWaterSummer = Math.round((summerUsage-(summerUsage*0.65*0.8)) * 100) / 100; operationalStatusList[0].groundWaterWinter = Math.round((winterUsage-(winterUsage*0.65*0.8)) * 100) / 100; diff --git a/apps/fo/app/store/store.tsx b/apps/fo/app/store/store.tsx index 512458c90..589bc4d78 100644 --- a/apps/fo/app/store/store.tsx +++ b/apps/fo/app/store/store.tsx @@ -59,7 +59,7 @@ export const StoreZus = } ) => { return createStore()((set) => { - LoginApi.login({userId: "admin1gmail", password: "test1234!"}) + LoginApi.login({userId: "CLEANWATER", password: "gktneh12!@"}) return { ...initState, ...CommonReducer(set), diff --git a/apps/fo/app/store/underWaterInput/index.tsx b/apps/fo/app/store/underWaterInput/index.tsx index dab73c138..6256c2f92 100644 --- a/apps/fo/app/store/underWaterInput/index.tsx +++ b/apps/fo/app/store/underWaterInput/index.tsx @@ -286,7 +286,13 @@ export const calRainEffectDay = (data: FlowDataItem[], weather: string) => { } let rtnData : FlowDataItem[] = []; - weather === 'ALL' ? rtnData = data : weather === 'SUNNY' ? rtnData = data.filter((item: FlowDataItem) => item.rainEffectDay === 0) : rtnData = data.filter((item: FlowDataItem) => item.rainEffectDay === 1); + if (weather === 'ALL') { + rtnData = data; + } else if (weather === 'SUNNY') { + rtnData = data.filter((item: FlowDataItem) => item.rainEffectDay === 0); + } else { + rtnData = data.filter((item: FlowDataItem) => item.rainEffectDay === 1); + } return rtnData; } @@ -327,7 +333,7 @@ export const underWaterReducer:(set:(fn: (state: UnderWaterType) => UnderWaterTy const summerUsage = sumSummerChungcunFlow / sumSummerChungcunDay; const winterUsage = sumWinterChungcunFlow / sumWinterChungcunDay; - item.underWaterInputYear = Math.round((usage-(usage*0.65*0.8)) * 100) / 100, + 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;