diff --git a/apps/st/src/components/module/DataGrid.tsx b/apps/st/src/components/module/DataGrid.tsx index e9c961ddb..a87005031 100644 --- a/apps/st/src/components/module/DataGrid.tsx +++ b/apps/st/src/components/module/DataGrid.tsx @@ -1992,42 +1992,6 @@ useEffect(() => { footerVerificationResult, ]); - /** footerVerificationResult만 바뀐 경우에도 총계 스타일 즉시 재적용/초기화 */ - useEffect(() => { - const gridView = gridRef.current?.gridView as - | { - columnByName?: (name: string) => { - footer?: { styleName?: string } | Array<{ styleName?: string }>; - } | null; - refresh?: () => void; - } - | undefined; - if (!gridView?.columnByName) return; - - columns.forEach((col) => { - if (!col.footer) return; - try { - const column = gridView.columnByName?.(col.name); - if (!column?.footer) return; - const styleName = - resolveFooterVerificationStyleName( - col, - footerVerificationResult, - ) ?? ""; - if (Array.isArray(column.footer)) { - column.footer.forEach((item) => { - item.styleName = styleName; - }); - } else { - column.footer.styleName = styleName; - } - } catch { - console.error('총계 스타일 재적용/초기화 error'); - } - }); - gridView.refresh?.(); - }, [footerVerificationResult, columns]); - // 행·셀 클릭 이벤트 (검증 오류 툴팁은 hover만 — onShowTooltip / 빈 셀 오버레이) useEffect(() => { const gridView = gridRef.current?.gridView; diff --git a/apps/st/src/components/module/ExceptionProcessingHistoryDialog.tsx b/apps/st/src/components/module/ExceptionProcessingHistoryDialog.tsx index 9e1dfcc0c..89d3090ac 100644 --- a/apps/st/src/components/module/ExceptionProcessingHistoryDialog.tsx +++ b/apps/st/src/components/module/ExceptionProcessingHistoryDialog.tsx @@ -63,7 +63,7 @@ const exceptionHistoryTabs: { value: ExceptionHistoryTabKey; label: string }[] = const TITLE = "예외처리 내역 조회"; /** 예외처리 건만 */ -const PRCS_YN_LIST = "2"; +const VRFC_STTS_CD_LIST = "2"; export type ExceptionRejectSubmitItem = { vrfcSn: number; @@ -196,8 +196,7 @@ export function ExceptionProcessingHistoryDialog({ statsYr: queryContext.statsYr, statsCd: queryContext.statsCd, vrfcMthdCd, - prcsYnList: PRCS_YN_LIST, - rejectCodeList: "0,1,2", + vrfcSttsCdList: VRFC_STTS_CD_LIST, page: pageIndex + 1, size: 30, }; diff --git a/apps/st/src/components/module/VerificationResultDialog.tsx b/apps/st/src/components/module/VerificationResultDialog.tsx index 22b77050f..60913eac0 100644 --- a/apps/st/src/components/module/VerificationResultDialog.tsx +++ b/apps/st/src/components/module/VerificationResultDialog.tsx @@ -232,8 +232,7 @@ export function VerificationResultDialog({ statsYr: stableQueryContext.statsYr, statsCd: stableQueryContext.statsCd, vrfcMthdCd, - prcsYnList: "0", - rejectCodeList: "0,1,2", + vrfcSttsCdList: "0", page: page + 1, size: 10000, }; diff --git a/apps/st/src/components/module/VerificationResultHistoryDialog.tsx b/apps/st/src/components/module/VerificationResultHistoryDialog.tsx index 6b06667cd..cd0ea4490 100644 --- a/apps/st/src/components/module/VerificationResultHistoryDialog.tsx +++ b/apps/st/src/components/module/VerificationResultHistoryDialog.tsx @@ -262,8 +262,7 @@ export function VerificationResultHistoryDialog({ statsYr: stableQueryContext.statsYr, statsCd: stableQueryContext.statsCd, vrfcMthdCd, - prcsYnList: "0,2", - rejectCodeList: "0,1,2", + vrfcSttsCdList: "0,2", page: pageIndex + 1, size: PAGE_SIZE, }; diff --git a/apps/st/src/components/module/post-submit-verification-results.ts b/apps/st/src/components/module/post-submit-verification-results.ts index 4efe25993..531e80037 100644 --- a/apps/st/src/components/module/post-submit-verification-results.ts +++ b/apps/st/src/components/module/post-submit-verification-results.ts @@ -22,7 +22,7 @@ function responseHasVerificationResults(response: VerificationResultListResponse } /** - * 제출 직후 `VerificationResultDialog`에 표시할 미통과(prcsYn=0) 검증 결과가 + * 제출 직후 `VerificationResultDialog`에 표시할 미통과(vrfcSttsCd=0) 검증 결과가 * 일반검증(NV)·I-MR(IMR)·HB 중 하나라도 있는지 조회합니다. */ export async function hasAnyPostSubmitVerificationResult( @@ -34,8 +34,7 @@ export async function hasAnyPostSubmitVerificationResult( sggNm: ctx.sggNm, statsYr: ctx.statsYr, statsCd: ctx.statsCd, - prcsYnList: "0", - rejectCodeList: "0,1,2", + vrfcSttsCdList: "0", page: 1, size: 1, }; diff --git a/apps/st/src/components/statistics/input/SewagePipeInp.tsx b/apps/st/src/components/statistics/input/SewagePipeInp.tsx index e4a39bec7..1e644df8d 100644 --- a/apps/st/src/components/statistics/input/SewagePipeInp.tsx +++ b/apps/st/src/components/statistics/input/SewagePipeInp.tsx @@ -81,7 +81,10 @@ import { patchVerificationFailedByTab, } from "@/components/util/input/verification-failed-flag"; import { nullableTrimmedString } from "@/components/util/input/nullableString"; -import type { VerificationResultLikeMap } from "@/components/util/input/verification-result-display"; +import { + getVerificationErrorsForField, + type VerificationResultLikeMap, +} from "@/components/util/input/verification-result-display"; import { useAdminStore } from "@/store/admin-store"; import { useStatisticsInputFocusStore } from "@/store/statistics-input-focus-store"; import { useTabStore } from "@/store/tab-store"; @@ -219,18 +222,33 @@ const applyPipeTypeStatusEditableColumns = ( }); }; -/** 2-3 관종별: verificationResult.prlgWhol → 총계 계(pipeByPrstWhol) */ +const PIPE_TYPE_TOTAL_WHOL_ALIASES = ["pipeWholPrlg", "prlgWhol"] as const; + +/** 2-3 관종별: 총계 검증 키(pipeWholPrlg/prlgWhol) → 총계 계(pipeByPrstWhol) */ function remapPipeTypePrlgWholVerification( result?: SeweragePipeInputVerificationResult | null, ): SeweragePipeInputVerificationResult | null | undefined { if (!result) return result; - const fromAlias = result.prlgWhol; - if (!Array.isArray(fromAlias) || fromAlias.length === 0) return result; const existing = result.pipeByPrstWhol; if (Array.isArray(existing) && existing.length > 0) return result; + const fromAlias = result.pipeWholPrlg ?? result.prlgWhol; + if (!Array.isArray(fromAlias) || fromAlias.length === 0) return result; return { ...result, pipeByPrstWhol: fromAlias }; } +function getSewagePipeRowVerificationErrors( + verification: SeweragePipeInputVerificationResult | undefined, + fieldName: string, + tabKey: string, +) { + if (!verification) return undefined; + const aliases = + tabKey === PIPE_TYPE_STATUS_TAB_KEY && fieldName === "pipeByPrstWhol" + ? PIPE_TYPE_TOTAL_WHOL_ALIASES + : undefined; + return getVerificationErrorsForField(verification, fieldName, aliases); +} + /** 관종별 신 응답(yearlyStatList) -> 그리드 y{year}* 필드로 정규화 */ function normalizePipeTypeStatusRow( row: SeweragePipeInputPipeTypeStatusItem, @@ -2202,8 +2220,11 @@ const SewagePipeInp = () => { } cellStyleCallback={({ row, fieldName }) => { const verification = (row as GridRowWithVerification).verificationResult; - if (!verification) return; - const errors = verification[fieldName]; + const errors = getSewagePipeRowVerificationErrors( + verification, + fieldName, + tabKey, + ); if (Array.isArray(errors) && errors.length > 0) { const hasImr = errors.some((e) => e.vrfcCd === "IMR" || e.vrfcCd === "HB"); return hasImr ? "rg-cell-verify-error-imr" : "rg-cell-verify-error"; @@ -2214,8 +2235,11 @@ const SewagePipeInp = () => { } cellTooltipCallback={({ row, fieldName }) => { const verification = (row as GridRowWithVerification).verificationResult; - if (!verification) return; - const errors = verification[fieldName]; + const errors = getSewagePipeRowVerificationErrors( + verification, + fieldName, + tabKey, + ); if (Array.isArray(errors) && errors.length > 0) { return errors .map((e) => { diff --git a/apps/st/src/components/statistics/verification/generalVerification/RegistDialog.tsx b/apps/st/src/components/statistics/verification/generalVerification/RegistDialog.tsx index f053e75f5..3eca65196 100644 --- a/apps/st/src/components/statistics/verification/generalVerification/RegistDialog.tsx +++ b/apps/st/src/components/statistics/verification/generalVerification/RegistDialog.tsx @@ -9,10 +9,10 @@ import { useQuery } from "@tanstack/react-query"; import { ENDPOINT } from "@/shared/config"; import { useAlertStore } from "@/shared/lib"; -import { Form, FormControl,FormField, FormItem } from "@/shared/ui/form"; +import { Form, FormControl, FormField, FormItem } from "@/shared/ui/form"; import { CodeSelect } from "@/entities/code"; import { generalverificationApiService } from '@/entities/statistics/api/general-verification-service'; -import type { RegistVrfcMasterRequest,UpdateVrfcMasterRequest } from "@/entities/statistics/model/general-verification-interface"; +import type { RegistVrfcMasterRequest, UpdateVrfcMasterRequest } from "@/entities/statistics/model/general-verification-interface"; import { type GeneralVerificationMasterSubmitFormData, generalVerificationMasterSubmitSchema } from '@/entities/statistics/model/general-verification-master-submit-schema'; import { UserApi } from "@/entities/user/api/user-service"; import { @@ -228,7 +228,7 @@ const RegistDialog = memo( if (mutationBlocked) { alert( blockedMessage ?? - "입력기간에는 검증항목을 등록하거나 수정할 수 없습니다.", + "입력기간에는 검증항목을 등록하거나 수정할 수 없습니다.", ); return; } @@ -298,14 +298,16 @@ const RegistDialog = memo( {children} - + + + {isVrfcSn ? detailData ? detailData.data.vrfcNm : : "일반 검증 등록"} - - + +