Bladeren bron

fix: 多源信息融合显示修改,多目标检测按键修改

Eagle 3 weken geleden
bovenliggende
commit
196f476d73

+ 20 - 0
src/views/demo/components/PreviewImages.vue

@@ -114,6 +114,25 @@ const handleOpen = async (api: any, params: any) => {
   }
 }
 
+const handleOpenWithPicArray = (picArr: any) => {
+  dialogVisible.value = true
+  imageIdx.value = 0
+  imageFps.value = 0
+  newImageIdx.value = ''
+  imageUrlList.value = []
+  playMode.value = 'normal'
+  step.value = 1
+  flag_direction.value = 1
+
+  imageUrlList.value = picArr
+  if (imageUrlList.value.length >= 1) {
+    updateCanvas()
+    return true
+  } else {
+    return false
+  }
+}
+
 const closeDialog = () => {
   dialogVisible.value = false
 }
@@ -223,6 +242,7 @@ const pre_picture = () => {
 
 defineExpose({
   handleOpen,
+  handleOpenWithPicArray,
   closeDialog
 })
 </script>

+ 7 - 3
src/views/demo/traceMerge/index.vue

@@ -90,6 +90,7 @@
       </el-container>
     </el-dialog>
     <ResultDialog ref="ResultDialogRef" />
+    <PreviewImages ref="previewImagesRef" />
   </div>
 </template>
 
@@ -162,6 +163,8 @@ const onSpeedChange = () => {
     }
   }, 1000 / frameSpeed.value)
 }
+import PreviewImages from '@/views/demo/components/PreviewImages.vue'
+const previewImagesRef = ref()
 const display = function (row) {
   // console.log(row)
   getResApi({ taskId: row.id }).then(res => {
@@ -171,16 +174,17 @@ const display = function (row) {
     }
     let arr = row.resultPath.split('ObjectDetection_Web')
     let pathPrefix = arr[arr.length - 1]
-    resultData.value = []
+    resultData.value = ['']
     for (let i = 1; i < res.data[0]; i++) {
       let _str = '' + i
       while (_str.length < 3) {
         _str = '0' + _str
       }
-      resultData.value.push(pathPrefix + '/number' + _str + '.png')
+      resultData.value.push('/profile' + pathPrefix + '/number' + _str + '.png')
     }
     console.log('resultData', resultData.value)
-    displayDialogVisible.value = true
+    // displayDialogVisible.value = true
+    previewImagesRef.value?.handleOpenWithPicArray(resultData.value)
   })
 }
 

+ 48 - 26
src/views/task/bizProcess/index.vue

@@ -47,19 +47,29 @@
         <!--          查看详情-->
         <!--        </el-button>-->
 
-        <el-button v-if="scope.row.name.indexOf('训练') === -1 && (scope.row.status === '0' || scope.row.status === '3')" type="primary" link icon="Refresh" @click="reRunTask(scope.row)">
+        <el-button
+          v-if="scope.row.name.indexOf('训练') === -1 && (scope.row.status === '0' || scope.row.status === '3')"
+          type="primary"
+          link
+          icon="VideoPlay"
+          @click="reRunTask(scope.row)"
+        >
+          开始任务
+        </el-button>
+        <el-button
+          v-if="scope.row.name.indexOf('训练') !== -1 && (scope.row.status === '0' || scope.row.status === '3')"
+          type="primary"
+          link
+          icon="VideoPlay"
+          @click="startTask(scope.row)"
+        >
           开始任务
         </el-button>
-        <el-button v-if="scope.row.name.indexOf('训练') !== -1 && (scope.row.status === '0' || scope.row.status === '3')" type="primary" link icon="Refresh" @click="startTask(scope.row)"> 开始任务 </el-button>
         <el-button v-if="scope.row.status === '0'" type="primary" link icon="Refresh" @click="taskExecute('continue', scope.row)">
           继续任务
         </el-button>
-        <el-button v-if="scope.row.status === '1'" type="primary" link icon="Refresh" @click="taskExecute('pause', scope.row)">
-          暂停任务
-        </el-button>
-        <el-button v-if="scope.row.status === '1'" type="primary" link icon="Refresh" @click="taskExecute('stop', scope.row)">
-          停止任务
-        </el-button>
+        <el-button v-if="scope.row.status === '1'" type="primary" link icon="Refresh" @click="taskExecute('pause', scope.row)"> 暂停任务 </el-button>
+        <el-button v-if="scope.row.status === '1'" type="primary" link icon="Refresh" @click="taskExecute('stop', scope.row)"> 停止任务 </el-button>
         <el-button v-if="!scope.row.name.includes('测试')" type="primary" link icon="finished" @click="showResult(scope.row)"> 结果图 </el-button>
 
         <el-button v-if="!scope.row.name.includes('训练')" type="primary" link icon="search" @click="showTimeResult(scope.row)"> 查看指标 </el-button>
@@ -68,8 +78,9 @@
           查看日志
         </el-button>
 
-        <el-button type="primary" link icon="document" @click="openDir(scope.row)"> 任务文件夹 </el-button>
-        <el-button type="primary" link icon="document" @click="exportData(scope.row)"> 结果文件夹 </el-button>
+        <el-button type="primary" link icon="FolderOpened" @click="openDir(scope.row, true)"> 预处理文件夹 </el-button>
+        <el-button type="primary" link icon="FolderOpened" @click="openDir(scope.row, false)"> 结果文件夹 </el-button>
+        <el-button type="primary" link icon="SoldOut" @click="exportData(scope.row)"> 导出结果 </el-button>
       </template>
     </ProTable>
     <FormDialog ref="formDialogRef" />
@@ -323,14 +334,19 @@ const startTask = row => {
 }
 
 const taskExecute = (type, row) => {
-  http.post<any>('/identification/identificationSubtaskDetails/' + (type === 'continue' ? 'continueTask' : type === 'pause' ? 'pauseTask' : 'stopTask'),
-    { bizId: row.id }, { loading: true }).then(res => {
-    if (res.code !== 200) {
-      ElMessage.error(res.msg)
-    } else {
-      ElMessage.success('操作成功')
-    }
-  })
+  http
+    .post<any>(
+      '/identification/identificationSubtaskDetails/' + (type === 'continue' ? 'continueTask' : type === 'pause' ? 'pauseTask' : 'stopTask'),
+      { bizId: row.id },
+      { loading: true }
+    )
+    .then(res => {
+      if (res.code !== 200) {
+        ElMessage.error(res.msg)
+      } else {
+        ElMessage.success('操作成功')
+      }
+    })
 }
 
 const typeDefs = ref(reactive([]))
@@ -339,19 +355,25 @@ const exportData = row => {
   http.get<any>('/identification/identificationSubtaskDetails/resultZip', { taskId: row.id }, { loading: true }).then(res => {
     console.log(res)
     if (res.code === 200) {
-      // window.open(res.msg, '_blank')
-      http.get<any>('/identification/identificationSubtaskDetails/openDir', { directory: row.resultPath + "/weights" }, { loading: true }).then(res => {
-        console.log(res)
-      })
+      window.open(res.msg, '_blank')
+      // http.get<any>('/identification/identificationSubtaskDetails/openDir', { directory: row.resultPath + "/weights" }, { loading: true }).then(res => {
+      //   console.log(res)
+      // })
     }
   })
 }
 
-const openDir = row => {
+const openDir = (row, isPre) => {
   console.log(row)
-  http.get<any>('/identification/identificationSubtaskDetails/openDir', { directory: row.preprocessPath }, { loading: true }).then(res => {
-    console.log(res)
-  })
+  http
+    .get<any>(
+      '/identification/identificationSubtaskDetails/openDir',
+      { directory: isPre ? row.preprocessPath : row.resultPath, type: '2' },
+      { loading: true }
+    )
+    .then(res => {
+      console.log(res)
+    })
 }
 
 let imgDataList = ref(reactive([]))