|
@@ -17,27 +17,75 @@
|
|
|
<div class="topbar">
|
|
|
<el-form style=" background-color: rgba(0,0,0,0%);" :inline="true" :model="queryLine"
|
|
|
class="demo-form-inline">
|
|
|
+ <el-form-item label="设备名称">
|
|
|
+ <el-input v-model="queryLine.equipmentName" placeholder="请输入设备名称" clearable/>
|
|
|
+ </el-form-item>
|
|
|
<el-form-item label="设备类型">
|
|
|
- <el-input v-model="queryLine.equipmentTypeName" placeholder="请输入设备类型" clearable/>
|
|
|
+<!-- <el-input v-model="queryLine.equipmentType" placeholder="请输入设备类型" clearable/>-->
|
|
|
+ <el-select
|
|
|
+ v-model="queryLine.equipmentType"
|
|
|
+ placeholder="请选择"
|
|
|
+ size="default"
|
|
|
+ @click.native="getKeywordsByField('device_type')"
|
|
|
+ style="width: 180px; "
|
|
|
+ clearable
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in equipmentTypes"
|
|
|
+ :key="item"
|
|
|
+ :label="item"
|
|
|
+ :value="item"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="算法版本">
|
|
|
<el-input v-model="queryLine.algorithmVersion" placeholder="请输入算法版本" clearable/>
|
|
|
+<!-- <el-select-->
|
|
|
+<!-- v-model="queryLine.algorithmVersion"-->
|
|
|
+<!-- placeholder="请选择"-->
|
|
|
+<!-- size="default"-->
|
|
|
+<!-- @click.native="getKeywordsByField('algo_image_name')"-->
|
|
|
+<!-- style="width: 180px; "-->
|
|
|
+<!-- clearable-->
|
|
|
+<!-- >-->
|
|
|
+<!-- <el-option-->
|
|
|
+<!-- v-for="item in algorithmVersions"-->
|
|
|
+<!-- :key="item"-->
|
|
|
+<!-- :label="item"-->
|
|
|
+<!-- :value="item"-->
|
|
|
+<!-- />-->
|
|
|
+<!-- </el-select>-->
|
|
|
</el-form-item>
|
|
|
+
|
|
|
<el-form-item label="算法评价等级">
|
|
|
- <el-input v-model="queryLine.algorithmLevel" placeholder="请输入算法评价等级" clearable/>
|
|
|
+ <!-- <el-input v-model="queryLine.algorithmLevel" placeholder="请输入算法评价等级" clearable/>-->
|
|
|
+ <el-select
|
|
|
+ v-model="queryLine.algorithmLevel"
|
|
|
+ placeholder="请选择"
|
|
|
+ size="default"
|
|
|
+ style="width: 180px; "
|
|
|
+ clearable
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in algoLevels"
|
|
|
+ :key="item"
|
|
|
+ :label="item"
|
|
|
+ :value="item"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
</el-form-item>
|
|
|
<el-form-item>
|
|
|
- <el-button type="danger" @click="onSubmit">查询</el-button>
|
|
|
+ <el-button type="danger" @click="queryRecordByCondition">查询</el-button>
|
|
|
</el-form-item>
|
|
|
<el-form-item>
|
|
|
<el-button type="danger" @click="onSubmit">重置</el-button>
|
|
|
</el-form-item>
|
|
|
<div style="float: right">
|
|
|
<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-button type="danger" @click="onSubmit">下载算法评价报告</el-button>
|
|
|
+ <el-button type="danger" @click="downloadFile('report')" :disabled="multipleSelection.length == 0">下载算法评价报告</el-button>
|
|
|
</el-form-item>
|
|
|
</div>
|
|
|
|
|
@@ -45,25 +93,28 @@
|
|
|
|
|
|
</div>
|
|
|
<el-table stripe style="background-color: rgba(255,0,0,99%);width: 100%" border :data="tableData"
|
|
|
+ @selection-change="handleSelectionChange"
|
|
|
fixed ref="multipleTableRef" :cell-style="{ textAlign: 'center'}" :header-cell-style="{ textAlign: 'center'}">
|
|
|
<el-table-column type="selection" width="55"/>
|
|
|
- <el-table-column prop="equipmentTypeName" label="设备类型"/>
|
|
|
- <el-table-column prop="algorithmVersion" label="算法版本"/>
|
|
|
- <el-table-column prop="testTime" label="测试时间"/>
|
|
|
- <el-table-column prop="pgmFile" label="pgm文件"/>
|
|
|
- <el-table-column prop="worldFile" label="world文件"/>
|
|
|
- <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="device_name" label="设备名称" width="300"/>
|
|
|
+ <el-table-column prop="device_type" label="设备类型"/>
|
|
|
+ <el-table-column prop="algo_image_name" label="算法版本"/>
|
|
|
+ <el-table-column prop="test_time" :formatter="formatDate" label="测试时间"/>
|
|
|
+ <el-table-column prop="round" label="轮次"/>
|
|
|
+ <el-table-column prop="pgm_path" :formatter="(row) => formatPath(row, 'pgm_path')" label="pgm文件"/>
|
|
|
+ <el-table-column prop="world_path" :formatter="(row) => formatPath(row, 'world_path')" label="world文件"/>
|
|
|
+ <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>
|
|
|
|
|
|
<p></p> <!--空行-->
|
|
|
<el-pagination
|
|
|
v-model:current-page="currentPage"
|
|
|
v-model:page-size="pageSize"
|
|
|
- :page-sizes="[10]"
|
|
|
+ :page-sizes="[10, 15, 20, 50]"
|
|
|
:small="small"
|
|
|
:disabled="disabled"
|
|
|
:background="true"
|
|
@@ -82,12 +133,13 @@
|
|
|
<script lang="ts" setup>
|
|
|
import {onBeforeMount, reactive, ref} from "vue";
|
|
|
import axios from "axios";
|
|
|
-import {ElTable} from "element-plus";
|
|
|
+import {ElMessage, ElTable} from "element-plus";
|
|
|
+import path from 'path-browserify';
|
|
|
+import moment from "moment";
|
|
|
|
|
|
-// 数据容量单位从B转成MB
|
|
|
const queryLine = reactive({
|
|
|
equipmentName: '',
|
|
|
- equipmentTypeName: '',
|
|
|
+ equipmentType: '',
|
|
|
algorithmVersion: '',
|
|
|
algorithmLevel: ''
|
|
|
})
|
|
@@ -96,28 +148,124 @@ const onSubmit = () => {
|
|
|
page()
|
|
|
}
|
|
|
|
|
|
-let total = ref(0)
|
|
|
-let tableData = ref([]);
|
|
|
+const total = ref(0)
|
|
|
+const tableData = ref([]);
|
|
|
+const resetTableData = ref([]);
|
|
|
+const algorithmVersions =ref()
|
|
|
+const equipmentTypes =ref(["引导服务机器人"])
|
|
|
+const equipmentNames =ref()
|
|
|
onBeforeMount(() => {
|
|
|
page()
|
|
|
})
|
|
|
+const multipleTableRef = ref<InstanceType<typeof ElTable>>
|
|
|
+const multipleSelection = ref<[]>([])
|
|
|
+
|
|
|
+const algoLevels = ['较差', '一般', '良好', '优秀']
|
|
|
+
|
|
|
+const handleSelectionChange = (rows: []) => {
|
|
|
+ multipleSelection.value = rows
|
|
|
+ console.log("multipleSelection", multipleSelection.value)
|
|
|
+}
|
|
|
+
|
|
|
+// 表格 - 格式化路径
|
|
|
+const formatPath = (row, name) => {
|
|
|
+ return path.basename(row[name])
|
|
|
+}
|
|
|
+
|
|
|
+const formatDate = (row) => {
|
|
|
+ return moment(+row.test_time).format("YYYY-MM-DD HH:mm:ss")
|
|
|
+}
|
|
|
+
|
|
|
+const getKeywordsByField = (field) => {
|
|
|
+ if (resetTableData.value.length > 0) {
|
|
|
+ let keywords = new Set(resetTableData.value.map((d) => d[field]))
|
|
|
+ if (field === "algo_image_name") {
|
|
|
+ algorithmVersions.value = keywords
|
|
|
+ }
|
|
|
+ // else if (field === "device_type") {
|
|
|
+ // equipmentTypes.value = keywords
|
|
|
+ // } else if (field === "device_name") {
|
|
|
+ // equipmentNames.value = keywords
|
|
|
+ // }
|
|
|
+
|
|
|
+ }
|
|
|
+}
|
|
|
+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 ? typeName + ".zip" : "test.bag"
|
|
|
+ } else if(typeName === "report") {
|
|
|
+ keys = multipleSelection.value.map(item => item["algo_evaluation_report"])
|
|
|
+ fileName = multipleSelection.value.length > 1 ? 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?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 queryRecordByCondition = async () => {
|
|
|
+ let response = await axios.post('/local/simulation/query/test/record?page=' + currentPage.value + '&pageSize=' + pageSize.value, {
|
|
|
+ "device_name": queryLine.equipmentName,
|
|
|
+ "device_type": queryLine.equipmentType,
|
|
|
+ "algo_image_name": queryLine.algorithmVersion,
|
|
|
+ "algo_evaluation_level": queryLine.algorithmLevel
|
|
|
+ })
|
|
|
+
|
|
|
+ if (!response.data.status){ // 不存在
|
|
|
+ ElMessage.error("仿真测试记录查询失败!");
|
|
|
+ return
|
|
|
+ }
|
|
|
+ // 解析结果
|
|
|
+ tableData.value = JSON.parse(response.data.data)
|
|
|
+ total.value = response.data.total
|
|
|
+}
|
|
|
+
|
|
|
+async function page() {
|
|
|
+ // axios.get('http://1.202.169.139:8081/open/scene/list?equipmentType=YI_DAO_JI_QI_REN&page=' + currentPage.value + '&size=' + pageSize.value,
|
|
|
+ // {
|
|
|
+ // headers: {
|
|
|
+ // "Authorization": "4773hd92ysj54paflw2jem3onyhywxt2"
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // ).then(function (response) {
|
|
|
+ // tableData.value = response.data.data.content
|
|
|
+ // total.value = response.data.data.totalElements
|
|
|
+ // // total.value = tableData.value.length
|
|
|
+ // // console.log(tableData);
|
|
|
+ // // console.log(response.data.data);
|
|
|
+ // }).catch(function (error) {
|
|
|
+ // console.log(error);
|
|
|
+ // });
|
|
|
|
|
|
-function page() {
|
|
|
- axios.get('http://1.202.169.139:8081/open/scene/list?equipmentType=YI_DAO_JI_QI_REN&page=' + currentPage.value + '&size=' + pageSize.value,
|
|
|
- {
|
|
|
- headers: {
|
|
|
- "Authorization": "4773hd92ysj54paflw2jem3onyhywxt2"
|
|
|
- }
|
|
|
- }
|
|
|
- ).then(function (response) {
|
|
|
- tableData.value = response.data.data.content
|
|
|
- total.value = response.data.data.totalElements
|
|
|
- // total.value = tableData.value.length
|
|
|
- // console.log(tableData);
|
|
|
- // console.log(response.data.data);
|
|
|
- }).catch(function (error) {
|
|
|
- console.log(error);
|
|
|
- });
|
|
|
+ // 查询算法评价记录
|
|
|
+ let response = await axios.post('/local/simulation/query/test/record?page=' + currentPage.value + '&pageSize=' + pageSize.value)
|
|
|
+
|
|
|
+ if (!response.data.status){ // 不存在
|
|
|
+ ElMessage.error("仿真测试记录查询失败!");
|
|
|
+ return
|
|
|
+ }
|
|
|
+ // 解析结果
|
|
|
+ tableData.value = JSON.parse(response.data.data)
|
|
|
+ console.log("tableData.value", tableData.value)
|
|
|
+ resetTableData.value = tableData.value // for reset purpose
|
|
|
+ total.value = response.data.total
|
|
|
}
|
|
|
|
|
|
const currentPage = ref(1)
|
|
@@ -127,17 +275,19 @@ const disabled = ref(false)
|
|
|
|
|
|
const handleSizeChange = (val: number) => {
|
|
|
pageSize.value = val
|
|
|
- page()
|
|
|
+ // page()
|
|
|
+ queryRecordByCondition()
|
|
|
if (tableData.value.length == 0) {
|
|
|
- page()
|
|
|
+ // page()
|
|
|
+ queryRecordByCondition()
|
|
|
}
|
|
|
}
|
|
|
const handleCurrentChange = (val: number) => {
|
|
|
currentPage.value = val
|
|
|
- page()
|
|
|
+ // page()
|
|
|
+ queryRecordByCondition()
|
|
|
}
|
|
|
|
|
|
-
|
|
|
</script>
|
|
|
<style scoped>
|
|
|
|