forked from drone/command-center-dashboard

罗广辉
2025-04-21 2800fa4f32f3900509cb4d6eefaf2bfaf54efdd7
src/views/SignMachineNest/MachineRight/InspectionRaskList.vue
@@ -9,7 +9,7 @@
               <div :class="tabIndex === 2 ? 'active' : ''" @click="tabClick(2)">历史任务</div>
            </div>
            <div class="search-box">
               <el-input v-model="searchText" placeholder="请输入搜索内容" class="input-with-select">
               <el-input v-model="searchText" placeholder="请输入关键字" class="input-with-select">
                  <template #append>
                     <el-button :icon="Search" @click="searchNickName" />
                  </template>
@@ -81,8 +81,7 @@
let viewer = null
let { taskDetails, workspace_id, getTaskDetails } = useTaskDetails()
let { wsInfo, removeWS } = useDroneWS(workspace_id) //ws信息,是一个ref对象
const wsInfo = inject('wsInfo')
const store = useStore()
// 设备任务详情
let currentInfoId = ref('')
@@ -92,6 +91,7 @@
// 单个机巢信息
const singleUavHome = computed(() => store.state.home.singleUavHome)
const osdVisible = computed(() => store.state.home.osdVisible);
const isMore = ref(true)
// 控制加载状态
@@ -200,6 +200,12 @@
const taskClick = item => {
   if (tabIndex.value === 1) {
      // 展示当前任务详情
      if (!item?.device_sns?.length) return ElMessage.warning('没有device_sns');
      if (item?.device_sns?.length !== 1) {
         // todo 后续开发
         ElMessage.success('即将跳转到集群调度');
         return
      }
      currentInfoId.value = item.wayline_job_info_id
      isShowCurrentTaskDetails.value = true
   } else {
@@ -211,10 +217,26 @@
watch([() => tabIndex.value, () => tableList.value], async ([newTabIndex, newTableList]) => {
   if (newTabIndex == 1 && newTableList.length > 0) {
      await getTaskDetails(newTableList[0].wayline_job_info_id)
      const params = {
         // 航线信息id
         wayLineJobInfoId:newTableList[0].wayline_job_info_id,
         // 当前航线id
         waylineJobId:newTableList[0].id,
      }
      await getTaskDetails(params)
   }
})
// 监听如果当前任务飞行完毕,当前任务即消失
watch(() => store.state.home.deviceState, async (newValue) => {
   const deviceInfo = newValue?.deviceInfo[osdVisible.value.sn];
   if (!deviceInfo) return
   // 重新刷新数据
   if (deviceInfo?.mode_code === 14) {
      getJobList()
   }
});
const { init: initTaskWayline, removeEntitys } = useTaskWayline()
onMounted(async () => {