diff --git a/ruoyi-ui/src/views/cesiumMap/index.vue b/ruoyi-ui/src/views/cesiumMap/index.vue index 7ce9d22..fecb74a 100644 --- a/ruoyi-ui/src/views/cesiumMap/index.vue +++ b/ruoyi-ui/src/views/cesiumMap/index.vue @@ -12,7 +12,6 @@ @import-data="importData" @locate="handleLocate" /> - - + \ No newline at end of file + diff --git a/ruoyi-ui/src/views/childRoom/index.vue b/ruoyi-ui/src/views/childRoom/index.vue index ecea06a..6694a8e 100644 --- a/ruoyi-ui/src/views/childRoom/index.vue +++ b/ruoyi-ui/src/views/childRoom/index.vue @@ -1,9 +1,6 @@ - - - @@ -11,7 +8,6 @@ 支持标绘/航线/空域/实时态势 - - - - - - - @@ -166,26 +157,22 @@ - - - - r.id === updatedRoute.id); + if (index !== -1) { + // 使用 splice 触发响应式更新 + const newRouteData = { ...this.routes[index], ...updatedRoute }; + this.routes.splice(index, 1, newRouteData); + + // 如果当前选中的是这条航线,同步更新详情中的名称 + if (this.selectedRouteDetails && this.selectedRouteId === updatedRoute.id) { + this.selectedRouteDetails.name = updatedRoute.name; + } + + this.$message.success('航线名称更新成功'); + } + }, + // 新建航线(占位) + createRoute() { + this.$message.info('新建航线功能开发中...'); }, // 航点编辑弹窗相关方法 openWaypointDialog(waypoint) { @@ -375,8 +376,32 @@ export default { this.showWaypointDialog = true; }, updateWaypoint(updatedWaypoint) { - // 这里可以添加实际的更新逻辑 - this.$message.success('航点更新成功'); + // 1. 检查是否有正在编辑的航线详情 + if (this.selectedRouteDetails && this.selectedRouteDetails.waypoints) { + + // 2. 找到当前被编辑的这个航点在数组中的位置 + const index = this.selectedRouteDetails.waypoints.indexOf(this.selectedWaypoint); + + if (index !== -1) { + // 3. 使用 splice 方法替换数据 + this.selectedRouteDetails.waypoints.splice(index, 1, updatedWaypoint); + + // 4. 更新当前的选中引用,以便连续编辑 + this.selectedWaypoint = updatedWaypoint; + + this.$message.success('航点更新成功'); + } else { + // 如果用 indexOf 没找到,尝试用名字匹配兜底 + const nameIndex = this.selectedRouteDetails.waypoints.findIndex(p => p.name === this.selectedWaypoint.name); + if (nameIndex !== -1) { + this.selectedRouteDetails.waypoints.splice(nameIndex, 1, updatedWaypoint); + this.selectedWaypoint = updatedWaypoint; + this.$message.success('航点更新成功'); + } else { + this.$message.error('更新失败:未找到对应航点'); + } + } + } }, updateTime() { const now = new Date(); @@ -618,9 +643,9 @@ export default { this.isRightPanelHidden = false; } } else if(item.id === 'modify'){ - this.drawDom = !this.drawDom - console.log(this.drawDom,999999) - } + this.drawDom = !this.drawDom + console.log(this.drawDom,999999) + } if (item.id === 'deduction') { // 点击推演按钮,显示/隐藏K时弹出框 this.showKTimePopup = !this.showKTimePopup; @@ -725,7 +750,7 @@ export default { return `K+${hours.toString().padStart(2, '0')}:${minutes.toString().padStart(2, '0')}:00`; }, - // 航线操作 + // 航线操作:点击列表项只展示详情,不弹窗 selectRoute(route) { this.selectedRouteId = route.id; // 模拟获取航点数据 @@ -738,8 +763,7 @@ export default { { name: 'WP4', altitude: 5800, speed: '830km/h', eta: 'K+01:25:00' }, ] }; - // 打开航线编辑弹窗 - this.openRouteDialog(route); + // 移除原有的 this.openRouteDialog(route); }, addWaypoint() { @@ -792,6 +816,7 @@ export default { \ No newline at end of file + diff --git a/ruoyi-ui/src/views/dialogs/WaypointEditDialog.vue b/ruoyi-ui/src/views/dialogs/WaypointEditDialog.vue index f32ec32..57e05d4 100644 --- a/ruoyi-ui/src/views/dialogs/WaypointEditDialog.vue +++ b/ruoyi-ui/src/views/dialogs/WaypointEditDialog.vue @@ -1,52 +1,61 @@ - - - + 航点编辑 × - + - - + - + - - + - - - - - + - - - + + + + + + + - +
支持标绘/航线/空域/实时态势