From 5fe88759ff433830c6d24fce8e3b0f6ecaff66e4 Mon Sep 17 00:00:00 2001
From: husq <931347610@qq.com>
Date: Thu, 14 Sep 2023 18:21:13 +0800
Subject: [PATCH] 功能修改、接口修改
---
src/components/task/TaskPanel.vue | 71 +++++++++++++----------------------
1 files changed, 27 insertions(+), 44 deletions(-)
diff --git a/src/components/task/TaskPanel.vue b/src/components/task/TaskPanel.vue
index 2955392..a2a42e5 100644
--- a/src/components/task/TaskPanel.vue
+++ b/src/components/task/TaskPanel.vue
@@ -6,12 +6,9 @@
<!-- 执行时间 -->
<template #duration="{ record }">
<div class="flex-row" style="white-space: pre-wrap">
- <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>{{ formatTaskTime(record.begin_time) }}</div>
+ <div>{{ formatTaskTime(record.end_time) }}</div>
</div>
<div class="ml10">
<div>{{ formatTaskTime(record.execute_time) }}</div>
@@ -68,30 +65,30 @@
<div class="action-area">
<a-popconfirm
v-if="record.status === TaskStatus.Wait"
- title="是否删除飞行计划?"
- ok-text="是"
- cancel-text="否"
+ title="你确定要删除该计划吗?"
+ ok-text="确定"
+ cancel-text="取消"
@confirm="onDeleteTask(record.job_id)"
>
<a-button type="primary" size="small">删除</a-button>
</a-popconfirm>
<a-popconfirm
v-if="record.status === TaskStatus.Carrying"
- title="是否暂停?"
- ok-text="是"
- cancel-text="否"
+ title="你确定要暂停该任务吗?"
+ ok-text="确定"
+ cancel-text="取消"
@confirm="onSuspendTask(record.job_id)"
>
<a-button type="primary" size="small">暂停</a-button>
</a-popconfirm>
<a-popconfirm
v-if="record.status === TaskStatus.Paused"
- title="是否重新开始?"
- ok-text="是"
- cancel-text="否"
+ title="你确定要重新开始吗?"
+ ok-text="确定"
+ cancel-text="取消"
@confirm="onResumeTask(record.job_id)"
>
- <a-button type="primary" size="small">重启</a-button>
+ <a-button type="primary" size="small">重新开始</a-button>
</a-popconfirm>
</div>
</template>
@@ -116,7 +113,7 @@
import { ExclamationCircleOutlined, UploadOutlined } from '@ant-design/icons-vue'
const store = useMyStore()
-const workspaceId = store.state.common.projectId
+const workspaceId = localStorage.getItem(ELocalStorageKey.WorkspaceId)!
const body: IPage = {
page: 1,
@@ -146,37 +143,26 @@
slots: { customRender: 'status' }
},
{
- title: '类型',
- dataIndex: 'taskType',
- width: 100,
- slots: { customRender: 'taskType' },
- },
- {
title: '计划名称',
- dataIndex: 'name',
- width: 100,
- },
- {
- title: '航线名称',
- dataIndex: 'fileName',
+ dataIndex: 'job_name',
width: 100,
},
{
title: '设备名称',
- dataIndex: 'dockName',
+ dataIndex: 'dock_name',
width: 100,
ellipsis: true
},
{
- title: '创建人',
- dataIndex: 'username',
- width: 120,
+ title: '相对机场返航高度',
+ dataIndex: 'rth_altitude',
+ width: 140,
},
{
- title: '媒体上传',
- key: 'media_upload',
- width: 160,
- slots: { customRender: 'media_upload' }
+ title: '航线飞行中失联',
+ dataIndex: 'out_of_control_action',
+ width: 140,
+ slots: { customRender: 'lostAction' },
},
{
title: '操作',
@@ -256,15 +242,12 @@
function getPlans () {
getWaylineJobs(workspaceId, body).then(res => {
- console.log('计划数据', res)
- const data = res.data
-
- if (res.code !== 5000) {
+ if (res.code !== 0) {
return
}
- plansData.data = data.records
- paginationProp.total = data.records.total
- paginationProp.current = data.records.current
+ plansData.data = res.data.list
+ paginationProp.total = res.data.pagination.total
+ paginationProp.current = res.data.pagination.page
})
}
--
Gitblit v1.9.3