无人机管理后台前端(已迁走)
chenyao
2025-11-17 233e4fc4f35bd00a36ee34a7fbf5e47b41db26db
src/views/job/components/TaskIntermediateContent/TaskIntermediateContent.vue
@@ -17,15 +17,14 @@
            </el-tooltip-copy>
          </template>
        </el-table-column>
        <el-table-column prop="name" label="任务编号" width="160">
        <el-table-column prop="name" label="任务名称" width="160">
          <template #default="scope">
            <el-tooltip-copy :content="scope.row.name" :showCopyText="true">
              {{scope.row.name}}
            </el-tooltip-copy>
          </template>
        </el-table-column>
            <el-table-column prop="dept_name" label="所属部门" width="200" align="center" />
            <el-table-column prop="device_names" label="所属机巢" />
            <el-table-column prop="device_names" label="所属机巢" show-overflow-tooltip/>
            <el-table-column prop="ai_type_str" label="关联算法" show-overflow-tooltip align="center" />
            <el-table-column label="任务状态" align="center">
               <template #default="scope">
@@ -70,6 +69,7 @@
               </template>
            </el-table-column>
            <el-table-column prop="cycle_time_value" label="任务时间" show-overflow-tooltip />
        <el-table-column prop="dept_name" label="创建部门" width="200" align="center" />
            <el-table-column prop="creator_name" label="创建人" align="center" show-overflow-tooltip />
            <el-table-column label="操作" width="200" align="center">
               <template #default="scope">
@@ -169,9 +169,14 @@
const jobId = ref('')
const handleDetail = row => {
   if (!row.device_sns.length) return ElMessage.warning('没有device_sns')
   if (row.device_sns.length !== 1) return ElMessage.success('即将跳转到集群调度')
   rowData.value = row ? row : {}
jobId.value = rowData.value?.job_id
   if (row.device_sns.length > 1 && (row.status === 2 || row.status === 1)) {
      const adminUrl = `${import.meta.env.VITE_APP_AREA_NAME}/command-center-dashboard/#/clusterScheduling`
      const targetPath = `taskNo=${encodeURIComponent(rowData.value.job_info_num)}`
      window.open(`${adminUrl}?${targetPath}`, '_blank')
      return
   }
   jobId.value = rowData.value?.job_id
   if (row.status === 2 || row.status === 1) {
      // isShowCurrentTaskDetails.value = true
      // 跳转大屏当前任务详情
@@ -259,14 +264,13 @@
const changeKey = inject('changeKey')
// 轮询查询是否刷新
const polling = setInterval(async () => {
  const res = await statusChangedApi()
  if (res.data.data.DEVICE_REFRESH || res.data.data.JOB_REFRESH) {
    getJobList()
    changeKey.value++
  }
}, 4000)
const jobUpdateKey = computed(() => store.state.common.jobUpdateKey)
const deviceUpdateKey = computed(() => store.state.common.deviceUpdateKey)
watch([jobUpdateKey,deviceUpdateKey],()=>{
  getJobList()
  changeKey.value++
})
onBeforeUnmount(() => {
  clearInterval(polling)