From a3f945f5df483551ecca0e5cb54b7c3662c379a2 Mon Sep 17 00:00:00 2001 From: kjs Date: Mon, 3 Nov 2025 14:39:43 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20TableListComponent=20=EC=BD=94=EB=93=9C?= =?UTF-8?q?=20=EB=B3=80=ED=99=98=20=EB=A1=9C=EC=A7=81=20=EC=9E=AC=EC=B6=94?= =?UTF-8?q?=EA=B0=80=20=EB=B0=8F=20=EA=B0=9C=EC=84=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 요구사항: - DB에 저장된 코드 값(예: '001') → 코드명(예: '활성')으로 표시 구현: - inputType === 'code'이고 codeCategory가 있을 때 변환 수행 - optimizedConvertCode를 통해 코드 값 → 코드명 변환 - 변환 성공 시 코드명 반환 - 변환 실패 시 원본 코드 값 반환 - try-catch로 에러 핸들링 추가 - 디버깅을 위한 에러 로그 추가 변경: - 코드 변환 로직 복원 - 에러 처리 강화 - 변환 실패 시 원본 값 표시로 안전장치 --- .../components/table-list/TableListComponent.tsx | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/frontend/lib/registry/components/table-list/TableListComponent.tsx b/frontend/lib/registry/components/table-list/TableListComponent.tsx index d3ae5046..5b2659ee 100644 --- a/frontend/lib/registry/components/table-list/TableListComponent.tsx +++ b/frontend/lib/registry/components/table-list/TableListComponent.tsx @@ -679,6 +679,21 @@ export const TableListComponent: React.FC = ({ // inputType 기반 포맷팅 (columnMeta에서 가져온 inputType 우선) const inputType = meta?.inputType || column.inputType; + // 코드 타입: 코드 값 → 코드명 변환 + if (inputType === "code" && meta?.codeCategory && value) { + try { + const convertedValue = optimizedConvertCode(value, meta.codeCategory); + // 변환에 성공했으면 변환된 코드명 반환 + if (convertedValue && convertedValue !== value) { + return convertedValue; + } + } catch (error) { + console.error(`코드 변환 실패: ${column.columnName}, 카테고리: ${meta.codeCategory}, 값: ${value}`, error); + } + // 변환 실패 시 원본 코드 값 반환 + return String(value); + } + // 숫자 타입 포맷팅 if (inputType === "number" || inputType === "decimal") { if (value !== null && value !== undefined && value !== "") {