Bläddra i källkod

feat: 停止功能

WANGKANG 5 månader sedan
förälder
incheckning
3e4dc257a0
1 ändrade filer med 22 tillägg och 3 borttagningar
  1. 22 3
      src/views/demo/algorithmTaskTrack/index.vue

+ 22 - 3
src/views/demo/algorithmTaskTrack/index.vue

@@ -294,10 +294,11 @@ import {
   delTrackSequenceApi,
   getTrackSequenceApi,
   startTrackSequenceApi,
+  stopTrackSequenceApi,
   updateTrackSequenceApi
 } from '@/api/modules/demo/trackSequence'
-import { delToInfraredApi, getToInfraredApi, startToInfraredApi, updateToInfraredApi } from '@/api/modules/demo/toInfrared'
-import { getTargetDetectionApi, startTargetDetectionApi, updateTargetDetectionApi } from '@/api/modules/demo/TargetDetection'
+import { delToInfraredApi, getToInfraredApi, startToInfraredApi, stopToInfraredApi, updateToInfraredApi } from '@/api/modules/demo/toInfrared'
+import { getTargetDetectionApi, startTargetDetectionApi, stopTargetDetectionApi, updateTargetDetectionApi } from '@/api/modules/demo/TargetDetection'
 import { delDataAugmentationApi } from '@/api/modules/demo/dataAugmentation'
 
 const startSubTask = async (row: any) => {
@@ -319,7 +320,25 @@ const startSubTask = async (row: any) => {
   }
   handleOpenView()
 }
-const stopSubTask = async (row: any) => {}
+const stopSubTask = async (row: any) => {
+  let res: any = null
+  if (row.subsystem === SubSystem__['可见光转红外']) {
+    res = await stopToInfraredApi(row.id)
+  } else if (row.subsystem === SubSystem__['目标检测']) {
+    res = await stopTargetDetectionApi(row.id)
+  } else if (row.subsystem === SubSystem__['注释轨迹序列']) {
+    res = await stopTrackSequenceApi(row.id)
+  } else {
+    ElMessage.error('暂不支持该子任务类型')
+    return
+  }
+  if (res.code === 200) {
+    ElMessage.success('终止任务成功!')
+  } else {
+    ElMessage.error('终止任务失败,请检查!')
+  }
+  handleOpenView()
+}
 const openLogSubTask = async (row: any) => {}
 const previewSubTask = async (row: any) => {}
 const showStatisticResultSubTask = async (row: any) => {}