Эх сурвалжийг харах

feat: 添加开始终止方法

WANGKANG 7 сар өмнө
parent
commit
993cd6f3a2

+ 22 - 1
src/views/demo/toInfrared/index.vue

@@ -74,10 +74,31 @@ import {
   importTemplateApi,
   importToInfraredDataApi,
   exportToInfraredApi,
-  getToInfraredApi
+  startToInfraredApi,
+  stopToInfraredApi
 } from '@/api/modules/demo/toInfrared'
 import statusEnums from '@/utils/status'
 
+const startVideo2image = async (params: any) => {
+  const res = await startToInfraredApi(params.id)
+  if (res.code === 200) {
+    ElMessage.success('任务已开始,请等待完成!')
+  } else {
+    ElMessage.error('任务开始失败,请检查!')
+  }
+  proTable.value?.getTableList()
+}
+
+const stopVideo2image = async (params: any) => {
+  const res = await stopToInfraredApi(params.id)
+  if (res.code === 200) {
+    ElMessage.success('终止任务成功!')
+  } else {
+    ElMessage.error('终止任务失败,请检查!')
+  }
+  proTable.value?.getTableList()
+}
+
 // ProTable 实例
 const proTable = ref<ProTableInstance>()
 

+ 20 - 0
src/views/demo/trackSequence/index.vue

@@ -80,6 +80,26 @@ import {
 } from '@/api/modules/demo/trackSequence'
 import statusEnums from '@/utils/status'
 
+const startVideo2image = async (params: any) => {
+  const res = await startTrackSequenceApi(params.id)
+  if (res.code === 200) {
+    ElMessage.success('任务已开始,请等待完成!')
+  } else {
+    ElMessage.error('任务开始失败,请检查!')
+  }
+  proTable.value?.getTableList()
+}
+
+const stopVideo2image = async (params: any) => {
+  const res = await stopTrackSequenceApi(params.id)
+  if (res.code === 200) {
+    ElMessage.success('终止任务成功!')
+  } else {
+    ElMessage.error('终止任务失败,请检查!')
+  }
+  proTable.value?.getTableList()
+}
+
 // ProTable 实例
 const proTable = ref<ProTableInstance>()