|
|
@@ -12,11 +12,11 @@
|
|
|
</a-checkbox>
|
|
|
</div>
|
|
|
<div v-if="state.onlineDockList.length">
|
|
|
- <div v-for="(dock, index) in state.onlineDockList" :key="dock.sn">
|
|
|
+ <div v-for="(dock) in state.onlineDockList" :key="dock.sn">
|
|
|
<div :class="[
|
|
|
'taskList-left-item',
|
|
|
- checkState.checkSnList.includes(dock.sn) ? 'taskList-left-item-selected' : ''
|
|
|
- ]" @click="onClickCheckItem(dock.sn)">
|
|
|
+ checkState.checkSnList.includes(dock.gateway.sn) ? 'taskList-left-item-selected' : ''
|
|
|
+ ]" @click="onClickCheckItem(dock.gateway.sn)">
|
|
|
<Airport :dock="dock" :look-info="false" />
|
|
|
</div>
|
|
|
</div>
|
|
|
@@ -26,9 +26,8 @@
|
|
|
</div>
|
|
|
</a-spin>
|
|
|
<div :style="{ width: state.collapsed ? 'calc(100% - 250px)' : '100%' }">
|
|
|
- <Search :onClickCollapsed="() => { state.collapsed = !state.collapsed }"
|
|
|
- :onClickCreateTask="() => { state.visible = true }" :onClickSearch="onClickSearch"
|
|
|
- :onClickReset="onClickReset" />
|
|
|
+ <Search :onClickCollapsed="() => { state.collapsed = !state.collapsed }" :onClickCreateTask="onClickCreateTask"
|
|
|
+ :onClickSearch="onClickSearch" :onClickReset="onClickReset" />
|
|
|
<a-table :scroll="{ x: '100%', y: 500 }" rowKey="job_id" :loading="state.listLoading" :columns="columns"
|
|
|
:dataSource="state.list" @change="refreshData" :rowClassName="rowClassName" :pagination="paginationConfig">
|
|
|
<!-- 计划|实际时间 -->
|
|
|
@@ -86,11 +85,12 @@
|
|
|
<!-- 操作 -->
|
|
|
<template #action="{ record }">
|
|
|
<div class="flex-align-center flex-row" style="color: #2d8cf0">
|
|
|
- <a-tooltip title="断点续飞" v-if="record.breakpoint_continuation && [4, 5, 6].includes(record.status)">
|
|
|
+ <a-tooltip title="断点续飞" v-if="record.breakpoint_continuation && [5].includes(record.status)"
|
|
|
+ @click="onClickContinueFlight(record.job_id)">
|
|
|
<ApiOutlined style="margin-right: 10px;" />
|
|
|
</a-tooltip>
|
|
|
- <a-tooltip title="复制任务" v-if="[0, 1].includes(record.task_type)">
|
|
|
- <CopyOutlined style="margin-right: 10px;" />
|
|
|
+ <a-tooltip title="复制任务" v-if="[0, 1].includes(record.task_type)" @click="onClickCopy(record.job_id)">
|
|
|
+ <CopyOutlined style=" margin-right: 10px;" />
|
|
|
</a-tooltip>
|
|
|
<a-tooltip title="查看轨迹" v-if="false">
|
|
|
<GatewayOutlined style="margin-right: 10px;" />
|
|
|
@@ -102,8 +102,9 @@
|
|
|
</template>
|
|
|
</a-table>
|
|
|
</div>
|
|
|
- <CreateTaskModal :jobId="''" :visible="state.visible" :onClickConfirm="createTaskModalOnClickConfirm"
|
|
|
- :onClickCancel="createTaskModalOnClickCancel" v-if="state.visible" />
|
|
|
+ <CreateTaskModal :jobId="state.currentJobId" :visible="state.visible"
|
|
|
+ :onClickConfirm="createTaskModalOnClickConfirm" :onClickCancel="createTaskModalOnClickCancel"
|
|
|
+ v-if="state.visible" />
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
@@ -119,11 +120,13 @@ import { useMyStore } from '/@/store';
|
|
|
import { useFormatTask } from '/@/components/task/use-format-task';
|
|
|
import { apis } from '/@/api/custom';
|
|
|
import { getDeviceTopo, getUnreadDeviceHms } from '/@/api/manage';
|
|
|
+import { createPlan } from '/@/api/wayline';
|
|
|
import { getWorkspaceId } from '/@/utils';
|
|
|
import { OnlineDevice, EModeCode } from '/@/types/device';
|
|
|
import { EDeviceTypeName } from '/@/types';
|
|
|
|
|
|
interface State {
|
|
|
+ currentJobId: string,
|
|
|
visible: boolean,
|
|
|
collapsed: boolean,
|
|
|
onlineDockListLoading: boolean,
|
|
|
@@ -134,6 +137,7 @@ interface State {
|
|
|
};
|
|
|
|
|
|
const state: State = reactive({
|
|
|
+ currentJobId: '',
|
|
|
visible: false,
|
|
|
collapsed: true,
|
|
|
onlineDockListLoading: false,
|
|
|
@@ -205,7 +209,7 @@ const fetchOnlineDock = async () => {
|
|
|
})
|
|
|
state.onlineDockList = list;
|
|
|
checkState.checkAll = true;
|
|
|
- checkState.checkSnList = list.map(item => item.sn);
|
|
|
+ checkState.checkSnList = list.map(item => item.gateway.sn);
|
|
|
} catch (error) {
|
|
|
console.error(error);
|
|
|
} finally {
|
|
|
@@ -277,7 +281,7 @@ onMounted(async () => {
|
|
|
// 全选
|
|
|
const onCheckAllChange = async (e: any) => {
|
|
|
Object.assign(checkState, {
|
|
|
- checkSnList: e.target.checked ? state.onlineDockList.map(item => item.sn) : [],
|
|
|
+ checkSnList: e.target.checked ? state.onlineDockList.map(item => item.gateway.sn) : [],
|
|
|
indeterminate: false,
|
|
|
});
|
|
|
await fetchList();
|
|
|
@@ -296,8 +300,15 @@ const onClickCheckItem = async (sn: string) => {
|
|
|
}
|
|
|
|
|
|
// 新建机场任务弹出层-点击确定
|
|
|
-const createTaskModalOnClickConfirm = async () => {
|
|
|
- state.visible = false;
|
|
|
+const createTaskModalOnClickConfirm = async (data: any) => {
|
|
|
+ try {
|
|
|
+ await createPlan(getWorkspaceId(), data);
|
|
|
+ state.visible = false;
|
|
|
+ message.success('新建成功');
|
|
|
+ await fetchList();
|
|
|
+ } catch (error) {
|
|
|
+ console.error(error);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
// 新建机场任务弹出层-点击取消
|
|
|
@@ -318,7 +329,7 @@ const columns = [
|
|
|
{
|
|
|
title: '计划|实际时间',
|
|
|
dataIndex: 'duration',
|
|
|
- width: 200,
|
|
|
+ width: 300,
|
|
|
slots: { customRender: 'duration' },
|
|
|
},
|
|
|
{
|
|
|
@@ -382,7 +393,7 @@ const columns = [
|
|
|
title: '操作',
|
|
|
dataIndex: 'actions',
|
|
|
fixed: 'right',
|
|
|
- width: 100,
|
|
|
+ width: 120,
|
|
|
slots: { customRender: 'action' },
|
|
|
},
|
|
|
];
|
|
|
@@ -401,6 +412,12 @@ const refreshData = async (page: any) => {
|
|
|
await fetchList();
|
|
|
}
|
|
|
|
|
|
+// 点击创建任务
|
|
|
+const onClickCreateTask = () => {
|
|
|
+ state.currentJobId = '';
|
|
|
+ state.visible = true
|
|
|
+}
|
|
|
+
|
|
|
// 点击搜索
|
|
|
const onClickSearch = async (query: any) => {
|
|
|
state.query = query;
|
|
|
@@ -413,6 +430,23 @@ const onClickReset = async (query: any) => {
|
|
|
await fetchList();
|
|
|
}
|
|
|
|
|
|
+// 点击断点续飞
|
|
|
+const onClickContinueFlight = async (id: string) => {
|
|
|
+ try {
|
|
|
+ await apis.renewalJob(id);
|
|
|
+ await fetchList();
|
|
|
+ message.success('操作成功');
|
|
|
+ } catch (error) {
|
|
|
+ console.error(error);
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+// 点击复制
|
|
|
+const onClickCopy = (id: string) => {
|
|
|
+ state.currentJobId = id;
|
|
|
+ state.visible = true;
|
|
|
+}
|
|
|
+
|
|
|
// 点击删除
|
|
|
const onClickDelete = (id: string, name: string) => {
|
|
|
Modal.confirm({
|