xx
This commit is contained in:
@@ -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]);
|
||||
|
||||
|
||||
@@ -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 && (
|
||||
<Space style={{ marginBottom: 12 }}>
|
||||
<Space style={{ marginBottom: 8 }}>
|
||||
<Button type={mowerView === 'front' ? 'primary' : 'default'} icon={<CameraOutlined />} onClick={() => setMowerView('front')}>前视</Button>
|
||||
<Button type={mowerView === 'back' ? 'primary' : 'default'} onClick={() => setMowerView('back')}>后视</Button>
|
||||
<Button type={mowerView === 'left' ? 'primary' : 'default'} onClick={() => setMowerView('left')}>左视</Button>
|
||||
@@ -713,7 +711,7 @@ export default function DeviceStatusPage({
|
||||
<Card
|
||||
title={<><DashboardOutlined /> {isUAV ? '无人机状态' : '机器人状态'}详情</>}
|
||||
bordered={false}
|
||||
style={{ borderRadius: 12, marginBottom: 16 }}
|
||||
style={{ borderRadius: 12, marginBottom: 8 }}
|
||||
extra={<Tag color={device.onlineStatus === 1 ? 'success' : 'default'}>{device.onlineStatus === 1 ? '在线' : '离线'}</Tag>}
|
||||
>
|
||||
{isUAV ? (
|
||||
@@ -771,10 +769,10 @@ export default function DeviceStatusPage({
|
||||
</Tag>
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label="GPS 卫星数">
|
||||
<Badge count={(currentDroneData || uavState || device).position_state?.gps_number || 0} style={{ backgroundColor: '#1890ff' }} />
|
||||
<Badge showZero count={(currentDroneData || uavState || device).position_state?.gps_number || 0} style={{ backgroundColor: '#1890ff' }} />
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label="RTK 卫星数">
|
||||
<Badge count={(currentDroneData || uavState || device).position_state?.rtk_number || 0} style={{ backgroundColor: '#52c41a' }} />
|
||||
<Badge showZero count={(currentDroneData || uavState || device).position_state?.rtk_number || 0} style={{ backgroundColor: '#52c41a' }} />
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label="RTK 状态">
|
||||
<Tag color={(currentDroneData || uavState || device).position_state?.is_fixed === 2 || (currentDroneData || uavState || device).position_state?.is_fixed === 'fixing_successful' ? 'success' : 'warning'}>
|
||||
|
||||
@@ -34,7 +34,7 @@ const DroneVideoPlayer: React.FC<DroneVideoPlayerProps> = ({
|
||||
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<number>(0);
|
||||
|
||||
@@ -86,7 +86,6 @@ export default function WayLinePage({ onRefresh }) {
|
||||
fetchAllData();
|
||||
}, [userInfo, stationId]);
|
||||
|
||||
const listDroneTimerRef = useRef<any>(null);
|
||||
|
||||
// 当MQTT数据更新时,更新持久化数据(只在有新数据时更新)
|
||||
const handleMqttMessage = (topic, message) => {
|
||||
|
||||
Reference in New Issue
Block a user