Browse Source

低空修改250327-01

zhiyuan-007 4 days ago
parent
commit
f13684d3b8
4 changed files with 67 additions and 140 deletions
  1. 58 12
      src/components/mapJK.vue
  2. 0 119
      src/config/basicTool.json
  3. 8 8
      src/service/http.js
  4. 1 1
      vite.config.js

+ 58 - 12
src/components/mapJK.vue

@@ -3083,9 +3083,9 @@ export default {
           })){
             if(res.data.data.list?.length >= 100000 && res.data.data.scrollId){
               let size = {
-                x:res.data.data.list[0].boxSize.latLength,
-                y:res.data.data.list[0].boxSize.lonLength,
-                z:res.data.data.list[0].boxSize.height
+                x:16,
+                y:16,
+                z:16
               }
               showThreeCubeDetail({
                 "id":params.id,
@@ -3099,9 +3099,9 @@ export default {
             }else{
               if(res.data.data.list?.length > 0){
                 let size = {
-                  x:res.data.data.list[0].boxSize.latLength,
-                  y:res.data.data.list[0].boxSize.lonLength,
-                  z:res.data.data.list[0].boxSize.height
+                  x:16,
+                  y:16,
+                  z:16
                 }
                 showThreeCubeDetail({
                   "id":params.id,
@@ -3116,6 +3116,33 @@ export default {
         })
       }
 
+
+      function generateGrid(startPoint, xRange, yRange, zRange, size) {
+        const grid = [];
+
+        // 计算每个方向的立方体数量
+        const xCount = Math.ceil(xRange / size);
+        const yCount = Math.ceil(yRange / size);
+        const zCount = Math.ceil(zRange / size);
+
+        // 生成网格点
+        for (let x = 0; x < xCount; x++) {
+          for (let y = 0; y < yCount; y++) {
+            for (let z = 0; z < zCount; z++) {
+              grid.push({
+                x: startPoint.x + x * size,
+                y: startPoint.y + y * size,
+                z: startPoint.z + z * size,
+                color: [0,0,1]
+              });
+            }
+          }
+        }
+
+        return grid;
+      }
+
+
       //获取当前场景
       function getPowerCube(params){
         let id = params.id;
@@ -3126,6 +3153,25 @@ export default {
         let deepShow = params.deepShow;
         let rings = params.rings;
         let fields = params.fields;
+
+
+        // const cubeGrid = generateGrid({
+        //   x:500,
+        //   y:-1500,
+        //   z:0,
+        // }, 4000, 4000, 120,32);
+        // showThreeCubeDetail({
+        //   "id":"test",
+        //   "status":"show",
+        //   "size": {
+        //     x:32,
+        //     y:32,
+        //     z:32
+        //   },
+        //   "points":cubeGrid,
+        //   "depthTest":false
+        // })
+
         if(status === "hide"){
           showThreeCubeDetail({
             id:params.id,
@@ -3175,9 +3221,9 @@ export default {
           })){
             if(res.data.data.list?.length >= 100000 && res.data.data.scrollId){
               let size = {
-                x:res.data.data.list[0].boxSize.latLength,
-                y:res.data.data.list[0].boxSize.lonLength,
-                z:res.data.data.list[0].boxSize.height
+                x:16,
+                y:16,
+                z:16
               }
               showThreeCubeDetail({
                 "id":params.id,
@@ -3191,9 +3237,9 @@ export default {
             }else{
               if(res.data.data.list?.length > 0){
                 let size = {
-                  x:res.data.data.list[0].boxSize.latLength,
-                  y:res.data.data.list[0].boxSize.lonLength,
-                  z:res.data.data.list[0].boxSize.height
+                  x:16,
+                  y:16,
+                  z:16
                 }
                 showThreeCubeDetail({
                   "id":params.id,

+ 0 - 119
src/config/basicTool.json

@@ -658,125 +658,6 @@
                   ],
                   "color": [0,255,255,0.7]
                 }
-              },
-              {
-                "type": "polyline",
-                "shape": {
-                  "radius": 10,
-                  "paths": [
-                    [
-                      [
-                        3499.5782683948523,
-                        7252.273350408689,
-                        0
-                      ],
-                      [
-                        3499.364569722593,
-                        7251.626996858693,
-                        100
-                      ],
-                      [
-                        3558.8660344507416,
-                        7251.648514626977,
-                        100
-                      ],
-                      [
-                        3558.852005535551,
-                        7290.14634859842,
-                        100
-                      ],
-                      [
-                        3568.767473443955,
-                        7293.999751210939,
-                        100
-                      ],
-                      [
-                        4279.47656249917,
-                        7294.283510610084,
-                        100
-                      ],
-                      [
-                        4282.768839396391,
-                        7325.0832129770815,
-                        100
-                      ],
-                      [
-                        4286.069444710435,
-                        7336.633997891262,
-                        100
-                      ],
-                      [
-                        4299.290211928166,
-                        7340.489525285203,
-                        100
-                      ],
-                      [
-                        4309.205361465806,
-                        7344.34362776725,
-                        100
-                      ],
-                      [
-                        4735.628798268906,
-                        7344.538185844389,
-                        100
-                      ],
-                      [
-                        4735.579268035517,
-                        7448.4823634558725,
-                        100
-                      ],
-                      [
-                        4734.06792183444,
-                        7449.867157578444,
-                        0
-                      ]
-                    ]
-                  ],
-                  "color": [0,255,255,0.7]
-                }
-              },
-              {
-                "type": "inverted-cone",
-                "shape": {
-                  "point": {
-                    "x": 0,
-                    "y": 0,
-                    "z": 0
-
-                  },
-                  "height": 200,
-                  "radius": 100,
-                  "color": [255,255,255,0.7]
-                }
-              },
-              {
-                "type": "frustum-cone",
-                "shape": {
-                  "point": {
-                    "x": 2000,
-                    "y": 2000,
-                    "z": 0
-                  },
-                  "height": 100,
-                  "topRadius": 200,
-                  "bottomRadius": 70,
-                  "color": [255,0,255,0.7]
-                }
-              },
-              {
-                "type": "funnel",
-                "shape": {
-                  "point": {
-                    "x": 2000,
-                    "y": 0,
-                    "z": 0
-                  },
-                  "coneHeight": 100,
-                  "cylinderHeight":100,
-                  "topRadius": 200,
-                  "bottomRadius": 70,
-                  "color": [255,0,255,0.7]
-                }
               }
             ]
           }

+ 8 - 8
src/service/http.js

@@ -109,7 +109,7 @@ export function getPowerPointByPolygon(params){
             //     "13.0":1,  //航线
             // },
             "isShowInfo":0,
-            "level":params.level
+            "level":14
         }
     })
 }
@@ -179,14 +179,14 @@ export function getOccupyPointByPolygon(params){
             //     "5.0": -999,
             //     "7.0": -999
             // },
-            "elementCount":{
-                "7.0":1, //禁飞区
-                "9.0":1,  //建筑物
-                "12.0":1,  //起降场
-                "13.0":1,  //航线
-            },
+            // "elementCount":{
+            //     "7.0":1, //禁飞区
+            //     "9.0":1,  //建筑物
+            //     "12.0":1,  //起降场
+            //     "13.0":1,  //航线
+            // },
             "isShowInfo":0,
-            "level":params.level
+            "level":14
         }
     })
 }

+ 1 - 1
vite.config.js

@@ -39,7 +39,7 @@ export default defineConfig({
       },
       '/netapi': {
         // 代理请求之后的请求地址(你的真实接口地址)
-        target: 'http://172.16.8.44:9250/low-altitude/',
+        target: 'http://58.34.215.19:8095/low-altitude/',
         //target: 'http://10.1.161.53:8095/',
         //target: 'http://localhost:9250/',
         secure: false,