From 9b78757a12e36a1ffc478ed175a9f7963f2f67b5 Mon Sep 17 00:00:00 2001 From: wangqiujuan0808 <578331299@qq.com> Date: Sun, 3 Dec 2023 15:29:48 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A1=A5=E5=85=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 1 + src/assets/images/top.png | Bin 0 -> 1401 bytes src/main.js | 3 + .../bimHome/components/ApplicationTree.vue | 13 ++- .../bim/bimHome/components/BuildInfo.vue | 49 +++++++++- .../bim/bimHome/components/BuildTree.vue | 12 ++- .../bim/bimHome/components/DeviceEvent.vue | 92 +++++++++++++++++- .../bim/bimHome/components/DeviceInfo.vue | 43 +++++++- .../bim/bimHome/components/DevicePie.vue | 8 +- .../bim/bimHome/components/DeviceTree.vue | 21 ++-- .../bim/bimHome/components/EquipmentInfo.vue | 44 ++++++++- src/views/bim/bimHome/components/RealData.vue | 66 +++++++++++-- .../bim/bimHome/components/ThreeView.vue | 17 ++++ src/views/bim/bimHome/components/TopDiv.vue | 24 +++++ src/views/bim/bimHome/index.vue | 2 +- vite.config.js | 20 ++++ 16 files changed, 371 insertions(+), 44 deletions(-) create mode 100644 src/assets/images/top.png create mode 100644 src/views/bim/bimHome/components/TopDiv.vue diff --git a/package.json b/package.json index d21e1b7..32e3865 100644 --- a/package.json +++ b/package.json @@ -16,6 +16,7 @@ }, "dependencies": { "@element-plus/icons-vue": "2.0.10", + "@jiaminghi/data-view": "^2.10.0", "@vueup/vue-quill": "1.2.0", "@vueuse/core": "9.5.0", "axios": "0.27.2", diff --git a/src/assets/images/top.png b/src/assets/images/top.png new file mode 100644 index 0000000000000000000000000000000000000000..2b39cc8508557cad0d96bff6221f8027efe57936 GIT binary patch literal 1401 zcmeAS@N?(olHy`uVBq!ia0vp^l|Zb^!3HF|o*r2Nq$EpRBT9nv(@M${i&7aJQ}UBi z6+Ckj(^G>|6H_V+Po~;1Ffc1;hD4M^`1)8S=jZ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 b/src/main.js @@ -44,6 +44,8 @@ import TreeSelect from '@/components/TreeSelect' import DictTag from '@/components/DictTag' // troisjs import { TroisJSVuePlugin } from 'troisjs'; +// 边框ui组件 +import dataV from '@jiaminghi/data-view' const app = createApp(App) @@ -68,6 +70,7 @@ app.component('ImagePreview', ImagePreview) app.component('RightToolbar', RightToolbar) app.component('Editor', Editor) +app.use(dataV) app.use(TroisJSVuePlugin) app.use(router) app.use(store) diff --git a/src/views/bim/bimHome/components/ApplicationTree.vue b/src/views/bim/bimHome/components/ApplicationTree.vue index cd708b2..896c883 100644 --- a/src/views/bim/bimHome/components/ApplicationTree.vue +++ b/src/views/bim/bimHome/components/ApplicationTree.vue @@ -1,10 +1,13 @@ \ No newline at end of file diff --git a/src/views/bim/bimHome/components/BuildTree.vue b/src/views/bim/bimHome/components/BuildTree.vue index f5398c6..55928d8 100644 --- a/src/views/bim/bimHome/components/BuildTree.vue +++ b/src/views/bim/bimHome/components/BuildTree.vue @@ -1,10 +1,12 @@ \ No newline at end of file diff --git a/src/views/bim/bimHome/components/DeviceInfo.vue b/src/views/bim/bimHome/components/DeviceInfo.vue index f170b9d..e82ee84 100644 --- a/src/views/bim/bimHome/components/DeviceInfo.vue +++ b/src/views/bim/bimHome/components/DeviceInfo.vue @@ -1,12 +1,34 @@ \ No newline at end of file diff --git a/src/views/bim/bimHome/components/DevicePie.vue b/src/views/bim/bimHome/components/DevicePie.vue index d90628f..67499d0 100644 --- a/src/views/bim/bimHome/components/DevicePie.vue +++ b/src/views/bim/bimHome/components/DevicePie.vue @@ -1,10 +1,12 @@ \ No newline at end of file diff --git a/src/views/bim/bimHome/components/RealData.vue b/src/views/bim/bimHome/components/RealData.vue index e1c6450..23236ac 100644 --- a/src/views/bim/bimHome/components/RealData.vue +++ b/src/views/bim/bimHome/components/RealData.vue @@ -1,26 +1,80 @@ \ No newline at end of file diff --git a/src/views/bim/bimHome/components/ThreeView.vue b/src/views/bim/bimHome/components/ThreeView.vue index 1fc84bb..bbea9de 100644 --- a/src/views/bim/bimHome/components/ThreeView.vue +++ b/src/views/bim/bimHome/components/ThreeView.vue @@ -46,6 +46,7 @@ onMounted(() => { loadSence(); // 启动动画 renderScene(); + document.addEventListener("click", modelMouseClick); }); const init = () => { scene = new THREE.Scene(); @@ -105,6 +106,22 @@ const renderScene = () => { // 写在requestAnimationFrame之后,否则会报错 labelRenderer.render(scene, camera); }; + +const modelMouseClick = (event) => { + mouse.x = (event.clientX / window.innerWidth) * 2 - 1; + mouse.y = -(event.clientY / window.innerHeight) * 2 + 1; + raycaster.setFromCamera(mouse, camera); + const intersects = raycaster.intersectObject(scene, true); + if (intersects.length > 0) { + console.log(intersects[0].object); + outlineObj(intersects[0].object); + } +}; + +//高亮 +const outlineObj = (object) => { + object.material.color.set(0x66ff00); +} \ No newline at end of file diff --git a/src/views/bim/bimHome/index.vue b/src/views/bim/bimHome/index.vue index a53e9ec..15726b3 100644 --- a/src/views/bim/bimHome/index.vue +++ b/src/views/bim/bimHome/index.vue @@ -1,7 +1,7 @@