Compare commits

...

2 Commits

3 changed files with 19 additions and 6 deletions

View File

@ -19,7 +19,7 @@ export enum MapPointType {
/** 库区点 - 仓储作业区域 */
,
/** 密集库区点 - 密集库区点位 */
,
// 密集库区点,
/** 电梯点 - 机器人乘坐电梯的专用点位 */
= 11,

View File

@ -198,6 +198,11 @@ export class EditorService extends Meta2d {
#mapScenePoint(pen?: MapPen): StandardScenePoint | null {
if (!pen?.id || isEmpty(pen?.point)) return null;
// 过滤掉临时视图中心点
if (pen.id.includes('view-center-point')) {
return null;
}
const { id, label, desc, properties } = pen;
const { type, extensionType, robots, actions, associatedStorageLocations, deviceId } = pen.point;
const { x = 0, y = 0 } = this.getPointRect(pen) ?? {};

View File

@ -223,13 +223,21 @@ export function useViewState() {
// 跳转到临时点
editor.gotoById(centerPointId);
// 延迟移除临时点
// 立即取消选择,避免右侧卡片显示临时点信息
setTimeout(() => {
const tempPen = editor.getPenById(centerPointId);
if (tempPen) {
editor.delete([tempPen]);
editor.inactive();
}, 10); // 短暂延迟确保跳转完成
// 延迟清理临时点(保存时已自动过滤,这里只是为了清理画布显示)
setTimeout(() => {
const remainingPoints = editor
.find('point')
.filter((point) => point.id && point.id.includes('view-center-point'));
if (remainingPoints && remainingPoints.length > 0) {
editor.delete(remainingPoints);
console.log(`清理了 ${remainingPoints.length} 个临时点`);
}
}, 100);
}, 500); // 增加延迟确保跳转完成
} catch (error) {
console.error('跳转到指定位置失败:', error);
}