| | |
| | | waylineId:string |
| | | dockSn: string |
| | | workspaceId: string |
| | | taskType: number |
| | | taskType: TaskType |
| | | executeSingleTime?: string |
| | | repeatExecuteTimeArr?: string[] |
| | | executeStartTime?: string |
| | |
| | | form.outOfControl = planForm.outOfControl |
| | | form.breakContinue = planForm.breakContinue |
| | | form.finishAction = planForm.finishAction |
| | | form.status = 1 |
| | | |
| | | // 根据不同任务策略给form添加不同字段 |
| | | if (planForm.taskType === TaskType.Timed) { |
| | |
| | | <!-- 执行时间 --> |
| | | <template #duration="{ record }"> |
| | | <div class="flex-row" style="white-space: pre-wrap"> |
| | | <div> |
| | | <div>{{ formatTaskTime(record.begin_time) }}</div> |
| | | <div>{{ formatTaskTime(record.end_time) }}</div> |
| | | <div v-if="record.taskType >2"> |
| | | <div>{{ formatTaskTime(record.executeStartTime) }}</div> |
| | | <div>{{ formatTaskTime(record.executeEndTime) }}</div> |
| | | </div> |
| | | <div v-else> |
| | | <div>{{formatTaskTime(record.executeSingleTime)}}</div> |
| | | </div> |
| | | <div class="ml10"> |
| | | <div>{{ formatTaskTime(record.execute_time) }}</div> |
| | |
| | | <div class="action-area"> |
| | | <a-popconfirm |
| | | v-if="record.status === TaskStatus.Wait" |
| | | title="Are you sure you want to delete flight task?" |
| | | ok-text="Yes" |
| | | cancel-text="No" |
| | | title="是否删除飞行计划?" |
| | | ok-text="是" |
| | | cancel-text="否" |
| | | @confirm="onDeleteTask(record.job_id)" |
| | | > |
| | | <a-button type="primary" size="small">Delete</a-button> |
| | | <a-button type="primary" size="small">删除</a-button> |
| | | </a-popconfirm> |
| | | <a-popconfirm |
| | | v-if="record.status === TaskStatus.Carrying" |
| | | title="Are you sure you want to suspend?" |
| | | ok-text="Yes" |
| | | cancel-text="No" |
| | | title="是否暂停?" |
| | | ok-text="是" |
| | | cancel-text="否" |
| | | @confirm="onSuspendTask(record.job_id)" |
| | | > |
| | | <a-button type="primary" size="small">Suspend</a-button> |
| | | <a-button type="primary" size="small">暂停</a-button> |
| | | </a-popconfirm> |
| | | <a-popconfirm |
| | | v-if="record.status === TaskStatus.Paused" |
| | | title="Are you sure you want to resume?" |
| | | ok-text="Yes" |
| | | cancel-text="No" |
| | | title="是否重新开始?" |
| | | ok-text="是" |
| | | cancel-text="否" |
| | | @confirm="onResumeTask(record.job_id)" |
| | | > |
| | | <a-button type="primary" size="small">Resume</a-button> |
| | | <a-button type="primary" size="small">重启</a-button> |
| | | </a-popconfirm> |
| | | </div> |
| | | </template> |
| | |
| | | import { DEFAULT_PLACEHOLDER } from '/@/utils/constants' |
| | | import { Task } from '/@/api/wayline' |
| | | import {Task, waylineJob} from '/@/api/wayline' |
| | | import { TaskStatusColor, TaskStatusMap, TaskTypeMap, OutOfControlActionMap, MediaStatusMap, MediaStatusColorMap, MediaStatus } from '/@/types/task' |
| | | import { isNil } from 'lodash' |
| | | |
| | | export function useFormatTask () { |
| | | function formatTaskType (task: Task) { |
| | | return TaskTypeMap[task.task_type] || DEFAULT_PLACEHOLDER |
| | | function formatTaskType (task: waylineJob) { |
| | | return TaskTypeMap[task.taskType] || DEFAULT_PLACEHOLDER |
| | | } |
| | | |
| | | function formatTaskTime (time: string) { |
| | |
| | | import { getRoot } from '/@/root' |
| | | |
| | | import * as Cesium from 'cesium' |
| | | let kmlDataSource = null |
| | | |
| | | const { appContext } = getCurrentInstance() |
| | | const global = appContext.config.globalProperties |
| | |
| | | getWaylineFiles({ |
| | | workspaceId: projectId, |
| | | }).then(res => { |
| | | console.log(res, '+++++++++++++++++++++++++++++++++++++') |
| | | |
| | | if (res.code !== 5000) { |
| | | return |
| | | } |
| | |
| | | } |
| | | |
| | | function selectRoute (wayline: WaylineFile) { |
| | | console.log(global, '+++++++++++') |
| | | initKmlFile('/src/assets/kmz/test.kmz') |
| | | // store.commit('SET_SELECT_WAYLINE_INFO', wayline) |
| | | } |
| | | |
| | | function initKmlFile (file:string) { |
| | | const options = { |
| | | camera: global.$viewer.scene.camera, |
| | | canvas: global.$viewer.scene.canvas, |
| | |
| | | } |
| | | global.$viewer.dataSources.add( |
| | | Cesium.KmlDataSource.load( |
| | | '/src/assets/kmz/test.kmz', |
| | | file, |
| | | options |
| | | )).then(res => { |
| | | console.log(res, '+++++++++++++++++++') |
| | | }) |
| | | kmlDataSource = res |
| | | kmlDataSource.show = true |
| | | |
| | | // store.commit('SET_SELECT_WAYLINE_INFO', wayline) |
| | | console.log('Entits数组', kmlDataSource.entities.values) |
| | | |
| | | const kmlEntityArr = kmlDataSource.entities.values[0]._children |
| | | const cartesianArr = [] |
| | | for (let i = 0; i < kmlEntityArr.length; i++) { |
| | | const entity = kmlEntityArr[i] |
| | | entity.point = new Cesium.PointGraphics({ |
| | | pixelSize: 12, |
| | | color: Cesium.Color.RED, |
| | | outlineColor: Cesium.Color.WHITE, |
| | | }) |
| | | entity.billboard = null |
| | | |
| | | cartesianArr.push(entity.position._value) |
| | | } |
| | | |
| | | const lineEntity = global.$viewer.entities.add({ |
| | | name: 'entityLine', |
| | | polyline: { |
| | | positions: cartesianArr, |
| | | width: 10, |
| | | material: new Cesium.PolylineArrowMaterialProperty(Cesium.Color.CYAN), |
| | | }, |
| | | }) |
| | | |
| | | global.$viewer.flyTo(lineEntity) |
| | | }) |
| | | } |
| | | |
| | | function onScroll (e: any) { |
| | |
| | | } |
| | | |
| | | export const TaskStatusMap = { |
| | | [TaskStatus.Wait]: 'To be performed', |
| | | [TaskStatus.Carrying]: 'In progress', |
| | | [TaskStatus.Success]: 'Task completed', |
| | | [TaskStatus.CanCel]: 'Task canceled', |
| | | [TaskStatus.Fail]: 'Task failed', |
| | | [TaskStatus.Paused]: 'Paused', |
| | | [TaskStatus.Wait]: '待执行', |
| | | [TaskStatus.Carrying]: '进行中', |
| | | [TaskStatus.Success]: '任务完成', |
| | | [TaskStatus.CanCel]: '任务取消', |
| | | [TaskStatus.Fail]: '任务失败', |
| | | [TaskStatus.Paused]: '已暂停', |
| | | |
| | | } |
| | | |