|
|
|
@ -55,7 +55,7 @@ |
|
|
|
:class="getRouteClasses(route.id)" |
|
|
|
> |
|
|
|
<div class="tree-item-header" @click="toggleRoute(route.id)"> |
|
|
|
<i :class="expandedRoutes.includes(route.id) ? 'el-icon-map-location' : 'el-icon-map-location'" class="tree-icon"></i> |
|
|
|
<i class="el-icon-map-location tree-icon"></i> |
|
|
|
<div class="tree-item-info"> |
|
|
|
<div class="tree-item-name">{{ route.name }}</div> |
|
|
|
<div class="tree-item-meta">{{ route.points }}{{ $t('rightPanel.points') }}</div> |
|
|
|
@ -98,25 +98,6 @@ |
|
|
|
></i> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<!-- 航点列表 --> |
|
|
|
<div v-if="expandedRoutes.includes(route.id)" class="tree-children waypoint-children"> |
|
|
|
<div |
|
|
|
v-for="(point,index) in (expandedRoutes.includes(route.id) && route.waypoints ? route.waypoints : [])" |
|
|
|
:key="point.name" |
|
|
|
class="tree-item waypoint-item" |
|
|
|
> |
|
|
|
<div class="tree-item-header"> |
|
|
|
<i class="el-icon-location tree-icon"></i> |
|
|
|
<div class="tree-item-info"> |
|
|
|
<div class="tree-item-name">{{ point.name }}</div> |
|
|
|
<div class="tree-item-meta">高度: {{ point.alt }}m | 速度: {{ point.speed }}<template v-if="point.startTime"> | 相对K: {{ formatWaypointKTime(point.startTime) }}</template></div> |
|
|
|
</div> |
|
|
|
<div class="tree-item-actions"> |
|
|
|
<i class="el-icon-edit" title="编辑" @click.stop="handleOpenWaypointDialog(point, index, route.waypoints.length)"></i> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
@ -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(22, 93, 255, 0.15) !important; |
|
|
|
border-color: rgba(22, 93, 255, 0.3); |
|
|
|
@ -785,10 +718,6 @@ export default { |
|
|
|
margin-left: 25px; |
|
|
|
} |
|
|
|
|
|
|
|
.waypoint-children { |
|
|
|
margin-left: 50px; |
|
|
|
} |
|
|
|
|
|
|
|
.action-buttons { |
|
|
|
display: flex; |
|
|
|
gap: 10px; |
|
|
|
|