feat: 데이터 흐름 조회 기능 개선 및 프리뷰 모드 추가

- 데이터 흐름 조회 API에 source_screen_id 파라미터 추가하여 특정 화면에서 시작하는 데이터 흐름만 조회 가능
- 화면 관리 페이지에서 선택된 그룹에 company_code 필드 추가하여 회사 코드 정보 포함
- 프리뷰 모드에서 URL 쿼리로 company_code를 받아와 데이터 조회 시 우선 사용하도록 로직 개선
- 화면 관계 흐름 및 서브 테이블 정보에서 company_code를 활용하여 필터링 및 시각화 개선
This commit is contained in:
DDD1542
2026-01-09 18:26:37 +09:00
parent a6569909a2
commit 0773989c74
9 changed files with 482 additions and 148 deletions

View File

@@ -254,10 +254,17 @@ export async function deleteFieldJoin(id: number): Promise<ApiResponse<void>> {
// 데이터 흐름 (screen_data_flows) API
// ============================================================
export async function getDataFlows(groupId?: number): Promise<ApiResponse<DataFlow[]>> {
export async function getDataFlows(params?: { groupId?: number; sourceScreenId?: number }): Promise<ApiResponse<DataFlow[]>> {
try {
const queryParams = groupId ? `?group_id=${groupId}` : "";
const response = await apiClient.get(`/screen-groups/data-flows${queryParams}`);
const queryParts: string[] = [];
if (params?.groupId) {
queryParts.push(`group_id=${params.groupId}`);
}
if (params?.sourceScreenId) {
queryParts.push(`source_screen_id=${params.sourceScreenId}`);
}
const queryString = queryParts.length > 0 ? `?${queryParts.join("&")}` : "";
const response = await apiClient.get(`/screen-groups/data-flows${queryString}`);
return response.data;
} catch (error: any) {
return { success: false, error: error.message };
@@ -403,9 +410,11 @@ export interface FieldMappingInfo {
// 서브 테이블 정보 타입
export interface SubTableInfo {
tableName: string;
tableLabel?: string; // 테이블 한글명
componentType: string;
relationType: 'lookup' | 'source' | 'join' | 'reference' | 'parentMapping' | 'rightPanelRelation';
fieldMappings?: FieldMappingInfo[];
filterColumns?: string[]; // 필터링에 사용되는 컬럼 목록
// rightPanelRelation에서 추가 정보 (관계 유형 추론용)
originalRelationType?: 'join' | 'detail'; // 원본 relation.type
foreignKey?: string; // 디테일 테이블의 FK 컬럼