From eee617ca83715e3f705dca2d24fefd023b2a42dd Mon Sep 17 00:00:00 2001 From: mmc <1556375442@qq.com> Date: Thu, 21 May 2026 13:32:11 +0800 Subject: [PATCH] xx --- src/api/device.ts | 96 ++++++++++++++++++++++++++ src/components/devices/WayLinePage.tsx | 10 ++- 2 files changed, 104 insertions(+), 2 deletions(-) diff --git a/src/api/device.ts b/src/api/device.ts index 9939800..fb43784 100644 --- a/src/api/device.ts +++ b/src/api/device.ts @@ -42,4 +42,100 @@ export function getJurisdiction(data) { // +// 获取所有航线 + +export function getsinglePlan(data) { + return request({ + url: `/iot/UAV/getFlightTask?sn=${data.gateway_sn}`, + method: 'get', + }) +} + +// 获取航线轨迹 iot/UAV/getFlightTaskTrack + +export function getsinglePlanTrack(data) { + return request({ + url: `/iot/UAV/getFlightTaskTrack?taskId=${data.uuid}`, + method: 'get', + }) +} + +//上传航线 + +export function uploadWayLine(data) { + return request({ + url: '/iot/UAV/uploadWayline', + method: 'post', + data: data, // 上传文件必须用 data,不能用 params + headers: { + 'Content-Type': 'multipart/form-data' // 上传文件必加! + } + }) +} + +//创建航线任务 +export function createWaylineTask(data) { + return request({ + url: '/iot/UAV/createFlightTask', + method: 'post', + data: data, + }) +} + + + +export function updateFlightTaskStatus(taskId, status) { + return request({ + url: '/iot/UAV/updateFlightTaskStatus', + method: 'post', + params: { taskId, status } + }) +} + +export function getFlightTaskDetail(taskId) { + return request({ + url: '/iot/UAV/getFlightTaskDetail', + method: 'get', + params: { taskId } + }) +} + +/// 航线列表 +export function getWayLine() { + return request({ + url: '/iot/UAV/getWayline', + method: 'get', + }) +} +//直播流 + + +///iot/UAV/flightTaskCommand +export function postFlightCommmand(data) { + return request({ + url: '/iot/UAV/flightTaskCommand', + method: 'post', + data + }) +} + +//切换相机 + +export function changeCamera(data) { + return request({ + url: '/iot/UAV/changeCamera', + method: 'post', + data + }) +} + +//直播心跳 + +export function postLiveHeartbeat(data) { + return request({ + url: `/iot/UAV/liveHeartbeat?sn=${data.sn}&cameraIndex=${data.cameraIndex}`, + method: 'post', + }) +} + diff --git a/src/components/devices/WayLinePage.tsx b/src/components/devices/WayLinePage.tsx index fb9ada0..1ba0cbd 100644 --- a/src/components/devices/WayLinePage.tsx +++ b/src/components/devices/WayLinePage.tsx @@ -1,4 +1,4 @@ -import React, { useState } from 'react'; +import React, { useState, useEffect } from 'react'; import { Row, Col, Card, Button, Space, Table, Tag, Typography, Progress, Badge, Tabs, Input, Switch, Divider, Tooltip, Timeline @@ -31,6 +31,7 @@ import { Maximize2, Target } from 'lucide-react'; +import { getsinglePlan } from '@/src/api/api'; const { Text, Title } = Typography; @@ -104,6 +105,11 @@ export default function WayLinePage() { bg: 'linear-gradient(135deg, #E8F3FF 0%, #BAE0FF 100%)' }, ]; +//useEffect(()=>{ +// getsinglePlan().then(res=>{ + +// }) +//}) return (
@@ -228,7 +234,7 @@ export default function WayLinePage() { {/* 航点列表 */} 航点列表 航线:FL-03} + title={航线列表 航线:FL-03} size="small" extra={} bordered={false}