diff --git a/.gitignore b/.gitignore index 6b685ea40..945daeeba 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ # turbo .turbo/ +.vscode/**/* # dependencies node_modules/ diff --git a/apps/fo/.env.development b/apps/fo/.env.development index d362ecf94..de81dde66 100644 --- a/apps/fo/.env.development +++ b/apps/fo/.env.development @@ -5,7 +5,8 @@ NEXT_PUBLIC_SERVER_API_URL = http://con.mind-one.co.kr:11082/api/v1 #NEXT_PUBLIC_SERVER_API_URL = http://dev.onasys.co.kr:8000 NEXT_PUBLIC_WR_SERVER_API_URL = http://con.mind-one.co.kr:11080/api/v1 NEXT_PUBLIC_CS_SERVER_API_URL = http://dev.onasys.co.kr:8000 -NEXT_PUBLIC_GEOSERVER_URL = http://rsone.iptime.org:10010/geoserver +#NEXT_PUBLIC_GEOSERVER_URL = http://rsone.iptime.org:10010/geoserver +NEXT_PUBLIC_GEOSERVER_URL = https://hasudo.geo.rsonesoft.com/geoserver NEXT_PUBLIC_LX_GEOSERVER_URL = http://con.mind-one.co.kr:11306/geoserver NEXT_PUBLIC_CLAIM_NAME = Authorization NEXT_PUBLIC_AUTH_USER_ID = token-id diff --git a/apps/fo/.env.local b/apps/fo/.env.local index 4313985b8..2e937af0c 100644 --- a/apps/fo/.env.local +++ b/apps/fo/.env.local @@ -5,7 +5,8 @@ NEXT_PUBLIC_SERVER_API_URL = http://con.mind-one.co.kr:11082/api/v1 #NEXT_PUBLIC_SERVER_API_URL = http://dev.onasys.co.kr:8000 NEXT_PUBLIC_WR_SERVER_API_URL = http://con.mind-one.co.kr:11080/api/v1 NEXT_PUBLIC_CS_SERVER_API_URL = http://dev.onasys.co.kr:8000 -NEXT_PUBLIC_GEOSERVER_URL = http://rsone.iptime.org:10010/geoserver +#NEXT_PUBLIC_GEOSERVER_URL = http://rsone.iptime.org:10010/geoserver +NEXT_PUBLIC_GEOSERVER_URL = https://hasudo.geo.rsonesoft.com/geoserver NEXT_PUBLIC_LX_GEOSERVER_URL = http://con.mind-one.co.kr:11306/geoserver NEXT_PUBLIC_CLAIM_NAME = Authorization NEXT_PUBLIC_AUTH_USER_ID = token-id diff --git a/apps/fo/.env.production b/apps/fo/.env.production index aa2cb2c90..797328765 100644 --- a/apps/fo/.env.production +++ b/apps/fo/.env.production @@ -18,7 +18,8 @@ NEXT_PUBLIC_SERVER_API_URL = http://con.mind-one.co.kr:11082/api/v1 #NEXT_PUBLIC_SERVER_API_URL = http://dev.onasys.co.kr:8000 NEXT_PUBLIC_WR_SERVER_API_URL = http://con.mind-one.co.kr:11080/api/v1 NEXT_PUBLIC_CS_SERVER_API_URL = http://dev.onasys.co.kr:8000 -NEXT_PUBLIC_GEOSERVER_URL = http://rsone.iptime.org:10010/geoserver +#NEXT_PUBLIC_GEOSERVER_URL = http://rsone.iptime.org:10010/geoserver +NEXT_PUBLIC_GEOSERVER_URL = https://hasudo.geo.rsonesoft.com/geoserver NEXT_PUBLIC_LX_GEOSERVER_URL = http://con.mind-one.co.kr:11306/geoserver NEXT_PUBLIC_CLAIM_NAME = Authorization NEXT_PUBLIC_AUTH_USER_ID = token-id diff --git a/apps/fo/app/pages/(with-layout)/sewageOccur/modal/page.tsx b/apps/fo/app/pages/(with-layout)/sewageOccur/modal/page.tsx index 06ca11cc1..4081b4547 100644 --- a/apps/fo/app/pages/(with-layout)/sewageOccur/modal/page.tsx +++ b/apps/fo/app/pages/(with-layout)/sewageOccur/modal/page.tsx @@ -6,17 +6,21 @@ import ListDiv from "@common/business_components/ui/list_div"; import { Table, TableCell, TableHead, TableRow } from "@common/components/ui"; import { useEffect, useState } from "react"; - export default function SewageOccurModal(props: { fcltyName: string; facilityCd : string; searchYear : string}) { // 그리드 관련 const {SewageOccurDetail, searchSewageOccurDetailList} = useFoStore((state) => state); // searchYear 유효성 검사 및 기본값 설정 const validSearchYear = props.searchYear && /^\d{4}$/.test(props.searchYear) ? props.searchYear : new Date().getFullYear().toString(); + const [startYearMonth, setStartYearMonth] = useState(validSearchYear+'01'); const [endYearMonth, setEndYearMonth] = useState(validSearchYear+'12'); const [detailList, setDetailList] = useState([]); + + // 가능한 시작년월 설정 + const [enableEndMonth, setEnableEndMonth] = useState(['1월', '2월', '3월', '4월', '5월', '6월', '7월', '8월', '9월', '10월', '11월', '12월']); + const { upHeadListSewageOccurDetail, gridListSewageOccurDetail @@ -33,7 +37,29 @@ export default function SewageOccurModal(props: { fcltyName: string; facilityCd useEffect(() => { searchSewageOccurDetailList(props.facilityCd, validSearchYear, startYearMonth, endYearMonth); - }, [startYearMonth, endYearMonth]); + }, [startYearMonth, endYearMonth, searchSewageOccurDetailList, props.facilityCd, validSearchYear]); + + useEffect(() => { + const standdardMonthList = ['1월', '2월', '3월', '4월', '5월', '6월', '7월', '8월', '9월', '10월', '11월', '12월'] + setEnableEndMonth(standdardMonthList); + // 시작년월이 바뀌면 선택가능한 년월 데이터가 변경돼야 한다. + if(startYearMonth){ + const startMm = startYearMonth.substring(4, 6); + + if(endYearMonth < startYearMonth) { + setEndYearMonth(startYearMonth); + } + + standdardMonthList.forEach((month) => { + setEnableEndMonth((prev) => { + if (parseInt(month.replaceAll('월', '')) < parseInt(startMm)) { + return prev.filter((m) => m !== month); + } + return prev; + }); + }); + } + }, [endYearMonth, startYearMonth]); return ( <> @@ -63,6 +89,7 @@ export default function SewageOccurModal(props: { fcltyName: string; facilityCd selectClass="ml-5 w-[100px]" startYear={1900} yearReadOnly={true} + enableMonth={['1월', '2월', '3월', '4월', '5월', '6월', '7월', '8월', '9월', '10월', '11월', '12월']} />~ diff --git a/apps/fo/app/store/sewageOccur/index.tsx b/apps/fo/app/store/sewageOccur/index.tsx index 5feb91f94..f97520d17 100644 --- a/apps/fo/app/store/sewageOccur/index.tsx +++ b/apps/fo/app/store/sewageOccur/index.tsx @@ -222,6 +222,7 @@ export const sewageOccurReducer:(set:any)=>SewageOccurActions=(set: any) => { }, })); const res = await fetchSewageOccurList(pageNo, pageSize, searchYear, part, nameCd, fcltCpct, operationValue, fcltyNm); + const excelDownList: ExcelType[] = []; const data = res.data; // Promise.all을 사용하여 모든 비동기 작업이 완료될 때까지 기다림 const calData = await Promise.all(data.map(async (item: SewageOccurProps) => { @@ -301,6 +302,28 @@ export const sewageOccurReducer:(set:any)=>SewageOccurActions=(set: any) => { item.estimationSewage = parseFloat((item.waterUsage * (item.swageChangePercent/100)).toFixed(2)); return item; })); + + if(pageSize>5000){ + calData.forEach((item: SewageOccurProps) => { + excelDownList.push({ + 시설코드: item.bscFctCd, + 권역: item.rvbsn, + 단위유역: item.lgbsn, + 중권역: item.mdmbsn, + 환경청: item.rgnNm, + 시설명: item.bscFctNm, + 시도: item.sido, + 시군구: item.sigungo, + 주소: item.daddr, + 시설용량: item.fctCpc, + 물사용량: item.waterUsage, + 오수전환율: item.swageChangePercent, + 오수발생량추정: item.estimationSewage, + 연간하수유입량 : item.sewageInputYear, + 청천시하수유입량 : item.sewageInputChungchun, + }); + }); + } // 조회 데이터 설정 set((state: any) => ({ ...state, @@ -311,7 +334,7 @@ export const sewageOccurReducer:(set:any)=>SewageOccurActions=(set: any) => { isLoading : false, }:{ ...state.SewageOccur, - excelList: [], + excelList: excelDownList, isLoading : false, }, }))