diff --git a/apps/st/src/components/statistics/input/SewageExcretaRelatedInp.tsx b/apps/st/src/components/statistics/input/SewageExcretaRelatedInp.tsx index 5588ba8cb..dab2b251c 100644 --- a/apps/st/src/components/statistics/input/SewageExcretaRelatedInp.tsx +++ b/apps/st/src/components/statistics/input/SewageExcretaRelatedInp.tsx @@ -42,8 +42,10 @@ import type { import { filterBySelectedAdmdstCd, isGugunOkForToolbar, + isJeonnamGwangjuSidoAllSearch, isJeonnamGwangjuSidoAllToolbarException, isSubmitOkForToolbar, + JEONNAM_GWANGJU_SIDO_ALL_SAVE_SUBMIT_MESSAGE, resolveNoApplicableForRequest, toInputSearchRegion, } from "@/entities/statistics"; @@ -1340,7 +1342,12 @@ const SewageExcretaRelatedInp = () => { return; } - if (await confirm("제출 하시겠습니까?")) { + const submitConfirmMessage = + ARTICLE_EDIT_TAB_KEYS.has(tabKey) && + isJeonnamGwangjuSidoAllSearch(sidoListRef.current, lastSearchedValues) + ? JEONNAM_GWANGJU_SIDO_ALL_SAVE_SUBMIT_MESSAGE + : "제출 하시겠습니까?"; + if (await confirm(submitConfirmMessage)) { setShowSubmitDialog(true); } })(); @@ -1622,7 +1629,12 @@ const SewageExcretaRelatedInp = () => { alert("해당 탭은 저장 기능이 준비되지 않았습니다."); return; } - if (!(await confirm("저장 하시겠습니까?"))) return; + const saveConfirmMessage = + ARTICLE_EDIT_TAB_KEYS.has(tabKey) && + isJeonnamGwangjuSidoAllSearch(sidoListRef.current, lastSearchedValues) + ? JEONNAM_GWANGJU_SIDO_ALL_SAVE_SUBMIT_MESSAGE + : "저장 하시겠습니까?"; + if (!(await confirm(saveConfirmMessage))) return; commitActiveGrid(); diff --git a/apps/st/src/components/statistics/input/SewerageFinanceInp.tsx b/apps/st/src/components/statistics/input/SewerageFinanceInp.tsx index 9083b505e..02aa95d69 100644 --- a/apps/st/src/components/statistics/input/SewerageFinanceInp.tsx +++ b/apps/st/src/components/statistics/input/SewerageFinanceInp.tsx @@ -41,8 +41,10 @@ import type { import { filterBySelectedAdmdstCd, isGugunOkForToolbar, + isJeonnamGwangjuSidoAllSearch, isJeonnamGwangjuSidoAllToolbarException, isSubmitOkForToolbar, + JEONNAM_GWANGJU_SIDO_ALL_SAVE_SUBMIT_MESSAGE, toInputSearchRegion, } from "@/entities/statistics"; @@ -846,7 +848,13 @@ const SewerageFinanceInp = () => { alert("제출할 데이터가 없습니다."); return; } - if (await confirm("제출 하시겠습니까?")) { + const submitConfirmMessage = isJeonnamGwangjuSidoAllSearch( + sidoListRef.current, + lastSearchedValues, + ) + ? JEONNAM_GWANGJU_SIDO_ALL_SAVE_SUBMIT_MESSAGE + : "제출 하시겠습니까?"; + if (await confirm(submitConfirmMessage)) { setShowSubmitDialog(true); } })(); @@ -1043,7 +1051,13 @@ const SewerageFinanceInp = () => { return; } - if (!(await confirm("저장 하시겠습니까?"))) return; + const saveConfirmMessage = isJeonnamGwangjuSidoAllSearch( + sidoListRef.current, + lastSearchedValues, + ) + ? JEONNAM_GWANGJU_SIDO_ALL_SAVE_SUBMIT_MESSAGE + : "저장 하시겠습니까?"; + if (!(await confirm(saveConfirmMessage))) return; const currentData = getTabGridRows(tabKey); if (!currentData.length) { diff --git a/apps/st/src/entities/statistics/index.ts b/apps/st/src/entities/statistics/index.ts index 047388249..06fb0dbd3 100644 --- a/apps/st/src/entities/statistics/index.ts +++ b/apps/st/src/entities/statistics/index.ts @@ -11,6 +11,8 @@ export { useScheduleInfo } from "./api/dashboard/schedule-info-queries"; export { scheduleInfoApi } from "./api/dashboard/schedule-info-service"; export { imrApi } from "./api/imr-api"; export { + JEONNAM_GWANGJU_SIDO_ALL_SAVE_SUBMIT_MESSAGE, + isJeonnamGwangjuSidoAllSearch, isJeonnamGwangjuSidoAllToolbarException, } from "./lib/jeonnam-gwangju-sido-all-toolbar"; export { diff --git a/apps/st/src/entities/statistics/lib/jeonnam-gwangju-sido-all-toolbar.ts b/apps/st/src/entities/statistics/lib/jeonnam-gwangju-sido-all-toolbar.ts index 423827128..28f1eff3a 100644 --- a/apps/st/src/entities/statistics/lib/jeonnam-gwangju-sido-all-toolbar.ts +++ b/apps/st/src/entities/statistics/lib/jeonnam-gwangju-sido-all-toolbar.ts @@ -23,6 +23,16 @@ function isJeonnamGwangjuUnifiedSido( return (values.sido ?? "").trim() === "전남광주통합특별시"; } +export const JEONNAM_GWANGJU_SIDO_ALL_SAVE_SUBMIT_MESSAGE = + "전남광주통합특별시는 시군구를 선택하지 않고 저장 및 제출 시 본청 데이터만 반영됩니다.\n각 시군구의 데이터는 선택 후 새로 조회하여 작성해주세요."; + +export function isJeonnamGwangjuSidoAllSearch( + sidoList: readonly Sido[] | undefined, + values: SidoGugunLookup | null | undefined, +): boolean { + return isJeonnamGwangjuUnifiedSido(sidoList, values) && isEmptyOrAllGugun(values); +} + export function isJeonnamGwangjuSidoAllToolbarException( sidoList: readonly Sido[] | undefined, values: SidoGugunLookup | null | undefined, @@ -31,5 +41,5 @@ export function isJeonnamGwangjuSidoAllToolbarException( if (!SIDO_ALL_TOOLBAR_USER_IDS.has((userId ?? "").trim().toUpperCase())) { return false; } - return isJeonnamGwangjuUnifiedSido(sidoList, values) && isEmptyOrAllGugun(values); + return isJeonnamGwangjuSidoAllSearch(sidoList, values); }