李富豪 1 год назад
Родитель
Сommit
04aa1069da

+ 27 - 7
Web/src/components/airport/index.vue

@@ -3,12 +3,13 @@
     <div class="content-title">
       <div class="content-title-left">
         <img class="content-title-left-icon" :src="taskSrc">
-        <div>
-          无任务
+        <div class="content-title-left-text">
+          {{ taskName }}
         </div>
       </div>
-      <div class="content-title-right">
-        {{ getTextByDockTaskCode(dockInfo[dock.sn] ? dockInfo[dock.sn].link_osd.flighttask_step_code :
+      <div class="content-title-right"
+        :style="dockInfo[dock.gateway.sn] && dockInfo[dock.gateway.sn].link_osd?.flighttask_step_code !== 255 ? 'color:#00EE8B' : 'color:red'">
+        {{ getTextByDockTaskCode(dockInfo[dock.gateway.sn] ? dockInfo[dock.gateway.sn].link_osd?.flighttask_step_code :
           EDockModeCode.Disconnected) }}
       </div>
     </div>
@@ -30,9 +31,9 @@
           </div>
           <div :class="[
             'content-info-left-style-other',
-            hmsInfo[dock.gateway.sn] && hmsInfo[dock.gateway.sn][0].level === 0 ? 'notice' : '',
-            hmsInfo[dock.gateway.sn] && hmsInfo[dock.gateway.sn][0].level === 1 ? 'caution' : '',
-            hmsInfo[dock.gateway.sn] && hmsInfo[dock.gateway.sn][0].level === 2 ? 'warn' : '',
+            hmsInfo[dock.gateway.sn] && hmsInfo[dock.gateway.sn][0]?.level === 0 ? 'notice' : '',
+            hmsInfo[dock.gateway.sn] && hmsInfo[dock.gateway.sn][0]?.level === 1 ? 'caution' : '',
+            hmsInfo[dock.gateway.sn] && hmsInfo[dock.gateway.sn][0]?.level === 2 ? 'warn' : '',
           ]">
             <div v-if="hangarLogInfo">
               <span class="word-loop">
@@ -109,6 +110,16 @@ const dockInfo = computed(() => store.state.deviceState.dockInfo);
 const hmsInfo = computed(() => store.state.hmsInfo);
 const osdVisible = computed(() => store.state.osdVisible);
 
+// 任务名称
+const taskName = computed(() => {
+  const dockTask = store.state.dockTask[props.dock.gateway.sn];
+  if (dockTask) {
+    return dockTask.name;
+  } else {
+    return '无任务';
+  }
+})
+
 // 飞行器告警信息
 const aircraftLogInfo = computed(() => {
   const hmsList = hmsInfo.value[props.dock.sn] || [];
@@ -161,9 +172,18 @@ const hangarLogInfo = computed(() => {
         height: 15px;
         margin-right: 5px;
       }
+
+      &-text {
+        white-space: nowrap;
+        overflow: hidden;
+        text-overflow: ellipsis;
+      }
     }
 
     &-right {
+      white-space: nowrap;
+      overflow: hidden;
+      text-overflow: ellipsis;
       margin-left: 5px;
     }
   }

+ 1 - 1
Web/src/pages/page-web/projects/media/detail/index.vue

@@ -222,7 +222,7 @@ const columns = [
     title: '操作',
     dataIndex: 'actions',
     fixed: 'right',
-    width: 80,
+    width: 100,
     slots: { customRender: 'action' },
   },
 ]

+ 1 - 2
Web/src/pages/page-web/projects/media/index/index.vue

@@ -229,8 +229,7 @@ const columns = [
     title: '操作',
     dataIndex: 'actions',
     fixed: 'right',
-    align: 'center',
-    width: 60,
+    width: 80,
     slots: { customRender: 'action' },
   },
 ]

+ 8 - 6
Web/src/pages/page-web/projects/member/index.vue

@@ -6,12 +6,14 @@
         :rowClassName="rowClassName" :dataSource="state.list" :pagination="paginationConfig">
         <!-- 操作 -->
         <template #action="{ record }">
-          <a-tooltip title="显示密码" v-if="!record.password">
-            <EyeOutlined style="color: #2d8cf0;" @click="onClickLookPassword(record.user_id)" />
-          </a-tooltip>
-          <a-tooltip title="隐藏密码" v-else>
-            <EyeInvisibleOutlined style="color: #2d8cf0;" @click="onClickClosePassword(record.user_id)" />
-          </a-tooltip>
+          <div style="color: #2d8cf0">
+            <a-tooltip title="显示密码" v-if="!record.password">
+              <EyeOutlined @click="onClickLookPassword(record.user_id)" />
+            </a-tooltip>
+            <a-tooltip title="隐藏密码" v-else>
+              <EyeInvisibleOutlined @click="onClickClosePassword(record.user_id)" />
+            </a-tooltip>
+          </div>
         </template>
       </a-table>
     </div>

+ 4 - 0
Web/src/pages/page-web/projects/task/index.vue

@@ -34,6 +34,10 @@ const messageHandler = async (payload: any) => {
     return
   }
   switch (payload.biz_code) {
+    case EBizCode.FlightTaskProgress: {// 机场任务
+      store.commit('SET_DOCK_TASK', payload.data)
+      break
+    }
     case EBizCode.GatewayOsd: {
       store.commit('SET_GATEWAY_INFO', payload.data)
       break

+ 3 - 2
Web/src/pages/page-web/projects/task/taskList/components/CreateTaskModal.vue → Web/src/pages/page-web/projects/task/taskList/components/TaskModal.vue

@@ -3,8 +3,8 @@
         wrapClassName="createTask-modal" :visible="visible">
         <div class="content">
             <div class="content-panel">
-                <TaskPanel ref="taskPanelRef" :drawTrajectory="drawTrajectory" :onClickConfirm="onClickConfirm"
-                    :onClickCancel="onClickCancel" />
+                <TaskPanel ref="taskPanelRef" :type="type" :drawTrajectory="drawTrajectory"
+                    :onClickConfirm="onClickConfirm" :onClickCancel="onClickCancel" />
             </div>
             <div class="content-map">
                 <div id="taskMap" :style="{ width: '100%', height: '100%' }"></div>
@@ -21,6 +21,7 @@ import { useGMapManage } from '/@/hooks/use-g-map';
 
 interface Props {
     jobId: string,
+    type: 'COPY' | 'DETAIL' | 'CREATE',
     visible: boolean,
     onClickConfirm: (data: any) => Promise<any>,
     onClickCancel: () => void,

+ 29 - 13
Web/src/pages/page-web/projects/task/taskList/components/TaskPanel.vue

@@ -2,7 +2,15 @@
   <div class="taskPanel">
     <div class="taskPanel-info">
       <div class="taskPanel-info-title">
-        新建机场任务
+        <span v-if="type === 'CREATE'">
+          新建机场任务
+        </span>
+        <span v-else-if="type === 'DETAIL'">
+          机场任务详情
+        </span>
+        <span v-else-if="type === 'COPY'">
+          复制机场任务
+        </span>
       </div>
       <a-spin :spinning="state.loading">
         <div class="taskPanel-info-content">
@@ -13,12 +21,12 @@
             </a-form-item>
             <!-- 执行航线 -->
             <a-form-item label="执行航线" name="file_id" :rules="[{ required: true, message: '执行航线不能为空' }]">
-              <a-button type="primary" @click="handleClickSelectWayline">
+              <a-button type="primary" @click="handleClickSelectWayline" v-if="type !== 'DETAIL'">
                 <PlusOutlined />
                 选择航线
               </a-button>
               <div v-if="waylineInfo">
-                <div class="wayline-panel">
+                <div class="wayline-panel" :style="{ marginTop: type === 'DETAIL' ? '0' : '10px' }">
                   <div class="wayline-panel-title">
                     <div class="wayline-panel-title-left">
                       {{ waylineInfo.name }}
@@ -44,12 +52,12 @@
             </a-form-item>
             <!-- 执行设备 -->
             <a-form-item label="执行设备" name="dock_sn" :rules="[{ required: true, message: '执行设备不能为空' }]">
-              <a-button type="primary" @click="handleClickSelectDevice">
+              <a-button type="primary" @click="handleClickSelectDevice" v-if="type !== 'DETAIL'">
                 <PlusOutlined />
                 选择设备
               </a-button>
               <div v-if="deviceInfo">
-                <div class="device-panel">
+                <div class="device-panel" :style="{ marginTop: type === 'DETAIL' ? '0' : '10px' }">
                   <div class="device-panel-cell">
                     <img :src="dockSrc">
                     <div>
@@ -160,12 +168,19 @@
         </div>
       </a-spin>
       <div class="taskPanel-info-footer">
-        <a-button style="background: #3c3c3c;margin-right: 10px;" @click="onClickCancel">
-          取消
-        </a-button>
-        <a-button type="primary" @click="handleClickConfirm">
-          确定
-        </a-button>
+        <template v-if="type !== 'DETAIL'">
+          <a-button style="background: #3c3c3c;margin-right: 10px;" @click="onClickCancel">
+            取消
+          </a-button>
+          <a-button type="primary" @click="handleClickConfirm">
+            确定
+          </a-button>
+        </template>
+        <template v-else>
+          <a-button style="background: #3c3c3c;" @click="onClickCancel">
+            返回
+          </a-button>
+        </template>
       </div>
     </div>
     <div class="taskPanel-modal" v-if="waylineState.visible">
@@ -252,6 +267,7 @@ import { wgs84togcj02 } from '/@/vendors/coordtransform';
 import { DEVICE_NAME } from '/@/types/device'
 
 interface Props {
+  type: 'COPY' | 'DETAIL' | 'CREATE',
   drawTrajectory: (list: {
     paths: number[],
     isSPoint: boolean,
@@ -402,7 +418,7 @@ const fetchDetail = async (id: string) => {
     const info = res.data;
     const data = {
       ...state.formModel,
-      name: info.job_name,
+      name: props.type === 'COPY' ? info.job_name + '_复制' : info.job_name,
       file_id: info.file_id,
       wayline_type: info.wayline_type,
       dock_sn: info.dock_sn,
@@ -576,7 +592,7 @@ defineExpose({ init });
       align-items: center;
 
       button {
-        width: 48%;
+        width: 100%;
         color: #FFFFFF;
         border: none;
       }

+ 43 - 34
Web/src/pages/page-web/projects/task/taskList/index.vue

@@ -79,47 +79,47 @@
         </template>
         <!-- 媒体上传 -->
         <template #media_upload="{ record }">
-          <div class="flex-display flex-align-center">
-            <span class="circle-icon" :style="{ backgroundColor: formatMediaTaskStatus(record).color }"></span>
-            {{ formatMediaTaskStatus(record).text }}
-          </div>
-          <div class="pl15">
-            {{ formatMediaTaskStatus(record).number }}
+          <div style="display: flex;align-items: center;">
+            <div style="display: flex;align-items: center;">
+              <span class="circle-icon" :style="{ backgroundColor: formatMediaTaskStatus(record).color }"></span>
+              {{ formatMediaTaskStatus(record).text }}
+            </div>
+            <div class="pl15">
+              {{ formatMediaTaskStatus(record).number }}
+            </div>
           </div>
         </template>
         <!-- 操作 -->
         <template #action="{ record }">
           <div class="flex-align-center flex-row" style="color: #2d8cf0">
-            <a-tooltip title="断点续飞" v-if="record.breakpoint_continuation && [5].includes(record.status)"
-              @click="onClickContinueFlight(record.job_id)">
-              <ApiOutlined style="margin-right: 10px;" />
+            <a-tooltip title="查看详情">
+              <EyeOutlined style="margin-right: 10px;" @click="onClickLookDetail(record.job_id)" />
             </a-tooltip>
-            <a-tooltip title="复制任务" v-if="[0, 1].includes(record.task_type)" @click="onClickCopy(record.job_id)">
-              <CopyOutlined style=" margin-right: 10px;" />
+            <a-tooltip title="复制任务" v-if="[0, 1].includes(record.task_type)">
+              <CopyOutlined style=" margin-right: 10px;" @click="onClickCopy(record.job_id)" />
             </a-tooltip>
-            <a-tooltip title="查看轨迹" v-if="false">
-              <GatewayOutlined style="margin-right: 10px;" />
+            <a-tooltip title="断点续飞" v-if="record.breakpoint_continuation && record.wayline_mission_state === 7">
+              <ApiOutlined style="margin-right: 10px;" @click="onClickContinueFlight(record.job_id)" />
             </a-tooltip>
-            <a-tooltip title="删除">
+            <a-tooltip title="删除" v-if="record.status !== 4">
               <DeleteOutlined @click="onClickDelete(record.job_id, record.job_name)" />
             </a-tooltip>
           </div>
         </template>
       </a-table>
     </div>
-    <CreateTaskModal :jobId="state.currentJobId" :visible="state.visible"
-      :onClickConfirm="createTaskModalOnClickConfirm" :onClickCancel="createTaskModalOnClickCancel"
-      v-if="state.visible" />
+    <TaskModal :jobId="state.currentJobId" :type="state.currentType" :visible="state.visible"
+      :onClickConfirm="taskModalOnClickConfirm" :onClickCancel="taskModalOnClickCancel" v-if="state.visible" />
   </div>
 </template>
 
 <script lang="ts" setup>
 import { reactive, onMounted, watch } from 'vue';
 import { Modal, message } from 'ant-design-vue';
-import { ExclamationCircleOutlined, ApiOutlined, CopyOutlined, GatewayOutlined, DeleteOutlined } from '@ant-design/icons-vue';
+import { ExclamationCircleOutlined, ApiOutlined, CopyOutlined, EyeOutlined, DeleteOutlined } from '@ant-design/icons-vue';
 import Search from './components/Search.vue';
 import Airport from '/@/components/airport/index.vue';
-import CreateTaskModal from './components/CreateTaskModal.vue';
+import TaskModal from './components/TaskModal.vue';
 import noDataSrc from '/@/assets/icons/no-data.png';
 import { useFormatTask } from '/@/components/task/use-format-task';
 import { apis } from '/@/api/custom';
@@ -131,6 +131,7 @@ import { EDeviceTypeName } from '/@/types';
 
 interface State {
   currentJobId: string,
+  currentType: 'COPY' | 'DETAIL' | 'CREATE',
   visible: boolean,
   collapsed: boolean,
   onlineDockListLoading: boolean,
@@ -142,6 +143,7 @@ interface State {
 
 const state: State = reactive({
   currentJobId: '',
+  currentType: 'CREATE',
   visible: false,
   collapsed: true,
   onlineDockListLoading: false,
@@ -234,10 +236,8 @@ const fetchList = async () => {
 }
 
 onMounted(async () => {
-  await Promise.all([
-    fetchOnlineDock(),
-    fetchList(),
-  ])
+  await fetchOnlineDock();
+  await fetchList();
 });
 
 // 全选
@@ -261,8 +261,8 @@ const onClickCheckItem = async (sn: string) => {
   await fetchList();
 }
 
-// 新建机场任务弹出层-点击确定
-const createTaskModalOnClickConfirm = async (data: any) => {
+// 机场任务弹出层-点击确定
+const taskModalOnClickConfirm = async (data: any) => {
   try {
     const res = await createPlan(getWorkspaceId(), data);
     if (res.code === 0) {
@@ -275,8 +275,8 @@ const createTaskModalOnClickConfirm = async (data: any) => {
   }
 }
 
-// 新建机场任务弹出层-点击取消
-const createTaskModalOnClickCancel = () => {
+// 机场任务弹出层-点击取消
+const taskModalOnClickCancel = () => {
   state.visible = false;
 }
 
@@ -293,7 +293,7 @@ const columns = [
   {
     title: '计划|实际时间',
     dataIndex: 'duration',
-    width: 300,
+    width: 350,
     slots: { customRender: 'duration' },
   },
   {
@@ -379,6 +379,7 @@ const refreshData = async (page: any) => {
 // 点击创建任务
 const onClickCreateTask = () => {
   state.currentJobId = '';
+  state.currentType = 'CREATE';
   state.visible = true
 }
 
@@ -394,6 +395,20 @@ const onClickReset = async (query: any) => {
   await fetchList();
 }
 
+// 点击查看详情
+const onClickLookDetail = (id: string) => {
+  state.currentJobId = id;
+  state.currentType = 'DETAIL';
+  state.visible = true;
+}
+
+// 点击复制
+const onClickCopy = (id: string) => {
+  state.currentJobId = id;
+  state.currentType = 'COPY';
+  state.visible = true;
+}
+
 // 点击断点续飞
 const onClickContinueFlight = async (id: string) => {
   try {
@@ -407,12 +422,6 @@ const onClickContinueFlight = async (id: string) => {
   }
 }
 
-// 点击复制
-const onClickCopy = (id: string) => {
-  state.currentJobId = id;
-  state.visible = true;
-}
-
 // 点击删除
 const onClickDelete = (id: string, name: string) => {
   Modal.confirm({

+ 1 - 1
Web/src/pages/page-web/projects/trajectory/index.vue

@@ -6,7 +6,7 @@
         @change="refreshData" :rowClassName="rowClassName" :dataSource="state.list" :pagination="paginationConfig">
         <!-- 操作 -->
         <template #action="{ record }">
-          <div class="flex-align-center flex-row" style="color: #2d8cf0">
+          <div style="color: #2d8cf0">
             <a-tooltip title="查看轨迹">
               <GatewayOutlined @click="onClickLookTrajectory(record.id)" />
             </a-tooltip>

+ 4 - 0
Web/src/pages/page-web/projects/workspace.vue

@@ -36,6 +36,10 @@ const messageHandler = async (payload: any) => {
       store.commit('SET_DEVICE_REASON', payload.data)
       break
     }
+    case EBizCode.FlightTaskProgress: {// 机场任务
+      store.commit('SET_DOCK_TASK', payload.data)
+      break
+    }
     case EBizCode.GatewayOsd: {
       store.commit('SET_GATEWAY_INFO', payload.data)
       break

+ 8 - 0
Web/src/store/index.ts

@@ -16,6 +16,9 @@ const initStateFunc = () => ({
   deviceReason: {} as {
     [sn: string]: any,
   },
+  dockTask: {} as {
+    [sn: string]: any,
+  },
   mapClickElement: {
     id: '',
     type: '',
@@ -119,6 +122,11 @@ const mutations: MutationTree<RootStateType> = {
   SET_DEVICE_REASON(state, info) {
     state.deviceReason[info.sn] = info
   },
+  SET_DOCK_TASK(state, info) {
+    state.dockTask[info.sn] = {
+      name: info.output.ext.job_name,
+    }
+  },
   SET_MAP_CLICK_ELEMENT(state, info) {
     state.mapClickElement = info
   },

+ 0 - 3
Web/src/utils/index.ts

@@ -96,9 +96,6 @@ export const getTextByDockModeCode = (code: number) => {
 export const getTextByDockTaskCode = (code: number) => {
     let text = '';
     switch (code) {
-        case -1:
-            text = '--';
-            break;
         case 0:
             text = '作业准备中';
             break;