|
@@ -63,7 +63,7 @@
|
|
|
v-model="mapDialogVisible"
|
|
|
title="地图续扫提醒"
|
|
|
width="400"
|
|
|
- :before-close="handleClose"
|
|
|
+ :before-close="handleMapClose"
|
|
|
>
|
|
|
<el-form :model="mapRescanForm">
|
|
|
<el-form-item label="请输入地图续扫提醒阈值" label-width="170">
|
|
@@ -149,7 +149,7 @@
|
|
|
v-model="worldDialogVisible"
|
|
|
title="生成world"
|
|
|
width="400"
|
|
|
- :before-close="handleClose"
|
|
|
+ :before-close="handleWorldClose"
|
|
|
>
|
|
|
<el-steps style="max-width: 600px" :active="world_active" finish-status="success">
|
|
|
<el-step title="数据准备"/>
|
|
@@ -158,7 +158,8 @@
|
|
|
</el-steps>
|
|
|
|
|
|
<template #footer>
|
|
|
- <el-button @click="goToMapUpdate" :disabled="world_active !== 2">去部署</el-button>
|
|
|
+ <el-button @click="nextToUpload" v-if="world_active != 2" :disabled="world_active !== 1">下一步</el-button>
|
|
|
+ <el-button @click="nextToUpload" v-if="world_active == 2" >上传</el-button>
|
|
|
</template>
|
|
|
</el-dialog>
|
|
|
<el-table stripe style="background-color: rgba(255,0,0,99%);width: 100%" border :data="tableData"
|
|
@@ -205,10 +206,8 @@
|
|
|
import {onBeforeMount, ref} from "vue";
|
|
|
import axios from "axios";
|
|
|
import {reactive} from 'vue'
|
|
|
-import {ElTable} from "element-plus";
|
|
|
-import { ElMessage } from "element-plus";
|
|
|
+import {ElTable, ElLoading, ElMessage} from "element-plus";
|
|
|
import {useRouter} from 'vue-router'; // 导入 Vue Router 的 useRouter 钩子
|
|
|
-import * as fs from "fs";
|
|
|
|
|
|
|
|
|
const value
|
|
@@ -226,9 +225,21 @@ const mapDialogVisible = ref(false)
|
|
|
const updateDialogVisible = ref(false)
|
|
|
const worldDialogVisible = ref(false)
|
|
|
|
|
|
+const loading = ref(true)
|
|
|
+
|
|
|
+
|
|
|
const handleClose = (done: () => void) => {
|
|
|
done()
|
|
|
}
|
|
|
+const handleWorldClose = (done: () => void) => {
|
|
|
+ done()
|
|
|
+}
|
|
|
+const handleMapClose = (done: () => void) => {
|
|
|
+ done()
|
|
|
+}
|
|
|
+const nextToUpload = () => {
|
|
|
+ world_active.value = 2
|
|
|
+}
|
|
|
|
|
|
const multipleSelection = ref<[]>([])
|
|
|
|
|
@@ -369,7 +380,7 @@ const rviz = () => {
|
|
|
const generateWorld = async (id) => {
|
|
|
|
|
|
console.log("id", id);
|
|
|
- console.log("Starting generating world...")
|
|
|
+ console.log("Starting download: map.bag...")
|
|
|
worldDialogVisible.value = true
|
|
|
|
|
|
// axios.get('http://127.0.0.1:8888/map/downloadmapbagfile?id=1820978518251540482',
|
|
@@ -413,8 +424,20 @@ const generateWorld = async (id) => {
|
|
|
} else {
|
|
|
console.log('File downloaded successfully:', result.filePath);
|
|
|
world_active.value = 1
|
|
|
+ console.log("Starting world generation...")
|
|
|
+ window.electronAPI.generateWorld(result.filePath);
|
|
|
+ const loadingInstance = ElLoading.service({fullscreen: false, target: '.el-dialog'})
|
|
|
+
|
|
|
+ window.electronAPI.generateWorldResult( (event, result) => {
|
|
|
+ loadingInstance.close()
|
|
|
+ if (result.success) {
|
|
|
+ console.log('脚本执行成功');
|
|
|
+ } else {
|
|
|
+ console.error('脚本执行失败');
|
|
|
+ ElMessage.error("world生成发生错误!");
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
|
|
|
|