Compare commits
No commits in common. "df0929db601e5d669350ed06e55a4d599d8409a1" and "436ec1c908b122033ce160b0b8cc08eea385bd02" have entirely different histories.
df0929db60
...
436ec1c908
|
|
@ -274,11 +274,6 @@ export const TableListComponent: React.FC<TableListComponentProps> = ({
|
|||
setCurrentPage(1); // 필터 변경 시 첫 페이지로
|
||||
}, [filters]);
|
||||
|
||||
// grouping이 변경되면 groupByColumns 업데이트
|
||||
useEffect(() => {
|
||||
setGroupByColumns(grouping);
|
||||
}, [grouping]);
|
||||
|
||||
// 초기 로드 시 localStorage에서 저장된 설정 불러오기
|
||||
useEffect(() => {
|
||||
if (tableConfig.selectedTable && currentUserId) {
|
||||
|
|
@ -1657,20 +1652,9 @@ export const TableListComponent: React.FC<TableListComponentProps> = ({
|
|||
data.forEach((item) => {
|
||||
// 그룹 키 생성: "통화:KRW > 단위:EA"
|
||||
const keyParts = groupByColumns.map((col) => {
|
||||
// 카테고리/엔티티 타입인 경우 _name 필드 사용
|
||||
const inputType = columnMeta?.[col]?.inputType;
|
||||
let displayValue = item[col];
|
||||
|
||||
if (inputType === 'category' || inputType === 'entity' || inputType === 'code') {
|
||||
// _name 필드가 있으면 사용 (예: division_name, writer_name)
|
||||
const nameField = `${col}_name`;
|
||||
if (item[nameField] !== undefined && item[nameField] !== null) {
|
||||
displayValue = item[nameField];
|
||||
}
|
||||
}
|
||||
|
||||
const value = item[col];
|
||||
const label = columnLabels[col] || col;
|
||||
return `${label}:${displayValue !== null && displayValue !== undefined ? displayValue : "-"}`;
|
||||
return `${label}:${value !== null && value !== undefined ? value : "-"}`;
|
||||
});
|
||||
const groupKey = keyParts.join(" > ");
|
||||
|
||||
|
|
@ -1693,7 +1677,7 @@ export const TableListComponent: React.FC<TableListComponentProps> = ({
|
|||
count: items.length,
|
||||
};
|
||||
});
|
||||
}, [data, groupByColumns, columnLabels, columnMeta]);
|
||||
}, [data, groupByColumns, columnLabels]);
|
||||
|
||||
// 저장된 그룹 설정 불러오기
|
||||
useEffect(() => {
|
||||
|
|
|
|||
Loading…
Reference in New Issue