-
云台控制 / GIMBAL
+
+ 云台控制 / GIMBAL
+ {drcMode && (
+ DRC模式
+ )}
+
云台方向
-
-
-
-
+
+
+
+
diff --git a/zlt-web/react-web-next/src/pages/device/mapDashboard/components/MapContainer/3d/BottomPanel/RightPanel.tsx b/zlt-web/react-web-next/src/pages/device/mapDashboard/components/MapContainer/3d/BottomPanel/RightPanel.tsx
index eac9da0b..50a3ada9 100644
--- a/zlt-web/react-web-next/src/pages/device/mapDashboard/components/MapContainer/3d/BottomPanel/RightPanel.tsx
+++ b/zlt-web/react-web-next/src/pages/device/mapDashboard/components/MapContainer/3d/BottomPanel/RightPanel.tsx
@@ -1,5 +1,5 @@
import React, { useState, useEffect } from 'react';
-import { Spin, Empty, message, Tooltip, Tabs, Progress } from 'antd';
+import { Spin, Empty, message, Tooltip, Tabs, Progress, Modal } from 'antd';
import {
CloseOutlined,
EnvironmentOutlined,
@@ -9,6 +9,7 @@ import {
ThunderboltOutlined,
DashboardOutlined,
SignalFilled,
+ LoadingOutlined,
} from '@ant-design/icons';
import { deviceApi } from '@/services/device';
import { ordersApi } from '@/services/orders';
@@ -24,15 +25,16 @@ interface RightPanelProps {
onControlClick: (device: any, realtimeData: any) => void;
}
-const RightPanel: React.FC
= ({
- visible,
- tourism,
+const RightPanel: React.FC = ({
+ visible,
+ tourism,
onClose,
- onControlClick
+ onControlClick
}) => {
const [deviceList, setDeviceList] = useState([]);
const [selectedDeviceSn, setSelectedDeviceSn] = useState('');
const [loading, setLoading] = useState(false);
+ const [takeoffLoading, setTakeoffLoading] = useState(false);
const { realtimeData, sseConnected, connectSSE, disconnectSSE } = useDeviceSSE();
@@ -85,6 +87,73 @@ const RightPanel: React.FC = ({
const formatValue = (val: any, unit: string = '') => (val !== undefined && val !== null ? `${val}${unit}` : '-');
+ // 一键起飞
+ const handleTakeoff = () => {
+ const dockData = realtimeData?.rawData?.dockData;
+
+ // 检查机库状态
+ if (dockData?.mode_code === 1) {
+ message.warning('机库正在执行任务,无法起飞');
+ return;
+ }
+
+ // 只有明确知道无人机不在库时才阻止(值为0时)
+ if (dockData?.drone_in_dock === 0) {
+ message.warning('无人机不在库,无法起飞');
+ return;
+ }
+
+ // 获取机库位置信息
+ const dockLatitude = dockData?.latitude || realtimeData?.gps?.latitude;
+ const dockLongitude = dockData?.longitude || realtimeData?.gps?.longitude;
+ const dockHeight = dockData?.height || realtimeData?.gps?.altitude || 0;
+
+ if (!dockLatitude || !dockLongitude) {
+ message.error('无法获取机库位置信息');
+ return;
+ }
+
+ // 弹窗确认
+ Modal.confirm({
+ title: '确认一键起飞',
+ content: (
+
+
无人机将自动开机并起飞到指定位置
+
+ 目标坐标: {dockLatitude.toFixed(6)}, {dockLongitude.toFixed(6)}
+ 目标高度: {(dockHeight + 30).toFixed(1)}m (机库高度+30m)
+
+
+ ),
+ okText: '确认起飞',
+ cancelText: '取消',
+ onOk: async () => {
+ setTakeoffLoading(true);
+ try {
+ const res = await deviceApi.takeoff({
+ deviceSn: selectedDeviceSn,
+ targetLatitude: dockLatitude,
+ targetLongitude: dockLongitude,
+ targetHeight: dockHeight + 30,
+ securityTakeoffHeight: 50,
+ rthAltitude: 50,
+ maxSpeed: 5,
+ });
+
+ if (res.code === 0) {
+ message.success('起飞命令已发送,无人机将自动开机并起飞');
+ } else {
+ message.error(res.msg || '起飞命令发送失败');
+ }
+ } catch (error: any) {
+ message.error(error.message || '起飞命令发送失败');
+ } finally {
+ setTakeoffLoading(false);
+ }
+ },
+ });
+ };
+
const renderItem = (label: string, value: any, unit: string = '', status: 'normal'|'warning'|'error'|'success' = 'normal') => (
{label}
@@ -190,8 +259,11 @@ const RightPanel: React.FC
= ({
-
diff --git a/zlt-web/react-web-next/src/pages/device/mapDashboard/components/MapContainer/3d/hooks/useDeviceSSE.ts b/zlt-web/react-web-next/src/pages/device/mapDashboard/components/MapContainer/3d/hooks/useDeviceSSE.ts
index 50769ab6..682c8572 100644
--- a/zlt-web/react-web-next/src/pages/device/mapDashboard/components/MapContainer/3d/hooks/useDeviceSSE.ts
+++ b/zlt-web/react-web-next/src/pages/device/mapDashboard/components/MapContainer/3d/hooks/useDeviceSSE.ts
@@ -14,6 +14,60 @@ export interface DockData {
[key: string]: any;
}
+// 无人机遥测数据接口定义
+export interface DroneData {
+ // 飞行姿态
+ attitude_pitch?: number; // 俯仰角 (度)
+ attitude_roll?: number; // 横滚角 (度)
+ attitude_head?: number; // 偏航角/航向 (度)
+
+ // 速度
+ horizontal_speed?: number; // 水平速度 (m/s)
+ vertical_speed?: number; // 垂直速度 (m/s)
+ ground_speed?: number; // 地面速度 (m/s)
+
+ // 位置
+ latitude?: number; // 纬度
+ longitude?: number; // 经度
+ height?: number; // 高度 (m)
+ elevation?: number; // 海拔高度 (m)
+ home_distance?: number; // 距Home点距离 (m)
+
+ // 电池
+ battery?: {
+ capacity_percent?: number; // 电量百分比
+ voltage?: number; // 电压 (mV)
+ temperature?: number; // 温度 (°C)
+ remain_flight_time?: number; // 剩余飞行时间 (s)
+ };
+
+ // 飞行模式
+ mode_code?: number; // 飞行模式代码
+ gear?: number; // 档位
+
+ // RTK/GPS
+ position_state?: {
+ rtk_number?: number; // RTK 卫星数
+ gps_number?: number; // GPS 卫星数
+ is_fixed?: number; // 是否固定 (1=FIX)
+ };
+
+ // 云台
+ gimbal_pitch?: number; // 云台俯仰角
+ gimbal_roll?: number; // 云台横滚角
+ gimbal_yaw?: number; // 云台偏航角
+
+ // 其他
+ wind_speed?: number; // 风速 (m/s)
+ wind_direction?: number; // 风向 (度)
+ storage?: {
+ total?: number; // 存储总容量
+ used?: number; // 已使用容量
+ };
+
+ [key: string]: any;
+}
+
// 实时数据
export interface RealtimeData {
deviceSn: string;
@@ -26,7 +80,9 @@ export interface RealtimeData {
flightStatus?: string;
timestamp?: number;
rawData?: {
- dockData?: any;
+ dockData?: any; // 机库状态数据 (fire_alarm)
+ droneData?: DroneData; // 无人机遥测数据 (msg_alarm)
+ msgAlarmData?: any; // msg_alarm 完整数据
[key: string]: any;
};
}
diff --git a/zlt-web/react-web-next/src/pages/device/mapDashboard/components/MapContainer/3d/hooks/useTilesetLoader.ts b/zlt-web/react-web-next/src/pages/device/mapDashboard/components/MapContainer/3d/hooks/useTilesetLoader.ts
index f48b7485..23d858d3 100644
--- a/zlt-web/react-web-next/src/pages/device/mapDashboard/components/MapContainer/3d/hooks/useTilesetLoader.ts
+++ b/zlt-web/react-web-next/src/pages/device/mapDashboard/components/MapContainer/3d/hooks/useTilesetLoader.ts
@@ -13,7 +13,10 @@ export interface TilesetConfig {
position?: { // 模型位置调整
longitude?: number; // 经度偏移
latitude?: number; // 纬度偏移
- height?: number; // 高度偏移
+ height?: number; // 高度偏移(通用)
+ cesiumHeight?: number; // Cesium Ion地形对应的高度偏移
+ arcgisHeight?: number; // ArcGIS地形对应的高度偏移
+ terrainType?: string; // 高度标定时使用的地形服务: cesium_ion/arcgis/ellipsoid
};
transform?: { // 模型变换
scale?: number; // 缩放比例
@@ -42,7 +45,7 @@ export interface TilesetState {
// Hook返回类型
export interface UseTilesetLoaderResult {
tilesets: Map