From b479664c3b17149488badef89ff411013026ac35 Mon Sep 17 00:00:00 2001 From: mmc <1556375442@qq.com> Date: Tue, 2 Jun 2026 10:08:23 +0800 Subject: [PATCH] xx --- src/components/devices/DeviceOverviewPage.tsx | 6 +----- src/components/devices/DeviceStatusPage.tsx | 14 ++++++-------- src/components/devices/DroneVideoPlayer.tsx | 2 +- src/components/devices/WayLinePage.tsx | 1 - 4 files changed, 8 insertions(+), 15 deletions(-) diff --git a/src/components/devices/DeviceOverviewPage.tsx b/src/components/devices/DeviceOverviewPage.tsx index 02897b1..688eb10 100644 --- a/src/components/devices/DeviceOverviewPage.tsx +++ b/src/components/devices/DeviceOverviewPage.tsx @@ -136,13 +136,10 @@ export default function DeviceOverviewPage({ onViewStatus, selectedSn, onDeviceS // MQTT消息处理 const handleMqttMessage = (topic, message) => { - console.log('DeviceOverviewPage MQTT Topic:', topic); - console.log('DeviceOverviewPage MQTT Message:', message); - console.log('实时设备数据:', realtimeDevice); + try { const parsed = JSON.parse(message); - console.log('MQTT解析结果:', parsed); if (parsed.data?.host) { const { host } = parsed.data; @@ -257,7 +254,6 @@ export default function DeviceOverviewPage({ onViewStatus, selectedSn, onDeviceS if (selectedDevice.gateway_sn && selectedDevice.gateway_sn !== selectedDevice.device_sn) { topics.push(`thing/product/${selectedDevice.gateway_sn}/osd`); } - console.log('DeviceOverviewPage 订阅的MQTT主题:', topics); return topics; }, [selectedDevice]); diff --git a/src/components/devices/DeviceStatusPage.tsx b/src/components/devices/DeviceStatusPage.tsx index 4a3752b..04c4d32 100644 --- a/src/components/devices/DeviceStatusPage.tsx +++ b/src/components/devices/DeviceStatusPage.tsx @@ -135,11 +135,9 @@ export default function DeviceStatusPage({ // 当MQTT数据更新时,更新持久化数据(只在有新数据时更新) const handleMqttMessage = (topic, message) => { - console.log('DeviceStatusPage MQTT 消息到达 - Topic:', topic); - console.log('DeviceStatusPage MQTT 消息内容:', message); + try { const parsedMessage = JSON.parse(message); - console.log('DeviceStatusPage 解析后的消息:', parsedMessage); if (parsedMessage.data && parsedMessage.data.host) { const { host } = parsedMessage.data; @@ -571,11 +569,11 @@ export default function DeviceStatusPage({ } bordered={false} - style={{ borderRadius: 12 }} + style={{ borderRadius: 12, marginBottom: 8 }} bodyStyle={{ padding: 12 }} > {!isUAV && ( - + @@ -713,7 +711,7 @@ export default function DeviceStatusPage({ {isUAV ? '无人机状态' : '机器人状态'}详情} bordered={false} - style={{ borderRadius: 12, marginBottom: 16 }} + style={{ borderRadius: 12, marginBottom: 8 }} extra={{device.onlineStatus === 1 ? '在线' : '离线'}} > {isUAV ? ( @@ -771,10 +769,10 @@ export default function DeviceStatusPage({ - + - + diff --git a/src/components/devices/DroneVideoPlayer.tsx b/src/components/devices/DroneVideoPlayer.tsx index 2c81616..bc4def7 100644 --- a/src/components/devices/DroneVideoPlayer.tsx +++ b/src/components/devices/DroneVideoPlayer.tsx @@ -34,7 +34,7 @@ const DroneVideoPlayer: React.FC = ({ else setInternalVideoSource(source); }; - const [selectedCamera, setSelectedCamera] = useState<'indoor' | 'outdoor'>('indoor'); // 默认选择室内 + const [selectedCamera, setSelectedCamera] = useState<'indoor' | 'outdoor'>('outdoor'); // 默认选择室外 const [selectedLens, setSelectedLens] = useState<'wide' | 'zoom' | 'ir'>(''); // 默认选择广角 // 当前选中的摄像头 index const [selectedDroneCameraIdx, setSelectedDroneCameraIdx] = useState(0); diff --git a/src/components/devices/WayLinePage.tsx b/src/components/devices/WayLinePage.tsx index fa30ab4..fc647a0 100644 --- a/src/components/devices/WayLinePage.tsx +++ b/src/components/devices/WayLinePage.tsx @@ -86,7 +86,6 @@ export default function WayLinePage({ onRefresh }) { fetchAllData(); }, [userInfo, stationId]); - const listDroneTimerRef = useRef(null); // 当MQTT数据更新时,更新持久化数据(只在有新数据时更新) const handleMqttMessage = (topic, message) => {