diff --git a/frontend/components/unified/UnifiedSelect.tsx b/frontend/components/unified/UnifiedSelect.tsx index d57ae9ad..a5c604be 100644 --- a/frontend/components/unified/UnifiedSelect.tsx +++ b/frontend/components/unified/UnifiedSelect.tsx @@ -621,7 +621,9 @@ export const UnifiedSelect = forwardRef( } else if (source === "select" || source === "distinct") { // 해당 테이블의 해당 컬럼에서 DISTINCT 값 조회 // tableName, columnName은 props에서 가져옴 - if (tableName && columnName) { + // 🆕 columnName이 컴포넌트 ID 형식(comp_xxx)이면 유효하지 않으므로 건너뜀 + const isValidColumnName = columnName && !columnName.startsWith("comp_"); + if (tableName && isValidColumnName) { const response = await apiClient.get(`/entity/${tableName}/distinct/${columnName}`); const data = response.data; if (data.success && data.data) { @@ -630,6 +632,9 @@ export const UnifiedSelect = forwardRef( label: String(item.label), })); } + } else if (!isValidColumnName) { + // columnName이 없거나 유효하지 않으면 빈 옵션 + console.warn("UnifiedSelect: 유효한 columnName이 없어 옵션을 로드하지 않습니다.", { tableName, columnName }); } } diff --git a/frontend/lib/registry/DynamicComponentRenderer.tsx b/frontend/lib/registry/DynamicComponentRenderer.tsx index 2a7440f6..8ef6a943 100644 --- a/frontend/lib/registry/DynamicComponentRenderer.tsx +++ b/frontend/lib/registry/DynamicComponentRenderer.tsx @@ -279,14 +279,15 @@ export const DynamicComponentRenderer: React.FC = ); case "unified-select": + // 🆕 unified-select는 항상 테이블 컬럼에서 distinct 값을 자동 로드 + // 정적 옵션(static)은 사용하지 않음 return ( = {}; + if (comp.tableName) topLevelProps.tableName = comp.tableName; + if (comp.columnName) topLevelProps.columnName = comp.columnName; + if (comp.label) topLevelProps.label = comp.label; + if (comp.required !== undefined) topLevelProps.required = comp.required; + if (comp.readonly !== undefined) topLevelProps.readonly = comp.readonly; + if (comp.codeCategory) topLevelProps.codeCategory = comp.codeCategory; + if (comp.inputType) topLevelProps.inputType = comp.inputType; + if (comp.webType) topLevelProps.webType = comp.webType; + // 현재 설정에서 차이값만 추출 const fullConfig = comp.componentConfig || {}; - const overrides = extractCustomConfig(fullConfig, defaults); + const configOverrides = extractCustomConfig(fullConfig, defaults); + + // 상위 레벨 속성과 componentConfig 병합 + const overrides = { ...topLevelProps, ...configOverrides }; return { id: comp.id,