7 Achegas a0dcc1bc51 ... 3487b63472

Autor SHA1 Mensaxe Data
  WANGKANG 3487b63472 Merge branch 'dev_wk2' into develop hai 5 meses
  Eagle e84e772cff feat: 多源信息融合、异源图像匹配、电子稳相的暂停、继续、停止功能 hai 5 meses
  Eagle 5bf88e391c feat: revert 4nodes labeled file to xywh format hai 5 meses
  allen f65c4dfe61 Merge branch 'dev_lsk_b12' into develop hai 6 meses
  28968 b6847bb29d fix: bug fix hai 6 meses
  Eagle 3fcbd18f3a feat: 数据扩增任务、电子稳相标准化 hai 6 meses
  28968 69045b929f fix: bug fix hai 6 meses

+ 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)

+ 8 - 0
src/api/modules/demo/match.ts

@@ -35,6 +35,14 @@ export const execute = data => {
   return http.get<any>('/demo/match/execute', data, { loading: false })
 }
 
+export const stopApi = data => {
+  return http.get<any>('/demo/match/stop', data, { loading: false })
+}
+
+export const hangupApi = data => {
+  return http.get<any>('/demo/match/hangup', data, { loading: false })
+}
+
 export const getResult = data => {
   return http.get<any>('/demo/match/result', data, { loading: false })
 }

+ 8 - 0
src/api/modules/demo/traceMerge.ts

@@ -31,6 +31,14 @@ export const executeApi = data => {
   return http.post<any>('/demo/traceMerge/execute', data, { loading: false })
 }
 
+export const stopApi = data => {
+  return http.post<any>('/demo/traceMerge/stop', data, { loading: false })
+}
+
+export const hangupApi = data => {
+  return http.post<any>('/demo/traceMerge/hangup', data, { loading: false })
+}
+
 export const getResApi = data => {
   return http.get<any>('/demo/traceMerge/result', data, { loading: false })
 }

+ 4 - 0
src/api/modules/demo/videoStable.ts

@@ -83,6 +83,10 @@ export const stopVideoStableApi = (id: String | Number) => {
   return http.get('/demo/videoStable/stop/' + id)
 }
 
+export const hangupVideoStableApi = (id: String | Number) => {
+  return http.get('/demo/videoStable/hangup/' + id)
+}
+
 export const getCompareImageApi = (taskId: String, idx: String | Number) => {
   return http.get('/demo/videoStable/compare/' + taskId + '/' + idx)
 }

+ 19 - 6
src/views/demo/components/img-maker.vue

@@ -5,10 +5,11 @@
       <el-button plain type="primary" class="shape-border" @click="enableDragMode" :disabled="state.dragMode">移动图片</el-button>
 
       <el-button plain type="primary" style="margin-left: 30px" class="shape-border" @click="selectLastObject" :disabled="!!state.activeTarget"
-        >选择最后一个标注(w)</el-button
+        >选择标注(w)</el-button
       >
       <el-button plain type="primary" class="shape-border" @click="rotate(8)" :disabled="!state.activeTarget"> 顺时针旋转(r) </el-button>
       <el-button plain type="primary" class="shape-border" @click="rotate(-8)" :disabled="!state.activeTarget">逆时针旋转(e)</el-button>
+      <el-button plain type="primary" class="shape-border" @click="deleteOne">删除(Back)</el-button>
       <el-button plain type="primary" style="margin-left: 30px" class="shape-border" @click="changeZoom(1.1)">放大图片</el-button>
       <el-button plain type="primary" class="shape-border" @click="changeZoom(0.9)">缩小图片</el-button>
       <!-- <el-button plain type="primary" class="shape-border" @click="drawPolygon('polygon')">多边形</el-button> -->
@@ -18,7 +19,7 @@
 </template>
 <script lang="ts" setup>
 import { fabric } from 'fabric'
-import { reactive, watch, onMounted } from 'vue'
+import { reactive, watch, onMounted, computed } from 'vue'
 import { ElMessage } from 'element-plus'
 // import { sortPoints } from '@/utils/fabric'
 
@@ -93,6 +94,7 @@ const state = reactive({
   activeLine: '' as any,
   line: {} as canvasPoint
 })
+
 watch(
   () => props.classDef,
   value => {
@@ -133,14 +135,23 @@ const changeZoom = multi => {
   state.canvas.renderAll()
 }
 
+const deleteOne = () => {
+  const obj = state.canvas.getActiveObject()
+  state.canvas.remove(obj)
+}
+
 const loadInit = () => {
   drawTypeChange('rectangle')
   state.color = props.classDef && props.classDef.color ? props.classDef.color : '#E34F51'
   if (!props.isPicOnly) {
     document.addEventListener('keydown', function (e) {
+      console.log(e.key, state.activeTarget, state.canvas.getActiveObject())
       if (e.key === 'w' || e.key === 'W') {
         selectLastObject()
         return
+      } else if (e.key === 'Backspace') {
+        const obj = state.canvas.getActiveObject()
+        state.canvas.remove(obj)
       }
       if (state.activeTarget) {
         if (e.key === 'r' || e.key === 'R') {
@@ -199,8 +210,9 @@ const loadInit = () => {
       for (let i = 0; i < props.jsonData.length; i++) {
         let config = props.jsonData[i]
         let subArr = config.subArr
-        const lW = imgInstance.width * state.radio
-        const lH = imgInstance.height * state.radio
+        console.log('ratio', state.radio)
+        const lW = imgInstance.width //* state.radio
+        const lH = imgInstance.height //* state.radio
         let obj = new fabric.Path(
           'M ' +
             subArr[1] * lW +
@@ -786,6 +798,7 @@ const getData = () => {
           // }
         })
       } else {
+        // console.log('else')
         marks.forEach(mark => {
           let poi = {
             x: getPoint(aCoords[mark].x),
@@ -794,8 +807,8 @@ const getData = () => {
           // console.log(poi)
           poi = getRealPoint(poi)
           // console.log(poi)
-          poi.x = poi.x / state.realRadioX / 1920
-          poi.y = poi.y / state.realRadioY / 1080
+          poi.x = poi.x / 1920
+          poi.y = poi.y / 1080
           // console.log(poi)
           point['nodes'].push(poi)
           // point['nodes'].push(getRealPoint(poi))

+ 15 - 12
src/views/demo/data/AmplifyForm.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="amplify-main">
-    <ProForm :items-options="items" :model="model"></ProForm>
+    <ProForm ref="proFormRef" :items-options="items"></ProForm>
     <el-button type="primary" v-if="showSelectBatchButton" style="margin-left: 50px" @click="showDataSelectionDialog()">选择批次</el-button>
 
     <el-dialog v-model="dataDialogVisible" title="选择数据批次" style="width: 70vw">
@@ -37,14 +37,15 @@ import { reactive, ref, computed, onMounted, defineEmits } from 'vue'
 import ProForm from '@/components/ProForm/index.vue'
 import { batchListDataApi } from '@/api/modules/demo/data'
 import { getDictsApi } from '@/api/modules/system/dictData'
+import ProFrom from '@/components/ProForm/index.vue'
 
 const emit = defineEmits(['updateData', 'updateModel', 'updateParams'])
-
+const proFormRef = ref<InstanceType<typeof ProFrom> | null>(null)
 // 数据
-let model = {
-  taskName: 'sss',
+const model = ref({
+  taskName: '',
   transfer: null
-}
+})
 
 const dataDialogVisible = ref(false)
 let batchDataList = ref(reactive([] as any[]))
@@ -54,12 +55,14 @@ let tempDeselectedBatchDataList = ref(reactive([] as any[]))
 let parameList = ref(reactive([] as any[]))
 let queryBatchData = ref(reactive([] as any[]))
 
-const props = defineProps({ showSelectBatchButton: Boolean })
+const props = defineProps({ showSelectBatchButton: Boolean, dataList: Array, useData: Boolean })
 
 onMounted(() => {
-  batchListDataApi().then(res => {
-    queryBatchData.value = reactive(res.data)
-  })
+  !props.useData &&
+    batchListDataApi().then(res => {
+      queryBatchData.value = reactive(res.data)
+    })
+  props.useData && (queryBatchData.value = props.dataList) // && console.log('load data', props.dataList)
 
   getDictsApi('expand_data_params').then(res => {
     parameList.value = reactive(JSON.parse(res.data[0].remark))
@@ -75,9 +78,9 @@ onMounted(() => {
           placeholder: '请输入' + item.name
         }
       })
-      model[`${item.agName}`] = item.defaultValue
+      // model.value[`${item.agName}`] = item.defaultValue
     })
-    emit('updateModel', model)
+    emit('updateModel', proFormRef.value.formModel)
     // Emit parameList 给父组件
     emit('updateParams', parameList.value)
   })
@@ -149,7 +152,7 @@ let items: ProForm.ItemsOptions[] = reactive([
     compOptions: {
       elTagName: 'input',
       clearable: true,
-      placeholder: '请输入用户名'
+      placeholder: '请输入任务名称'
     }
   },
   {

+ 11 - 3
src/views/demo/data/index.vue

@@ -212,6 +212,7 @@ const deleteData = async (params: any) => {
   await useHandleData(delDataApi, params.id, `删除【${params.name}】数据`)
   proTable.value?.getTableList()
 }
+import { fourNodes2xywh, xywh2fourNodes } from './reformat'
 
 // 标注图片
 const markImg = data => {
@@ -245,9 +246,11 @@ const markImg = data => {
           .get<any>(state.cacheData.labelurl)
           .then(res => {
             state.jsonData = []
-            console.log(res)
+            res = xywh2fourNodes(res)
+            // console.log('check3', res)
+
             let arr = res.replace('\r', '').split('\n')
-            console.log(arr)
+            // console.log(arr)
             for (let i = 0; i < arr.length; i++) {
               let subArr = arr[i].split(' ')
               // console.log(subArr)
@@ -352,7 +355,12 @@ const handleImgSuccess = data => {
     filename = filename.substring(1)
   }
   // console.log(filename)
-
+  let pData = fourNodes2xywh(data['data'])
+  // console.log('check1', data['data'])
+  data['data'] = pData
+  // let a = xywh2fourNodes(pData)
+  // console.log('check2', a)
+  // let rData = xywh2fourNodes(pData)
   labelFile(data['data'], filename).then(res => {
     // console.log(res)
     if (res.code === 200) {

+ 41 - 0
src/views/demo/data/reformat.js

@@ -0,0 +1,41 @@
+export const fourNodes2xywh = function (data) {
+  let lines = data.replace('\r', '').split('\n')
+  let res = []
+  lines.forEach(line => {
+    const arr = line.split(' ')
+    let tmp = []
+    tmp.push(arr[0])
+    tmp.push((parseFloat(arr[3]) + parseFloat(arr[5])) / 2)
+    tmp.push((parseFloat(arr[2]) + parseFloat(arr[4])) / 2)
+    tmp.push(Math.abs(arr[5] - arr[3]))
+    tmp.push(Math.abs(arr[4] - arr[2]))
+    res.push(tmp.join(' '))
+  })
+  // console.log(res)
+  return res.join('\r\n')
+}
+
+export const xywh2fourNodes = function (data) {
+  let lines = data.replace('\r', '').split('\n')
+  let res = []
+  lines.forEach(line => {
+    const arr = line.split(' ')
+    let tmp = []
+    tmp.push(arr[0])
+    tmp.push(parseFloat(arr[1]) + parseFloat(arr[3]) / 2)
+    tmp.push(parseFloat(arr[2]) - parseFloat(arr[4]) / 2)
+
+    tmp.push(parseFloat(arr[1]) + parseFloat(arr[3]) / 2)
+    tmp.push(parseFloat(arr[2]) + parseFloat(arr[4]) / 2)
+
+    tmp.push(parseFloat(arr[1]) - parseFloat(arr[3]) / 2)
+    tmp.push(parseFloat(arr[2]) + parseFloat(arr[4]) / 2)
+
+    tmp.push(parseFloat(arr[1]) - parseFloat(arr[3]) / 2)
+    tmp.push(parseFloat(arr[2]) - parseFloat(arr[4]) / 2)
+
+    res.push(tmp.join(' '))
+  })
+  // console.log(res)
+  return res.join('\r\n')
+}

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

@@ -20,11 +20,17 @@
       <!-- 表格操作 -->
       <template #operation="scope">
         <el-button type="primary" link icon="View" @click="startDataAugmentation(scope.row)" v-if="scope.row.status == '0'"> 开始 </el-button>
+        <el-button type="primary" link icon="View" @click="startDataAugmentation(scope.row)" v-if="scope.row.status == '4'"> 继续 </el-button>
         <el-popconfirm title="确定终止此任务吗?" @confirm="stopDataAugmentation(scope.row)" v-if="scope.row.status == '1'">
           <template #reference>
             <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 +127,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 +250,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

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

@@ -19,12 +19,18 @@
       </template>
       <!-- 表格操作 -->
       <template #operation="scope">
+        <el-button type="primary" link icon="View" @click="startDataAugmentation(scope.row)" v-if="scope.row.status == '4'"> 继续 </el-button>
         <el-button type="primary" link icon="View" @click="startDataAugmentation(scope.row)" v-if="scope.row.status == '0'"> 开始 </el-button>
         <el-popconfirm title="确定终止此任务吗?" @confirm="stopDataAugmentation(scope.row)" v-if="scope.row.status == '1'">
           <template #reference>
             <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 +116,8 @@ import {
   getCompareImageCountApi,
   getDialogApi,
   getTaskDictData,
-  getMetricApi
+  getMetricApi,
+  pauseDataAugmentationApi
 } from '@/api/modules/demo/dataAugmentation'
 // import {  } from '@/api/modules/system/dictData'
 
@@ -229,7 +236,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

+ 19 - 3
src/views/demo/match/index.vue

@@ -28,7 +28,9 @@
       <!-- 表格操作 -->
       <template #operation="scope">
         <el-button type="primary" icon="View" link @click="doExecute(scope.row)">开始任务</el-button>
-
+        <el-button type="primary" link icon="View" @click="hangupTask(scope.row)"> 暂停任务 </el-button>
+        <el-button type="primary" link icon="View" @click="doExecute(scope.row)"> 继续任务 </el-button>
+        <el-button type="primary" link icon="View" @click="stopTask(scope.row)"> 停止任务 </el-button>
         <el-button type="primary" icon="View" link @click="showData(scope.row)">执行结果</el-button>
 
         <el-button type="primary" icon="View" link @click="showLog(scope.row)">查看日志</el-button>
@@ -68,7 +70,7 @@
         <file @update:model-value="updateFile" :file-size="2048" :file-type="['zip']"></file>
       </el-container>
 
-      <el-container v-for="(item, index) in jsonParams" :key="index" style=" align-items: center;margin-top: 5px">
+      <el-container v-for="(item, index) in jsonParams" :key="index" style="align-items: center; margin-top: 5px">
         <span style="min-width: 80px; max-width: 150px">{{ item.name }}</span>
         <el-tooltip :content="item.prompt" placement="top">
           <el-icon><InfoFilled /></el-icon>
@@ -155,7 +157,9 @@ import {
   getMatchApi,
   createTask,
   execute,
-  getResult
+  getResult,
+  hangupApi,
+  stopApi
 } from '@/api/modules/demo/match'
 import File from '@/components/Upload/File.vue'
 import { getDictsApi } from '@/api/modules/system/dictData'
@@ -229,6 +233,18 @@ const doExecute = function (row) {
   })
 }
 
+const hangupTask = function (row) {
+  hangupApi({ taskId: row.id }).then(res => {
+    console.log(res)
+  })
+}
+
+const stopTask = function (row) {
+  stopApi({ taskId: row.id }).then(res => {
+    console.log(res)
+  })
+}
+
 const jsonParams = ref([])
 const dialogVisible = ref(false)
 const openCreateDialog = async function () {

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

@@ -19,12 +19,18 @@
       </template>
       <!-- 表格操作 -->
       <template #operation="scope">
+        <el-button type="primary" link icon="View" @click="startDataAugmentation(scope.row)" v-if="scope.row.status == '4'"> 继续 </el-button>
         <el-button type="primary" link icon="View" @click="startDataAugmentation(scope.row)" v-if="scope.row.status == '0'"> 开始 </el-button>
         <el-popconfirm title="确定终止此任务吗?" @confirm="stopDataAugmentation(scope.row)" v-if="scope.row.status == '1'">
           <template #reference>
             <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 +124,8 @@ import {
   getCompareImageCountApi,
   getDialogApi,
   getTaskDictData,
-  getMetricApi
+  getMetricApi,
+  pauseDataAugmentationApi
 } from '@/api/modules/demo/dataAugmentation'
 // import {  } from '@/api/modules/system/dictData'
 
@@ -231,6 +238,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)

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

@@ -19,12 +19,18 @@
       </template>
       <!-- 表格操作 -->
       <template #operation="scope">
+        <el-button type="primary" link icon="View" @click="startDataAugmentation(scope.row)" v-if="scope.row.status == '4'"> 继续 </el-button>
         <el-button type="primary" link icon="View" @click="startDataAugmentation(scope.row)" v-if="scope.row.status == '0'"> 开始 </el-button>
         <el-popconfirm title="确定终止此任务吗?" @confirm="stopDataAugmentation(scope.row)" v-if="scope.row.status == '1'">
           <template #reference>
             <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 +130,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 +415,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>()

+ 29 - 4
src/views/demo/traceMerge/index.vue

@@ -26,7 +26,10 @@
         <!--          编辑-->
         <!--        </el-button>-->
         <!--        <el-button type="primary" link icon="Delete" v-auth="['demo:traceMerge:remove']" @click="deleteTraceMerge(scope.row)"> 删除 </el-button>-->
-        <el-button type="primary" link icon="View" @click="execute(scope.row)"> 执行任务 </el-button>
+        <el-button type="primary" link icon="View" @click="execute(scope.row)"> 开始任务 </el-button>
+        <el-button type="primary" link icon="View" @click="hangupTask(scope.row)"> 暂停任务 </el-button>
+        <el-button type="primary" link icon="View" @click="execute(scope.row)"> 继续任务 </el-button>
+        <el-button type="primary" link icon="View" @click="stopTask(scope.row)"> 停止任务 </el-button>
         <el-button type="primary" link icon="View" @click="display(scope.row)"> 展示结果 </el-button>
         <el-button type="primary" link icon="View" @click="showLog(scope.row)"> 查看日志 </el-button>
         <el-button type="primary" link icon="View" @click="showResult(scope.row)"> 查看指标 </el-button>
@@ -43,9 +46,9 @@
         </el-container>
         <el-container style="margin-top: 20px">
           <span style="min-width: 80px">任务文件</span>
-          <file @update:model-value="updateFiles" :file-size="20" :file-type="['mat']"></file>
+          <file @update:model-value="updateFiles" :file-size="20" :file-type="['mat', 'json', 'txt']"></file>
         </el-container>
-        <el-container v-for="(item, index) in jsonParams" :key="index" style=" align-items: center;margin-top: 5px">
+        <el-container v-for="(item, index) in jsonParams" :key="index" style="align-items: center; margin-top: 5px">
           <span style="min-width: 80px; max-width: 150px">{{ item.name }}</span>
           <el-tooltip :content="item.prompt" placement="top">
             <el-icon><InfoFilled /></el-icon>
@@ -100,9 +103,11 @@ import {
   exportTraceMergeApi,
   getResApi,
   getTraceMergeApi,
+  hangupApi,
   importTemplateApi,
   importTraceMergeDataApi,
   listTraceMergeApi,
+  stopApi,
   updateTraceMergeApi
 } from '@/api/modules/demo/traceMerge'
 import File from '@/components/Upload/File.vue'
@@ -184,6 +189,26 @@ const execute = function (row) {
   })
 }
 
+const hangupTask = function (row) {
+  hangupApi({ taskId: row.id }).then(res => {
+    if (res.code == 200) {
+      ElMessage.success('暂停成功!')
+    } else {
+      ElMessage.error('暂停失败: ' + res.msg)
+    }
+  })
+}
+
+const stopTask = function (row) {
+  stopApi({ taskId: row.id }).then(res => {
+    if (res.code == 200) {
+      ElMessage.success('停止成功!')
+    } else {
+      ElMessage.error('停止失败: ' + res.msg)
+    }
+  })
+}
+
 const jsonParams = ref([])
 const createTask = async function () {
   const res = await getOneAlgorithmConfigApi({ algorithmName: '多源信息融合' })
@@ -198,7 +223,7 @@ const createTask = async function () {
 
 const submitCreateTask = function () {
   if (params.value.preprocessPath == null || params.value.preprocessPath === '') {
-    ElMessage.error('请上传mat文件!')
+    ElMessage.error('请上传源数据文件!')
     return
   } else if (params.value.name == null || params.value.name === '') {
     ElMessage.error('请输入任务名称!')

+ 109 - 74
src/views/demo/videoStable/index.vue

@@ -30,10 +30,17 @@
           link
           icon="View"
           @click="startVideoStable(scope.row)"
-          v-if="scope.row.status == '0' || scope.row.status == '3' || scope.row.status == '4'"
+          v-if="scope.row.status == '0' || scope.row.status == '3' || scope.row.status == '2'"
         >
           开始
         </el-button>
+
+        <el-button type="primary" link icon="View" @click="startVideoStable(scope.row)" v-if="scope.row.status == '4'"> 继续 </el-button>
+        <el-popconfirm title="确定暂停此任务吗?" @confirm="hangupVideoStable(scope.row)" v-if="scope.row.status == '1'">
+          <template #reference>
+            <el-button type="primary" link icon="View"> 暂停 </el-button>
+          </template>
+        </el-popconfirm>
         <el-popconfirm title="确定终止此任务吗?" @confirm="stopVideoStable(scope.row)" v-if="scope.row.status == '1'">
           <template #reference>
             <el-button type="primary" link icon="View"> 终止 </el-button>
@@ -89,13 +96,15 @@ import {
   // getCompareImageApi,
   // getCompareImageCountApi,
   getImagesApi,
-  getLogVideoStableApi
+  getLogVideoStableApi,
+  hangupVideoStableApi
 } from '@/api/modules/demo/videoStable'
 
 import useWebSocketStore from '@/stores/modules/websocket'
 import { resetHeart } from '@/utils/websocket'
 import ViewLog from '@/views/demo/components/ViewLog.vue'
 import PreviewCompareImages from '@/views/demo/components/PreviewCompareImages.vue'
+import { getOneAlgorithmConfigApi, listAlgorithmConfigApi } from '@/api/modules/demo/algorithmConfig'
 
 const previewCompareImagesRef = ref()
 const previewCompare = async row => {
@@ -138,6 +147,16 @@ const stopVideoStable = async (params: any) => {
   proTable.value?.getTableList()
 }
 
+const hangupVideoStable = async (params: any) => {
+  const res = await hangupVideoStableApi(params.id)
+  if (res.code === 200) {
+    ElMessage.success('任务暂停成功')
+  } else {
+    ElMessage.error('任务暂停失败!')
+  }
+  proTable.value?.getTableList()
+}
+
 // ProTable 实例
 const proTable = ref<ProTableInstance>()
 
@@ -181,7 +200,7 @@ const openDialog = async (type: number, title: string, row?: any) => {
     res = await getVideoStableApi(row?.id || null)
   }
   // 重置表单
-  setItemsOptions()
+  await setItemsOptions()
   const params = {
     title,
     width: 580,
@@ -338,7 +357,7 @@ const columns = reactive<ColumnProps<any>[]>([
 ])
 // 表单配置项
 let itemsOptions: ProForm.ItemsOptions[] = []
-const setItemsOptions = () => {
+const setItemsOptions = async () => {
   itemsOptions = [
     {
       label: '任务名称',
@@ -359,76 +378,76 @@ const setItemsOptions = () => {
         placeholder: '请上传图片集压缩包'
       }
     },
-    {
-      label: '网格大小',
-      prop: 'block_size',
-      rules: [],
-      compOptions: {
-        type: 'input',
-        clearable: true,
-        placeholder: '默认50'
-      }
-    },
-    {
-      label: '扩散半径',
-      prop: 'radius',
-      rules: [],
-      compOptions: {
-        type: 'input',
-        clearable: true,
-        placeholder: '默认500'
-      }
-    },
-    {
-      label: '缓冲区大小',
-      prop: 'buffer_size',
-      rules: [],
-      compOptions: {
-        type: 'input',
-        clearable: true,
-        placeholder: '默认200'
-      }
-    },
-    {
-      label: '角点质量',
-      prop: 'cornerquality',
-      rules: [],
-      compOptions: {
-        type: 'input',
-        clearable: true,
-        placeholder: '默认0.2'
-      }
-    },
-    {
-      label: '角点最小距离',
-      prop: 'cornerminDistance',
-      rules: [],
-      compOptions: {
-        type: 'input',
-        clearable: true,
-        placeholder: '默认5'
-      }
-    },
-    {
-      label: '光流层级',
-      prop: 'lklevel',
-      rules: [],
-      compOptions: {
-        type: 'input',
-        clearable: true,
-        placeholder: '默认3'
-      }
-    },
-    {
-      label: '光流窗口大小',
-      prop: 'lkwinSiz',
-      rules: [],
-      compOptions: {
-        type: 'input',
-        clearable: true,
-        placeholder: '默认15'
-      }
-    },
+    // {
+    //   label: '网格大小',
+    //   prop: 'block_size',
+    //   rules: [],
+    //   compOptions: {
+    //     type: 'input',
+    //     clearable: true,
+    //     placeholder: '默认50'
+    //   }
+    // },
+    // {
+    //   label: '扩散半径',
+    //   prop: 'radius',
+    //   rules: [],
+    //   compOptions: {
+    //     type: 'input',
+    //     clearable: true,
+    //     placeholder: '默认500'
+    //   }
+    // },
+    // {
+    //   label: '缓冲区大小',
+    //   prop: 'buffer_size',
+    //   rules: [],
+    //   compOptions: {
+    //     type: 'input',
+    //     clearable: true,
+    //     placeholder: '默认200'
+    //   }
+    // },
+    // {
+    //   label: '角点质量',
+    //   prop: 'cornerquality',
+    //   rules: [],
+    //   compOptions: {
+    //     type: 'input',
+    //     clearable: true,
+    //     placeholder: '默认0.2'
+    //   }
+    // },
+    // {
+    //   label: '角点最小距离',
+    //   prop: 'cornerminDistance',
+    //   rules: [],
+    //   compOptions: {
+    //     type: 'input',
+    //     clearable: true,
+    //     placeholder: '默认5'
+    //   }
+    // },
+    // {
+    //   label: '光流层级',
+    //   prop: 'lklevel',
+    //   rules: [],
+    //   compOptions: {
+    //     type: 'input',
+    //     clearable: true,
+    //     placeholder: '默认3'
+    //   }
+    // },
+    // {
+    //   label: '光流窗口大小',
+    //   prop: 'lkwinSiz',
+    //   rules: [],
+    //   compOptions: {
+    //     type: 'input',
+    //     clearable: true,
+    //     placeholder: '默认15'
+    //   }
+    // },
     {
       label: '备注',
       prop: 'remarks',
@@ -444,6 +463,22 @@ const setItemsOptions = () => {
       }
     }
   ]
+
+  const res = await getOneAlgorithmConfigApi({ algorithmName: '电子稳相' })
+  const config = JSON.parse(res.data.parameters)
+  config.forEach(item => {
+    itemsOptions.push({
+      label: item.name,
+      prop: item.agName,
+      rules: [],
+      compOptions: {
+        type: 'input',
+        clearable: true,
+        placeholder: item.defaultValue
+      },
+      tooltip: item.prompt
+    })
+  })
 }
 </script>
 

+ 256 - 0
src/views/system/config/index.vue

@@ -0,0 +1,256 @@
+<template>
+  <div class="table-box">
+    <ProTable ref="proTable" :columns="columns" row-key="id" :request-api="listAlgorithmConfigApi">
+      <!-- 表格 header 按钮 -->
+      <template #tableHeader="scope">
+        <el-button type="primary" v-auth="['demo:algorithmConfig:add']" icon="CirclePlus" @click="openDialog(1, '通用算法配置新增')">
+          新增
+        </el-button>
+        <el-button type="primary" v-auth="['demo:algorithmConfig:import']" icon="Upload" plain @click="batchAdd"> 导入 </el-button>
+        <el-button type="primary" v-auth="['demo:algorithmConfig:export']" icon="Download" plain @click="downloadFile"> 导出 </el-button>
+        <el-button
+          type="danger"
+          v-auth="['demo:algorithmConfig:remove']"
+          icon="Delete"
+          plain
+          :disabled="!scope.isSelected"
+          @click="batchDelete(scope.selectedListIds)"
+        >
+          批量删除
+        </el-button>
+      </template>
+      <!-- 表格操作 -->
+      <template #operation="scope">
+        <el-button type="primary" link icon="View" v-auth="['demo:algorithmConfig:query']" @click="openDialog(3, '通用算法配置查看', scope.row)">
+          查看
+        </el-button>
+        <el-button type="primary" link icon="EditPen" v-auth="['demo:algorithmConfig:edit']" @click="openDialog(2, '通用算法配置编辑', scope.row)">
+          编辑
+        </el-button>
+        <el-button type="primary" link icon="Delete" v-auth="['demo:algorithmConfig:remove']" @click="deleteAlgorithmConfig(scope.row)">
+          删除
+        </el-button>
+      </template>
+    </ProTable>
+    <FormDialog ref="formDialogRef" />
+    <ImportExcel ref="dialogRef" />
+  </div>
+</template>
+
+<script setup lang="tsx" name="AlgorithmConfig">
+import { ref, reactive } from 'vue'
+import { useHandleData } from '@/hooks/useHandleData'
+import { useDownload } from '@/hooks/useDownload'
+import { 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'
+import { ProTableInstance, ColumnProps } from '@/components/ProTable/interface'
+import {
+  listAlgorithmConfigApi,
+  delAlgorithmConfigApi,
+  addAlgorithmConfigApi,
+  updateAlgorithmConfigApi,
+  importTemplateApi,
+  importAlgorithmConfigDataApi,
+  exportAlgorithmConfigApi,
+  getAlgorithmConfigApi
+} from '@/api/modules/demo/algorithmConfig'
+
+// ProTable 实例
+const proTable = ref<ProTableInstance>()
+
+// 删除通用算法配置信息
+const deleteAlgorithmConfig = async (params: any) => {
+  await useHandleData(delAlgorithmConfigApi, params.id, '删除【' + params.id + '】通用算法配置')
+  proTable.value?.getTableList()
+}
+
+// 批量删除通用算法配置信息
+const batchDelete = async (ids: string[]) => {
+  await useHandleData(delAlgorithmConfigApi, ids, '删除所选通用算法配置信息')
+  proTable.value?.clearSelection()
+  proTable.value?.getTableList()
+}
+
+// 导出通用算法配置列表
+const downloadFile = async () => {
+  ElMessageBox.confirm('确认导出通用算法配置数据?', '温馨提示', { type: 'warning' }).then(() =>
+    useDownload(exportAlgorithmConfigApi, '通用算法配置列表', proTable.value?.searchParam)
+  )
+}
+
+// 批量添加通用算法配置
+const dialogRef = ref<InstanceType<typeof ImportExcel> | null>(null)
+const batchAdd = () => {
+  const params = {
+    title: '通用算法配置',
+    tempApi: importTemplateApi,
+    importApi: importAlgorithmConfigDataApi,
+    getTableList: proTable.value?.getTableList
+  }
+  dialogRef.value?.acceptParams(params)
+}
+
+const formDialogRef = ref<InstanceType<typeof FormDialog> | null>(null)
+// 打开弹框的功能
+const openDialog = async (type: number, title: string, row?: any) => {
+  let res = { data: {} }
+  if (row?.id) {
+    res = await getAlgorithmConfigApi(row?.id || null)
+  }
+  // 重置表单
+  setItemsOptions()
+  const params = {
+    title,
+    width: 580,
+    isEdit: type !== 3,
+    itemsOptions: itemsOptions,
+    model: type == 1 ? {} : res.data,
+    api: type == 1 ? addAlgorithmConfigApi : updateAlgorithmConfigApi,
+    getTableList: proTable.value?.getTableList
+  }
+  formDialogRef.value?.openDialog(params)
+}
+
+// 表格配置项
+const columns = reactive<ColumnProps<any>[]>([
+  { type: 'selection', fixed: 'left', width: 70 },
+  { prop: 'id', label: 'ID' },
+  {
+    prop: 'tool',
+    label: '工具',
+    search: {
+      el: 'input'
+    },
+    width: 120
+  },
+  {
+    prop: 'module',
+    label: '模块',
+    search: {
+      el: 'input'
+    },
+    width: 120
+  },
+  {
+    prop: 'algorithmName',
+    label: '算法名称',
+    search: {
+      el: 'input'
+    },
+    width: 120
+  },
+  {
+    prop: 'startApi',
+    label: '开始接口',
+    search: {
+      el: 'input'
+    },
+    width: 120
+  },
+  {
+    prop: 'pauseApi',
+    label: '暂停接口',
+    search: {
+      el: 'input'
+    },
+    width: 120
+  },
+  {
+    prop: 'terminateApi',
+    label: '终止接口',
+    search: {
+      el: 'input'
+    },
+    width: 120
+  },
+  {
+    prop: 'parameters',
+    label: '参数',
+    search: {
+      el: 'input'
+    },
+    width: 120
+  },
+  {
+    prop: 'remarks',
+    label: '备注',
+    search: {
+      el: 'input'
+    },
+    width: 120
+  },
+  { prop: 'operation', label: '操作', width: 230, fixed: 'right' }
+])
+// 表单配置项
+let itemsOptions: ProForm.ItemsOptions[] = []
+const setItemsOptions = () => {
+  itemsOptions = [
+    {
+      label: '工具',
+      prop: 'tool',
+      rules: [{ required: true, message: '工具名称不能为空', trigger: 'blur' }],
+      compOptions: {
+        placeholder: '请输入工具名称'
+      }
+    },
+    {
+      label: '模块',
+      prop: 'module',
+      rules: [{ required: true, message: '模块不能为空', trigger: 'blur' }],
+      compOptions: {
+        placeholder: '请输入模块'
+      }
+    },
+    {
+      label: '算法名称',
+      prop: 'algorithmName',
+      rules: [{ required: true, message: '算法名称不能为空', trigger: 'blur' }],
+      compOptions: {
+        placeholder: '请输入算法名称'
+      }
+    },
+    {
+      label: '开始接口',
+      prop: 'startApi',
+      rules: [{ required: true, message: '开始接口不能为空', trigger: 'blur' }],
+      compOptions: {
+        placeholder: '请输入开始接口'
+      }
+    },
+    {
+      label: '暂停接口',
+      prop: 'pauseApi',
+      rules: [{ required: true, message: '暂停接口不能为空', trigger: 'blur' }],
+      compOptions: {
+        placeholder: '请输入暂停接口'
+      }
+    },
+    {
+      label: '终止接口',
+      prop: 'terminateApi',
+      rules: [{ required: true, message: '终止接口不能为空', trigger: 'blur' }],
+      compOptions: {
+        placeholder: '请输入终止接口'
+      }
+    },
+    {
+      label: '参数',
+      prop: 'parameters',
+      rules: [{ required: true, message: '参数不能为空', trigger: 'blur' }],
+      compOptions: {
+        placeholder: '请输入参数'
+      }
+    },
+    {
+      label: '备注',
+      prop: 'remarks',
+      rules: [{ required: false, message: '备注不能为空', trigger: 'blur' }],
+      compOptions: {
+        placeholder: '请输入备注'
+      }
+    }
+  ]
+}
+</script>

+ 8 - 3
src/views/taais/homePage/task/index.vue

@@ -110,7 +110,9 @@
           @update-data="updateBatchData"
           @update-model="updateModelData"
           @update-params="updateParamsList"
-          :show-select-batch-button="false"
+          :show-select-batch-button="true"
+          :use-data="true"
+          :data-list="selectedBatchDataList"
         />
       </el-container>
       <el-container style="height: 10px"></el-container>
@@ -202,11 +204,13 @@ const updateBatchData = data => {
 
 const updateModelData = data => {
   model.value = data
+  console.log('model', model.value)
 }
 
 // 监听 parameList 更新
 const updateParamsList = data => {
   parameList.value = data
+  console.log('params', parameList.value)
 }
 
 // 提交逻辑
@@ -219,8 +223,9 @@ const getTrainAugmentationParams = () => {
   })
 
   return {
-    batchNum,
+    batchNum: batchNum,
     taskName: model.value.taskName,
+    augmentationType: model.value.augmentationType,
     otherParams: parameList.value
   }
 }
@@ -276,7 +281,6 @@ const valid = data => {
 }
 
 const submit = () => {
-  console.log('submit data, formdata is: ', formData)
   const params = {
     taskName: formData.taskName,
     taskType: formData.taskType,
@@ -287,6 +291,7 @@ const submit = () => {
     hasTrainAugmentation: formData.expandData,
     trainAugmentationParams: getTrainAugmentationParams()
   }
+  console.log('submit data', params)
   let result = valid(params)
   // console.log(result)
   if (result.code !== 200) {

+ 2 - 0
src/views/task/bizProcess/index.vue

@@ -412,10 +412,12 @@ const loadVerifyResult = async (name, filepath) => {
   }
 }
 
+import { xywh2fourNodes } from '../../demo/data/reformat'
 const setDetail = obj => {
   http.get<any>(obj.labelUrl).then(res => {
     obj.jsonData = []
     // console.log('result', res)
+    res = xywh2fourNodes(res)
     let arr = res.replace('\r', '').split('\n')
     // console.log(arr)
     for (let i = 0; i < arr.length; i++) {