| | |
| | | // Get Wayline Files |
| | | export const getWaylineFiles = async function (params:any): Promise<IWorkspaceResponse<any>> { |
| | | const url = `${HTTP_PREFIX}/waylineFile/getList` |
| | | const result = await request.get(url,{ params }) |
| | | const result = await request.get(url, { params }) |
| | | return result.data |
| | | } |
| | | |
| | |
| | | breakContinue: number |
| | | } |
| | | |
| | | |
| | | |
| | | // 新增计划 |
| | | export const createPlan = async function (plan:any): Promise<IWorkspaceResponse<any>> { |
| | | const url = `${HTTP_PREFIX}/waylineJob/add` |
| | |
| | | // 获取计划列表(分页) |
| | | export const getWaylineJobs = async function (workspaceId: string, page: IPage): Promise<IListWorkspaceResponse<Task>> { |
| | | const url = `${HTTP_PREFIX}/waylineJob/getPage` |
| | | const result = await request.get(url,{params:{workspaceId}}) |
| | | const result = await request.get(url, { params: { workspaceId } }) |
| | | return result.data |
| | | } |
| | | |
| | |
| | | export const importKmzFile = async function (workspaceId: string, file: {}): Promise<IWorkspaceResponse<any>> { |
| | | const url = `${HTTP_PREFIX}/waylineFile/upload` |
| | | const result = await request.post(url, file, { |
| | | params:{ |
| | | params: { |
| | | projectId: workspaceId |
| | | }, |
| | | headers: { |
| | |
| | | import { DEFAULT_PLACEHOLDER } from '/@/utils/constants' |
| | | import {Task, waylineJob} from '/@/api/wayline' |
| | | import { Task, waylineJob } from '/@/api/wayline' |
| | | import { TaskStatusColor, TaskStatusMap, TaskTypeMap, OutOfControlActionMap, MediaStatusMap, MediaStatusColorMap, MediaStatus } from '/@/types/task' |
| | | import { isNil } from 'lodash' |
| | | |
| | |
| | | Immediate = 1, // 立即执行 |
| | | Timed = 2, // 单次定时任务 |
| | | RepeatTimed = 3, // 重复定时任务 |
| | | Continuous//连续执行 |
| | | Continuous// 连续执行 |
| | | } |
| | | |
| | | export const TaskTypeMap = { |
| | |
| | | { value: TaskType.Continuous, label: TaskTypeMap[TaskType.Continuous] }, |
| | | ] |
| | | |
| | | //频率类型 |
| | | // 频率类型 |
| | | export enum FrequencyType { |
| | | day = 1, // 日 |
| | | week = 2, // 周 |
| | |
| | | [FrequencyType.month]: '月', |
| | | } |
| | | |
| | | |
| | | export const FrequencyTypeOptions = [ |
| | | { value: FrequencyType.month, label: FrequencyTypeMap[FrequencyType.month]}, |
| | | { value: FrequencyType.month, label: FrequencyTypeMap[FrequencyType.month] }, |
| | | { value: FrequencyType.week, label: FrequencyTypeMap[FrequencyType.week] }, |
| | | { value: FrequencyType.day, label: FrequencyTypeMap[FrequencyType.day] }, |
| | | ] |
| | |
| | | [RepeatRuleType.week]: '按星期', |
| | | } |
| | | |
| | | export const RepeatRuleTypeOptions=[ |
| | | export const RepeatRuleTypeOptions = [ |
| | | { value: RepeatRuleType.day, label: RepeatRuleTypeMap[RepeatRuleType.day] }, |
| | | { value: RepeatRuleType.week, label: RepeatRuleTypeMap[RepeatRuleType.week] }, |
| | | ] |
| | | |
| | | export const WhichWeekOptions = [ |
| | | {value: 1, label: '第一个'}, |
| | | {value: 2, label: '第二个'}, |
| | | {value: 3, label: '第三个'}, |
| | | {value: 4, label: '第四个'}, |
| | | { value: 1, label: '第一个' }, |
| | | { value: 2, label: '第二个' }, |
| | | { value: 3, label: '第三个' }, |
| | | { value: 4, label: '第四个' }, |
| | | ] |
| | | export const WhichDayOptions = [ |
| | | {value: 7, label: '周日'}, |
| | | {value: 1, label: '周一'}, |
| | | {value: 2, label: '周二'}, |
| | | {value: 3, label: '周三'}, |
| | | {value: 4, label: '周四'}, |
| | | {value: 5, label: '周五'}, |
| | | {value: 6, label: '周六'}, |
| | | { value: 7, label: '周日' }, |
| | | { value: 1, label: '周一' }, |
| | | { value: 2, label: '周二' }, |
| | | { value: 3, label: '周三' }, |
| | | { value: 4, label: '周四' }, |
| | | { value: 5, label: '周五' }, |
| | | { value: 6, label: '周六' }, |
| | | ] |
| | | |
| | | |
| | | // 失控动作 |
| | | export enum OutOfControlAction { |
| | | ReturnToHome = 0, //返航 |
| | | Hover = 1, //盘旋 |
| | | Land = 2, //降落 |
| | | Continue//继续执行 |
| | | ReturnToHome = 0, // 返航 |
| | | Hover = 1, // 盘旋 |
| | | Land = 2, // 降落 |
| | | Continue// 继续执行 |
| | | } |
| | | |
| | | export const OutOfControlActionMap = { |
| | |
| | | ] |
| | | |
| | | export const FinishActionOptions = [ |
| | | {value:1,label:"自动返航"} |
| | | { value: 1, label: '自动返航' } |
| | | ] |
| | | |
| | | // 任务状态 |