From 1ef360a14efab8a1defa1dfdc13bb5af64a9d621 Mon Sep 17 00:00:00 2001
From: husq <931347610@qq.com>
Date: Mon, 18 Sep 2023 17:02:51 +0800
Subject: [PATCH] 飞行指令打开
---
src/api/wayline.ts | 32 +++++++++++++++++++++++++++-----
1 files changed, 27 insertions(+), 5 deletions(-)
diff --git a/src/api/wayline.ts b/src/api/wayline.ts
index 230b7a9..7ce981c 100644
--- a/src/api/wayline.ts
+++ b/src/api/wayline.ts
@@ -3,7 +3,7 @@
import { TaskType, TaskStatus, OutOfControlAction } from '/@/types/task'
import { WaylineType } from '/@/types/wayline'
-const HTTP_PREFIX = 'drone/waylineFile'
+const HTTP_PREFIX = '/wayline/api/v1'
// Get Wayline Files
export const getWaylineFiles = async function (wid: string, body: {}): Promise<IWorkspaceResponse<any>> {
@@ -36,6 +36,29 @@
return result.data
}
+export interface waylineJob {
+ name: string
+ fileId: string
+ waylineId:string
+ dockSn: string
+ workspaceId: string
+ taskType: TaskType
+ executeSingleTime?: string
+ repeatExecuteTimeArr?: string[]
+ executeStartTime?: string
+ executeEndTime?: string
+ executeRepeatTime?: string[]
+ frequencyValue?: number
+ frequencyType?: number
+ repeatRuleType?: number
+ repeatRuleValueDay?: number[]
+ repeatRuleValueWeek?: number[]
+ startPower: number
+ rthAltitude: number
+ outOfControl: number
+ finishAction: number
+ breakContinue: number
+}
export interface CreatePlan {
name: string,
file_id: string,
@@ -47,8 +70,7 @@
rth_altitude: number // 相对机场返航高度 20 - 500
out_of_control_action: OutOfControlAction // 失控动作
}
-
-// Create Wayline Job
+// 新增计划
export const createPlan = async function (workspaceId: string, plan: CreatePlan): Promise<IWorkspaceResponse<any>> {
const url = `${HTTP_PREFIX}/workspaces/${workspaceId}/flight-tasks`
const result = await request.post(url, plan)
@@ -80,7 +102,7 @@
uploaded_count: number // 已上传媒体数量
}
-// Get Wayline Jobs
+// 获取计划列表(分页)
export const getWaylineJobs = async function (workspaceId: string, page: IPage): Promise<IListWorkspaceResponse<Task>> {
const url = `${HTTP_PREFIX}/workspaces/${workspaceId}/jobs?page=${page.page}&page_size=${page.page_size}`
const result = await request.get(url)
@@ -120,7 +142,7 @@
// Upload Wayline file
export const importKmzFile = async function (workspaceId: string, file: {}): Promise<IWorkspaceResponse<any>> {
- const url = `api/${HTTP_PREFIX}/upload`
+ const url = `${HTTP_PREFIX}/workspaces/${workspaceId}/waylines/file/upload`
const result = await request.post(url, file, {
headers: {
'Content-Type': 'multipart/form-data',
--
Gitblit v1.9.3