Kaynağa Gözat

feat: 数据指标

Eagle 8 ay önce
ebeveyn
işleme
3e80924bc0

+ 30 - 0
src/components/ResultDialog/ResultDialog.vue

@@ -0,0 +1,30 @@
+<template>
+  <el-dialog v-model="dialogVisible" :title="params.title">
+    <el-table :data="params.data" style="width: 100%">
+      <el-table-column prop="name" label="指标" width="300" />
+      <el-table-column prop="value" label="数值" width="300" />
+    </el-table>
+  </el-dialog>
+</template>
+
+<script setup lang="tsx" name="ResultDialog">
+import { ref } from 'vue'
+const params = ref({
+  title: '指标对比',
+  data: []
+})
+
+const dialogVisible = ref(false)
+
+const openDialog = (data, title) => {
+  params.value.data = data
+  params.value.title = title && title.length > 0 ? title : params.value.title
+  dialogVisible.value = true
+}
+
+defineExpose({
+  openDialog
+})
+</script>
+
+<style scoped lang="scss"></style>

+ 11 - 0
src/views/demo/traceMerge/index.vue

@@ -29,6 +29,7 @@
         <el-button type="primary" link icon="View" @click="execute(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>
       </template>
     </ProTable>
     <FormDialog ref="formDialogRef" />
@@ -67,6 +68,7 @@
         </el-container>
       </el-container>
     </el-dialog>
+    <ResultDialog ref="ResultDialogRef" />
   </div>
 </template>
 
@@ -94,6 +96,15 @@ import {
 import File from '@/components/Upload/File.vue'
 import { getDictsApi } from '@/api/modules/system/dictData'
 import http from '@/api'
+import ResultDialog from '@/components/ResultDialog/ResultDialog.vue'
+
+const ResultDialogRef = ref<InstanceType<typeof ResultDialog> | null>(null)
+const showResult = async function (row) {
+  let path = row.resultPath.split('ObjectDetection_Web')
+  path = path[path.length - 1]
+  let result = await http.get('/profile' + path + '/result.json')
+  ResultDialogRef.value.openDialog(result)
+}
 
 const logDialogVisible = ref(false)
 const logData = ref([])