From 84525b7e87e97dfa6b7b245b15015facb2d7cca2 Mon Sep 17 00:00:00 2001 From: rsone001 Date: Fri, 27 Nov 2026 17:19:46 +0900 Subject: [PATCH] =?UTF-8?q?[ST]=20-=20refactor:=20=EC=A0=84=EB=82=A8?= =?UTF-8?q?=EA=B4=91=EC=A3=BC=ED=86=B5=ED=95=A9=ED=8A=B9=EB=B3=84=EC=8B=9C?= =?UTF-8?q?=20=EB=B3=B8=EC=B2=AD=20=EB=8D=B0=EC=9D=B4=ED=84=B0=20=EA=B4=80?= =?UTF-8?q?=EB=A0=A8=20=EC=A0=80=EC=9E=A5&=EC=A0=9C=EC=B6=9C=20alert=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../input/SewageExcretaRelatedInp.tsx | 16 ++++++++++++++-- .../statistics/input/SewerageFinanceInp.tsx | 18 ++++++++++++++++-- apps/st/src/entities/statistics/index.ts | 2 ++ .../lib/jeonnam-gwangju-sido-all-toolbar.ts | 12 +++++++++++- 4 files changed, 43 insertions(+), 5 deletions(-) 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); }