diff --git a/ruoyi-ui/src/views/childRoom/RightPanel.vue b/ruoyi-ui/src/views/childRoom/RightPanel.vue index 380e4ea..d972568 100644 --- a/ruoyi-ui/src/views/childRoom/RightPanel.vue +++ b/ruoyi-ui/src/views/childRoom/RightPanel.vue @@ -178,8 +178,13 @@
{{ platform.name }}
{{ platform.type }}
-
- +
+
@@ -204,8 +209,8 @@
{{ platform.name }}
{{ platform.type }}
-
- +
+
@@ -230,8 +235,8 @@
{{ platform.name }}
{{ platform.type }}
-
- +
+
diff --git a/ruoyi-ui/src/views/childRoom/index.vue b/ruoyi-ui/src/views/childRoom/index.vue index 91ec3ce..f5c69ad 100644 --- a/ruoyi-ui/src/views/childRoom/index.vue +++ b/ruoyi-ui/src/views/childRoom/index.vue @@ -142,6 +142,7 @@ @resolve-conflict="resolveConflict" @run-conflict-check="runConflictCheck" @open-platform-dialog="openPlatformDialog" + @delete-platform="handleDeletePlatform" @open-import-dialog="showImportDialog = true" /> @@ -299,7 +300,7 @@ import TopHeader from './TopHeader' import { listScenario,addScenario,delScenario} from "@/api/system/scenario"; import { listRoutes, getRoutes, addRoutes, updateRoutes, delRoutes } from "@/api/system/routes"; import { updateWaypoints } from "@/api/system/waypoints"; -import { listLib,addLib } from "@/api/system/lib"; +import { listLib,addLib,delLib} from "@/api/system/lib"; import PlatformImportDialog from "@/views/dialogs/PlatformImportDialog.vue"; export default { name: 'MissionPlanningView', @@ -556,6 +557,20 @@ export default { console.error("查找失败!账本内IDs:", waypointsList.map(w => w.id)); } }, + /** 删除平台库数据 */ + handleDeletePlatform(platform) { + // 安全确认:防止误操作 + this.$modal.confirm('是否确认删除名称为 "' + platform.name + '" 的平台数据?').then(() => { + // 调用后端接口删除 + return delLib(platform.id); + }).then(() => { + // 删除成功后的反馈 + this.$modal.msgSuccess("删除成功"); + //重新分拣列表,让页面上的卡片消失 + this.getPlatformList(); + }).catch(() => { + }); + }, // 处理从地图点击传来的航线编辑请求 async handleOpenRouteEdit(routeId) { @@ -590,7 +605,7 @@ export default { }, // 平台编辑弹窗相关方法 openPlatformDialog(platform) { - this.selectedPlatform = platform; + this.selectedPlatform = JSON.parse(JSON.stringify(platform)); this.showPlatformDialog = true; }, /** 从数据库查询并分拣平台库数据 */ @@ -605,6 +620,7 @@ export default { id: item.id, name: item.name, type: item.type, + specsJson: item.specsJson, imageUrl: item.iconUrl || '', icon: item.iconUrl ? '' : 'el-icon-picture-outline', status: 'ready' @@ -648,9 +664,13 @@ export default { console.error("上传出错:", err); }); }, - updatePlatform(updatedPlatform) { - // 这里可以添加实际的更新逻辑 - this.$message.success('平台更新成功'); + updatePlatform() { + // 刷新平台列表 + this.getPlatformList(); + // 提示成功 + this.$modal.msgSuccess('平台配置更新成功'); + // 关闭弹窗 + this.showPlatformDialog = false; }, /** 从航线 attributes JSON 解析出地图渲染用的样式对象 */ parseRouteStyle(attributes) { diff --git a/ruoyi-ui/src/views/dialogs/PlatformEditDialog.vue b/ruoyi-ui/src/views/dialogs/PlatformEditDialog.vue index 0c12bea..47ab8b9 100644 --- a/ruoyi-ui/src/views/dialogs/PlatformEditDialog.vue +++ b/ruoyi-ui/src/views/dialogs/PlatformEditDialog.vue @@ -1,207 +1,278 @@ diff --git a/ruoyi-ui/vue.config.js b/ruoyi-ui/vue.config.js index c4d5b73..984b3f0 100644 --- a/ruoyi-ui/vue.config.js +++ b/ruoyi-ui/vue.config.js @@ -22,6 +22,7 @@ const port = process.env.port || process.env.npm_config_port || 80 // 端口 const cesiumSource = 'node_modules/cesium/Build/Cesium' module.exports = { + // 部署生产环境和开发环境下的URL。 publicPath: process.env.NODE_ENV === "production" ? "/" : "/", outputDir: 'dist',