카테고리 매핑 로직 개선 및 디버그 로그 제거
- 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 });
|
||||
|
||||
@@ -584,7 +584,7 @@ export const UnifiedInput = forwardRef<HTMLDivElement, UnifiedInputProps>((props
|
||||
userEditedNumberingRef.current = false;
|
||||
}
|
||||
|
||||
console.log("채번 코드 생성 성공:", generatedCode);
|
||||
// 채번 코드 생성 성공
|
||||
} else {
|
||||
console.warn("채번 코드 생성 실패:", previewResponse);
|
||||
}
|
||||
@@ -703,7 +703,7 @@ export const UnifiedInput = forwardRef<HTMLDivElement, UnifiedInputProps>((props
|
||||
const template = numberingTemplateRef.current;
|
||||
const canEdit = hadManualPartRef.current && template;
|
||||
|
||||
console.log("채번 필드 렌더링:", { displayValue, template, manualInputValue, canEdit, isGeneratingNumbering });
|
||||
// 채번 필드 렌더링
|
||||
|
||||
// 템플릿이 없으면 읽기 전용 (아직 생성 전이거나 수동 입력 부분 없음)
|
||||
if (!canEdit) {
|
||||
|
||||
Reference in New Issue
Block a user