Добавлены отладочные логи для отслеживания значений SSD в компонентах QuickDetailSection и UnitDetailsSection. Обновлены GraphQL запросы для включения поля ssd. Отключено кэширование для получения актуальных данных SSD в UnitDetailsSection.

This commit is contained in:
Bivekich
2025-07-03 15:35:37 +03:00
parent 513163b174
commit 5b8ff6c02e
4 changed files with 57 additions and 4 deletions

View File

@ -209,11 +209,21 @@ const QuickDetailSection: React.FC<QuickDetailSectionProps> = ({
// Если выбран узел для детального просмотра, показываем UnitDetailsSection // Если выбран узел для детального просмотра, показываем UnitDetailsSection
if (selectedUnit) { if (selectedUnit) {
const unitSsd = selectedUnit.ssd || ssd;
console.log('🔍 QuickDetailSection передает в UnitDetailsSection:', {
unitSsd: unitSsd ? `${unitSsd.substring(0, 50)}...` : 'отсутствует',
unitSsdLength: unitSsd?.length,
selectedUnitSsd: selectedUnit.ssd ? `${selectedUnit.ssd.substring(0, 50)}...` : 'отсутствует',
fallbackSsd: ssd ? `${ssd.substring(0, 50)}...` : 'отсутствует',
unitId: selectedUnit.unitid,
unitName: selectedUnit.name
});
return ( return (
<UnitDetailsSection <UnitDetailsSection
catalogCode={catalogCode} catalogCode={catalogCode}
vehicleId={vehicleId} vehicleId={vehicleId}
ssd={selectedUnit.ssd || ssd} // Используем SSD узла ssd={unitSsd} // Используем SSD узла
unitId={selectedUnit.unitid} unitId={selectedUnit.unitid}
unitName={selectedUnit.name} unitName={selectedUnit.name}
onBack={handleBackFromUnit} onBack={handleBackFromUnit}

View File

@ -29,7 +29,22 @@ const UnitDetailsSection: React.FC<UnitDetailsSectionProps> = ({
const [isBrandModalOpen, setIsBrandModalOpen] = useState(false); const [isBrandModalOpen, setIsBrandModalOpen] = useState(false);
const [selectedDetail, setSelectedDetail] = useState<LaximoUnitDetail | null>(null); const [selectedDetail, setSelectedDetail] = useState<LaximoUnitDetail | null>(null);
// Отладочная информация для SSD
console.log('🔍 UnitDetailsSection получил SSD:', {
ssd: ssd ? `${ssd.substring(0, 50)}...` : 'отсутствует',
ssdLength: ssd?.length,
unitId,
unitName
});
// Получаем информацию об узле // Получаем информацию об узле
console.log('🔍 UnitDetailsSection - GET_LAXIMO_UNIT_INFO SSD:', {
ssd: ssd ? `${ssd.substring(0, 50)}...` : 'отсутствует',
ssdLength: ssd?.length,
unitId,
unitName
});
const { data: unitInfoData, loading: unitInfoLoading, error: unitInfoError } = useQuery<{ laximoUnitInfo: LaximoUnitInfo }>( const { data: unitInfoData, loading: unitInfoLoading, error: unitInfoError } = useQuery<{ laximoUnitInfo: LaximoUnitInfo }>(
GET_LAXIMO_UNIT_INFO, GET_LAXIMO_UNIT_INFO,
{ {
@ -40,11 +55,20 @@ const UnitDetailsSection: React.FC<UnitDetailsSectionProps> = ({
ssd: ssd || '' ssd: ssd || ''
}, },
skip: !catalogCode || vehicleId === undefined || vehicleId === null || !unitId, skip: !catalogCode || vehicleId === undefined || vehicleId === null || !unitId,
errorPolicy: 'all' errorPolicy: 'all',
fetchPolicy: 'no-cache', // Отключаем кэширование для получения актуального SSD
notifyOnNetworkStatusChange: true
} }
); );
// Получаем детали узла // Получаем детали узла
console.log('🔍 UnitDetailsSection - GET_LAXIMO_UNIT_DETAILS SSD:', {
ssd: ssd ? `${ssd.substring(0, 50)}...` : 'отсутствует',
ssdLength: ssd?.length,
unitId,
unitName
});
const { data: unitDetailsData, loading: unitDetailsLoading, error: unitDetailsError } = useQuery<{ laximoUnitDetails: LaximoUnitDetail[] }>( const { data: unitDetailsData, loading: unitDetailsLoading, error: unitDetailsError } = useQuery<{ laximoUnitDetails: LaximoUnitDetail[] }>(
GET_LAXIMO_UNIT_DETAILS, GET_LAXIMO_UNIT_DETAILS,
{ {
@ -55,11 +79,20 @@ const UnitDetailsSection: React.FC<UnitDetailsSectionProps> = ({
ssd: ssd || '' ssd: ssd || ''
}, },
skip: !catalogCode || vehicleId === undefined || vehicleId === null || !unitId, skip: !catalogCode || vehicleId === undefined || vehicleId === null || !unitId,
errorPolicy: 'all' errorPolicy: 'all',
fetchPolicy: 'no-cache', // Отключаем кэширование для получения актуального SSD
notifyOnNetworkStatusChange: true
} }
); );
// Получаем карту изображений узла // Получаем карту изображений узла
console.log('🔍 UnitDetailsSection - GET_LAXIMO_UNIT_IMAGE_MAP SSD:', {
ssd: ssd ? `${ssd.substring(0, 50)}...` : 'отсутствует',
ssdLength: ssd?.length,
unitId,
unitName
});
const { data: unitImageMapData, loading: unitImageMapLoading, error: unitImageMapError } = useQuery<{ laximoUnitImageMap: LaximoUnitImageMap }>( const { data: unitImageMapData, loading: unitImageMapLoading, error: unitImageMapError } = useQuery<{ laximoUnitImageMap: LaximoUnitImageMap }>(
GET_LAXIMO_UNIT_IMAGE_MAP, GET_LAXIMO_UNIT_IMAGE_MAP,
{ {
@ -70,7 +103,9 @@ const UnitDetailsSection: React.FC<UnitDetailsSectionProps> = ({
ssd: ssd || '' ssd: ssd || ''
}, },
skip: !catalogCode || vehicleId === undefined || vehicleId === null || !unitId, skip: !catalogCode || vehicleId === undefined || vehicleId === null || !unitId,
errorPolicy: 'all' errorPolicy: 'all',
fetchPolicy: 'no-cache', // Отключаем кэширование для получения актуального SSD
notifyOnNetworkStatusChange: true
} }
); );

View File

@ -860,6 +860,7 @@ export const GET_LAXIMO_UNITS = gql`
code code
imageurl imageurl
largeimageurl largeimageurl
ssd
children { children {
quickgroupid quickgroupid
name name
@ -867,6 +868,7 @@ export const GET_LAXIMO_UNITS = gql`
code code
imageurl imageurl
largeimageurl largeimageurl
ssd
children { children {
quickgroupid quickgroupid
name name
@ -874,6 +876,7 @@ export const GET_LAXIMO_UNITS = gql`
code code
imageurl imageurl
largeimageurl largeimageurl
ssd
} }
} }
} }
@ -892,6 +895,7 @@ export const GET_LAXIMO_QUICK_DETAIL = gql`
description description
imageurl imageurl
largeimageurl largeimageurl
ssd
details { details {
detailid detailid
name name

View File

@ -84,6 +84,7 @@ export const GET_LAXIMO_UNITS = gql`
code code
imageurl imageurl
largeimageurl largeimageurl
ssd
children { children {
quickgroupid quickgroupid
name name
@ -91,6 +92,7 @@ export const GET_LAXIMO_UNITS = gql`
code code
imageurl imageurl
largeimageurl largeimageurl
ssd
children { children {
quickgroupid quickgroupid
name name
@ -98,6 +100,7 @@ export const GET_LAXIMO_UNITS = gql`
code code
imageurl imageurl
largeimageurl largeimageurl
ssd
} }
} }
} }
@ -135,6 +138,7 @@ export const GET_LAXIMO_QUICK_DETAIL = gql`
code code
imageurl imageurl
largeimageurl largeimageurl
ssd
details { details {
detailid detailid
name name