Переделана навигация к датчикам, добавлена работа поиска тултипов на модели, добавлен функционал перехода из дашборда и истории тревог к датчику с тревогой на 3д модели

This commit is contained in:
2026-02-03 16:42:15 +03:00
parent eccc564cc7
commit 458222817e
19 changed files with 5111 additions and 61 deletions

View File

@@ -35,13 +35,22 @@ interface MonitoringProps {
}
const Monitoring: React.FC<MonitoringProps> = ({ onClose, onSelectModel }) => {
const { currentObject, currentZones, zonesLoading, zonesError, loadZones } = useNavigationStore();
const { currentObject, currentZones, zonesLoading, zonesError, loadZones, currentModelPath } = useNavigationStore();
const [autoSelectedRef, setAutoSelectedRef] = React.useState(false);
const handleSelectModel = useCallback((modelPath: string) => {
console.log(`[Monitoring] Model selected: ${modelPath}`);
console.log(`[Monitoring] onSelectModel callback:`, onSelectModel);
onSelectModel?.(modelPath);
}, [onSelectModel]);
// Автоматически закрываем панель после выбора модели
if (onClose) {
setTimeout(() => {
console.log('[Monitoring] Auto-closing after model selection');
onClose();
}, 100);
}
}, [onSelectModel, onClose]);
// Загрузка зон при изменении объекта
useEffect(() => {
@@ -51,7 +60,19 @@ const Monitoring: React.FC<MonitoringProps> = ({ onClose, onSelectModel }) => {
loadZones(objId);
}, [currentObject?.id, loadZones]);
// Автоматический выбор первой зоны ОТКЛЮЧЕН - пользователь должен выбрать модель вручную
// Автоматический выбор модели, если currentModelPath установлен (переход из таблицы)
useEffect(() => {
if (!currentModelPath || autoSelectedRef || !onSelectModel) return;
console.log('[Monitoring] Auto-selecting model from currentModelPath:', currentModelPath);
setAutoSelectedRef(true);
onSelectModel(currentModelPath);
}, [currentModelPath, autoSelectedRef, onSelectModel]);
// Сброс флага при изменении объекта
useEffect(() => {
setAutoSelectedRef(false);
}, [currentObject?.id])
const sortedZones: Zone[] = React.useMemo(() => {
const sorted = (currentZones || []).slice().sort((a: Zone, b: Zone) => {