feat: 엑셀 다운로드 기능 개선

- 화면 편집기 컬럼 설정 기반 다운로드 (visible 컬럼만)
- 필터 조건 적용 (필터링된 데이터만 다운로드)
- 한글 라벨명 표시 (column_labels 테이블 조회)
- Entity 조인 값 표시 (writer → writer_name 등)
- 카테고리 타입 라벨 변환 (코드 → 라벨)
- 멀티테넌시 보안 강화 (autoFilter: true)
- 디버깅 로그 정리

변경된 파일:
- frontend/lib/utils/buttonActions.ts
- frontend/lib/registry/components/table-list/TableListComponent.tsx

관련 이슈: #엑셀다운로드개선
This commit is contained in:
kjs
2025-11-10 18:12:09 +09:00
parent 49f779e0e4
commit dad7e9edab
5 changed files with 1243 additions and 205 deletions

View File

@@ -9,6 +9,15 @@ interface TableDisplayState {
sortBy: string | null;
sortOrder: "asc" | "desc";
tableName: string;
// 🆕 엑셀 다운로드 개선을 위한 추가 필드
filterConditions?: Record<string, any>; // 필터 조건
searchTerm?: string; // 검색어
visibleColumns?: string[]; // 화면 표시 컬럼
columnLabels?: Record<string, string>; // 컬럼 라벨
currentPage?: number; // 현재 페이지
pageSize?: number; // 페이지 크기
totalItems?: number; // 전체 항목 수
}
class TableDisplayStore {
@@ -22,13 +31,23 @@ class TableDisplayStore {
* @param columnOrder 컬럼 순서
* @param sortBy 정렬 컬럼
* @param sortOrder 정렬 방향
* @param options 추가 옵션 (필터, 페이징 등)
*/
setTableData(
tableName: string,
data: any[],
columnOrder: string[],
sortBy: string | null,
sortOrder: "asc" | "desc"
sortOrder: "asc" | "desc",
options?: {
filterConditions?: Record<string, any>;
searchTerm?: string;
visibleColumns?: string[];
columnLabels?: Record<string, string>;
currentPage?: number;
pageSize?: number;
totalItems?: number;
}
) {
this.state.set(tableName, {
data,
@@ -36,15 +55,7 @@ class TableDisplayStore {
sortBy,
sortOrder,
tableName,
});
console.log("📦 [TableDisplayStore] 데이터 저장:", {
tableName,
dataCount: data.length,
columnOrderLength: columnOrder.length,
sortBy,
sortOrder,
firstRow: data[0],
...options,
});
this.notifyListeners();
@@ -55,15 +66,7 @@ class TableDisplayStore {
* @param tableName 테이블명
*/
getTableData(tableName: string): TableDisplayState | undefined {
const state = this.state.get(tableName);
console.log("📤 [TableDisplayStore] 데이터 조회:", {
tableName,
found: !!state,
dataCount: state?.data.length,
});
return state;
return this.state.get(tableName);
}
/**