diff --git a/apps/st/src/components/module/SearchForm.tsx b/apps/st/src/components/module/SearchForm.tsx index 08b6e2b50..ccc76bc3d 100644 --- a/apps/st/src/components/module/SearchForm.tsx +++ b/apps/st/src/components/module/SearchForm.tsx @@ -172,6 +172,30 @@ const SearchForm = (props: SearchFormProps = {}) => { ); const sggOptions = sggList?.data ?? []; + // 시도 설정 후 시군구 목록이 오면 첫 번째 항목 자동 선택 + useEffect(() => { + if (!mergedProps.gugun) return; + if (props.defaultValues?.gugun) return; + if (!values.sido || values.sido === "ALL") return; + + const firstSgg = sggList?.data?.[0]; + if (!firstSgg) return; + + setValues((prev) => { + if (prev.gugun) return prev; + return { + ...prev, + gugun: firstSgg.gugun, + bsnmCd: firstSgg.bsnmCd, + }; + }); + }, [ + sggList, + values.sido, + mergedProps.gugun, + props.defaultValues?.gugun, + ]); + const handleSubmit = (e: React.FormEvent) => { e.preventDefault(); props.onSubmit?.(values); diff --git a/apps/st/src/components/statistics/input/PrivateSewageFacilityInp.tsx b/apps/st/src/components/statistics/input/PrivateSewageFacilityInp.tsx index 7a365dae9..b2edb8f2c 100644 --- a/apps/st/src/components/statistics/input/PrivateSewageFacilityInp.tsx +++ b/apps/st/src/components/statistics/input/PrivateSewageFacilityInp.tsx @@ -715,7 +715,7 @@ const PrivateSewageFacilityInp = () => { tabKey, searchParamRef.current, lastSearchedValues, - false, + true, false, ); alert("제출 취소되었습니다."); @@ -815,7 +815,7 @@ const PrivateSewageFacilityInp = () => { tabKey, searchParamRef.current!, lastSearchedValues, - false, + true, false, ); }; @@ -988,7 +988,7 @@ const PrivateSewageFacilityInp = () => { tabKey, searchParamRef.current, lastSearchedValues, - false, + true, false, ); alert("저장되었습니다."); @@ -1012,7 +1012,7 @@ const PrivateSewageFacilityInp = () => { tabKey, searchParamRef.current, lastSearchedValues, - false, + true, false, ); alert("저장되었습니다."); @@ -1037,7 +1037,7 @@ const PrivateSewageFacilityInp = () => { tabKey, searchParamRef.current, lastSearchedValues, - false, + true, false, ); alert("저장되었습니다."); @@ -1288,7 +1288,7 @@ const PrivateSewageFacilityInp = () => { activeTabRef.current, searchParamRef.current, values, - false, + true, false, ); }} diff --git a/apps/st/src/components/statistics/input/SewageExcretaRelatedInp.tsx b/apps/st/src/components/statistics/input/SewageExcretaRelatedInp.tsx index aeb2b712f..addeda5c0 100644 --- a/apps/st/src/components/statistics/input/SewageExcretaRelatedInp.tsx +++ b/apps/st/src/components/statistics/input/SewageExcretaRelatedInp.tsx @@ -1141,7 +1141,7 @@ const SewageExcretaRelatedInp = () => { tabKey, searchParamRef.current, ctx, - false, + true, false, ); } @@ -1376,7 +1376,7 @@ const SewageExcretaRelatedInp = () => { tabKey, searchParamRef.current!, lastSearchedValues, - false, + true, false, ); }; @@ -1650,7 +1650,7 @@ const SewageExcretaRelatedInp = () => { const param = searchParamRef.current ?? buildSewageExcretaRelatedSearchParam(lastSearchedValues); - await loadActiveTabData(tabKey, param, lastSearchedValues, false, false); + await loadActiveTabData(tabKey, param, lastSearchedValues, true, false); alert("저장되었습니다."); } else { alert(response.message ?? "저장 중 오류가 발생했습니다."); diff --git a/apps/st/src/components/statistics/input/SewageExcretaSlurgeInp.tsx b/apps/st/src/components/statistics/input/SewageExcretaSlurgeInp.tsx index 9244da4f3..885d00f8b 100644 --- a/apps/st/src/components/statistics/input/SewageExcretaSlurgeInp.tsx +++ b/apps/st/src/components/statistics/input/SewageExcretaSlurgeInp.tsx @@ -1366,7 +1366,7 @@ const SewageExcretaSlurgeInp = () => { tabKey, searchParamRef.current!, lastSearchedValues, - false, + true, false, ); }; @@ -1535,7 +1535,7 @@ const SewageExcretaSlurgeInp = () => { tabKey, searchParamRef.current, lastSearchedValues, - false, + true, false, ); alert("제출 취소되었습니다."); @@ -1731,7 +1731,7 @@ const SewageExcretaSlurgeInp = () => { const param = searchParamRef.current ?? buildSewageExcretaSlurgeSearchParam(lastSearchedValues); - await loadActiveTabData(tabKey, param, lastSearchedValues, false, false); + await loadActiveTabData(tabKey, param, lastSearchedValues, true, false); alert("저장되었습니다."); } else { alert(response.message ?? "저장 중 오류가 발생했습니다."); @@ -2179,7 +2179,7 @@ const SewageExcretaSlurgeInp = () => { activeTabRef.current, searchParamRef.current, values, - false, + true, false, ); }} @@ -2195,7 +2195,7 @@ const SewageExcretaSlurgeInp = () => { activeTabRef.current, searchParamRef.current, values, - false, + true, false, ); }} diff --git a/apps/st/src/components/statistics/input/SewagePipeMaintainInp.tsx b/apps/st/src/components/statistics/input/SewagePipeMaintainInp.tsx index 35d2480d5..64ea20096 100644 --- a/apps/st/src/components/statistics/input/SewagePipeMaintainInp.tsx +++ b/apps/st/src/components/statistics/input/SewagePipeMaintainInp.tsx @@ -622,7 +622,7 @@ const SewagePipeMaintainInp = () => { tabKey, searchParamRef.current!, lastSearchedValues, - false, + true, false, ); }; @@ -775,7 +775,7 @@ const SewagePipeMaintainInp = () => { RepairStatusInpColumn.tabKey, searchParamRef.current, lastSearchedValues, - false, + true, false, ); setGlobalProgress(100); @@ -812,7 +812,7 @@ const SewagePipeMaintainInp = () => { PipeDredgingStatusInpColumn.tabKey, searchParamRef.current, lastSearchedValues, - false, + true, false, ); setGlobalProgress(100); @@ -861,7 +861,7 @@ const SewagePipeMaintainInp = () => { tabKey, searchParamRef.current, lastSearchedValues, - false, + true, false, ); alert("제출 취소되었습니다."); diff --git a/apps/st/src/components/statistics/input/SewageReservoirPumpInp.tsx b/apps/st/src/components/statistics/input/SewageReservoirPumpInp.tsx index f0ed5b9cd..69e9d946b 100644 --- a/apps/st/src/components/statistics/input/SewageReservoirPumpInp.tsx +++ b/apps/st/src/components/statistics/input/SewageReservoirPumpInp.tsx @@ -519,7 +519,7 @@ const SewageReservoirPumpInp = () => { if (response.status === "success") { setIsLoading(true); - await loadActiveTabData(tabKey, lastSearchedValues, false, false); + await loadActiveTabData(tabKey, lastSearchedValues, true, false); alert("제출 취소되었습니다."); } else { alert(response.message ?? "제출 취소 중 오류가 발생했습니다."); @@ -721,7 +721,7 @@ const SewageReservoirPumpInp = () => { } else { setRainfallPumpStationDeleteList([]); } - await loadActiveTabData(tabKey, lastSearchedValues, false, false); + await loadActiveTabData(tabKey, lastSearchedValues, true, false); alert("저장되었습니다."); } else { alert(response.message ?? "저장 중 오류가 발생했습니다."); @@ -788,7 +788,7 @@ const SewageReservoirPumpInp = () => { } else { setRainfallPumpStationDeleteList([]); } - await loadActiveTabData(tabKey, lastSearchedValues, false, false); + await loadActiveTabData(tabKey, lastSearchedValues, true, false); }; if (!noApplicable && submitList.length === 0) { @@ -1670,7 +1670,7 @@ const SewageReservoirPumpInp = () => { onExceptionResetSubmitted={async () => { const values = lastSearchedValues ?? searchValues; if (!values) return; - await loadActiveTabData(activeTabRef.current, values, false, false); + await loadActiveTabData(activeTabRef.current, values, true, false); }} /> { onExceptionSubmitted={async () => { const values = lastSearchedValues ?? searchValues; if (!values) return; - await loadActiveTabData(activeTabRef.current, values, false, false); + await loadActiveTabData(activeTabRef.current, values, true, false); }} /> diff --git a/apps/st/src/components/statistics/input/SewerageFinanceInp.tsx b/apps/st/src/components/statistics/input/SewerageFinanceInp.tsx index 6733d0a0b..058eaf784 100644 --- a/apps/st/src/components/statistics/input/SewerageFinanceInp.tsx +++ b/apps/st/src/components/statistics/input/SewerageFinanceInp.tsx @@ -757,7 +757,7 @@ const SewerageFinanceInp = () => { tabKey, searchParamRef.current, lastSearchedValues, - false, + true, false, ); alert("제출 취소되었습니다."); @@ -857,7 +857,7 @@ const SewerageFinanceInp = () => { tabKey, searchParamRef.current!, lastSearchedValues, - false, + true, false, ); }; @@ -1033,7 +1033,7 @@ const SewerageFinanceInp = () => { tabKey, searchParamRef.current, lastSearchedValues, - false, + true, false, ); alert("저장되었습니다."); @@ -1057,7 +1057,7 @@ const SewerageFinanceInp = () => { tabKey, searchParamRef.current, lastSearchedValues, - false, + true, false, ); alert("저장되었습니다."); @@ -1081,7 +1081,7 @@ const SewerageFinanceInp = () => { tabKey, searchParamRef.current, lastSearchedValues, - false, + true, false, ); alert("저장되었습니다."); @@ -1103,7 +1103,7 @@ const SewerageFinanceInp = () => { tabKey, searchParamRef.current, lastSearchedValues, - false, + true, false, ); alert("저장되었습니다."); diff --git a/apps/st/src/components/statistics/input/SewerageServiceLevelInp.tsx b/apps/st/src/components/statistics/input/SewerageServiceLevelInp.tsx index bd1efe8a9..d9b8c46bc 100644 --- a/apps/st/src/components/statistics/input/SewerageServiceLevelInp.tsx +++ b/apps/st/src/components/statistics/input/SewerageServiceLevelInp.tsx @@ -755,7 +755,7 @@ const SewerageServiceLevelInp = () => { tabKey, searchParamRef.current!, lastSearchedValues, - false, + true, false, ); }; @@ -991,7 +991,7 @@ const SewerageServiceLevelInp = () => { tabKey, searchParamRef.current, lastSearchedValues, - false, + true, false, ); alert("제출 취소되었습니다."); diff --git a/apps/st/src/components/statistics/input/WaterReuseInp.tsx b/apps/st/src/components/statistics/input/WaterReuseInp.tsx index 8cb416861..a1735f454 100644 --- a/apps/st/src/components/statistics/input/WaterReuseInp.tsx +++ b/apps/st/src/components/statistics/input/WaterReuseInp.tsx @@ -1163,7 +1163,7 @@ const WaterReuseInp = () => { const param = searchParamRef.current ?? buildWaterReuseSearchParam(lastSearchedValues); - await loadActiveTabData(tabKey, param, lastSearchedValues, false, false); + await loadActiveTabData(tabKey, param, lastSearchedValues, true, false); }; try { @@ -1413,7 +1413,7 @@ const WaterReuseInp = () => { tabKey, param, lastSearchedValues, - false, + true, false, ); }; @@ -1742,7 +1742,7 @@ const WaterReuseInp = () => { PublicSewageTreatWaterReuseInpColumn.tabKey, param, lastSearchedValues, - false, + true, false, ); setGlobalProgress(100); @@ -1896,7 +1896,7 @@ const WaterReuseInp = () => { tabKey, searchParamRef.current, lastSearchedValues, - false, + true, false, ); alert("제출 취소되었습니다."); diff --git a/apps/st/src/components/statistics/management/PopulationStatusChart.tsx b/apps/st/src/components/statistics/management/PopulationStatusChart.tsx index 1b7198135..fa0f8ba5b 100644 --- a/apps/st/src/components/statistics/management/PopulationStatusChart.tsx +++ b/apps/st/src/components/statistics/management/PopulationStatusChart.tsx @@ -3,7 +3,9 @@ import { Chart as ChartJS, CategoryScale, LinearScale, + BarController, BarElement, + LineController, LineElement, PointElement, Title, @@ -12,7 +14,18 @@ import { } from "chart.js"; import type { ChartOptions } from "chart.js"; -ChartJS.register(CategoryScale, LinearScale, BarElement, LineElement, PointElement, Title, Tooltip, Legend); +ChartJS.register( + CategoryScale, + LinearScale, + BarController, + BarElement, + LineController, + LineElement, + PointElement, + Title, + Tooltip, + Legend, +); // 차트 설정 외부 정의 (Mixed 타입 명시) const options: ChartOptions<"bar" | "line"> = {