diff --git a/ruoyi-ui/src/views/cesiumMap/index.vue b/ruoyi-ui/src/views/cesiumMap/index.vue index bf6b2be..18f8cdb 100644 --- a/ruoyi-ui/src/views/cesiumMap/index.vue +++ b/ruoyi-ui/src/views/cesiumMap/index.vue @@ -2588,56 +2588,8 @@ export default { }).catch(() => {}); } }; - if (currentRoomId && platId && !hasZoneOnRoute) { - getPlatformStyle({ roomId: currentRoomId, routeId: 0, platformId: platId }).then(standRes => { - const stand = standRes.data; - if (stand) { - const normalizedStand = this.normalizeZonesFromStyle(stand) - const savedDetectionZones = normalizedStand.detectionZones || [] - const savedPowerZones = normalizedStand.powerZones || [] - if (savedDetectionZones.length > 0 || savedPowerZones.length > 0) { - const firstSavedDetection = savedDetectionZones[0] || null - const firstSavedPower = savedPowerZones[0] || null - style = Object.assign({}, style || {}, { - detectionZones: savedDetectionZones, - powerZones: savedPowerZones, - detectionZoneRadius: firstSavedDetection ? firstSavedDetection.radiusKm : stand.detectionZoneRadius, - detectionZoneColor: firstSavedDetection ? firstSavedDetection.color : stand.detectionZoneColor, - detectionZoneOpacity: firstSavedDetection ? firstSavedDetection.opacity : stand.detectionZoneOpacity, - detectionZoneVisible: firstSavedDetection ? firstSavedDetection.visible !== false : stand.detectionZoneVisible, - powerZoneRadius: firstSavedPower ? firstSavedPower.radiusKm : stand.powerZoneRadius, - powerZoneAngle: firstSavedPower ? firstSavedPower.angleDeg : stand.powerZoneAngle, - powerZoneColor: firstSavedPower ? firstSavedPower.color : stand.powerZoneColor, - powerZoneOpacity: firstSavedPower ? firstSavedPower.opacity : stand.powerZoneOpacity, - powerZoneVisible: firstSavedPower ? firstSavedPower.visible !== false : stand.powerZoneVisible - }); - savePlatformStyle({ - roomId: String(currentRoomId), - routeId: routeId, - platformId: platId, - platformName: (style.platformName || (platform && platform.name)) || undefined, - labelFontSize: style.labelFontSize, - labelFontColor: style.labelFontColor, - platformSize: style.platformSize, - platformColor: style.platformColor, - detectionZones: savedDetectionZones, - powerZones: savedPowerZones, - detectionZoneRadius: style.detectionZoneRadius, - detectionZoneColor: style.detectionZoneColor, - detectionZoneOpacity: style.detectionZoneOpacity, - detectionZoneVisible: style.detectionZoneVisible, - powerZoneRadius: style.powerZoneRadius, - powerZoneAngle: style.powerZoneAngle, - powerZoneColor: style.powerZoneColor, - powerZoneOpacity: style.powerZoneOpacity, - powerZoneVisible: style.powerZoneVisible - }).catch(() => {}); - } - } - applyStyle(style); - }).catch(() => applyStyle(style)); - return; - } + // 航线平台样式仅使用 routeId 对应记录,不再从 routeId=0(独立拖拽平台)回填探测区/威力区。 + // 这样首次给航线加平台时只会使用航线默认样式,避免“额外区域”被自动继承。 applyStyle(style); }).catch(() => { addPlatformBillboard('#000000', 144); diff --git a/ruoyi-ui/src/views/childRoom/RightPanel.vue b/ruoyi-ui/src/views/childRoom/RightPanel.vue index d1d0694..e36dca5 100644 --- a/ruoyi-ui/src/views/childRoom/RightPanel.vue +++ b/ruoyi-ui/src/views/childRoom/RightPanel.vue @@ -55,7 +55,7 @@ :class="getRouteClasses(route.id)" >
- +
{{ route.name }}
{{ route.points }}{{ $t('rightPanel.points') }}
@@ -98,25 +98,6 @@ >
- -
-
-
- -
-
{{ point.name }}
-
高度: {{ point.alt }}m | 速度: {{ point.speed }}
-
-
- -
-
-
-
@@ -289,7 +270,7 @@ export default { type: Object, default: null }, - /** 父组件要求展开的航线 ID 列表(如冲突定位时),会展开对应方案与航线 */ + /** 父组件要求展开的方案树(如冲突定位时),会展开对应方案以便看到航线行 */ expandRouteIds: { type: Array, default: () => [] @@ -311,7 +292,6 @@ export default { return { activePlatformTab: 'air', expandedPlans: [], // 展开的方案列表 - expandedRoutes: [], // 展开的航线列表 platformJustDragged: false // 刚拖拽过,避免拖拽后误触点击打开弹窗 } }, @@ -323,9 +303,6 @@ export default { if (r && r.scenarioId != null && !this.expandedPlans.includes(r.scenarioId)) { this.expandedPlans.push(r.scenarioId); } - if (routeId != null && !this.expandedRoutes.includes(routeId)) { - this.expandedRoutes.push(routeId); - } }); } }, @@ -346,17 +323,6 @@ export default { } }, methods: { - /** 航点 startTime(如 K+00:40:00)格式化为简短显示:K+40 或 K-15 */ - formatWaypointKTime(startTime) { - if (!startTime || typeof startTime !== 'string') return '—'; - const m = startTime.match(/K([+-])(\d{2}):(\d{2})/); - if (!m) return startTime; - const sign = m[1]; - const h = parseInt(m[2], 10); - const min = parseInt(m[3], 10); - const totalMin = h * 60 + min; - return totalMin === 0 ? 'K+0' : `K${sign}${totalMin}`; - }, // 切换方案展开/折叠 togglePlan(planId) { const index = this.expandedPlans.indexOf(planId) @@ -372,7 +338,6 @@ export default { } else { // 展开新方案:不再隐藏航线,保留已打开的航线显示;仅切换展开状态并选中方案 this.expandedPlans = []; - this.expandedRoutes = []; this.expandedPlans.push(planId) const plan = this.plans.find(p => p.id === planId) if (plan) { @@ -381,34 +346,19 @@ export default { } }, - // 切换航线展开/折叠 + // 点击航线行:与父组件 selectRoute 联动(未选中则上图,已选中则取消上图);航点请在「编辑航线」中维护 toggleRoute(routeId) { const route = this.routes.find(r => r.id === routeId) if (!route) return if (!route.waypoints) { - this.$set(route, 'waypoints', []); // 使用 $set 确保新属性是响应式的 + this.$set(route, 'waypoints', []) } - const isRouteSelected = this.activeRouteIds.includes(routeId) - const isRouteExpanded = this.expandedRoutes.includes(routeId) - if (isRouteSelected) { - if (isRouteExpanded) { - const index = this.expandedRoutes.indexOf(routeId) - this.expandedRoutes.splice(index, 1) - } else { - this.expandedRoutes.push(routeId) + this.handleSelectRoute(route) + this.$nextTick(() => { + if (route.scenarioId != null && !this.expandedPlans.includes(route.scenarioId)) { + this.expandedPlans.push(route.scenarioId) } - } else { - this.handleSelectRoute(route) - this.$nextTick(() => { - // 检查当前方案是否已展开,如果没展开,可能需要先展开方案才能看到航线 - if (!this.expandedPlans.includes(route.scenarioId)) { - this.expandedPlans.push(route.scenarioId); - } - if (!this.expandedRoutes.includes(routeId)) { - this.expandedRoutes.push(routeId) - } - }) - } + }) }, // 判断是否是图片路径 @@ -473,11 +423,6 @@ export default { handleToggleRouteVisibility(route) { this.$emit('toggle-route-visibility', route) - // 当隐藏航线时,自动收回航点列表 - const routeIndex = this.expandedRoutes.indexOf(route.id) - if (routeIndex > -1) { - this.expandedRoutes.splice(routeIndex, 1) - } }, getRouteClasses(routeId) { @@ -498,14 +443,6 @@ export default { const e = this.routeLockedBy[routeId] return (e && (e.nickName || e.userName)) || '' }, - handleOpenWaypointDialog(point,index,total) { - this.$emit('open-waypoint-dialog', { - ...point, - currentIndex: index, - totalPoints: total - }); - }, - handleOpenPlatformDialog(platform) { this.$emit('open-platform-dialog', platform) }, @@ -685,10 +622,6 @@ export default { background: rgba(255, 255, 255, 0.8) !important; } -.tree-item.waypoint-item .tree-item-header { - background: rgba(224, 238, 255, 0.8); -} - .tree-item.active .tree-item-header { background: rgba(0, 138, 255, 0.15) !important; border-color: rgba(0, 138, 255, 0.3); @@ -785,10 +718,6 @@ export default { margin-left: 25px; } -.waypoint-children { - margin-left: 50px; -} - .action-buttons { display: flex; gap: 10px; diff --git a/ruoyi-ui/src/views/childRoom/index.vue b/ruoyi-ui/src/views/childRoom/index.vue index 279a95c..b271956 100644 --- a/ruoyi-ui/src/views/childRoom/index.vue +++ b/ruoyi-ui/src/views/childRoom/index.vue @@ -5812,45 +5812,37 @@ export default { /** 切换航线:实现多选/开关逻辑 */ async selectRoute(route) { const index = this.activeRouteIds.indexOf(route.id); - const isRouteExpanded = this.$refs.rightPanel ? this.$refs.rightPanel.expandedRoutes.includes(route.id) : false; - // 航线已在选中列表中 + // 航线已在地图上选中:再次点击右侧航线行则取消选中(右侧不再展开航点子列表) if (index > -1) { - if (isRouteExpanded) { - return; - } else { - // 航线未展开,点击则取消选中(从地图移除) - this.activeRouteIds.splice(index, 1); - if (this.$refs.cesiumMap) { - this.$refs.cesiumMap.removeRouteById(route.id); - // 隐藏航线时,同时移除关联的探测区、威力区 - this.$refs.cesiumMap.removeDetectionZoneByRouteId(route.id); - this.$refs.cesiumMap.removePowerZoneByRouteId(route.id); - } - if (this.selectedRouteDetails && this.selectedRouteDetails.id === route.id) { - if (this.activeRouteIds.length > 0) { - const lastId = this.activeRouteIds[this.activeRouteIds.length - 1]; - try { - const res = await getRoutes(lastId); - if (res.code === 200 && res.data) { - this.selectedRouteId = res.data.id; - this.selectedRouteDetails = { - id: res.data.id, - name: res.data.callSign, - waypoints: res.data.waypoints || [] - }; - } - } catch (e) { - console.error("回显剩余航线失败", e); + this.activeRouteIds.splice(index, 1); + if (this.$refs.cesiumMap) { + this.$refs.cesiumMap.removeRouteById(route.id); + this.$refs.cesiumMap.removeDetectionZoneByRouteId(route.id); + this.$refs.cesiumMap.removePowerZoneByRouteId(route.id); + } + if (this.selectedRouteDetails && this.selectedRouteDetails.id === route.id) { + if (this.activeRouteIds.length > 0) { + const lastId = this.activeRouteIds[this.activeRouteIds.length - 1]; + try { + const res = await getRoutes(lastId); + if (res.code === 200 && res.data) { + this.selectedRouteId = res.data.id; + this.selectedRouteDetails = { + id: res.data.id, + name: res.data.callSign, + waypoints: res.data.waypoints || [] + }; } - } else { - this.selectedRouteId = null; - this.selectedRouteDetails = null; + } catch (e) { + console.error("回显剩余航线失败", e); } + } else { + this.selectedRouteId = null; + this.selectedRouteDetails = null; } - // 航线显隐仅本地生效,不同步给他人 - this.$message.info(`已取消航线: ${route.name}`); - return; } + this.$message.info(`已取消航线: ${route.name}`); + return; } // 航线未被选中,点击则选中并显示航线和航点 diff --git a/ruoyi-ui/src/views/dialogs/RouteEditDialog.vue b/ruoyi-ui/src/views/dialogs/RouteEditDialog.vue index e2c1541..fbcaf20 100644 --- a/ruoyi-ui/src/views/dialogs/RouteEditDialog.vue +++ b/ruoyi-ui/src/views/dialogs/RouteEditDialog.vue @@ -8,9 +8,26 @@
- - - +
+ + + +
+
+ + +
@@ -195,15 +212,6 @@
该航线暂无航点数据
- -
@@ -445,6 +448,7 @@ export default { activeTab(val) { if (val === 'platform' && this.visible) this.loadPlatforms() if (val === 'waypoints' && this.panelWidth < 920) this.panelWidth = 920 + if (val !== 'waypoints') this.waypointsEditMode = false } }, methods: { @@ -707,7 +711,7 @@ export default { }, confirmWaypointsEdit() { this.waypointsEditMode = false - this.$message.success('表格已保存,点击下方「确定」将提交航线与航点') + this.$message.success('航点表格已保存,请切换到「基础」或「平台」后点击「确定」提交航线') }, cancelWaypointsEdit() { this.syncWaypointsTableData(this.route.waypoints || []) @@ -863,11 +867,6 @@ export default { flex-direction: column; min-height: 0; } -.route-edit-dialog-wrap .dialog-footer { - padding: 10px 0 0; - margin-top: 8px; - border-top: 1px solid #ebeef5; -} .route-edit-dialog-wrap .resize-handle { position: absolute; right: 0; @@ -886,11 +885,31 @@ export default {