|
@@ -20,25 +20,27 @@
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<div style="float: right">
|
|
<div style="float: right">
|
|
<el-form-item>
|
|
<el-form-item>
|
|
- <el-button type="danger" @click="onSubmit">下载测试bag</el-button>
|
|
|
|
|
|
+ <el-button type="danger" @click="downloadFile('bag')" :disabled="multipleSelection.length == 0">下载测试bag</el-button>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item>
|
|
<el-form-item>
|
|
- <el-button type="danger" @click="onSubmit">下载算法评价报告</el-button>
|
|
|
|
|
|
+ <el-button type="danger" @click="downloadFile('report')" :disabled="multipleSelection.length == 0">下载算法评价报告</el-button>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
</el-form>
|
|
</el-form>
|
|
|
|
|
|
</div>
|
|
</div>
|
|
- <el-table stripe style="background-color: rgba(255,0,0,99%);width: 100%" border :data="evalData"
|
|
|
|
|
|
+ <el-table stripe style="background-color: rgba(255,0,0,99%);width: 100%" border :data="evalTableData"
|
|
|
|
+ @selection-change="handleSelectionChange"
|
|
fixed ref="multipleTableRef" :cell-style="{ textAlign: 'center'}" :header-cell-style="{ textAlign: 'center'}">
|
|
fixed ref="multipleTableRef" :cell-style="{ textAlign: 'center'}" :header-cell-style="{ textAlign: 'center'}">
|
|
<el-table-column type="selection" width="55"/>
|
|
<el-table-column type="selection" width="55"/>
|
|
- <el-table-column prop="testTime" label="测试时间"/>
|
|
|
|
- <el-table-column prop="testBag" label="测试bag"/>
|
|
|
|
- <el-table-column prop="testDuration" label="测试时长"/>
|
|
|
|
- <el-table-column prop="testDistance" label="测试里程"/>
|
|
|
|
- <el-table-column prop="algorithmLevel" label="算法评价等级"/>
|
|
|
|
- <el-table-column prop="algorithmReport" label="算法评价报告"/>
|
|
|
|
|
|
+ <el-table-column prop="test_time" label="测试时间"/>
|
|
|
|
+ <el-table-column prop="round" label="轮次"/>
|
|
|
|
+ <el-table-column prop="test_bag_path" :formatter="(row) => formatPath(row, 'test_bag_path')" label="测试bag"/>
|
|
|
|
+ <el-table-column prop="test_duration" label="测试时长"/>
|
|
|
|
+ <el-table-column prop="test_distance" label="测试里程"/>
|
|
|
|
+ <el-table-column prop="algo_evaluation_level" label="算法评价等级"/>
|
|
|
|
+ <el-table-column prop="algo_evaluation_report" :formatter="(row) => formatPath(row, 'algo_evaluation_report')" label="算法评价报告"/>
|
|
</el-table>
|
|
</el-table>
|
|
|
|
|
|
</el-dialog>
|
|
</el-dialog>
|
|
@@ -151,7 +153,8 @@
|
|
</el-dialog>
|
|
</el-dialog>
|
|
|
|
|
|
<!-- <el-button style="margin-left: 10px;" type="primary" @click="goToMain">更换设置并执行</el-button>-->
|
|
<!-- <el-button style="margin-left: 10px;" type="primary" @click="goToMain">更换设置并执行</el-button>-->
|
|
- <el-button style="margin-left: 10px;" type="primary" @click="evalTableVisible = true" >算法评价结果</el-button>
|
|
|
|
|
|
+<!-- :disabled="evalResult.length === 0"-->
|
|
|
|
+ <el-button style="margin-left: 10px;" type="primary" @click="showEvalResult" >算法评价结果</el-button>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<!-- <el-form-item label=" ">-->
|
|
<!-- <el-form-item label=" ">-->
|
|
<!-- <el-button type="primary" @click="goToAlgorithmEval">算法评价结果</el-button>-->
|
|
<!-- <el-button type="primary" @click="goToAlgorithmEval">算法评价结果</el-button>-->
|
|
@@ -165,24 +168,27 @@
|
|
|
|
|
|
<script lang="ts" setup>
|
|
<script lang="ts" setup>
|
|
import {useRoute, useRouter} from 'vue-router'; // 导入 Vue Router 的 useRouter 钩子
|
|
import {useRoute, useRouter} from 'vue-router'; // 导入 Vue Router 的 useRouter 钩子
|
|
-import {reactive} from 'vue'
|
|
|
|
|
|
+import {nextTick, reactive} from 'vue'
|
|
import {ref} from 'vue'
|
|
import {ref} from 'vue'
|
|
import {ElMessageBox} from 'element-plus'
|
|
import {ElMessageBox} from 'element-plus'
|
|
import {ElTable, ElLoading, ElMessage} from "element-plus";
|
|
import {ElTable, ElLoading, ElMessage} from "element-plus";
|
|
import {getCurrentInstance} from "vue";
|
|
import {getCurrentInstance} from "vue";
|
|
import axios from "axios";
|
|
import axios from "axios";
|
|
|
|
+import path from 'path-browserify';
|
|
|
|
+import * as net from "node:net";
|
|
|
|
|
|
const startDialogVisible = ref(false)
|
|
const startDialogVisible = ref(false)
|
|
const endDialogVisible = ref(false)
|
|
const endDialogVisible = ref(false)
|
|
const {proxy} = getCurrentInstance();
|
|
const {proxy} = getCurrentInstance();
|
|
const evalResult = ref([])
|
|
const evalResult = ref([])
|
|
-const evalTableVisible = ref(true)
|
|
|
|
-const evalData = ref([])
|
|
|
|
|
|
+const evalTableVisible = ref(false)
|
|
|
|
+const evalTableData = ref([])
|
|
const queryLine = reactive({
|
|
const queryLine = reactive({
|
|
algorithmLevel: ''
|
|
algorithmLevel: ''
|
|
})
|
|
})
|
|
|
|
+const multipleSelection = ref<[]>([])
|
|
const onSubmit = () => {
|
|
const onSubmit = () => {
|
|
- page()
|
|
|
|
|
|
+ // page()
|
|
}
|
|
}
|
|
|
|
|
|
const router = useRouter();
|
|
const router = useRouter();
|
|
@@ -203,6 +209,8 @@ console.log("deviceName", deviceName)
|
|
console.log("algoImageName", algoImageName)
|
|
console.log("algoImageName", algoImageName)
|
|
console.log("worldPath", worldPath)
|
|
console.log("worldPath", worldPath)
|
|
|
|
|
|
|
|
+const testTime = ref("1726033307148")
|
|
|
|
+
|
|
const handleClose = (done: () => void) => {
|
|
const handleClose = (done: () => void) => {
|
|
done()
|
|
done()
|
|
}
|
|
}
|
|
@@ -253,6 +261,68 @@ const destinationChange = (value: string) => {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+const handleSelectionChange = (rows: []) => {
|
|
|
|
+ multipleSelection.value = rows
|
|
|
|
+ console.log("multipleSelection", multipleSelection.value)
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+const downloadFile = async (typeName) => {
|
|
|
|
+ // object key
|
|
|
|
+ let keys
|
|
|
|
+ // 文件名(区分1个文件/多个文件)
|
|
|
|
+ let fileName
|
|
|
|
+
|
|
|
|
+ if (typeName === "bag") {
|
|
|
|
+ keys = multipleSelection.value.map(item => item["test_bag_path"])
|
|
|
|
+ fileName = multipleSelection.value.length > 1 ? sceneId + "_" + typeName + ".zip" : "test.bag"
|
|
|
|
+ } else if(typeName === "report") {
|
|
|
|
+ keys = multipleSelection.value.map(item => item["algo_evaluation_report"])
|
|
|
|
+ fileName = multipleSelection.value.length > 1 ? sceneId + "_" + typeName + ".zip" : "report.pdf"
|
|
|
|
+ }
|
|
|
|
+ console.log("keys", keys)
|
|
|
|
+ console.log("typeName", typeName)
|
|
|
|
+ console.log("fileName", fileName)
|
|
|
|
+
|
|
|
|
+ // 下载记录
|
|
|
|
+ const url = "http://127.0.0.1:8888/simulation/download/oss/key?sceneId=" + sceneId + "&typeName=" + typeName
|
|
|
|
+ const result = await window.electronAPI.downloadFile(url, fileName, "", true, true, "post", keys);
|
|
|
|
+ if (!result.success) { // 下载失败
|
|
|
|
+ console.error('File download failed:', result.error);
|
|
|
|
+ ElMessage.error("文件下载失败!");
|
|
|
|
+ } else { // 下载成功
|
|
|
|
+ console.log('File downloaded successfully:', result.filePath);
|
|
|
|
+ ElMessage.success("文件下载成功!");
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+// 表格 - 格式化路径
|
|
|
|
+const formatPath = (row, name) => {
|
|
|
|
+ return path.basename(row[name])
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+// 弹窗显示算法评价记录
|
|
|
|
+const showEvalResult = async (value: string) => {
|
|
|
|
+ console.log("testTime", testTime.value)
|
|
|
|
+ console.log("sceneId", sceneId)
|
|
|
|
+ if (testTime.value != "") {
|
|
|
|
+ // 查询算法评价记录
|
|
|
|
+ let response = await axios.get('/local/simulation/query/eval/record?sceneId=' + sceneId + "&testTime=" + testTime.value)
|
|
|
|
+
|
|
|
|
+ if (!response.data.status){ // 不存在
|
|
|
|
+ proxy.$message.error("算法评价结果查询失败!");
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ // 解析结果
|
|
|
|
+ evalTableData.value = JSON.parse(response.data.details)
|
|
|
|
+ await nextTick() // 避免vue warning: onMounted is called when there is no active component instance...
|
|
|
|
+ // 开启弹窗
|
|
|
|
+ evalTableVisible.value = true
|
|
|
|
+ console.log("evalTableData.value", evalTableData.value)
|
|
|
|
+ }else {
|
|
|
|
+ proxy.$message.error("暂无算法评价结果!");
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
const runSimulation = () => {
|
|
const runSimulation = () => {
|
|
// 是否加载默认障碍物
|
|
// 是否加载默认障碍物
|
|
let random_flag = form.isRandom
|
|
let random_flag = form.isRandom
|
|
@@ -300,6 +370,7 @@ const runSimulation = () => {
|
|
console.log('uploadPgmKey', uploadPgmKey)
|
|
console.log('uploadPgmKey', uploadPgmKey)
|
|
let simulation_data = []
|
|
let simulation_data = []
|
|
evalResult.value.forEach((d, i) => {
|
|
evalResult.value.forEach((d, i) => {
|
|
|
|
+ if (i === 0) testTime.value = String(d["timeStamp"])
|
|
simulation_data.push({
|
|
simulation_data.push({
|
|
'device_id': deviceId,
|
|
'device_id': deviceId,
|
|
'device_name': deviceName,
|
|
'device_name': deviceName,
|
|
@@ -320,7 +391,6 @@ const runSimulation = () => {
|
|
})
|
|
})
|
|
console.log("simulation_data", simulation_data)
|
|
console.log("simulation_data", simulation_data)
|
|
// 上传数据
|
|
// 上传数据
|
|
- // 检查world文件是否存在
|
|
|
|
let response = await axios.post('/local/simulation/add/record', simulation_data)
|
|
let response = await axios.post('/local/simulation/add/record', simulation_data)
|
|
|
|
|
|
if (!response.data.status){ // 不存在
|
|
if (!response.data.status){ // 不存在
|