Browse Source

绘制内容结算0112

zhiyuan-007 2 months ago
parent
commit
29d385cf99

BIN
src/assets/tex_0 - 副本.png


+ 28 - 5
src/components/mapJK.vue

@@ -579,6 +579,8 @@ export default {
       }
 
 
+
+
       function showThreeCubeDetail(params){
         let status = params.status;
         let id = params.id;
@@ -1360,7 +1362,7 @@ export default {
           if(socket){
             socket.send(JSON.stringify(params.flyList));
           }else{
-            socket = new WebSocket('ws://58.34.215.19:19259/aircraftRouteSpeedWebSocket');
+            socket = new WebSocket('ws://10.1.163.15:19259/aircraftRouteSpeedWebSocket');
             socket.onopen = () => {
               console.log('WebSocket 连接成功');
               socket.send(JSON.stringify(params.flyList));
@@ -1374,14 +1376,26 @@ export default {
                     id:message.id,
                     uavid:message.uavid,
                     status:message.routeInfoVO.status == 3?"hide":"show",
-                    duration:message.time,
+                    duration:message.time + 500,
                     //duration:3000,
                     point:message.position_cj
                   });
                 }else{
                   if(message.nearestAircraft.status != "SAFE"){  //碰撞
-                    console.log("无人机碰撞异常信息",message);
+
+                    flyGLTF({
+                      id:message.id,
+                      uavid:message.uavid,
+                      status:message.routeInfoVO.status == 3?"hide":"show",
+                      duration:message.time + 500,
+                      //duration:3000,
+                      point:message.position_cj
+                    });
 
+                    showThreeCubeDetail({
+                      "id":message.uavid,
+                      "status": "hide",
+                    })
                     showThreeCubeDetail({
                       "id":message.uavid,
                       "status": "show",
@@ -1406,11 +1420,12 @@ export default {
                   }else if(message.electricityWarning != "SAFE"){
                     console.log("无人机电量异常信息",message);
                   }else{
+                    console.log("message_point",message);
                     flyGLTF({
                       id:message.id,
                       uavid:message.uavid,
                       status:message.routeInfoVO.status == 3?"hide":"show",
-                      duration:message.time,
+                      duration:message.time + 500,
                       //duration:3000,
                       point:message.position_cj
                     });
@@ -1446,7 +1461,7 @@ export default {
           skip_route_id:skip_route_id,
           distance:distance
         }).then(res =>{
-          console.log("临时路线",res)
+          console.log("临时路线",res);
           pathPipe({
             "id": uavid+'_change',
             "status": "show",
@@ -1455,6 +1470,14 @@ export default {
             "intensity": 1.2,
             "pipeRadius": 5
           });
+          debugger
+          getRealFlyPoint({
+            flyList:{
+              "path": res.data.data.pathAll,
+              "avoidanceType":"avoid",
+              "uavid": uavid
+            }
+          })
         })
       }
 

+ 1 - 1
src/config/basicTool.json

@@ -42,7 +42,7 @@
             "title":"BaseMap",
             "visible": true,
             "opacity": 1,
-            "url": "https://cimweb.zjw.sh.cegn.cn:2008/MapServiceProxy/eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3MzY1NjM2NzMsImtleSI6IjkzNDkzMzIxIiwic2VydmljZU5vIjoiRDkwMDEwMDcxMjAyMzA4MDEiLCJ1c2VybmFtZSI6InB0Z2wifQ.1IzaPYUa56F26oMgLR-i05_XvNNpGm6anKdcwTkE-3g",
+            "url": "https://cimweb.zjw.sh.cegn.cn:2008/MapServiceProxy/eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3MzY3NTI1MjEsImtleSI6IjkzNDkzMzIxIiwic2VydmljZU5vIjoiRDkwMDEwMDcxMjAyMzA4MDEiLCJ1c2VybmFtZSI6InB0Z2wifQ.wm7tHVPLL2YUhLtvm7BL3BCNCOT-SQ9jSzXXEzYzUO0",
             "token": ""
           }
         }

+ 6 - 1
src/units/map/FlyGLTFEvent.js

@@ -60,6 +60,11 @@ class FlyGLTFEvent{
             ]
         };
         if(this.path.length > 1){
+            if(JSON.stringify(this.path[1]) == JSON.stringify(this.path[0])){
+                this.flyGLTFEvent.setHovering(true)
+            }else{
+                this.flyGLTFEvent.setHovering(false)
+            }
             this.flyGLTFEvent.setPathCurve(this.path,duration);
             //更新路径属性
             //this.flyGLTFEvent.setPanelType("type")
@@ -128,7 +133,7 @@ class FlyGLTFEvent{
                 };
             }
 
-        },1);
+        }, 1);
 
     }
     // 计算两个点之间的heading和tilt

+ 2 - 4
src/units/threejs/flyGLTF.js

@@ -61,7 +61,6 @@ export const FlyGLTFClass = {
 
         this.resetWebGLState();
 
-        // 使用 ArcGIS 的事件机制来监听点击
         this.mouseClickEvent = this.view.on("click", this.onMouseClick.bind(this));
     },
 
@@ -242,7 +241,7 @@ export const FlyGLTFClass = {
               this.pathCurve.add(line);
           }
           //创建几何体以便在场景中可视化路径
-          const geometry = new THREE.BufferGeometry().setFromPoints(this.pathCurve.getPoints(50));
+          const geometry = new THREE.BufferGeometry().setFromPoints(this.pathCurve.getPoints(100));
           const material = new THREE.LineBasicMaterial({color:0xff0000,lineWidth:2});
           this.pathLine = new THREE.Line(geometry,material);
           this.scene.add(this.pathLine);
@@ -326,8 +325,7 @@ export const FlyGLTFClass = {
 
         // 计算路径进度
         this.pathProgress = elapsedTime / this.duration;
-
-        if (this.pathCurve && this.targetObject && !this.isHovering) {
+        if (this.pathCurve && this.targetObject) {
             // 如果到达终点,重置路径并请求新路径
             if (this.pathProgress >= 1) {
                 this.pathProgress = 1; // 确保进度不超过 1

+ 10 - 6
src/units/threejs/threeCubeDetail.js

@@ -1,5 +1,5 @@
 import * as THREE from 'three';
-
+import texture1 from "../../assets/tex_0.png";
 export const ThreeCubeDetailClass = {
     constructor(options) {
         this.webgl = options.webgl;
@@ -57,8 +57,7 @@ export const ThreeCubeDetailClass = {
         const directionalLight = new THREE.DirectionalLight(0xffffff, 0.5);
         directionalLight.position.set(10, 10, 10);
         this.scene.add(directionalLight);
-        debugger
-        // 使用 ArcGIS 的事件机制来监听点击
+
         this.mouseClickEvent = this.view.on("click", this.onMouseClick.bind(this));
     },
 
@@ -68,10 +67,15 @@ export const ThreeCubeDetailClass = {
 
         const boxGeometry = new THREE.BoxGeometry(this.size.z, this.size.x, this.size.y);
         boxGeometry.computeVertexNormals();
+        const texture = new THREE.TextureLoader().load(texture1);
+        // texture.wrapS = THREE.RepeatWrapping;  // 设置U轴的重复模式
+        // texture.wrapT = THREE.RepeatWrapping;  // 设置V轴的重复模式
+        // texture.repeat.set(1, 1);  // 设置重复次数
 
         const material = new THREE.MeshPhongMaterial({
+            map: texture,
             transparent: true,
-            opacity: 0.02,
+            opacity: 0.5,
             depthTest: true,
             side: THREE.DoubleSide,
             depthWrite: false,
@@ -174,8 +178,8 @@ export const ThreeCubeDetailClass = {
 
             const edgeLine = new THREE.LineSegments(edgesGeometry, glowMaterial);
             edgeLine.position.copy(dummy.position);
-            this.scene.add(edgeLine);
-            this.edgesReferences.push(edgeLine);
+            // this.scene.add(edgeLine);
+            // this.edgesReferences.push(edgeLine);
         }
 
         // 更新实例属性

+ 2 - 1
vite.config.js

@@ -22,7 +22,8 @@ export default defineConfig({
       },
       '/netapi': {
         // 代理请求之后的请求地址(你的真实接口地址)
-        target: 'http://58.34.215.19:19259/DataSearch/',
+        // target: 'http://58.34.215.19:19259/DataSearch/',
+        target: 'http://10.1.163.15:19259/DataSearch/',
         //target: 'http://localhost:9250/',
         secure: false,
         ws: true,