From 520810b1cebf16e611e175f133e17438f379eb7c Mon Sep 17 00:00:00 2001 From: JouChun Date: Mon, 21 Oct 2024 23:21:29 -0400 Subject: [PATCH 1/2] =?UTF-8?q?forge=20sprite=20=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/forge/ForgeForSystem.vue | 12 +- src/components/navbar/NavbarItem.vue | 104 +++++------------ src/hooks/forge/useForgeSprite.js | 106 ++++++++++++------ src/hooks/useSelectedFloor.js | 17 +++ src/router/index.js | 7 +- src/views/system/System.vue | 10 +- src/views/system/SystemFloor.vue | 4 +- src/views/system/components/SystemCard.vue | 15 ++- .../system/components/SystemFloorBar.vue | 13 +-- src/views/system/components/SystemSubBar.vue | 2 +- 10 files changed, 154 insertions(+), 136 deletions(-) create mode 100644 src/hooks/useSelectedFloor.js diff --git a/src/components/forge/ForgeForSystem.vue b/src/components/forge/ForgeForSystem.vue index 000e6f6..b39106a 100644 --- a/src/components/forge/ForgeForSystem.vue +++ b/src/components/forge/ForgeForSystem.vue @@ -33,7 +33,7 @@ const updateHeatBarIsShow = (isShow) => { heat_bar_isShow.value = isShow; }; -const { updateDataVisualization, createSprites, hideAllObjects } = useForgeSprite() +const { updateDataVisualization, createSprites, hideAllObjects, forgeClickListener } = useForgeSprite() const forgeDom = ref(null); @@ -162,9 +162,13 @@ const initForge = async () => { "Autodesk.Viewing.GEOMETRY_LOADED_EVENT", viewer.isLoadDone() ); - // updateForgeViewer(viewer); - // createSprites() - hideAllObjects(); + + if (viewer.isLoadDone()) { + // updateForgeViewer(viewer); + hideAllObjects(); + createSprites(); + forgeClickListener(); + } }) }; diff --git a/src/components/navbar/NavbarItem.vue b/src/components/navbar/NavbarItem.vue index 54f6a3a..22c93b0 100644 --- a/src/components/navbar/NavbarItem.vue +++ b/src/components/navbar/NavbarItem.vue @@ -18,9 +18,9 @@ const iniFroList = async () => { res.data.map((d) => AUTHPAGES.find(({ authCode }) => authCode === d.authCode) ? { - ...d, - ...AUTHPAGES.find(({ authCode }) => authCode === d.authCode), - } + ...d, + ...AUTHPAGES.find(({ authCode }) => authCode === d.authCode), + } : d ) ); @@ -71,85 +71,38 @@ onMounted(() => {