28968 6 månader sedan
förälder
incheckning
69045b929f

+ 3 - 0
src/api/modules/demo/dataAugmentation.ts

@@ -108,6 +108,9 @@ export const startDataAugmentationApi = (id: String | Number) => {
 export const stopDataAugmentationApi = (id: String | Number) => {
   return http.get('/demo/dataAugmentation/stop/' + id)
 }
+export const pauseDataAugmentationApi = (id: String | Number) => {
+  return http.get('/demo/dataAugmentation/pause/' + id)
+}
 
 export const getCompareImageApi = (taskId: String) => {
   return http.get('/demo/dataAugmentation/compare/' + taskId)

+ 17 - 1
src/views/demo/dataAugmentation/index.vue

@@ -25,6 +25,11 @@
             <el-button type="primary" link icon="View"> 终止 </el-button>
           </template>
         </el-popconfirm>
+        <el-popconfirm title="确定暂停此任务吗?" @confirm="pauseDataAugmentation(scope.row)" v-if="scope.row.status == '1'">
+          <template #reference>
+            <el-button type="primary" link icon="View"> 暂停 </el-button>
+          </template>
+        </el-popconfirm>
         <el-button type="primary" link icon="View" @click="preview(scope.row)" v-if="scope.row.status == '2'"> 预览 </el-button>
         <el-button type="primary" link icon="View" @click="downloadFile(scope.row)" v-if="scope.row.status == '2'"> 导出 </el-button>
         <el-button
@@ -121,7 +126,8 @@ import {
   getDialogApi,
   getTaskDictData,
   getMetricApi,
-  getCompareImageApiNew
+  getCompareImageApiNew,
+  pauseDataAugmentationApi
 } from '@/api/modules/demo/dataAugmentation'
 // import {  } from '@/api/modules/system/dictData'
 // import { S } from 'vite/dist/node/types.d-aGj9QkWt'
@@ -243,6 +249,16 @@ const stopDataAugmentation = async (params: any) => {
   proTable.value?.getTableList()
 }
 
+const pauseDataAugmentation = async (params: any) => {
+  const res = await pauseDataAugmentationApi(params.id)
+  if (res.code === 200) {
+    ElMessage.success('任务暂停成功')
+  } else {
+    ElMessage.error('任务暂停失败!')
+  }
+  proTable.value?.getTableList()
+}
+
 const loadImageData = async (taskId: string, imageIdx: number) => {
   const res: any = await getCompareImageApi(taskId, imageIdx)
   // imageBase64List.value.origin = res.origin

+ 16 - 2
src/views/demo/imageMosaic/index.vue

@@ -25,6 +25,11 @@
             <el-button type="primary" link icon="View"> 终止 </el-button>
           </template>
         </el-popconfirm>
+        <el-popconfirm title="确定暂停此任务吗?" @confirm="pauseDataAugmentation(scope.row)" v-if="scope.row.status == '1'">
+          <template #reference>
+            <el-button type="primary" link icon="View"> 暂停 </el-button>
+          </template>
+        </el-popconfirm>
         <el-button type="primary" link icon="View" @click="compareDataAugmentation(scope.row)" v-if="scope.row.status == '2'"> 预览 </el-button>
         <el-button type="primary" link icon="View" @click="downloadFile(scope.row)" v-if="scope.row.status == '2'"> 导出 </el-button>
         <el-button type="primary" link icon="View" @click="openMetricDialog(scope.row.id)" v-if="scope.row.status == '2'"> 指标 </el-button>
@@ -110,7 +115,8 @@ import {
   getCompareImageCountApi,
   getDialogApi,
   getTaskDictData,
-  getMetricApi
+  getMetricApi,
+  pauseDataAugmentationApi
 } from '@/api/modules/demo/dataAugmentation'
 // import {  } from '@/api/modules/system/dictData'
 
@@ -229,7 +235,15 @@ const stopDataAugmentation = async (params: any) => {
   }
   proTable.value?.getTableList()
 }
-
+const pauseDataAugmentation = async (params: any) => {
+  const res = await pauseDataAugmentationApi(params.id)
+  if (res.code === 200) {
+    ElMessage.success('任务暂停成功')
+  } else {
+    ElMessage.error('任务暂停失败!')
+  }
+  proTable.value?.getTableList()
+}
 const loadImageData = async (taskId: string, imageIdx: number) => {
   const res: any = await getCompareImageApi(taskId, imageIdx)
   // imageBase64List.value.origin = res.origin

+ 16 - 1
src/views/demo/targetDamageAcess/index.vue

@@ -25,6 +25,11 @@
             <el-button type="primary" link icon="View"> 终止 </el-button>
           </template>
         </el-popconfirm>
+        <el-popconfirm title="确定暂停此任务吗?" @confirm="pauseDataAugmentation(scope.row)" v-if="scope.row.status == '1'">
+          <template #reference>
+            <el-button type="primary" link icon="View"> 暂停 </el-button>
+          </template>
+        </el-popconfirm>
         <el-button type="primary" link icon="View" @click="compareDataAugmentation(scope.row)" v-if="scope.row.status == '2'"> 预览 </el-button>
         <el-button type="primary" link icon="View" @click="downloadFile(scope.row)" v-if="scope.row.status == '2'"> 导出 </el-button>
         <el-button
@@ -118,7 +123,8 @@ import {
   getCompareImageCountApi,
   getDialogApi,
   getTaskDictData,
-  getMetricApi
+  getMetricApi,
+  pauseDataAugmentationApi
 } from '@/api/modules/demo/dataAugmentation'
 // import {  } from '@/api/modules/system/dictData'
 
@@ -231,6 +237,15 @@ const stopDataAugmentation = async (params: any) => {
   }
   proTable.value?.getTableList()
 }
+const pauseDataAugmentation = async (params: any) => {
+  const res = await pauseDataAugmentationApi(params.id)
+  if (res.code === 200) {
+    ElMessage.success('任务暂停成功')
+  } else {
+    ElMessage.error('任务暂停失败!')
+  }
+  proTable.value?.getTableList()
+}
 
 const loadImageData = async (taskId: string, imageIdx: number) => {
   const res: any = await getCompareImageApi(taskId, imageIdx)

+ 16 - 1
src/views/demo/targetTrack/index.vue

@@ -25,6 +25,11 @@
             <el-button type="primary" link icon="View"> 终止 </el-button>
           </template>
         </el-popconfirm>
+        <el-popconfirm title="确定暂停此任务吗?" @confirm="pauseDataAugmentation(scope.row)" v-if="scope.row.status == '1'">
+          <template #reference>
+            <el-button type="primary" link icon="View"> 暂停 </el-button>
+          </template>
+        </el-popconfirm>
         <el-button type="primary" link icon="View" @click="preview(scope.row)" v-if="scope.row.status == '2'"> 预览 </el-button>
         <el-button type="primary" link icon="View" @click="downloadFile(scope.row)" v-if="scope.row.status == '2'"> 导出 </el-button>
         <el-button type="primary" link icon="View" @click="openMetricDialog(scope.row.id)" v-if="scope.row.status == '2'"> 指标 </el-button>
@@ -124,7 +129,8 @@ import {
   getTaskDictData,
   getMetricApi,
   getVideoUrl,
-  getCompareImageApiNew
+  getCompareImageApiNew,
+  pauseDataAugmentationApi
 } from '@/api/modules/demo/dataAugmentation'
 // import { VideoPlayer } from 'vue-video-player'
 // import 'vue-video-player/dist/simple.css'
@@ -408,6 +414,15 @@ const stopDataAugmentation = async (params: any) => {
   }
   proTable.value?.getTableList()
 }
+const pauseDataAugmentation = async (params: any) => {
+  const res = await pauseDataAugmentationApi(params.id)
+  if (res.code === 200) {
+    ElMessage.success('任务暂停成功')
+  } else {
+    ElMessage.error('任务暂停失败!')
+  }
+  proTable.value?.getTableList()
+}
 
 // ProTable 实例
 const proTable = ref<ProTableInstance>()