diff --git a/apps/st/src/components/statistics/input/PublicSewageFacilityInp.tsx b/apps/st/src/components/statistics/input/PublicSewageFacilityInp.tsx index 4197084bb..509ab5db6 100644 --- a/apps/st/src/components/statistics/input/PublicSewageFacilityInp.tsx +++ b/apps/st/src/components/statistics/input/PublicSewageFacilityInp.tsx @@ -173,6 +173,10 @@ function normalizePrxyCtrtCn(raw: unknown): string | null { return s; } +function isMainFacilityRow(row: Record): boolean { + return String(row.isMainYn ?? '').toUpperCase() === 'Y'; +} + function isValidPrxyCtrtCn(value: string | null): boolean { if (value === null) return true; if (!/^\d{8}~\d{8}$/.test(value)) return false; @@ -1540,13 +1544,25 @@ const PublicSewageFacilityInp = () => { showHeaderCheckbox={false} enableSort={false} cellStyleCallback={({ row, fieldName }) => { + const lockPrxyCtrtCn = + fieldName === 'prxyCtrtCn' && isMainFacilityRow(row); const verification = (row as GridRowWithVerification).verificationResult; - if (!verification) return; - const errors = verification[fieldName]; - 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"; + let verifyStyle: string | undefined; + if (verification) { + const errors = verification[fieldName]; + if (Array.isArray(errors) && errors.length > 0) { + const hasImr = errors.some((e) => e.vrfcCd === "IMR" || e.vrfcCd === "HB"); + verifyStyle = hasImr ? "rg-cell-verify-error-imr" : "rg-cell-verify-error"; + } } + if (lockPrxyCtrtCn) { + return { + editable: false, + readOnly: true, + styleName: [verifyStyle, 'rg-cell-readonly'].filter(Boolean).join(' ') || 'rg-cell-readonly', + }; + } + return verifyStyle; }} footerVerificationResult={ footerVerificationByTab.get(tab.tabKey) ?? null diff --git a/apps/st/src/components/statistics/verification/generalVerification/FomulaDialog.tsx b/apps/st/src/components/statistics/verification/generalVerification/FomulaDialog.tsx index 1fbe87806..4bfacc36b 100644 --- a/apps/st/src/components/statistics/verification/generalVerification/FomulaDialog.tsx +++ b/apps/st/src/components/statistics/verification/generalVerification/FomulaDialog.tsx @@ -761,7 +761,7 @@ const FomulaDialog = ({ open, onOpenChange, data, trgtStatsCd, trgtStatsNm, allo onClick={() => { if (isUserDirectInputMode) { setFormulaSaveError(null); - const raw = formulaDisplaySegments.join(""); + const raw = formulaDisplaySegments.join("").replace(/\s+/g, ""); const wrapped = wrapWithBacktick(raw); const isEmptyFormula = raw.trim().length === 0; const refStats = resolveRefStatsForConfirm(isEmptyFormula); diff --git a/apps/st/src/components/util/column/input/PublicSewageFactInpColumn/PublicSewageFactColumn.ts b/apps/st/src/components/util/column/input/PublicSewageFactInpColumn/PublicSewageFactColumn.ts index 6efaed0c1..db1c9e73e 100644 --- a/apps/st/src/components/util/column/input/PublicSewageFactInpColumn/PublicSewageFactColumn.ts +++ b/apps/st/src/components/util/column/input/PublicSewageFactInpColumn/PublicSewageFactColumn.ts @@ -170,6 +170,7 @@ export const PublicSewageFactColumn = { { name: 'admdstNm', fieldName: 'admdstNm', header: { text: '행정구역명' }, visible: false, editable: false, styleName: 'rg-cell-readonly' }, { name: 'fcltSn', fieldName: 'fcltSn', header: { text: '처리시설일련번호' }, visible: false, editable: false, valueType: ValueType.TEXT, styleName: 'rg-cell-readonly' }, { name: 'swtrmtFcltCd', fieldName: 'swtrmtFcltCd', header: { text: '하수처리시설코드' }, visible: false, editable: false, styleName: 'rg-cell-readonly' }, + { name: 'isMainYn', fieldName: 'isMainYn', header: { text: '중심처리시설여부' }, visible: false, editable: false, styleName: 'rg-cell-readonly' }, ], columnLayout: [ @@ -271,6 +272,7 @@ export const PublicSewageFactColumn = { 'admdstCd', 'fcltSn', 'swtrmtFcltCd', + 'isMainYn', ], rowStartNum: 3, fixedColumns: 2, diff --git a/apps/st/src/entities/statistics/model/input/statistics-public-sewage-facility-input-interface.ts b/apps/st/src/entities/statistics/model/input/statistics-public-sewage-facility-input-interface.ts index 96b1a6abc..91cc5e920 100644 --- a/apps/st/src/entities/statistics/model/input/statistics-public-sewage-facility-input-interface.ts +++ b/apps/st/src/entities/statistics/model/input/statistics-public-sewage-facility-input-interface.ts @@ -35,6 +35,7 @@ export interface PublicSewageFacilityItem { sggNm: string; admdstNm: string; fcltSn: number; + isMainYn: string; swtrmtFcltCd: string; swtrmtFcltNm: string; fcltPstnCn: string | null; diff --git a/apps/st/src/entities/statistics/model/verification-input-report-interface.ts b/apps/st/src/entities/statistics/model/verification-input-report-interface.ts index 0af515cbf..ad5ceae35 100644 --- a/apps/st/src/entities/statistics/model/verification-input-report-interface.ts +++ b/apps/st/src/entities/statistics/model/verification-input-report-interface.ts @@ -29,7 +29,6 @@ export interface VerificationInputReportItem { rsnExpln: string; nowVlCn: string; compVlCn: string | null; - vrfcStatusNm: string; } export interface VerificationInputReportPageInfo {