refactor: 注释掉密集库区点,更新编辑器服务以过滤临时视图中心点并清理画布显示
This commit is contained in:
parent
6d1d492a0d
commit
5fa6aa5e1c
@ -19,7 +19,7 @@ export enum MapPointType {
|
||||
/** 库区点 - 仓储作业区域 */
|
||||
库区点,
|
||||
/** 密集库区点 - 密集库区点位 */
|
||||
密集库区点,
|
||||
// 密集库区点,
|
||||
|
||||
/** 电梯点 - 机器人乘坐电梯的专用点位 */
|
||||
电梯点 = 11,
|
||||
|
@ -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) ?? {};
|
||||
|
@ -223,13 +223,16 @@ export function useViewState() {
|
||||
// 跳转到临时点
|
||||
editor.gotoById(centerPointId);
|
||||
|
||||
// 延迟移除临时点
|
||||
// 延迟清理临时点(保存时已自动过滤,这里只是为了清理画布显示)
|
||||
setTimeout(() => {
|
||||
const tempPen = editor.getPenById(centerPointId);
|
||||
if (tempPen) {
|
||||
editor.delete([tempPen]);
|
||||
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);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user