우측화면 데이터 필터링 수정
This commit is contained in:
@@ -1268,18 +1268,9 @@ export const TableListComponent: React.FC<TableListComponentProps> = ({
|
||||
});
|
||||
}
|
||||
|
||||
console.log(`📡 [TableList] API 호출 시작 [${columnName}]:`, {
|
||||
url: `/table-categories/${targetTable}/${targetColumn}/values`,
|
||||
});
|
||||
|
||||
const response = await apiClient.get(`/table-categories/${targetTable}/${targetColumn}/values`);
|
||||
|
||||
console.log(`📡 [TableList] API 응답 [${columnName}]:`, {
|
||||
success: response.data.success,
|
||||
dataLength: response.data.data?.length,
|
||||
rawData: response.data,
|
||||
items: response.data.data,
|
||||
});
|
||||
|
||||
if (response.data.success && response.data.data && Array.isArray(response.data.data)) {
|
||||
const mapping: Record<string, { label: string; color?: string }> = {};
|
||||
@@ -1291,18 +1282,11 @@ export const TableListComponent: React.FC<TableListComponentProps> = ({
|
||||
label: item.valueLabel,
|
||||
color: item.color,
|
||||
};
|
||||
console.log(` 🔑 [${columnName}] "${key}" => "${item.valueLabel}" (색상: ${item.color})`);
|
||||
});
|
||||
|
||||
if (Object.keys(mapping).length > 0) {
|
||||
// 🆕 원래 컬럼명(item_info.material)으로 매핑 저장
|
||||
mappings[columnName] = mapping;
|
||||
console.log(`✅ [TableList] 카테고리 매핑 로드 완료 [${columnName}]:`, {
|
||||
columnName,
|
||||
mappingCount: Object.keys(mapping).length,
|
||||
mappingKeys: Object.keys(mapping),
|
||||
mapping,
|
||||
});
|
||||
} else {
|
||||
console.warn(`⚠️ [TableList] 매핑 데이터가 비어있음 [${columnName}]`);
|
||||
}
|
||||
@@ -1342,7 +1326,6 @@ export const TableListComponent: React.FC<TableListComponentProps> = ({
|
||||
col.columnName,
|
||||
})) || [];
|
||||
|
||||
console.log("🔍 [TableList] additionalJoinInfo 컬럼:", additionalJoinColumns);
|
||||
|
||||
// 조인 테이블별로 그룹화
|
||||
const joinedTableColumns: Record<string, { columnName: string; actualColumn: string }[]> = {};
|
||||
@@ -1375,7 +1358,6 @@ export const TableListComponent: React.FC<TableListComponentProps> = ({
|
||||
});
|
||||
}
|
||||
|
||||
console.log("🔍 [TableList] 조인 테이블별 컬럼:", joinedTableColumns);
|
||||
|
||||
// 조인된 테이블별로 inputType 정보 가져오기
|
||||
const newJoinedColumnMeta: Record<string, { webType?: string; codeCategory?: string; inputType?: string }> = {};
|
||||
@@ -1421,9 +1403,6 @@ export const TableListComponent: React.FC<TableListComponentProps> = ({
|
||||
|
||||
if (Object.keys(mapping).length > 0) {
|
||||
mappings[col.columnName] = mapping;
|
||||
console.log(`✅ [TableList] 조인 테이블 카테고리 매핑 로드 완료 [${col.columnName}]:`, {
|
||||
mappingCount: Object.keys(mapping).length,
|
||||
});
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
@@ -1442,16 +1421,9 @@ export const TableListComponent: React.FC<TableListComponentProps> = ({
|
||||
console.log("✅ [TableList] 조인 컬럼 메타데이터 설정:", newJoinedColumnMeta);
|
||||
}
|
||||
|
||||
console.log("📊 [TableList] 전체 카테고리 매핑 설정:", {
|
||||
mappingsCount: Object.keys(mappings).length,
|
||||
mappingsKeys: Object.keys(mappings),
|
||||
mappings,
|
||||
});
|
||||
|
||||
if (Object.keys(mappings).length > 0) {
|
||||
setCategoryMappings(mappings);
|
||||
setCategoryMappingsKey((prev) => prev + 1);
|
||||
console.log("✅ [TableList] setCategoryMappings 호출 완료");
|
||||
} else {
|
||||
console.warn("⚠️ [TableList] 매핑이 비어있어 상태 업데이트 스킵");
|
||||
}
|
||||
@@ -1473,11 +1445,6 @@ export const TableListComponent: React.FC<TableListComponentProps> = ({
|
||||
// ========================================
|
||||
|
||||
const fetchTableDataInternal = useCallback(async () => {
|
||||
console.log("📡 [TableList] fetchTableDataInternal 호출됨", {
|
||||
tableName: tableConfig.selectedTable,
|
||||
isDesignMode,
|
||||
currentPage,
|
||||
});
|
||||
|
||||
if (!tableConfig.selectedTable || isDesignMode) {
|
||||
setData([]);
|
||||
@@ -1501,13 +1468,6 @@ export const TableListComponent: React.FC<TableListComponentProps> = ({
|
||||
let hasLinkedFiltersConfigured = false; // 연결 필터가 설정되어 있는지 여부
|
||||
let hasSelectedLeftData = false; // 좌측에서 데이터가 선택되었는지 여부
|
||||
|
||||
console.log("🔍 [TableList] 분할 패널 컨텍스트 확인:", {
|
||||
hasSplitPanelContext: !!splitPanelContext,
|
||||
tableName: tableConfig.selectedTable,
|
||||
selectedLeftData: splitPanelContext?.selectedLeftData,
|
||||
linkedFilters: splitPanelContext?.linkedFilters,
|
||||
splitPanelPosition: splitPanelPosition,
|
||||
});
|
||||
|
||||
if (splitPanelContext) {
|
||||
// 연결 필터 설정 여부 확인 (현재 테이블에 해당하는 필터가 있는지)
|
||||
@@ -1523,7 +1483,6 @@ export const TableListComponent: React.FC<TableListComponentProps> = ({
|
||||
splitPanelContext.selectedLeftData && Object.keys(splitPanelContext.selectedLeftData).length > 0;
|
||||
|
||||
const allLinkedFilters = splitPanelContext.getLinkedFilterValues();
|
||||
console.log("🔗 [TableList] 연결 필터 원본:", allLinkedFilters);
|
||||
|
||||
// 현재 테이블에 해당하는 필터만 추출 (테이블명.컬럼명 형식에서)
|
||||
// 연결 필터는 코드 값이므로 정확한 매칭(equals)을 사용해야 함
|
||||
@@ -1655,7 +1614,6 @@ export const TableListComponent: React.FC<TableListComponentProps> = ({
|
||||
};
|
||||
});
|
||||
|
||||
console.log("🎯 [TableList] 화면별 엔티티 설정:", screenEntityConfigs);
|
||||
|
||||
// 🆕 제외 필터 처리 (다른 테이블에 이미 존재하는 데이터 제외)
|
||||
let excludeFilterParam: any = undefined;
|
||||
@@ -2146,16 +2104,6 @@ export const TableListComponent: React.FC<TableListComponentProps> = ({
|
||||
// 분할 패널 컨텍스트가 있고, 좌측 화면인 경우에만 행 선택 및 데이터 전달
|
||||
const effectiveSplitPosition = splitPanelPosition || currentSplitPosition;
|
||||
|
||||
console.log("🔗 [TableList] 셀 클릭 - 분할 패널 위치 확인:", {
|
||||
rowIndex,
|
||||
colIndex,
|
||||
splitPanelPosition,
|
||||
currentSplitPosition,
|
||||
effectiveSplitPosition,
|
||||
hasSplitPanelContext: !!splitPanelContext,
|
||||
isCurrentlySelected,
|
||||
});
|
||||
|
||||
if (splitPanelContext && effectiveSplitPosition === "left" && !splitPanelContext.disableAutoDataTransfer) {
|
||||
// 이미 선택된 행과 다른 행을 클릭한 경우에만 처리
|
||||
if (!isCurrentlySelected) {
|
||||
@@ -2165,10 +2113,6 @@ export const TableListComponent: React.FC<TableListComponentProps> = ({
|
||||
|
||||
// 분할 패널 컨텍스트에 데이터 저장
|
||||
splitPanelContext.setSelectedLeftData(row);
|
||||
console.log("🔗 [TableList] 셀 클릭으로 분할 패널 좌측 데이터 저장:", {
|
||||
row,
|
||||
parentDataMapping: splitPanelContext.parentDataMapping,
|
||||
});
|
||||
|
||||
// onSelectedRowsChange 콜백 호출
|
||||
if (onSelectedRowsChange) {
|
||||
@@ -2888,7 +2832,6 @@ export const TableListComponent: React.FC<TableListComponentProps> = ({
|
||||
|
||||
try {
|
||||
localStorage.setItem(tableStateKey, JSON.stringify(state));
|
||||
console.log("✅ 테이블 상태 저장:", tableStateKey);
|
||||
} catch (error) {
|
||||
console.error("❌ 테이블 상태 저장 실패:", error);
|
||||
}
|
||||
@@ -2930,7 +2873,6 @@ export const TableListComponent: React.FC<TableListComponentProps> = ({
|
||||
setHeaderFilters(filters);
|
||||
}
|
||||
|
||||
console.log("✅ 테이블 상태 복원:", tableStateKey);
|
||||
} catch (error) {
|
||||
console.error("❌ 테이블 상태 복원 실패:", error);
|
||||
}
|
||||
@@ -2951,7 +2893,6 @@ export const TableListComponent: React.FC<TableListComponentProps> = ({
|
||||
setShowGridLines(true);
|
||||
setHeaderFilters({});
|
||||
toast.success("테이블 설정이 초기화되었습니다.");
|
||||
console.log("✅ 테이블 상태 초기화:", tableStateKey);
|
||||
} catch (error) {
|
||||
console.error("❌ 테이블 상태 초기화 실패:", error);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user