Răsfoiți Sursa

Merge branch 'dev_lsk_1103' of www/taais-web into develop

Sk18834839360 7 luni în urmă
părinte
comite
d851f302d7

+ 9 - 4
src/views/demo/match/index.vue

@@ -58,7 +58,7 @@
     <FormDialog ref="formDialogRef" />
     <ImportExcel ref="dialogRef" />
 
-    <el-dialog v-model="dialogVisible" title="创建任务">
+    <el-dialog v-if="dialogVisible" v-model="dialogVisible" title="创建任务">
       <el-container>
         <span class="span_class">任务名称</span>
         <el-input v-model="formData.name" placeholder="请输入任务名称"></el-input>
@@ -221,17 +221,22 @@ const doExecute = function (row) {
 
 const dialogVisible = ref(false)
 const openCreateDialog = function () {
+  formData.value = {
+    name: '',
+    file: null
+  }
   dialogVisible.value = true
 }
-const formData = reactive({
+const formData = ref({
   name: '',
   file: null
 })
 const doCreateTask = function () {
-  createTask(formData).then(res => {
+  createTask(formData.value).then(res => {
     if (res.code === 200) {
       dialogVisible.value = false
       ElMessage.success('创建成功')
+      proTable.value.getTableList()
     } else {
       ElMessage.error('创建失败,' + res.msg)
     }
@@ -239,7 +244,7 @@ const doCreateTask = function () {
 }
 const updateFile = function (fileId) {
   // console.log('catch')
-  formData.file = fileId
+  formData.value.file = fileId
 }
 
 // ProTable 实例

+ 6 - 1
src/views/demo/traceMerge/index.vue

@@ -35,7 +35,7 @@
     <FormDialog ref="formDialogRef" />
     <ImportExcel ref="dialogRef" />
 
-    <el-dialog v-model="createTaskDialogVisible" title="新增任务">
+    <el-dialog v-if="createTaskDialogVisible" v-model="createTaskDialogVisible" title="新增任务">
       <el-container style="display: flex; flex-direction: column; justify-content: center">
         <el-container>
           <span style="min-width: 80px">任务名称</span>
@@ -155,6 +155,10 @@ const execute = function (row) {
 
 const createTask = function () {
   createTaskDialogVisible.value = true
+  params.value = {
+    preprocessPath: null,
+    name: ''
+  }
 }
 
 const submitCreateTask = function () {
@@ -171,6 +175,7 @@ const submitCreateTask = function () {
       if (res.code === 200) {
         ElMessage.success('创建成功!')
         createTaskDialogVisible.value = false
+        proTable.value.getTableList()
       } else {
         ElMessage.error(res.msg)
       }

+ 43 - 76
src/views/task/bizProcess/index.vue

@@ -52,11 +52,9 @@
         </el-button>
         <el-button v-else type="primary" link icon="Refresh" @click="startTask(scope.row)"> 开始训练 </el-button>
 
-        <el-button type="primary" link icon="finished" @click="showResult(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-show="scope.row.name.indexOf('训练') === -1" type="primary" link icon="search" @click="showExecutedTime(scope.row)">
-          执行时间
-        </el-button>
+        <el-button v-if="!scope.row.name.includes('训练')" type="primary" link icon="search" @click="showTimeResult(scope.row)"> 查看指标 </el-button>
 
         <el-button type="primary" link icon="document" v-auth="['identification:identificationSubtaskDetails:query']" @click="viewLog(scope.row)">
           查看日志
@@ -68,29 +66,6 @@
     <FormDialog ref="formDialogRef" />
     <ImportExcel ref="dialogRef" />
 
-    <el-dialog v-model="executedTimeVisible" title="执行时间统计" width="70%">
-      <el-container v-for="(item, index) in executedTimeData.data" :key="index">
-        <el-container style="display: flex; flex-direction: column">
-          <h4 v-if="index === 0" style="color: greenyellow">单幅图像最短运行时间</h4>
-          <h4 v-else-if="index === 1" style="color: greenyellow">单幅图像最长运行时间</h4>
-          <h4 v-else-if="index === 2" style="color: greenyellow">单幅图像平均运行时间</h4>
-          <div style="display: flex; flex-direction: row">
-            <h5>前处理用时: {{ item['preprocess'] }}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</h5>
-            <h5>推理用时: {{ item['inference'] }}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</h5>
-            <h5>后处理用时: {{ item['postprocess'] }}</h5>
-          </div>
-        </el-container>
-      </el-container>
-      <el-container>
-        <div v-if="executedTimeData.isVal">
-          <h4 style="color: greenyellow">虚警率</h4>
-          <h5>{{ executedTimeData.falseAlarmRate }} &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</h5>
-          <h4 style="color: greenyellow">漏检率</h4>
-          <h5>{{ executedTimeData.omitDetectRate }}</h5>
-        </div>
-      </el-container>
-    </el-dialog>
-
     <el-dialog v-model="dialogVisible" title="日志" width="70%">
       <div class="log" ref="logRef">
         <div class="p" v-for="(item, index) in logInfo" :key="index">{{ item }}</div>
@@ -160,33 +135,41 @@
 
     <el-dialog v-model="resultDialogVisible" title="执行结果">
       <!--      style="width: 70vw"-->
-      <el-card :body-style="{ padding: '0px' }">
+      <div v-if="refSelectData.name.includes('训练')">
         <div style="padding: 14px">
-          <span>P_curve</span>
+          <span>Results</span>
         </div>
-        <el-image :src="PATH_PREFIX + refSelectData.resultPath + '/P_curve.png'"></el-image>
-      </el-card>
+        <el-image :src="PATH_PREFIX + refSelectData.resultPath + '/results.png'"></el-image>
+      </div>
+      <div v-else>
+        <el-card :body-style="{ padding: '0px' }">
+          <div style="padding: 14px">
+            <span>P_curve</span>
+          </div>
+          <el-image :src="PATH_PREFIX + refSelectData.resultPath + '/P_curve.png'"></el-image>
+        </el-card>
 
-      <el-card :body-style="{ padding: '0px' }" style="margin-top: 10px">
-        <div style="padding: 14px">
-          <span>R_curve</span>
-        </div>
-        <el-image :src="PATH_PREFIX + refSelectData.resultPath + '/R_curve.png'"></el-image>
-      </el-card>
+        <el-card :body-style="{ padding: '0px' }" style="margin-top: 10px">
+          <div style="padding: 14px">
+            <span>R_curve</span>
+          </div>
+          <el-image :src="PATH_PREFIX + refSelectData.resultPath + '/R_curve.png'"></el-image>
+        </el-card>
 
-      <el-card :body-style="{ padding: '0px' }" style="margin-top: 10px">
-        <div style="padding: 14px">
-          <span>PR_curve</span>
-        </div>
-        <el-image :src="PATH_PREFIX + refSelectData.resultPath + '/PR_curve.png'"></el-image>
-      </el-card>
+        <el-card :body-style="{ padding: '0px' }" style="margin-top: 10px">
+          <div style="padding: 14px">
+            <span>PR_curve</span>
+          </div>
+          <el-image :src="PATH_PREFIX + refSelectData.resultPath + '/PR_curve.png'"></el-image>
+        </el-card>
 
-      <el-card :body-style="{ padding: '0px' }" style="margin-top: 10px">
-        <div style="padding: 14px">
-          <span>F1_curve</span>
-        </div>
-        <el-image :src="PATH_PREFIX + refSelectData.resultPath + '/F1_curve.png'"></el-image>
-      </el-card>
+        <el-card :body-style="{ padding: '0px' }" style="margin-top: 10px">
+          <div style="padding: 14px">
+            <span>F1_curve</span>
+          </div>
+          <el-image :src="PATH_PREFIX + refSelectData.resultPath + '/F1_curve.png'"></el-image>
+        </el-card>
+      </div>
     </el-dialog>
 
     <el-dialog v-model="compareDialogVisible" title="验证指标对比">
@@ -264,6 +247,8 @@
         </el-container>
       </el-container>
     </el-dialog>
+
+    <ResultDialog ref="ResultDialogRef" />
   </div>
 </template>
 
@@ -295,6 +280,15 @@ import { getDictsApi, listDataApi as listDictDataApi } from '@/api/modules/syste
 import { useRoute } from 'vue-router'
 import ImagePreview from '@/components/ImagePreview/index.vue'
 import http from '@/api'
+import ResultDialog from '@/components/ResultDialog/ResultDialog.vue'
+
+const ResultDialogRef = ref<InstanceType<typeof ResultDialog> | null>(null)
+const showTimeResult = async function (row) {
+  let path = row.resultPath.split('ObjectDetection_Web')
+  path = path[path.length - 1]
+  let result = await http.get('/profile/task/' + path + '/result.json')
+  ResultDialogRef.value.openDialog(result)
+}
 const route = useRoute()
 const PATH_PREFIX = 'api/profile/task'
 let resultDialogVisible = ref(false)
@@ -328,33 +322,6 @@ const exportData = row => {
   })
 }
 
-let executedTimeVisible = ref(false)
-let executedTimeData = ref({})
-const showExecutedTime = row => {
-  try {
-    console.log('row', row)
-    executedTimeData.value.isVal = row.name.includes('验证')
-    http.get('/profile/task' + row.resultPath + '/time.json').then(res => {
-      executedTimeData.value.data = []
-      executedTimeData.value.data.push(res[0].min)
-      executedTimeData.value.data.push(res[0].max)
-      executedTimeData.value.data.push(res[0].average)
-      if (executedTimeData.value.isVal) {
-        setTimeout(() => {
-          http.get('/profile/task' + row.resultPath + '/matrics.json').then(res => {
-            executedTimeData.value.omitDetectRate = res[1].omit_detect_rate
-            executedTimeData.value.falseAlarmRate = res[0].false_alarm_rate
-          })
-        }, 550)
-      }
-    })
-  } catch (e) {
-    ElMessage.error('解析JSON错误,请检查任务是否已完成')
-    return
-  }
-  executedTimeVisible.value = true
-}
-
 let imgDataList = ref(reactive([]))
 let titleMsg = ref('')
 let valDialogVisible = ref(false)