forge api 更新
This commit is contained in:
parent
faa267ff75
commit
9a77f7a719
@ -33,7 +33,7 @@ const updateHeatBarIsShow = (isShow) => {
|
||||
heat_bar_isShow.value = isShow;
|
||||
};
|
||||
|
||||
const { updateDataVisualization, createSprites, hideAllObjects, forgeClickListener } = useForgeSprite()
|
||||
const { updateDataVisualization, createSprites, hideAllObjects, forgeClickListener, clear } = useForgeSprite()
|
||||
|
||||
const forgeDom = ref(null);
|
||||
|
||||
@ -194,7 +194,7 @@ const getCurrentInfoModalData = (e, position, value) => {
|
||||
onUnmounted(() => {
|
||||
console.log("Forge 銷毀");
|
||||
|
||||
NOP_VIEWER.tearDown();
|
||||
clear();
|
||||
});
|
||||
</script>
|
||||
|
||||
|
@ -24,7 +24,7 @@ export default function useForgeSprite() {
|
||||
};
|
||||
|
||||
function onSpriteClicked(event) {
|
||||
event.hasStopped = false;
|
||||
event.hasStopped = true;
|
||||
|
||||
if (event.type === Autodesk.DataVisualization.Core.MOUSE_CLICK_OUT) return;
|
||||
|
||||
@ -154,10 +154,23 @@ export default function useForgeSprite() {
|
||||
forgeViewer.value.impl.invalidate(true);
|
||||
};
|
||||
|
||||
const clear = () => {
|
||||
forgeViewer.value.removeEventListener(
|
||||
Autodesk.DataVisualization.Core.MOUSE_CLICK,
|
||||
onSpriteClicked
|
||||
);
|
||||
forgeViewer.value.removeEventListener(
|
||||
Autodesk.DataVisualization.Core.MOUSE_CLICK_OUT,
|
||||
onSpriteClicked
|
||||
);
|
||||
forgeViewer.value.tearDown();
|
||||
};
|
||||
|
||||
return {
|
||||
createSprites,
|
||||
updateDataVisualization,
|
||||
hideAllObjects,
|
||||
forgeClickListener,
|
||||
clear
|
||||
};
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user