diff --git a/ruoyi-admin/src/main/resources/application-druid.yml b/ruoyi-admin/src/main/resources/application-druid.yml index 037db5c..c40f2aa 100644 --- a/ruoyi-admin/src/main/resources/application-druid.yml +++ b/ruoyi-admin/src/main/resources/application-druid.yml @@ -8,7 +8,7 @@ spring: master: url: jdbc:mysql://localhost:3306/ry?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 username: root - password: 123456 + password: A20040303ctw! # 从库数据源 slave: # 从数据源开关/默认关闭 diff --git a/ruoyi-ui/src/views/childRoom/LeftMenu.vue b/ruoyi-ui/src/views/childRoom/LeftMenu.vue index 0611f6c..a68353b 100644 --- a/ruoyi-ui/src/views/childRoom/LeftMenu.vue +++ b/ruoyi-ui/src/views/childRoom/LeftMenu.vue @@ -136,4 +136,4 @@ export default { color: #008aff; box-shadow: 0 2px 8px rgba(0, 138, 255, 0.3); } - + \ No newline at end of file diff --git a/ruoyi-ui/src/views/childRoom/RightPanel.vue b/ruoyi-ui/src/views/childRoom/RightPanel.vue index 4cc93b4..85d9d89 100644 --- a/ruoyi-ui/src/views/childRoom/RightPanel.vue +++ b/ruoyi-ui/src/views/childRoom/RightPanel.vue @@ -18,16 +18,16 @@
-
- 航线列表 +
+
航线列表
- 新建航线 + 新建
@@ -66,7 +66,6 @@ v-for="point in selectedRouteDetails.waypoints" :key="point.name" class="waypoint-item" - @click="handleOpenWaypointDialog(point)" >
@@ -272,6 +271,11 @@ export default { this.$emit('select-route', route) }, + // 新增:新建航线事件 + handleCreateRoute() { + this.$emit('create-route') + }, + handleOpenRouteDialog(route) { this.$emit('open-route-dialog', route) }, @@ -377,13 +381,31 @@ export default { margin-bottom: 20px; } +/* 新增:标题栏容器样式 */ +.section-header { + display: flex; + justify-content: space-between; + align-items: center; + border-bottom: 2px solid rgba(0, 138, 255, 0.2); + margin-bottom: 10px; + padding-bottom: 8px; +} + +/* 修改:移除了原有的 border-bottom,改在 section-header 中统一定义 */ .section-title { font-size: 14px; font-weight: 600; color: #008aff; - margin-bottom: 10px; - padding-bottom: 8px; - border-bottom: 2px solid rgba(0, 138, 255, 0.2); +} + +/* 新增:头部按钮样式 */ +.header-action-btn { + padding: 0; + color: #008aff; +} + +.header-action-btn:hover { + color: #0066cc; } .route-list { @@ -464,7 +486,6 @@ export default { padding: 10px; background: rgba(255, 255, 255, 0.8); border-radius: 6px; - cursor: pointer; transition: all 0.3s; border: 1px solid rgba(0, 138, 255, 0.1); } diff --git a/ruoyi-ui/src/views/childRoom/index.vue b/ruoyi-ui/src/views/childRoom/index.vue index cb86576..bfbf1b6 100644 --- a/ruoyi-ui/src/views/childRoom/index.vue +++ b/ruoyi-ui/src/views/childRoom/index.vue @@ -11,7 +11,6 @@

支持标绘/航线/空域/实时态势

-
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 +391,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(); @@ -734,8 +774,7 @@ export default { { name: 'WP4', altitude: 5800, speed: '830km/h', eta: 'K+01:25:00' }, ] }; - // 打开航线编辑弹窗 - this.openRouteDialog(route); + // 移除原有的 this.openRouteDialog(route); }, addWaypoint() { diff --git a/ruoyi-ui/src/views/dialogs/RouteEditDialog.vue b/ruoyi-ui/src/views/dialogs/RouteEditDialog.vue index ecee213..f62fd46 100644 --- a/ruoyi-ui/src/views/dialogs/RouteEditDialog.vue +++ b/ruoyi-ui/src/views/dialogs/RouteEditDialog.vue @@ -1,66 +1,30 @@ \ 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 @@