feat: enhance v2 components and entity join functionality
- Add entity join controller/routes enhancements - Improve table management and category value services - Update v2 table list, card display, search widget components - Improve split panel layout responsiveness Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -648,24 +648,31 @@ export const InteractiveDataTable: React.FC<InteractiveDataTableProps> = ({
|
||||
);
|
||||
|
||||
if (response.data.success && response.data.data) {
|
||||
// valueCode 및 valueId -> {label, color} 매핑 생성
|
||||
// valueCode 및 valueId -> {label, color} 매핑 생성 (트리 재귀 평탄화)
|
||||
const mapping: Record<string, { label: string; color?: string }> = {};
|
||||
response.data.data.forEach((item: any) => {
|
||||
// valueCode로 매핑
|
||||
if (item.valueCode) {
|
||||
mapping[item.valueCode] = {
|
||||
label: item.valueLabel,
|
||||
color: item.color,
|
||||
};
|
||||
}
|
||||
// valueId로도 매핑 (숫자 ID 저장 시 라벨 표시용)
|
||||
if (item.valueId !== undefined && item.valueId !== null) {
|
||||
mapping[String(item.valueId)] = {
|
||||
label: item.valueLabel,
|
||||
color: item.color,
|
||||
};
|
||||
}
|
||||
});
|
||||
const flattenCategoryTree = (items: any[], parentLabel: string = "") => {
|
||||
items.forEach((item: any) => {
|
||||
const displayLabel = parentLabel
|
||||
? `${parentLabel} / ${item.valueLabel}`
|
||||
: item.valueLabel;
|
||||
if (item.valueCode) {
|
||||
mapping[item.valueCode] = {
|
||||
label: displayLabel,
|
||||
color: item.color,
|
||||
};
|
||||
}
|
||||
if (item.valueId !== undefined && item.valueId !== null) {
|
||||
mapping[String(item.valueId)] = {
|
||||
label: displayLabel,
|
||||
color: item.color,
|
||||
};
|
||||
}
|
||||
if (item.children && Array.isArray(item.children) && item.children.length > 0) {
|
||||
flattenCategoryTree(item.children, item.valueLabel);
|
||||
}
|
||||
});
|
||||
};
|
||||
flattenCategoryTree(response.data.data);
|
||||
mappings[col.columnName] = mapping;
|
||||
console.log(`✅ 카테고리 매핑 로드 성공 [${col.columnName}]:`, mapping, { menuObjid });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user