Parcourir la source

Merge branch 'develop' of http://101.126.133.7:9001/www/taais-web into develop

28968 il y a 3 semaines
Parent
commit
14f5ac3536

+ 8 - 5
src/views/demo/components/img-maker.vue

@@ -66,6 +66,7 @@ const props = defineProps({
 const state = reactive({
   loading: true,
   radio: 1,
+  radioBackup: 1,
   realRadioX: 0.5,
   realRadioY: 0.5,
   imgPoint: { x: 0, y: 0 },
@@ -211,8 +212,9 @@ const loadInit = () => {
         let config = props.jsonData[i]
         let subArr = config.subArr
         console.log('ratio', state.radio)
-        const lW = imgInstance.width //* state.radio
-        const lH = imgInstance.height //* state.radio
+        state.radioBackup = state.radio
+        const lW = imgInstance.width * state.radio
+        const lH = imgInstance.height * state.radio
         let obj = new fabric.Path(
           'M ' +
             subArr[1] * lW +
@@ -754,7 +756,7 @@ const clearAll = () => {
   state.drawType = 'rectangle'
 }
 const getPoint = pi => {
-  return Math.floor(pi / state.radio)
+  return Math.floor(pi)// / state.radio
 }
 const getRealPoint = poi => {
   let dx = Math.abs(state.imgPoint.x > poi.x ? state.imgPoint.x - poi.x : state.imgPoint.x + poi.x) * state.realRadioX
@@ -807,8 +809,9 @@ const getData = () => {
           // console.log(poi)
           poi = getRealPoint(poi)
           // console.log(poi)
-          poi.x = poi.x / 1920
-          poi.y = poi.y / 1080
+          console.log('radio final:', state.radio, state.radioBackup)
+          poi.x = poi.x / 1920 / state.radioBackup
+          poi.y = poi.y / 1080 / state.radioBackup
           // console.log(poi)
           point['nodes'].push(poi)
           // point['nodes'].push(getRealPoint(poi))

+ 1 - 1
src/views/demo/data/index.vue

@@ -243,7 +243,7 @@ const markImg = data => {
       if (state.cacheData.labelurl && state.cacheData.labelurl.length > 0) {
         console.log('get label jsonData', state.cacheData.labelurl)
         http
-          .get<any>(state.cacheData.labelurl)
+          .get<any>(state.cacheData.labelurl + '?version=' + new Date().getTime())
           .then(res => {
             state.jsonData = []
             res = xywh2fourNodes(res)

+ 30 - 7
src/views/task/bizProcess/index.vue

@@ -47,11 +47,19 @@
         <!--          查看详情-->
         <!--        </el-button>-->
 
-        <el-button v-if="scope.row.name.indexOf('训练') === -1" type="primary" link icon="Refresh" @click="reRunTask(scope.row)">
-          执行任务
+        <el-button v-if="scope.row.name.indexOf('训练') === -1 && (scope.row.status === '0' || scope.row.status === '3')" type="primary" link icon="Refresh" @click="reRunTask(scope.row)">
+          开始任务
+        </el-button>
+        <el-button v-if="scope.row.name.indexOf('训练') !== -1 && (scope.row.status === '0' || scope.row.status === '3')" type="primary" link icon="Refresh" @click="startTask(scope.row)"> 开始任务 </el-button>
+        <el-button v-if="scope.row.status === '0'" type="primary" link icon="Refresh" @click="taskExecute('continue', scope.row)">
+          继续任务
+        </el-button>
+        <el-button v-if="scope.row.status === '1'" type="primary" link icon="Refresh" @click="taskExecute('pause', scope.row)">
+          暂停任务
+        </el-button>
+        <el-button v-if="scope.row.status === '1'" type="primary" link icon="Refresh" @click="taskExecute('stop', scope.row)">
+          停止任务
         </el-button>
-        <el-button v-else type="primary" link icon="Refresh" @click="startTask(scope.row)"> 开始任务 </el-button>
-
         <el-button v-if="!scope.row.name.includes('测试')" type="primary" link icon="finished" @click="showResult(scope.row)"> 结果图 </el-button>
 
         <el-button v-if="!scope.row.name.includes('训练')" type="primary" link icon="search" @click="showTimeResult(scope.row)"> 查看指标 </el-button>
@@ -60,8 +68,8 @@
           查看日志
         </el-button>
 
-        <el-button type="primary" link icon="Refresh" @click="openDir(scope.row)"> 打开文件夹 </el-button>
-        <el-button type="primary" link icon="Refresh" @click="exportData(scope.row)"> 导出结果 </el-button>
+        <el-button type="primary" link icon="document" @click="openDir(scope.row)"> 任务文件夹 </el-button>
+        <el-button type="primary" link icon="document" @click="exportData(scope.row)"> 结果文件夹 </el-button>
       </template>
     </ProTable>
     <FormDialog ref="formDialogRef" />
@@ -313,13 +321,28 @@ const startTask = row => {
     }
   })
 }
+
+const taskExecute = (type, row) => {
+  http.post<any>('/identification/identificationSubtaskDetails/' + (type === 'continue' ? 'continueTask' : type === 'pause' ? 'pauseTask' : 'stopTask'),
+    { bizId: row.id }, { loading: true }).then(res => {
+    if (res.code !== 200) {
+      ElMessage.error(res.msg)
+    } else {
+      ElMessage.success('操作成功')
+    }
+  })
+}
+
 const typeDefs = ref(reactive([]))
 
 const exportData = row => {
   http.get<any>('/identification/identificationSubtaskDetails/resultZip', { taskId: row.id }, { loading: true }).then(res => {
     console.log(res)
     if (res.code === 200) {
-      window.open(res.msg, '_blank')
+      // window.open(res.msg, '_blank')
+      http.get<any>('/identification/identificationSubtaskDetails/openDir', { directory: row.resultPath + "/weights" }, { loading: true }).then(res => {
+        console.log(res)
+      })
     }
   })
 }