Browse Source

取消 鼠标阻止默认

xu 4 months ago
parent
commit
1fc2b38217
2 changed files with 7 additions and 9 deletions
  1. 0 1
      index.html
  2. 7 8
      src/App.vue

+ 0 - 1
index.html

@@ -8,7 +8,6 @@
   </head>
   <body style="margin: 0;">
     <div id="app"></div>
-    <script type="text/javascript" src="https://api.map.baidu.com/api?v=3.0&ak=YwKx9ej9X37pvSHGl0Y9S1G2tvtKzP0v"></script>
     <script type="module" src="/src/main.js"></script>
   </body>
 </html>

+ 7 - 8
src/App.vue

@@ -194,9 +194,9 @@
 </template>
 
 <script setup>
-import {ref, onMounted, reactive, computed} from 'vue';
-import {BorderBox1,BorderBox2,BorderBox8,Decoration5 } from '@dataview/datav-vue3';
-import {ElContainer, ElButton, ElMessage, ElMessageBox} from 'element-plus';
+import {computed, onMounted, reactive, ref} from 'vue';
+import {BorderBox1, BorderBox8, Decoration5} from '@dataview/datav-vue3';
+import {ElButton, ElContainer, ElMessage, ElMessageBox} from 'element-plus';
 import {
   deviceBatchSwitch,
   deviceLoopSwitch,
@@ -208,6 +208,9 @@ import {
 } from "@/api/device.js";
 import DeviceReplayTimeSet from "@/comm/deviceReplayTimeSet.vue";
 import DeviceLoopReplayTimeSet from "@/comm/deviceLoopReplayTimeSet.vue";
+import * as THREE from 'three';
+import {OrbitControls} from 'three/addons/controls/OrbitControls.js';
+import {GLTFLoader} from "three/addons/loaders/GLTFLoader.js";
 
 const buttons = ref([
   { text: '生活区', initialLeft: 500, initialTop: 1800 },
@@ -513,10 +516,6 @@ onMounted(() => {
 });
 
 // 3d图
-
-import * as THREE from 'three';
-import {OrbitControls} from 'three/addons/controls/OrbitControls.js';
-import {GLTFLoader} from "three/addons/loaders/GLTFLoader.js";
 // 创建场景
 const scene = new THREE.Scene();
 
@@ -571,7 +570,7 @@ function animate() {
 
 // 鼠标点击事件处理
 function onDocumentMouseDown(event) {
-  event.preventDefault();
+  // event.preventDefault();
 
   // 将鼠标位置归一化到 -1 到 1 的范围内
   mouse.x = (event.clientX / window.innerWidth) * 2 - 1;