feat: 렉 구조 컴포넌트 v2 지원 및 불필요한 로그 제거
- 렉 구조 컴포넌트에서 v2-rack-structure를 지원하도록 수정하였습니다. 기존의 rack-structure 컴포넌트는 deprecated 처리되었습니다. - 불필요한 콘솔 로그 메시지를 제거하여 코드의 가독성을 향상시켰습니다. - 관련된 컴포넌트에서 v2 구조에 맞게 변경 사항을 반영하였습니다.
This commit is contained in:
@@ -240,7 +240,6 @@ export const RackStructureComponent: React.FC<RackStructureComponentProps> = ({
|
||||
// 카테고리 코드로 라벨 일괄 조회
|
||||
const response = await getCategoryLabelsByCodes(valuesToLookup);
|
||||
if (response.success && response.data) {
|
||||
console.log("✅ 카테고리 라벨 조회 완료:", response.data);
|
||||
setCategoryLabels((prev) => ({ ...prev, ...response.data }));
|
||||
}
|
||||
} catch (error) {
|
||||
@@ -286,12 +285,6 @@ export const RackStructureComponent: React.FC<RackStructureComponentProps> = ({
|
||||
status: getCategoryLabel(rawStatus),
|
||||
};
|
||||
|
||||
console.log("🏗️ [RackStructure] context 생성:", {
|
||||
fieldMapping,
|
||||
rawValues: { rawFloor, rawZone, rawLocationType, rawStatus },
|
||||
context: ctx,
|
||||
});
|
||||
|
||||
return ctx;
|
||||
}, [propContext, formData, fieldMapping, getCategoryLabel]);
|
||||
|
||||
@@ -384,16 +377,9 @@ export const RackStructureComponent: React.FC<RackStructureComponentProps> = ({
|
||||
// 기존 데이터 조회 (창고/층/구역이 변경될 때마다)
|
||||
useEffect(() => {
|
||||
const loadExistingLocations = async () => {
|
||||
console.log("🏗️ [RackStructure] 기존 데이터 조회 체크:", {
|
||||
warehouseCode: warehouseCodeForQuery,
|
||||
floor: floorForQuery,
|
||||
zone: zoneForQuery,
|
||||
});
|
||||
|
||||
// 필수 조건이 충족되지 않으면 기존 데이터 초기화
|
||||
// DB에는 라벨 값(예: "1층", "A구역")으로 저장되어 있으므로 라벨 값 사용
|
||||
if (!warehouseCodeForQuery || !floorForQuery || !zoneForQuery) {
|
||||
console.log("⚠️ [RackStructure] 필수 조건 미충족 - 조회 스킵");
|
||||
setExistingLocations([]);
|
||||
setDuplicateErrors([]);
|
||||
return;
|
||||
@@ -409,7 +395,6 @@ export const RackStructureComponent: React.FC<RackStructureComponentProps> = ({
|
||||
floor: { value: floorForQuery, operator: "equals" },
|
||||
zone: { value: zoneForQuery, operator: "equals" },
|
||||
};
|
||||
console.log("🔍 기존 위치 데이터 조회 시작 (정확한 일치):", searchParams);
|
||||
|
||||
// 직접 apiClient 사용하여 정확한 형식으로 요청
|
||||
// 백엔드는 search를 객체로 받아서 각 필드를 WHERE 조건으로 처리
|
||||
@@ -421,8 +406,6 @@ export const RackStructureComponent: React.FC<RackStructureComponentProps> = ({
|
||||
autoFilter: true, // 회사별 데이터 필터링 (멀티테넌시)
|
||||
});
|
||||
|
||||
console.log("🔍 기존 위치 데이터 응답:", response.data);
|
||||
|
||||
// API 응답 구조: { success: true, data: { data: [...], total, ... } }
|
||||
const responseData = response.data?.data || response.data;
|
||||
const dataArray = Array.isArray(responseData) ? responseData : responseData?.data || [];
|
||||
@@ -434,9 +417,7 @@ export const RackStructureComponent: React.FC<RackStructureComponentProps> = ({
|
||||
location_code: item.location_code,
|
||||
}));
|
||||
setExistingLocations(existing);
|
||||
console.log("✅ 기존 위치 데이터 조회 완료:", existing.length, "개", existing);
|
||||
} else {
|
||||
console.log("⚠️ 기존 위치 데이터 없음 또는 조회 실패");
|
||||
setExistingLocations([]);
|
||||
}
|
||||
} catch (error) {
|
||||
@@ -533,14 +514,6 @@ export const RackStructureComponent: React.FC<RackStructureComponentProps> = ({
|
||||
|
||||
// 미리보기 생성
|
||||
const generatePreview = useCallback(() => {
|
||||
console.log("🔍 [generatePreview] 검증 시작:", {
|
||||
missingFields,
|
||||
hasRowOverlap,
|
||||
hasDuplicateWithExisting,
|
||||
duplicateErrorsCount: duplicateErrors.length,
|
||||
existingLocationsCount: existingLocations.length,
|
||||
});
|
||||
|
||||
// 필수 필드 검증
|
||||
if (missingFields.length > 0) {
|
||||
alert(`다음 필드를 먼저 입력해주세요: ${missingFields.join(", ")}`);
|
||||
@@ -607,17 +580,6 @@ export const RackStructureComponent: React.FC<RackStructureComponentProps> = ({
|
||||
setPreviewData(locations);
|
||||
setIsPreviewGenerated(true);
|
||||
|
||||
console.log("🏗️ [RackStructure] 생성된 위치 데이터:", {
|
||||
locationsCount: locations.length,
|
||||
firstLocation: locations[0],
|
||||
context: {
|
||||
warehouseCode: context?.warehouseCode,
|
||||
warehouseName: context?.warehouseName,
|
||||
floor: context?.floor,
|
||||
zone: context?.zone,
|
||||
},
|
||||
});
|
||||
|
||||
onChange?.(locations);
|
||||
}, [
|
||||
conditions,
|
||||
|
||||
Reference in New Issue
Block a user