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

feat: 添加中止,开始任务按钮

WANGKANG 7 сар өмнө
parent
commit
95b3e5d37a

+ 11 - 11
src/views/demo/toInfrared/index.vue

@@ -23,19 +23,19 @@
           type="primary"
           link
           icon="View"
-          v-auth="['demo:video2image:start']"
+          v-auth="['demo:ToInfrared:start']"
           v-if="scope.row.status == '0' || scope.row.status == '3' || scope.row.status == '4'"
-          ><!-- @click="startVideo2image(scope.row)" -->
-          <!-- @confirm="stopVideo2image(scope.row)" -->
+          @click="startToInfrared(scope.row)"
+        >
           开始
         </el-button>
-        <el-popconfirm title="确定终止此任务吗?" v-if="scope.row.status == '1'">
+        <el-popconfirm title="确定终止此任务吗?" @confirm="stopToInfrared(scope.row)" v-if="scope.row.status == '1'">
           <template #reference>
             <el-button type="primary" link icon="Delete"> 终止 </el-button>
           </template>
         </el-popconfirm>
-        <el-button type="primary" link icon="View" v-auth="['demo:video2image:download']" v-if="scope.row.status == '2'">
-          <!-- @click="dowloadVideo2image(scope.row)" -->
+        <el-button type="primary" link icon="View" v-auth="['demo:ToInfrared:download']" v-if="scope.row.status == '2'">
+          <!-- @click="dowloadToInfrared(scope.row)" -->
           下载
         </el-button>
         <!-- <el-button type="primary" link icon="View" v-auth="['demo:toInfrared:query']" @click="openDialog(3, '查看', scope.row)"> 查看 </el-button> -->
@@ -61,7 +61,7 @@
 import { ref, reactive } from 'vue'
 import { useHandleData } from '@/hooks/useHandleData'
 import { useDownload } from '@/hooks/useDownload'
-import { ElMessageBox } from 'element-plus'
+import { ElMessage, ElMessageBox } from 'element-plus'
 import ProTable from '@/components/ProTable/index.vue'
 import ImportExcel from '@/components/ImportExcel/index.vue'
 import FormDialog from '@/components/FormDialog/index.vue'
@@ -79,8 +79,8 @@ import {
 } from '@/api/modules/demo/toInfrared'
 import statusEnums from '@/utils/status'
 
-const startVideo2image = async (params: any) => {
-  const res = await startToInfraredApi(params.id)
+const startToInfrared = async (params: any) => {
+  const res: any = await startToInfraredApi(params.id)
   if (res.code === 200) {
     ElMessage.success('任务已开始,请等待完成!')
   } else {
@@ -89,8 +89,8 @@ const startVideo2image = async (params: any) => {
   proTable.value?.getTableList()
 }
 
-const stopVideo2image = async (params: any) => {
-  const res = await stopToInfraredApi(params.id)
+const stopToInfrared = async (params: any) => {
+  const res: any = await stopToInfraredApi(params.id)
   if (res.code === 200) {
     ElMessage.success('终止任务成功!')
   } else {

+ 9 - 9
src/views/demo/trackSequence/index.vue

@@ -25,11 +25,11 @@
           icon="View"
           v-auth="['demo:trackSequence:start']"
           v-if="scope.row.status == '0' || scope.row.status == '3' || scope.row.status == '4'"
-          ><!-- @click="starttrackSequence(scope.row)" -->
-          <!-- @confirm="stoptrackSequence(scope.row)" -->
+          @click="startTrackSequence(scope.row)"
+        >
           开始
         </el-button>
-        <el-popconfirm title="确定终止此任务吗?" v-if="scope.row.status == '1'">
+        <el-popconfirm title="确定终止此任务吗?" @confirm="stopTrackSequence(scope.row)" v-if="scope.row.status == '1'">
           <template #reference>
             <el-button type="primary" link icon="Delete"> 终止 </el-button>
           </template>
@@ -45,7 +45,7 @@
           link
           icon="Delete"
           v-auth="['demo:toInfrared:remove']"
-          @click="deleteToInfrared(scope.row)"
+          @click="deleteTrackSequence(scope.row)"
           :disabled="scope.row.status == '1'"
         >
           删除
@@ -61,7 +61,7 @@
 import { ref, reactive } from 'vue'
 import { useHandleData } from '@/hooks/useHandleData'
 import { useDownload } from '@/hooks/useDownload'
-import { ElMessageBox } from 'element-plus'
+import { ElMessage, ElMessageBox } from 'element-plus'
 import ProTable from '@/components/ProTable/index.vue'
 import ImportExcel from '@/components/ImportExcel/index.vue'
 import FormDialog from '@/components/FormDialog/index.vue'
@@ -80,8 +80,8 @@ import {
 } from '@/api/modules/demo/trackSequence'
 import statusEnums from '@/utils/status'
 
-const startVideo2image = async (params: any) => {
-  const res = await startTrackSequenceApi(params.id)
+const startTrackSequence = async (params: any) => {
+  const res: any = await startTrackSequenceApi(params.id)
   if (res.code === 200) {
     ElMessage.success('任务已开始,请等待完成!')
   } else {
@@ -90,8 +90,8 @@ const startVideo2image = async (params: any) => {
   proTable.value?.getTableList()
 }
 
-const stopVideo2image = async (params: any) => {
-  const res = await stopTrackSequenceApi(params.id)
+const stopTrackSequence = async (params: any) => {
+  const res: any = await stopTrackSequenceApi(params.id)
   if (res.code === 200) {
     ElMessage.success('终止任务成功!')
   } else {