feat: DISTINCT 값 조회 API 추가 및 라우터 설정
- 테이블 컬럼의 DISTINCT 값을 조회하는 API를 추가하였습니다. 이 API는 특정 테이블과 컬럼에서 DISTINCT 값을 반환하여 선택박스 옵션으로 사용할 수 있도록 합니다. - API 호출 시 멀티테넌시를 고려하여 회사 코드에 따라 필터링을 적용하였습니다. - 관련된 라우터 설정을 추가하여 API 접근을 가능하게 하였습니다. - 프론트엔드에서 DISTINCT 값을 조회할 수 있도록 UnifiedSelect 컴포넌트를 업데이트하였습니다.
This commit is contained in:
@@ -370,13 +370,25 @@ export const DynamicComponentConfigPanel: React.FC<ComponentConfigPanelProps> =
|
||||
// 🆕 allComponents를 screenComponents 형태로 변환 (집계 위젯 등에서 사용)
|
||||
// Hooks 규칙: 조건부 return 전에 선언해야 함
|
||||
const screenComponents = React.useMemo(() => {
|
||||
if (!allComponents) return [];
|
||||
return allComponents.map((comp: any) => ({
|
||||
id: comp.id,
|
||||
componentType: comp.componentType || comp.type,
|
||||
label: comp.label || comp.name || comp.id,
|
||||
tableName: comp.componentConfig?.tableName || comp.tableName,
|
||||
}));
|
||||
if (!allComponents) {
|
||||
console.log("[getComponentConfigPanel] allComponents is undefined or null");
|
||||
return [];
|
||||
}
|
||||
console.log("[getComponentConfigPanel] allComponents 변환 시작:", allComponents.length, "개");
|
||||
const result = allComponents.map((comp: any) => {
|
||||
const columnName = comp.columnName || comp.componentConfig?.columnName || comp.componentConfig?.fieldName;
|
||||
console.log(`[getComponentConfigPanel] comp: ${comp.id}, type: ${comp.componentType || comp.type}, columnName: ${columnName}`);
|
||||
return {
|
||||
id: comp.id,
|
||||
componentType: comp.componentType || comp.type,
|
||||
label: comp.label || comp.name || comp.id,
|
||||
tableName: comp.componentConfig?.tableName || comp.tableName,
|
||||
// 🆕 폼 필드 인식용 columnName 추가
|
||||
columnName,
|
||||
};
|
||||
});
|
||||
console.log("[getComponentConfigPanel] screenComponents 변환 완료:", result);
|
||||
return result;
|
||||
}, [allComponents]);
|
||||
|
||||
if (loading) {
|
||||
|
||||
Reference in New Issue
Block a user