|
|
|
@ -12,13 +12,23 @@ |
|
|
|
<cesiumMap ref="cesiumMap" :drawDomClick="drawDom || airspaceDrawDom" |
|
|
|
:tool-mode="drawDom ? 'ranging' : (airspaceDrawDom ? 'airspace' : 'airspace')" |
|
|
|
:scaleConfig="scaleConfig" |
|
|
|
:coordinateFormat="coordinateFormat" |
|
|
|
:route-locked="routeLocked" |
|
|
|
@draw-complete="handleMapDrawComplete" |
|
|
|
@route-lock-changed="handleRouteLockChanged" |
|
|
|
@drawing-points-update="missionDrawingPointsCount = $event" |
|
|
|
@platform-route-drawing-started="missionDrawingActive = true" |
|
|
|
@drawing-cancelled="missionDrawingActive = false" |
|
|
|
@open-waypoint-dialog="handleOpenWaypointEdit" |
|
|
|
@open-route-dialog="handleOpenRouteEdit" |
|
|
|
@copy-route="handleCopyRoute" |
|
|
|
@route-copy-placed="handleRouteCopyPlaced" |
|
|
|
@waypoint-position-changed="handleWaypointPositionChanged" |
|
|
|
@scale-click="handleScaleClick" |
|
|
|
@platform-icon-updated="onPlatformIconUpdated" |
|
|
|
@platform-icon-removed="onPlatformIconRemoved" /> |
|
|
|
@platform-icon-removed="onPlatformIconRemoved" |
|
|
|
@viewer-ready="onViewerReady" |
|
|
|
@drawing-entities-changed="onDrawingEntitiesChanged" /> |
|
|
|
<div v-show="!screenshotMode" class="map-overlay-text"> |
|
|
|
<!-- <i class="el-icon-location-outline text-3xl mb-2 block"></i> --> |
|
|
|
<!-- <p>二维GIS地图区域</p> |
|
|
|
@ -40,11 +50,17 @@ |
|
|
|
<div class="red-dot"></div> |
|
|
|
<i class="el-icon-s-unfold icon-inside"></i> |
|
|
|
</div> |
|
|
|
<el-dialog title="保存新航线" :visible.sync="showNameDialog" width="30%" :append-to-body="true"> |
|
|
|
<el-dialog title="保存新航线" :visible.sync="showNameDialog" width="30%" :append-to-body="true" @open="onSaveRouteDialogOpen" @close="tempMapPlatform = null; saveDialogScenarioId = null"> |
|
|
|
<el-form label-width="80px"> |
|
|
|
<el-form-item label="航线名称"> |
|
|
|
<el-input v-model="newRouteName" placeholder="例如:航线一"></el-input> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="所属方案"> |
|
|
|
<el-select v-model="saveDialogScenarioId" placeholder="请选择方案" style="width:100%" clearable> |
|
|
|
<el-option v-for="p in plans" :key="p.id" :label="p.name" :value="p.id" /> |
|
|
|
</el-select> |
|
|
|
<div v-if="plans.length === 0" class="el-form-item__error" style="margin-top:4px;">暂无方案,请先点击地图左侧红点展开菜单,选择「方案」并新建方案后再保存。</div> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
<div slot="footer" class="dialog-footer"> |
|
|
|
<el-button @click="showNameDialog = false">取 消</el-button> |
|
|
|
@ -162,6 +178,7 @@ |
|
|
|
:selected-route-id="selectedRouteId" |
|
|
|
:routes="routes" |
|
|
|
:active-route-ids="activeRouteIds" |
|
|
|
:route-locked="routeLocked" |
|
|
|
:selected-route-details="selectedRouteDetails" |
|
|
|
:conflicts="conflicts" |
|
|
|
:conflict-count="conflictCount" |
|
|
|
@ -181,6 +198,7 @@ |
|
|
|
@add-waypoint="addWaypoint" |
|
|
|
@cancel-route="cancelRoute" |
|
|
|
@toggle-route-visibility="toggleRouteVisibility" |
|
|
|
@toggle-route-lock="handleToggleRouteLockFromPanel" |
|
|
|
@view-conflict="viewConflict" |
|
|
|
@resolve-conflict="resolveConflict" |
|
|
|
@run-conflict-check="runConflictCheck" |
|
|
|
@ -467,6 +485,10 @@ export default { |
|
|
|
showNameDialog: false, |
|
|
|
newRouteName: '', |
|
|
|
tempMapPoints: [], |
|
|
|
/** 从平台右键「在此之前/在此之后插入航线」完成时传入,保存航线时用作 platformId */ |
|
|
|
tempMapPlatform: null, |
|
|
|
/** 保存新航线弹窗内选择的方案 ID(弹窗内可直接选方案,无需先展开侧边) */ |
|
|
|
saveDialogScenarioId: null, |
|
|
|
platformIconSaveTimer: null, |
|
|
|
//导入平台弹窗 |
|
|
|
showImportDialog: false, |
|
|
|
@ -485,6 +507,7 @@ export default { |
|
|
|
roomDetail: null, |
|
|
|
showKTimeSetDialog: false, |
|
|
|
kTimeForm: { dateTime: null }, |
|
|
|
saveRoomDrawingsTimer: null, |
|
|
|
|
|
|
|
// 左侧菜单栏 |
|
|
|
isMenuHidden: true, // 是否完全隐藏左侧菜单 |
|
|
|
@ -563,6 +586,9 @@ export default { |
|
|
|
showLandmark: true, |
|
|
|
showRoute: true, |
|
|
|
|
|
|
|
// 坐标格式控制 |
|
|
|
coordinateFormat: 'dms', // 'decimal' 或 'dms' |
|
|
|
|
|
|
|
menuItems: [], |
|
|
|
|
|
|
|
// 右侧面板 |
|
|
|
@ -570,6 +596,8 @@ export default { |
|
|
|
plans: [], |
|
|
|
activeRightTab: 'plan', |
|
|
|
activeRouteIds: [], // 存储当前所有选中的航线ID |
|
|
|
/** 航线上锁状态:routeId -> true 上锁,与地图右键及右侧列表锁图标同步 */ |
|
|
|
routeLocked: {}, |
|
|
|
// 冲突数据 |
|
|
|
conflictCount: 2, |
|
|
|
conflicts: [ |
|
|
|
@ -799,6 +827,106 @@ export default { |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
/** 右键「复制航线」:拉取航点后进入复制预览,左键放置后弹窗保存 */ |
|
|
|
async handleCopyRoute(routeId) { |
|
|
|
try { |
|
|
|
const res = await getRoutes(routeId); |
|
|
|
if (res.code !== 200 || !res.data) { |
|
|
|
this.$message.error('获取航线数据失败'); |
|
|
|
return; |
|
|
|
} |
|
|
|
const waypoints = res.data.waypoints || []; |
|
|
|
if (waypoints.length < 2) { |
|
|
|
this.$message.warning('航线航点不足,无法复制'); |
|
|
|
return; |
|
|
|
} |
|
|
|
if (this.$refs.cesiumMap && typeof this.$refs.cesiumMap.startRouteCopyPreview === 'function') { |
|
|
|
this.$refs.cesiumMap.startRouteCopyPreview(waypoints); |
|
|
|
this.$message.info('移动鼠标到目标位置,左键放置复制航线;右键取消'); |
|
|
|
} |
|
|
|
} catch (e) { |
|
|
|
this.$message.error('获取航线数据失败'); |
|
|
|
console.error(e); |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
/** 复制航线已放置:用当前偏移后的航点打开「保存新航线」弹窗 */ |
|
|
|
handleRouteCopyPlaced(points) { |
|
|
|
this.tempMapPoints = points || []; |
|
|
|
this.tempMapPlatform = null; |
|
|
|
this.showNameDialog = true; |
|
|
|
}, |
|
|
|
|
|
|
|
/** 地图上拖拽航点结束:将新位置写回数据库并刷新显示 */ |
|
|
|
async handleWaypointPositionChanged({ dbId, routeId, lat, lng, alt }) { |
|
|
|
let waypoints = null; |
|
|
|
let route = null; |
|
|
|
if (this.selectedRouteDetails && this.selectedRouteDetails.id === routeId) { |
|
|
|
waypoints = this.selectedRouteDetails.waypoints; |
|
|
|
route = this.selectedRouteDetails; |
|
|
|
} |
|
|
|
if (!waypoints) { |
|
|
|
const r = this.routes.find(r => r.id === routeId); |
|
|
|
if (r && r.waypoints) { |
|
|
|
waypoints = r.waypoints; |
|
|
|
route = r; |
|
|
|
} |
|
|
|
} |
|
|
|
if (!waypoints || !route) { |
|
|
|
this.$message.error('未找到对应航线数据'); |
|
|
|
return; |
|
|
|
} |
|
|
|
const wp = waypoints.find(p => p.id === dbId); |
|
|
|
if (!wp) { |
|
|
|
this.$message.error('未找到对应航点'); |
|
|
|
return; |
|
|
|
} |
|
|
|
const payload = { |
|
|
|
id: wp.id, |
|
|
|
routeId: wp.routeId != null ? wp.routeId : routeId, |
|
|
|
name: wp.name, |
|
|
|
seq: wp.seq, |
|
|
|
lat: Number(lat), |
|
|
|
lng: Number(lng), |
|
|
|
alt: Number(alt), |
|
|
|
speed: wp.speed, |
|
|
|
startTime: (wp.startTime != null && wp.startTime !== '') ? wp.startTime : 'K+00:00:00', |
|
|
|
turnAngle: wp.turnAngle |
|
|
|
}; |
|
|
|
if (wp.pointType != null) payload.pointType = wp.pointType; |
|
|
|
if (wp.holdParams != null) payload.holdParams = wp.holdParams; |
|
|
|
if (wp.labelFontSize != null) payload.labelFontSize = wp.labelFontSize; |
|
|
|
if (wp.labelColor != null) payload.labelColor = wp.labelColor; |
|
|
|
try { |
|
|
|
const response = await updateWaypoints(payload); |
|
|
|
if (response.code === 200) { |
|
|
|
const merged = { ...wp, ...payload }; |
|
|
|
const idx = waypoints.findIndex(p => p.id === dbId); |
|
|
|
if (idx !== -1) waypoints.splice(idx, 1, merged); |
|
|
|
if (this.selectedRouteDetails && this.selectedRouteDetails.id === routeId) { |
|
|
|
const i = this.selectedRouteDetails.waypoints.findIndex(p => p.id === dbId); |
|
|
|
if (i !== -1) this.selectedRouteDetails.waypoints.splice(i, 1, merged); |
|
|
|
} |
|
|
|
if (this.$refs.cesiumMap) { |
|
|
|
this.$refs.cesiumMap.renderRouteWaypoints( |
|
|
|
waypoints, |
|
|
|
routeId, |
|
|
|
route.platformId, |
|
|
|
route.platform, |
|
|
|
this.parseRouteStyle(route.attributes) |
|
|
|
); |
|
|
|
} |
|
|
|
this.$message.success('航点位置已更新'); |
|
|
|
this.$nextTick(() => this.updateDeductionPositions()); |
|
|
|
} else { |
|
|
|
throw new Error(response.msg || '更新失败'); |
|
|
|
} |
|
|
|
} catch (error) { |
|
|
|
console.error('更新航点位置失败:', error); |
|
|
|
this.$message.error(error.message || '更新失败,请重试'); |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
// 显示在线成员弹窗 |
|
|
|
showOnlineMembersDialog() { |
|
|
|
this.showOnlineMembers = true; |
|
|
|
@ -998,7 +1126,7 @@ export default { |
|
|
|
if (idx > -1) { |
|
|
|
this.activeRouteIds.splice(idx, 1); |
|
|
|
} |
|
|
|
await this.getList(); |
|
|
|
await this.getList({ skipRoomPlatformIcons: true }); |
|
|
|
} |
|
|
|
} catch (e) { |
|
|
|
if (e !== 'cancel') { |
|
|
|
@ -1007,8 +1135,12 @@ export default { |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
/** 从数据库拉取最新的航线列表数据 */ |
|
|
|
async getList() { |
|
|
|
/** |
|
|
|
* 从数据库拉取最新的航线列表数据 |
|
|
|
* @param {Object} opts - 可选:{ skipRoomPlatformIcons: true } 时不再加载房间平台图标(用于删除航线等仅航线变化的场景,避免地图上的平台图标被清空再重画导致闪一下) |
|
|
|
*/ |
|
|
|
async getList(opts = {}) { |
|
|
|
const { skipRoomPlatformIcons = false } = opts; |
|
|
|
try { |
|
|
|
const roomId = this.$route.query.roomId || this.currentRoomId; |
|
|
|
const scenarioRes = await listScenario({ roomId: roomId }); |
|
|
|
@ -1016,6 +1148,7 @@ export default { |
|
|
|
this.plans = scenarioRes.rows.map(s => ({ |
|
|
|
id: s.id, |
|
|
|
name: s.name, |
|
|
|
frontendDrawings: s.frontendDrawings || null, |
|
|
|
routes: [] |
|
|
|
})); |
|
|
|
} |
|
|
|
@ -1054,7 +1187,8 @@ export default { |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
// 加载该房间下保存的地图平台图标 |
|
|
|
// 加载该房间下保存的地图平台图标(删除航线等操作时跳过,避免清空再重画导致平台图标闪一下) |
|
|
|
if (!skipRoomPlatformIcons) { |
|
|
|
const rId = roomId || this.currentRoomId; |
|
|
|
if (rId && this.$refs.cesiumMap && typeof this.$refs.cesiumMap.loadRoomPlatformIcons === 'function') { |
|
|
|
listRoomPlatformIcons(rId).then(res => { |
|
|
|
@ -1062,20 +1196,26 @@ export default { |
|
|
|
}).catch(() => {}); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} catch (error) { |
|
|
|
console.error("数据加载失败:", error); |
|
|
|
this.$message.error("获取方案列表失败"); |
|
|
|
} |
|
|
|
}, |
|
|
|
handleMapDrawComplete(points) { |
|
|
|
handleMapDrawComplete(points, options) { |
|
|
|
this.missionDrawingActive = false; |
|
|
|
if (!points || points.length < 2) { |
|
|
|
this.$message.error('航点太少,无法生成航线'); |
|
|
|
this.drawDom = false; |
|
|
|
return; |
|
|
|
} |
|
|
|
this.tempMapPoints = points; // 暂存坐标点 |
|
|
|
this.showNameDialog = true; // 弹出对话框起名 |
|
|
|
this.tempMapPoints = points; |
|
|
|
this.tempMapPlatform = (options && (options.platformId != null || options.platform)) ? options : null; |
|
|
|
this.showNameDialog = true; |
|
|
|
}, |
|
|
|
/** 保存新航线弹窗打开时:若当前未选方案则用已选方案或第一个方案填充,便于在弹窗内直接选择 */ |
|
|
|
onSaveRouteDialogOpen() { |
|
|
|
this.saveDialogScenarioId = this.selectedPlanId || (this.plans[0] && this.plans[0].id) || null; |
|
|
|
}, |
|
|
|
|
|
|
|
openAddHoldDuringDrawing() { |
|
|
|
@ -1091,9 +1231,9 @@ export default { |
|
|
|
this.$message.error('新增航线未命名,请输入名称后保存!'); |
|
|
|
return; |
|
|
|
} |
|
|
|
const currentScenarioId = this.selectedPlanId; |
|
|
|
const currentScenarioId = this.saveDialogScenarioId != null ? this.saveDialogScenarioId : this.selectedPlanId; |
|
|
|
if (!currentScenarioId) { |
|
|
|
this.$message.warning('请先在左侧选择一个方案,再保存航线!'); |
|
|
|
this.$message.warning(this.plans.length === 0 ? '暂无方案,请先点击地图左侧红点展开菜单,选择「方案」并新建方案后再保存。' : '请在上方选择所属方案后再保存。'); |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
@ -1121,7 +1261,7 @@ export default { |
|
|
|
const routeData = { |
|
|
|
callSign: this.newRouteName, |
|
|
|
scenarioId: currentScenarioId, |
|
|
|
platformId: 1, |
|
|
|
platformId: (this.tempMapPlatform && this.tempMapPlatform.platformId != null) ? this.tempMapPlatform.platformId : 1, |
|
|
|
attributes: this.getDefaultRouteAttributes(), |
|
|
|
waypoints: finalWaypoints |
|
|
|
}; |
|
|
|
@ -1148,25 +1288,37 @@ export default { |
|
|
|
this.activeRouteIds.push(newRouteId); |
|
|
|
} |
|
|
|
|
|
|
|
// 3. UI 重置 |
|
|
|
// 3. 先保存“用于创建航线的平台”引用,再清空(后续删除要用到) |
|
|
|
const platformToRemove = this.tempMapPlatform; |
|
|
|
|
|
|
|
// 4. UI 重置 |
|
|
|
this.drawDom = false; |
|
|
|
this.showNameDialog = false; |
|
|
|
this.newRouteName = ''; |
|
|
|
this.tempMapPoints = []; |
|
|
|
this.tempMapPlatform = null; |
|
|
|
|
|
|
|
// 4. 【修复关键 B】:千万不要调用 clearAllWaypoints()! |
|
|
|
// 改为只删除绘制过程中的临时预览实体,保留地图上已有的正式线 |
|
|
|
// 5. 【修复关键 B】:只清理临时预览实体,不 clearAllWaypoints |
|
|
|
if (this.$refs.cesiumMap) { |
|
|
|
// 只清理临时点(假如你的地图组件有这个更细的方法) |
|
|
|
// 如果没有,就直接删掉 tempPreviewEntity |
|
|
|
if (this.$refs.cesiumMap.tempPreviewEntity) { |
|
|
|
this.viewer.entities.remove(this.$refs.cesiumMap.tempPreviewEntity); |
|
|
|
this.$refs.cesiumMap.tempPreviewEntity = null; |
|
|
|
} |
|
|
|
// 如果 clearAllWaypoints 会清空所有,那这里就不能调用它 |
|
|
|
} |
|
|
|
|
|
|
|
// 5. 刷新右侧列表(拉取最新数据,含新建航线);getList 内部会根据 activeRouteIds 自动渲染新航线 |
|
|
|
// 6. 若本条航线是从“地图上的平台图标”创建的:先删库再刷新列表,最后从地图移除该占位图标(避免 getList 重新拉取到未删记录又画上去) |
|
|
|
if (platformToRemove && this.$refs.cesiumMap) { |
|
|
|
if (platformToRemove.serverId) { |
|
|
|
await delRoomPlatformIcon(platformToRemove.serverId).catch(() => {}); |
|
|
|
if (typeof this.$refs.cesiumMap.removePlatformIconByServerId === 'function') { |
|
|
|
this.$refs.cesiumMap.removePlatformIconByServerId(platformToRemove.serverId); |
|
|
|
} |
|
|
|
} else if (platformToRemove.mapEntityId && typeof this.$refs.cesiumMap.removeEntity === 'function') { |
|
|
|
this.$refs.cesiumMap.removeEntity(platformToRemove.mapEntityId); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// 7. 刷新右侧列表(拉取最新数据,含新建航线);getList 会重新加载房间平台图标,因已删记录,不会再画出该图标 |
|
|
|
await this.getList(); |
|
|
|
const routeFromList = this.routes.find(r => r.id === newRouteId); |
|
|
|
if (routeFromList) { |
|
|
|
@ -1290,9 +1442,43 @@ export default { |
|
|
|
getRoomDetail() { |
|
|
|
if (!this.currentRoomId) return; |
|
|
|
getRooms(this.currentRoomId).then(res => { |
|
|
|
if (res.code === 200 && res.data) this.roomDetail = res.data; |
|
|
|
if (res.code === 200 && res.data) { |
|
|
|
this.roomDetail = res.data; |
|
|
|
this.$nextTick(() => this.loadRoomDrawings()); |
|
|
|
} |
|
|
|
}).catch(() => {}); |
|
|
|
}, |
|
|
|
/** 加载当前房间的空域/威力区图形(与房间 ID 绑定,进入该房间即显示) */ |
|
|
|
loadRoomDrawings() { |
|
|
|
if (!this.roomDetail || !this.$refs.cesiumMap || typeof this.$refs.cesiumMap.loadFrontendDrawings !== 'function') return; |
|
|
|
if (this.roomDetail.frontendDrawings) { |
|
|
|
this.$refs.cesiumMap.loadFrontendDrawings(this.roomDetail.frontendDrawings); |
|
|
|
} else { |
|
|
|
this.$refs.cesiumMap.clearDrawingEntities(); |
|
|
|
} |
|
|
|
}, |
|
|
|
/** 地图 viewer 就绪时加载当前房间图形(可能 getRoomDetail 尚未返回,此处再试一次) */ |
|
|
|
onViewerReady() { |
|
|
|
this.loadRoomDrawings(); |
|
|
|
}, |
|
|
|
/** 空域/威力区图形增删时防抖自动保存到当前房间 */ |
|
|
|
onDrawingEntitiesChanged() { |
|
|
|
if (!this.currentRoomId) return; |
|
|
|
if (this.saveRoomDrawingsTimer) clearTimeout(this.saveRoomDrawingsTimer); |
|
|
|
this.saveRoomDrawingsTimer = setTimeout(() => { |
|
|
|
this.saveRoomDrawingsTimer = null; |
|
|
|
this.saveRoomDrawingsToServer(); |
|
|
|
}, 600); |
|
|
|
}, |
|
|
|
/** 将当前地图上的空域图形写入当前房间(静默保存,不弹成功提示;失败时抛出供调用方处理) */ |
|
|
|
async saveRoomDrawingsToServer() { |
|
|
|
if (!this.currentRoomId || !this.$refs.cesiumMap) return; |
|
|
|
if (typeof this.$refs.cesiumMap.getFrontendDrawingsData !== 'function') return; |
|
|
|
const drawingsData = this.$refs.cesiumMap.getFrontendDrawingsData(); |
|
|
|
const frontendDrawingsStr = JSON.stringify(drawingsData); |
|
|
|
await updateRooms({ id: this.currentRoomId, frontendDrawings: frontendDrawingsStr }); |
|
|
|
if (this.roomDetail) this.roomDetail.frontendDrawings = frontendDrawingsStr; |
|
|
|
}, |
|
|
|
/** 将任意日期字符串格式化为 yyyy-MM-dd HH:mm:ss,供日期选择器使用 */ |
|
|
|
formatKTimeForPicker(val) { |
|
|
|
if (!val) return null; |
|
|
|
@ -1365,9 +1551,18 @@ export default { |
|
|
|
this.activeMenu = item.id; |
|
|
|
}, |
|
|
|
|
|
|
|
// 文件下拉菜单方法 |
|
|
|
savePlan() { |
|
|
|
this.$message.success('保存计划'); |
|
|
|
// 文件下拉菜单方法:立即保存当前房间的空域/威力区图形(与自动保存共用逻辑) |
|
|
|
async savePlan() { |
|
|
|
if (!this.currentRoomId) { |
|
|
|
this.$message.warning('请先进入任务房间'); |
|
|
|
return; |
|
|
|
} |
|
|
|
try { |
|
|
|
await this.saveRoomDrawingsToServer(); |
|
|
|
this.$message.success('房间空域图形已保存'); |
|
|
|
} catch (e) { |
|
|
|
this.$message.error('保存失败,请检查网络'); |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
importPlanFile() { |
|
|
|
@ -1796,8 +1991,8 @@ export default { |
|
|
|
}, |
|
|
|
|
|
|
|
coordinateConversion() { |
|
|
|
this.$message.success('坐标换算'); |
|
|
|
// 这里可以添加坐标换算的逻辑 |
|
|
|
this.coordinateFormat = this.coordinateFormat === 'decimal' ? 'dms' : 'decimal' |
|
|
|
this.$message.success(`坐标格式已切换为:${this.coordinateFormat === 'decimal' ? '十进制' : '度分秒'}`) |
|
|
|
}, |
|
|
|
|
|
|
|
// 选项下拉菜单方法 |
|
|
|
@ -2549,11 +2744,11 @@ export default { |
|
|
|
this.selectedRouteDetails = null; |
|
|
|
this.activeRouteIds = []; |
|
|
|
|
|
|
|
// 物理清场 |
|
|
|
// 物理清场(仅航点/航线;空域图形与房间绑定,不随方案切换) |
|
|
|
if (this.$refs.cesiumMap && this.$refs.cesiumMap.clearAllWaypoints) { |
|
|
|
this.$refs.cesiumMap.clearAllWaypoints(); |
|
|
|
} |
|
|
|
console.log(`>>> [切换成功] 已进入方案: ${plan.name},地图已清空,列表已展开。`); |
|
|
|
console.log(`>>> [切换成功] 已进入方案: ${plan && plan.name},地图已清空,列表已展开。`); |
|
|
|
}, |
|
|
|
/** 切换航线:实现多选/开关逻辑 */ |
|
|
|
async selectRoute(route) { |
|
|
|
@ -2730,6 +2925,18 @@ export default { |
|
|
|
}, |
|
|
|
|
|
|
|
// 切换航线显示/隐藏 |
|
|
|
/** 地图右键上锁/解锁后同步到列表 */ |
|
|
|
handleRouteLockChanged({ routeId, locked }) { |
|
|
|
this.$set(this.routeLocked, routeId, locked); |
|
|
|
}, |
|
|
|
/** 右侧列表锁图标点击:切换该航线上锁状态,与地图右键状态同步 */ |
|
|
|
handleToggleRouteLockFromPanel(route) { |
|
|
|
if (!route || route.id == null) return; |
|
|
|
const nextLocked = !this.routeLocked[route.id]; |
|
|
|
this.$set(this.routeLocked, route.id, nextLocked); |
|
|
|
this.$message.success(nextLocked ? '航线已上锁,无法修改' : '航线已解锁,可以编辑'); |
|
|
|
}, |
|
|
|
|
|
|
|
toggleRouteVisibility(route) { |
|
|
|
const index = this.activeRouteIds.indexOf(route.id); |
|
|
|
|
|
|
|
|