카테고리 매핑 로직 개선 및 디버그 로그 제거
- InteractiveDataTable에서 valueCode 및 valueId에 대한 매핑 로직을 추가하여, 두 가지 키로 카테고리 정보를 저장할 수 있도록 개선하였습니다. - UnifiedInput 및 TableListComponent에서 불필요한 디버그 로그를 주석 처리하여 코드 가독성을 향상시켰습니다. 이로 인해 카테고리 관리 및 데이터 처리의 효율성이 향상되었습니다.
This commit is contained in:
@@ -384,13 +384,23 @@ export const InteractiveDataTable: React.FC<InteractiveDataTableProps> = ({
|
||||
);
|
||||
|
||||
if (response.data.success && response.data.data) {
|
||||
// valueCode -> {label, color} 매핑 생성
|
||||
// valueCode 및 valueId -> {label, color} 매핑 생성
|
||||
const mapping: Record<string, { label: string; color?: string }> = {};
|
||||
response.data.data.forEach((item: any) => {
|
||||
mapping[item.valueCode] = {
|
||||
label: item.valueLabel,
|
||||
color: item.color,
|
||||
};
|
||||
// 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,
|
||||
};
|
||||
}
|
||||
});
|
||||
mappings[col.columnName] = mapping;
|
||||
console.log(`✅ 카테고리 매핑 로드 성공 [${col.columnName}]:`, mapping, { menuObjid });
|
||||
|
||||
Reference in New Issue
Block a user