|
@@ -12,22 +12,22 @@
|
|
|
<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.teamName" placeholder="请输入数据名称" clearable/>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="数据标签">
|
|
|
- <el-input v-model="queryLine.teamName" placeholder="请输入数据标签" clearable/>
|
|
|
+ <el-input v-model="queryLine.dataName" placeholder="请输入数据名称" clearable/>
|
|
|
</el-form-item>
|
|
|
+ <!-- <el-form-item label="数据标签">-->
|
|
|
+ <!-- <el-input v-model="queryLine.teamName" placeholder="请输入数据标签" clearable/>-->
|
|
|
+ <!-- </el-form-item>-->
|
|
|
<el-form-item label="设备名称">
|
|
|
- <el-input v-model="queryLine.teamName" placeholder="请输入设备名称" clearable/>
|
|
|
+ <el-input v-model="queryLine.equipmentName" placeholder="请输入设备名称" clearable/>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="设备类型">
|
|
|
- <el-input v-model="queryLine.teamName" placeholder="请输入设备类型" clearable/>
|
|
|
+ <el-input v-model="queryLine.equipmentTypeName" placeholder="请输入设备类型" clearable/>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="触发器名称">
|
|
|
- <el-input v-model="queryLine.teamName" placeholder="请输入触发器名称" clearable/>
|
|
|
+ <el-input v-model="queryLine.triggerName" placeholder="请输入触发器名称" clearable/>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="触发器类型">
|
|
|
- <el-input v-model="queryLine.teamName" placeholder="请输入触发器类型" clearable/>
|
|
|
+ <el-input v-model="queryLine.triggerTypeName" placeholder="请输入触发器类型" clearable/>
|
|
|
</el-form-item>
|
|
|
<el-form-item>
|
|
|
<el-button type="danger" @click="onSubmit">查询</el-button>
|
|
@@ -39,7 +39,7 @@
|
|
|
<el-button type="primary" @click="onSubmit">算法镜像导入</el-button>
|
|
|
<el-button style="margin-left: 100px;" type="primary" @click="onSubmit">选择算法镜像版本</el-button>
|
|
|
<el-switch
|
|
|
- v-model="value1"
|
|
|
+ v-model="algorithmContainerState"
|
|
|
class="ml-2"
|
|
|
inline-prompt
|
|
|
style="margin-left: 100px;--el-switch-on-color: #13ce66; --el-switch-off-color: #ff4949"
|
|
@@ -47,20 +47,22 @@
|
|
|
inactive-text="算法容器已关闭"
|
|
|
/>
|
|
|
<el-switch
|
|
|
- v-model="value2"
|
|
|
+ v-model="gazeboState"
|
|
|
class="ml-2"
|
|
|
inline-prompt
|
|
|
style="margin-left: 100px; --el-switch-on-color: #13ce66; --el-switch-off-color: #ff4949"
|
|
|
active-text="Gazebo 已开启"
|
|
|
inactive-text="Gazebo 已关闭"
|
|
|
+ @click="gazebo"
|
|
|
/>
|
|
|
<el-switch
|
|
|
- v-model="value3"
|
|
|
+ v-model="rvizState"
|
|
|
class="ml-2"
|
|
|
inline-prompt
|
|
|
style="margin-left: 100px;--el-switch-on-color: #13ce66; --el-switch-off-color: #ff4949"
|
|
|
active-text="Rviz 已开启"
|
|
|
inactive-text="Rviz 已关闭"
|
|
|
+ @click="rviz"
|
|
|
/>
|
|
|
<el-button style="margin-left: 100px;" type="primary" @click="onSubmit">地图更新</el-button>
|
|
|
<br>
|
|
@@ -68,31 +70,17 @@
|
|
|
<el-table stripe style="background-color: rgba(255,0,0,99%);width: 100%" border :data="tableData"
|
|
|
fixed ref="multipleTableRef">
|
|
|
<el-table-column type="selection" width="55"/>
|
|
|
- <el-table-column prop="id" label="数据名称"/>
|
|
|
- <el-table-column prop="id" label="数据容量"/>
|
|
|
- <el-table-column sortable prop="id" label="设备名称"/>
|
|
|
- <el-table-column sortable prop="id" label="设备类型"/>
|
|
|
- <el-table-column sortable prop="id" label="触发器名称"/>
|
|
|
- <el-table-column sortable prop="id" label="触发器类型"/>
|
|
|
- <el-table-column sortable prop="id" label="上报时间"/>
|
|
|
- <el-table-column sortable prop="id" label="数据状态"/>
|
|
|
- <el-table-column width="300" fixed="right" label="操作">
|
|
|
- <template #default="scope">
|
|
|
- <el-button
|
|
|
- size="small"
|
|
|
- type="danger"
|
|
|
- @click="openGazebo"
|
|
|
- >仿真测试
|
|
|
- </el-button
|
|
|
- >
|
|
|
- <el-button
|
|
|
- size="small"
|
|
|
- type="danger"
|
|
|
- @click="openRviz"
|
|
|
- >算法评价
|
|
|
- </el-button
|
|
|
- >
|
|
|
- </template>
|
|
|
+ <el-table-column prop="dataName" label="数据名称"/>
|
|
|
+ <el-table-column prop="dataSize" label="数据容量" :formatter="dataSizeFormatter"/>
|
|
|
+ <el-table-column prop="equipmentName" label="设备名称"/>
|
|
|
+ <el-table-column prop="equipmentTypeName" label="设备类型"/>
|
|
|
+ <el-table-column prop="triggerName" label="触发器名称"/>
|
|
|
+ <el-table-column prop="triggerTypeName" label="触发器类型"/>
|
|
|
+ <el-table-column prop="callbackTime" label="上报时间"/>
|
|
|
+ <el-table-column prop="dataStateName" label="数据状态"/>
|
|
|
+ <el-table-column width="100" fixed="right" label="操作">
|
|
|
+ <el-button size="small" type="danger" @click="goToDetail">仿真测试</el-button>
|
|
|
+<!-- <el-button size="small" type="danger" @click="goToDetail">算法评价</el-button>-->
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
|
|
@@ -109,6 +97,7 @@
|
|
|
@size-change="handleSizeChange"
|
|
|
@current-change="handleCurrentChange"
|
|
|
/>
|
|
|
+ <!-- <el-pagination background layout="prev, pager, next" :total="1000"/>-->
|
|
|
</el-main>
|
|
|
<!-- <el-footer style="background-color: rgba(255,0,0,99%)">国家智能网联汽车创新中心</el-footer>-->
|
|
|
</el-container>
|
|
@@ -120,30 +109,60 @@ import {onBeforeMount, ref} from "vue";
|
|
|
import axios from "axios";
|
|
|
import {reactive} from 'vue'
|
|
|
import {ElTable} from "element-plus";
|
|
|
-import {Check, Close} from '@element-plus/icons-vue'
|
|
|
-
|
|
|
-const value1 = ref(true)
|
|
|
-const value2 = ref(true)
|
|
|
-const value3 = ref(true)
|
|
|
+import { useRouter } from 'vue-router'; // 导入 Vue Router 的 useRouter 钩子
|
|
|
|
|
|
+const router = useRouter();
|
|
|
+const algorithmContainerState = ref(false)
|
|
|
+const gazeboState = ref(false)
|
|
|
+const rvizState = ref(false)
|
|
|
const multipleTableRef = ref<InstanceType<typeof ElTable>>
|
|
|
|
|
|
|
|
|
-const openGazebo = () => {
|
|
|
- if (window.electronAPI) {
|
|
|
- console.log('Calling gazebo & rviz');
|
|
|
- window.electronAPI.openGazebo();
|
|
|
+const goToDetail = () => {
|
|
|
+ router.push('/about')
|
|
|
+}
|
|
|
+
|
|
|
+// 数据容量单位从B转成MB
|
|
|
+const dataSizeFormatter = (row, column, cellValue, index) => {
|
|
|
+ // 假设 1MB = 1024 * 1024 字节
|
|
|
+ if (cellValue) {
|
|
|
+ const mb = (cellValue / (1024 * 1024)).toFixed(2); // 保留两位小数
|
|
|
+ return `${mb}MB`;
|
|
|
+ }
|
|
|
+ return cellValue; // 如果cellValue为null或undefined,则返回原值或你想要的默认值
|
|
|
+}
|
|
|
+
|
|
|
+const gazebo = () => {
|
|
|
+ if (gazeboState.value) {
|
|
|
+ if (window.electronAPI) {
|
|
|
+ window.electronAPI.openGazebo(); // 关闭 gazebo
|
|
|
+ } else {
|
|
|
+ console.error('electronAPI is not defined');
|
|
|
+ }
|
|
|
+ // gazeboState.value = false
|
|
|
} else {
|
|
|
- console.error('electronAPI is not defined');
|
|
|
+ if (window.electronAPI) {
|
|
|
+ window.electronAPI.closeGazebo();
|
|
|
+ } else {
|
|
|
+ console.error('electronAPI is not defined');
|
|
|
+ }
|
|
|
+ // gazeboState.value = true
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-const openRviz = () => {
|
|
|
- if (window.electronAPI) {
|
|
|
- console.log('Calling gazebo & rviz');
|
|
|
- window.electronAPI.openRviz();
|
|
|
+const rviz = () => {
|
|
|
+ if (rvizState.value) {
|
|
|
+ if (window.electronAPI) {
|
|
|
+ window.electronAPI.openRviz();
|
|
|
+ } else {
|
|
|
+ console.error('electronAPI is not defined');
|
|
|
+ }
|
|
|
} else {
|
|
|
- console.error('electronAPI is not defined');
|
|
|
+ if (window.electronAPI) {
|
|
|
+ window.electronAPI.closeRviz();
|
|
|
+ } else {
|
|
|
+ console.error('electronAPI is not defined');
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -202,12 +221,12 @@ const openPdf = (index: number, row: any) => {
|
|
|
}
|
|
|
|
|
|
|
|
|
-const fit = 'fill'
|
|
|
-const fits = ['fill', 'contain', 'cover', 'none', 'scale-down']
|
|
|
-// const logoUrl = 'src/assets/img.png'
|
|
|
const queryLine = reactive({
|
|
|
- teamName: '',
|
|
|
- topic: '',
|
|
|
+ dataName: '',
|
|
|
+ equipmentName: '',
|
|
|
+ equipmentTypeName: '',
|
|
|
+ triggerName: '',
|
|
|
+ triggerTypeName: '',
|
|
|
})
|
|
|
|
|
|
const onSubmit = () => {
|
|
@@ -221,7 +240,7 @@ onBeforeMount(() => {
|
|
|
})
|
|
|
|
|
|
function page() {
|
|
|
- axios.get('http://1.202.169.139:8081/open/scene/list?page=1&size=10',
|
|
|
+ axios.get('http://1.202.169.139:8081/open/scene/list?page=' + currentPage.value + '&size=' + pageSize.value,
|
|
|
{
|
|
|
headers: {
|
|
|
"Authorization": "4773hd92ysj54paflw2jem3onyhywxt2"
|
|
@@ -229,7 +248,7 @@ function page() {
|
|
|
}
|
|
|
).then(function (response) {
|
|
|
tableData.value = response.data.data.content
|
|
|
- total.value = response.data.totalElements
|
|
|
+ total.value = response.data.data.totalElements
|
|
|
// total.value = tableData.value.length
|
|
|
// console.log(tableData);
|
|
|
// console.log(response.data.data);
|