Compare commits
No commits in common. "1b4c6b25527458a3576cd18e6cdd09ca620b198b" and "b55dae256f055e685a1e852f0137daf701156d2b" have entirely different histories.
1b4c6b2552
...
b55dae256f
@ -1,2 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M12 17a2 2 0 0 0 2-2 2 2 0 0 0-2-2 2 2 0 0 0-2 2 2 2 0 0 0 2 2m6-9a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V10a2 2 0 0 1 2-2h1V6a5 5 0 0 1 10 0v2h1m-6-4a3 3 0 0 0-3 3v2h6V6a3 3 0 0 0-3-3Z"/></svg>
|
||||
EOF < /dev/null
|
Before Width: | Height: | Size: 308 B |
@ -138,7 +138,7 @@ onMounted(async () => {
|
||||
await readScene();
|
||||
await editor.value?.initRobots();
|
||||
await monitorScene();
|
||||
storageLocationService.value?.startMonitoring({ interval: 3 });
|
||||
await storageLocationService.value?.startMonitoring({ interval: 3 });
|
||||
// 自动保存和恢复视图状态
|
||||
await handleAutoSaveAndRestoreViewState();
|
||||
});
|
||||
|
@ -632,40 +632,6 @@ export class EditorService extends Meta2d {
|
||||
this.updatePen(pointId, { statusStyle: color }, false);
|
||||
}
|
||||
|
||||
public updatePointLockIcon(pointId: string, show: boolean): void {
|
||||
const pointPen = this.getPenById(pointId);
|
||||
if (!pointPen || pointPen.name !== 'point') return;
|
||||
|
||||
const lockIconId = `lock-icon-${pointId}`;
|
||||
const existingIcon = this.getPenById(lockIconId);
|
||||
|
||||
if (show) {
|
||||
if (existingIcon) {
|
||||
this.setValue({ id: lockIconId, visible: true }, { render: true, history: false, doEvent: false });
|
||||
} else {
|
||||
const { x = 0, y = 0 } = this.getPenRect(pointPen);
|
||||
const iconPen: MapPen = {
|
||||
id: lockIconId,
|
||||
name: 'circle',
|
||||
tags: ['lock-icon'],
|
||||
x: x + 48, // 在点右侧显示
|
||||
y: y + 60,
|
||||
width: 8,
|
||||
height: 8,
|
||||
background: '#ff4d4f', // 红色背景
|
||||
color: '#ff4d4f',
|
||||
locked: LockState.Disable,
|
||||
visible: true,
|
||||
};
|
||||
this.addPen(iconPen, false, false, true);
|
||||
}
|
||||
} else {
|
||||
if (existingIcon) {
|
||||
this.setValue({ id: lockIconId, visible: false }, { render: true, history: false, doEvent: false });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//#region 实时机器人
|
||||
public async initRobots(): Promise<void> {
|
||||
await Promise.all(
|
||||
|
@ -90,15 +90,10 @@ export class StorageLocationService {
|
||||
}
|
||||
|
||||
const allOccupied = locations.every((loc) => loc.is_occupied);
|
||||
const allLocked = locations.every((loc) => loc.is_locked);
|
||||
const color = allOccupied ? '#ff4d4f' : '#52c41a'; // 全部占用红色,否则绿色
|
||||
|
||||
const color = allOccupied ? '#ff4d4f' : '#52c41a'; // 占用红色,否则绿色
|
||||
|
||||
// 更新边框颜色
|
||||
// 通知编辑器更新点的边框颜色
|
||||
this.editor?.updatePointBorderColor(pointId, color);
|
||||
|
||||
// 更新锁定图标状态
|
||||
this.editor?.updatePointLockIcon(pointId, allLocked);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user