From 8576ef83b5b3a4338d3ad5098782e11df2834bfa Mon Sep 17 00:00:00 2001 From: rsone001 Date: Tue, 1 Sep 2026 16:25:55 +0900 Subject: [PATCH] =?UTF-8?q?[ST]=20-=20refactor:=206-1=20=EC=A4=91=EC=8B=AC?= =?UTF-8?q?=EC=B2=98=EB=A6=AC=EC=8B=9C=EC=84=A4=20row=EB=8A=94=20=EC=9C=84?= =?UTF-8?q?=ED=83=81=EA=B3=84=EC=95=BD=EA=B8=B0=EA=B0=84=20=EC=A7=81?= =?UTF-8?q?=EC=A0=91=20=EC=88=98=EC=A0=95=20=EB=AA=BB=ED=95=98=EB=8F=84?= =?UTF-8?q?=EB=A1=9D=20=EC=A0=81=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../input/PublicSewageFacilityInp.tsx | 26 +++++++++++++++---- .../PublicSewageFactColumn.ts | 2 ++ ...-public-sewage-facility-input-interface.ts | 1 + .../verification-input-report-interface.ts | 1 - 4 files changed, 24 insertions(+), 6 deletions(-) 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/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 {