#
vincentlu
2025-12-09 9dff81608258d1b24a1ed6ba36194875ce4bb72c
#
2个文件已修改
25 ■■■■■ 已修改文件
zy-acs-flow/src/map/MapPage.jsx 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-acs-flow/src/map/tool.js 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-acs-flow/src/map/MapPage.jsx
@@ -168,6 +168,9 @@
                    Tool.beSettings(child, setCurSprite);
                })
                break
            case MAP_MODE.ZONING_MODE:
                Tool.removeAgvGraphics();
                break
            default:
                break
        }
zy-acs-flow/src/map/tool.js
@@ -854,3 +854,25 @@
    mapContainer.addChild(agvPath);
}
export const removeAgvGraphics = () => {
    if (!mapContainer) {
        return;
    }
    for (let i = mapContainer.children.length - 1; i >= 0; i--) {
        const child = mapContainer.children[i];
        if (child?.data?.type === DEVICE_TYPE.AGV) {
            if (child.data.jobEffect) {
                app?.ticker.remove(child.data.jobEffect._onTick);
                child.removeChild(child.data.jobEffect);
                child.data.jobEffect.destroy(true);
                child.data.jobEffect = null;
            }
            mapContainer.removeChild(child);
            child.destroy({ children: true, texture: false, baseTexture: false });
        } else if (child?.name?.startsWith('agvPath-')) {
            mapContainer.removeChild(child);
            child.destroy({ children: true, texture: false, baseTexture: false });
        }
    }
}