Browse Source

格网、分别绘制

zhiyuan-007 4 months ago
parent
commit
4fd545fc09

+ 2 - 0
.env.development

@@ -0,0 +1,2 @@
+VITE_BASE_API = '/api'
+VITE_BASE_URL = 'http://localhost:9250'

+ 2 - 0
.env.production

@@ -0,0 +1,2 @@
+VITE_BASE_API='http://10.90.9.143:9252/DataSearch/'
+VITE_BASE_URL='http://10.90.9.143:9252/DataSearch/'

+ 127 - 0
package-lock.json

@@ -11,6 +11,7 @@
       "dependencies": {
         "@arcgis/core": "^4.30.9",
         "@element-plus/icons-vue": "^2.1.0",
+        "axios": "^1.7.9",
         "element-plus": "^2.3.12",
         "i": "^0.3.7",
         "jquery": "^3.7.0",
@@ -1866,6 +1867,23 @@
       "resolved": "https://registry.npmmirror.com/async-validator/-/async-validator-4.2.5.tgz",
       "integrity": "sha512-7HhHjtERjqlNbZtqNqy2rckN/SpOOlmDliet+lP7k+eKZEjPk3DgyeU9lIXLdeLz0uBbbVp+9Qdow9wJWgwwfg=="
     },
+    "node_modules/asynckit": {
+      "version": "0.4.0",
+      "resolved": "https://registry.npmmirror.com/asynckit/-/asynckit-0.4.0.tgz",
+      "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==",
+      "license": "MIT"
+    },
+    "node_modules/axios": {
+      "version": "1.7.9",
+      "resolved": "https://registry.npmmirror.com/axios/-/axios-1.7.9.tgz",
+      "integrity": "sha512-LhLcE7Hbiryz8oMDdDptSrWowmB4Bl6RCt6sIJKpRB4XtVf0iEgewX3au/pJqm+Py1kCASkb/FFKjxQaLtxJvw==",
+      "license": "MIT",
+      "dependencies": {
+        "follow-redirects": "^1.15.6",
+        "form-data": "^4.0.0",
+        "proxy-from-env": "^1.1.0"
+      }
+    },
     "node_modules/babel-loader": {
       "version": "9.1.3",
       "resolved": "https://registry.npmmirror.com/babel-loader/-/babel-loader-9.1.3.tgz",
@@ -2193,6 +2211,18 @@
       "resolved": "https://registry.npmmirror.com/color-name/-/color-name-1.1.4.tgz",
       "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA=="
     },
+    "node_modules/combined-stream": {
+      "version": "1.0.8",
+      "resolved": "https://registry.npmmirror.com/combined-stream/-/combined-stream-1.0.8.tgz",
+      "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==",
+      "license": "MIT",
+      "dependencies": {
+        "delayed-stream": "~1.0.0"
+      },
+      "engines": {
+        "node": ">= 0.8"
+      }
+    },
     "node_modules/commander": {
       "version": "2.20.3",
       "resolved": "https://registry.npmmirror.com/commander/-/commander-2.20.3.tgz",
@@ -2320,6 +2350,15 @@
         "node": ">=0.10.0"
       }
     },
+    "node_modules/delayed-stream": {
+      "version": "1.0.0",
+      "resolved": "https://registry.npmmirror.com/delayed-stream/-/delayed-stream-1.0.0.tgz",
+      "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==",
+      "license": "MIT",
+      "engines": {
+        "node": ">=0.4.0"
+      }
+    },
     "node_modules/delegates": {
       "version": "1.0.0",
       "resolved": "https://registry.npmmirror.com/delegates/-/delegates-1.0.0.tgz",
@@ -2585,6 +2624,40 @@
         "tabbable": "^6.2.0"
       }
     },
+    "node_modules/follow-redirects": {
+      "version": "1.15.9",
+      "resolved": "https://registry.npmmirror.com/follow-redirects/-/follow-redirects-1.15.9.tgz",
+      "integrity": "sha512-gew4GsXizNgdoRyqmyfMHyAmXsZDk6mHkSxZFCzW9gwlbtOW44CDtYavM+y+72qD/Vq2l550kMF52DT8fOLJqQ==",
+      "funding": [
+        {
+          "type": "individual",
+          "url": "https://github.com/sponsors/RubenVerborgh"
+        }
+      ],
+      "license": "MIT",
+      "engines": {
+        "node": ">=4.0"
+      },
+      "peerDependenciesMeta": {
+        "debug": {
+          "optional": true
+        }
+      }
+    },
+    "node_modules/form-data": {
+      "version": "4.0.1",
+      "resolved": "https://registry.npmmirror.com/form-data/-/form-data-4.0.1.tgz",
+      "integrity": "sha512-tzN8e4TX8+kkxGPK8D5u0FNmjPUjw3lwC9lSLxxoB/+GtsJG91CO8bSWy73APlgAZzZbXEYZJuxjkHH2w+Ezhw==",
+      "license": "MIT",
+      "dependencies": {
+        "asynckit": "^0.4.0",
+        "combined-stream": "^1.0.8",
+        "mime-types": "^2.1.12"
+      },
+      "engines": {
+        "node": ">= 6"
+      }
+    },
     "node_modules/fs-minipass": {
       "version": "2.1.0",
       "resolved": "https://registry.npmmirror.com/fs-minipass/-/fs-minipass-2.1.0.tgz",
@@ -4242,6 +4315,12 @@
         "node": ">=10"
       }
     },
+    "node_modules/proxy-from-env": {
+      "version": "1.1.0",
+      "resolved": "https://registry.npmmirror.com/proxy-from-env/-/proxy-from-env-1.1.0.tgz",
+      "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==",
+      "license": "MIT"
+    },
     "node_modules/punycode": {
       "version": "2.3.1",
       "resolved": "https://registry.npmmirror.com/punycode/-/punycode-2.3.1.tgz",
@@ -6948,6 +7027,21 @@
       "resolved": "https://registry.npmmirror.com/async-validator/-/async-validator-4.2.5.tgz",
       "integrity": "sha512-7HhHjtERjqlNbZtqNqy2rckN/SpOOlmDliet+lP7k+eKZEjPk3DgyeU9lIXLdeLz0uBbbVp+9Qdow9wJWgwwfg=="
     },
+    "asynckit": {
+      "version": "0.4.0",
+      "resolved": "https://registry.npmmirror.com/asynckit/-/asynckit-0.4.0.tgz",
+      "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q=="
+    },
+    "axios": {
+      "version": "1.7.9",
+      "resolved": "https://registry.npmmirror.com/axios/-/axios-1.7.9.tgz",
+      "integrity": "sha512-LhLcE7Hbiryz8oMDdDptSrWowmB4Bl6RCt6sIJKpRB4XtVf0iEgewX3au/pJqm+Py1kCASkb/FFKjxQaLtxJvw==",
+      "requires": {
+        "follow-redirects": "^1.15.6",
+        "form-data": "^4.0.0",
+        "proxy-from-env": "^1.1.0"
+      }
+    },
     "babel-loader": {
       "version": "9.1.3",
       "resolved": "https://registry.npmmirror.com/babel-loader/-/babel-loader-9.1.3.tgz",
@@ -7213,6 +7307,14 @@
       "optional": true,
       "peer": true
     },
+    "combined-stream": {
+      "version": "1.0.8",
+      "resolved": "https://registry.npmmirror.com/combined-stream/-/combined-stream-1.0.8.tgz",
+      "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==",
+      "requires": {
+        "delayed-stream": "~1.0.0"
+      }
+    },
     "commander": {
       "version": "2.20.3",
       "resolved": "https://registry.npmmirror.com/commander/-/commander-2.20.3.tgz",
@@ -7320,6 +7422,11 @@
         }
       }
     },
+    "delayed-stream": {
+      "version": "1.0.0",
+      "resolved": "https://registry.npmmirror.com/delayed-stream/-/delayed-stream-1.0.0.tgz",
+      "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ=="
+    },
     "delegates": {
       "version": "1.0.0",
       "resolved": "https://registry.npmmirror.com/delegates/-/delegates-1.0.0.tgz",
@@ -7541,6 +7648,21 @@
         "tabbable": "^6.2.0"
       }
     },
+    "follow-redirects": {
+      "version": "1.15.9",
+      "resolved": "https://registry.npmmirror.com/follow-redirects/-/follow-redirects-1.15.9.tgz",
+      "integrity": "sha512-gew4GsXizNgdoRyqmyfMHyAmXsZDk6mHkSxZFCzW9gwlbtOW44CDtYavM+y+72qD/Vq2l550kMF52DT8fOLJqQ=="
+    },
+    "form-data": {
+      "version": "4.0.1",
+      "resolved": "https://registry.npmmirror.com/form-data/-/form-data-4.0.1.tgz",
+      "integrity": "sha512-tzN8e4TX8+kkxGPK8D5u0FNmjPUjw3lwC9lSLxxoB/+GtsJG91CO8bSWy73APlgAZzZbXEYZJuxjkHH2w+Ezhw==",
+      "requires": {
+        "asynckit": "^0.4.0",
+        "combined-stream": "^1.0.8",
+        "mime-types": "^2.1.12"
+      }
+    },
     "fs-minipass": {
       "version": "2.1.0",
       "resolved": "https://registry.npmmirror.com/fs-minipass/-/fs-minipass-2.1.0.tgz",
@@ -8881,6 +9003,11 @@
         "retry": "^0.12.0"
       }
     },
+    "proxy-from-env": {
+      "version": "1.1.0",
+      "resolved": "https://registry.npmmirror.com/proxy-from-env/-/proxy-from-env-1.1.0.tgz",
+      "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg=="
+    },
     "punycode": {
       "version": "2.3.1",
       "resolved": "https://registry.npmmirror.com/punycode/-/punycode-2.3.1.tgz",

+ 1 - 0
package.json

@@ -13,6 +13,7 @@
   "dependencies": {
     "@arcgis/core": "^4.30.9",
     "@element-plus/icons-vue": "^2.1.0",
+    "axios": "^1.7.9",
     "element-plus": "^2.3.12",
     "i": "^0.3.7",
     "jquery": "^3.7.0",

+ 177 - 82
src/components/mapJK.vue

@@ -43,6 +43,10 @@ import GraphicsLayer from "@arcgis/core/layers/GraphicsLayer.js";
 import SketchViewModel from "@arcgis/core/widgets/Sketch/SketchViewModel.js";
 import AddDrawEvent from "../units/map/addDrawEvent.js";
 import SymbolPathPipeEvent from "../units/map/SymbolPathPipeEvent.js";
+import SymbolPointCubeEvent from "../units/map/SymbolPointCubeEvent.js";
+import AddThreeCubeEvent from "../units/map/AddThreeCubeEvent.js";
+import AddThreeNetEvent from "../units/map/AddThreeNetEvent.js";
+import {getBuildingPoint} from "../service/http.js";
 
 export default {
   name: "mapJK",
@@ -61,6 +65,8 @@ export default {
     let viewShedAnalysisWidget = null;
     let addLightBallEvent = null;
     let addThreeGridEvent = null;
+    let addThreeCubeEvent = null;
+    let addThreeNetEvent = null;
     let limitHeightAnalysisEvent = null;
     let reRenderingEvent = null;
     let pathPipeEvent = null;
@@ -68,7 +74,7 @@ export default {
     let addDrawEvent = null;
     let draw_GeometryMeshPrismEffectEvent = null;
     let symbolPathPipeEvent = null;
-    let draw_SymbolPathPipeEvent = null;
+    let symbolPointCubeEvent = null;
     onMounted(() =>{
       bus.on('CreateMap',() =>{
         MapReady = $.Deferred();
@@ -182,6 +188,9 @@ export default {
           case "SymbolPathPipe":
             symbolPathPipe(params);
             break;
+          case "SymbolPointCube":
+            symbolPointCube(params);
+            break;
         }
       }
       function setBackground(params){
@@ -502,98 +511,168 @@ export default {
       }
 
 
+      async function showLayersWithScaleEventsReturn(scaleValue) {
+        try {
+          // 初始化 AddThreeCubeEvent,暂时不启动
+          const addThreeCubeEvent = new AddThreeCubeEvent({
+            view: m_view,
+          });
 
+          // 获取所有建筑点数据
+          const allPoints = await getAllBuildingPoints();
 
-      function showLayersWithScaleEventsReturn(scaleValue){
-        let eyeExtent = getEyeExtent();
-        if(!eyeExtent){
-          return
-        }
-        let height = m_view.camera.position.z;
-        console.log("height",height,"scale",m_view.scale)
-        let sizeObj = extentGridLimit({
-          eyeExtent,
-          height
-        });
-        let size = sizeObj.size;
-        let opacity = sizeObj.opacity;
-        let layerHeight;
-        if(size > 400){
-          layerHeight = 400;
-        }else{
-          layerHeight = size;
-        }
-        if(addThreeGridEvent){
-          addThreeGridEvent.extent = {minX:eyeExtent.xmin,maxX:eyeExtent.xmax,minY:eyeExtent.ymin,maxY:eyeExtent.ymax};
-          addThreeGridEvent.height = height>1200?1200:height;
-          addThreeGridEvent.size = size;
-          addThreeGridEvent.layerHeight = layerHeight;
-          addThreeGridEvent.gridEnabled = true;
-          addThreeGridEvent.netEnabled = true;
-          addThreeGridEvent.opacity = opacity;
-          addThreeGridEvent.start();
-        }else{
-          addThreeGridEvent = new AddThreeGridEvent({
-            view:m_view,
-            extent: {minX:eyeExtent.xmin,maxX:eyeExtent.xmax,minY:eyeExtent.ymin,maxY:eyeExtent.ymax},
-            height:height>1200?1200:height,
-            size:size,
-            gridEnabled : true,
-            netEnabled : true,
-            opacity:opacity,
-            layerHeight:layerHeight,
-          })
-          addThreeGridEvent.start();
-        }
+          // 将获取到的点数据赋值给 addThreeCubeEvent 的 points 属性
+          addThreeCubeEvent.points = allPoints;
 
+          // 确保所有点数据已加载后再启动事件
+          addThreeCubeEvent.start();
+
+          console.log('AddThreeCubeEvent started with points:', allPoints);
+        } catch (error) {
+          console.error('Error in showLayersWithScaleEventsReturn:', error);
+        }
       }
 
-      function extentGridLimit(params){
-        try{
-          //let size = [7.73,61.84,123.69,1850];
-          let size = [
-            {
-              value:7.73,
-              opacity:0.05
-            },
-            {
-              value:61.84,
-              opacity:0.05
-            },
-            {
-              value:123.69,
-              opacity:0.15
-            },
-            {
-              value:1850,
-              opacity:0.3
+      // 递归获取所有建筑点的辅助函数
+      async function getAllBuildingPoints(initialScrollId = null) {
+        let allPoints = [];        // 用于存储所有点的数组
+        let currentScrollId = initialScrollId; // 当前的 scrollId
+
+        while (true) {
+          try {
+            // 发起获取建筑点的请求
+            const res = await getBuildingPoint({
+              x: m_view.camera.position.x,
+              y: m_view.camera.position.y,
+              scrollId: currentScrollId,
+            });
+
+            // 检查响应码
+            if (res.data.code !== 200) {
+              throw new Error(`API返回错误代码: ${res.data.code}`);
             }
-          ]
-          params.eyeExtent = {
-            xmin: params.eyeExtent.xmin < -60000?-60000:params.eyeExtent.xmin,
-            ymin: params.eyeExtent.ymin < -60000?-60000:params.eyeExtent.ymin,
-            xmax: params.eyeExtent.xmax > 60000?60000:params.eyeExtent.xmax,
-            ymax: params.eyeExtent.ymax > 70000?70000:params.eyeExtent.ymax,
-          }
-          params.height = params.height < 1200?params.height:1200;
-          for(let i = 0;i<size.length;i++){
-            let xCount = Math.floor((params.eyeExtent.xmax - params.eyeExtent.xmin) / size[i].value);
-            let yCount = Math.floor((params.eyeExtent.ymax - params.eyeExtent.ymin) / size[i].value);
-            let zCount = Math.floor(params.height / size[i].value);
-            let count = xCount * yCount * zCount;
-            if(count < 200000){
-              return {
-                size: size[i].value,
-                opacity: size[i].opacity
-              }
+
+            const data = res.data.data;
+
+            // 假设 data.list 是当前请求返回的点数组
+            if (Array.isArray(data.list)) {
+              allPoints = allPoints.concat(data.list);
+            } else {
+              console.warn('data.list 不是数组:', data.list);
             }
+
+            // 判断是否还有更多数据需要获取
+            if (data.list?.length >= 10000 && data.scrollId) {
+              currentScrollId = data.scrollId; // 更新 scrollId 以获取下一批数据
+            } else {
+              break; // 没有更多数据,退出循环
+            }
+          } catch (error) {
+            console.error('Error in getAllBuildingPoints:', error);
+            throw error; // 将错误抛出,以便上层捕获
           }
-        }catch(e){
-          debugger
-          console.log("params",params)
         }
+
+        return allPoints; // 返回累积的所有点
       }
 
+
+
+
+      //全市格网自定义分割效果加载
+      // function showLayersWithScaleEventsReturn(scaleValue){
+      //   let eyeExtent = getEyeExtent();
+      //   if(!eyeExtent){
+      //     return
+      //   }
+      //   let height = m_view.camera.position.z;
+      //   console.log("height",height,"scale",m_view.scale);
+      //   let sizeObj = extentGridLimit({
+      //     eyeExtent,
+      //     height
+      //   });
+      //   let size = sizeObj.size;
+      //   let opacity = sizeObj.opacity;
+      //   let layerHeight;
+      //   if(size > 400){
+      //     layerHeight = 400;
+      //   }else{
+      //     layerHeight = size;
+      //   }
+      //   if(addThreeGridEvent){
+      //     addThreeGridEvent.extent = {minX:eyeExtent.xmin,maxX:eyeExtent.xmax,minY:eyeExtent.ymin,maxY:eyeExtent.ymax};
+      //     addThreeGridEvent.height = height>1200?1200:height;
+      //     addThreeGridEvent.size = size;
+      //     addThreeGridEvent.layerHeight = layerHeight;
+      //     addThreeGridEvent.gridEnabled = true;
+      //     addThreeGridEvent.netEnabled = true;
+      //     addThreeGridEvent.opacity = opacity;
+      //     addThreeGridEvent.start();
+      //   }else{
+      //     addThreeGridEvent = new AddThreeGridEvent({
+      //       view:m_view,
+      //       extent: {minX:eyeExtent.xmin,maxX:eyeExtent.xmax,minY:eyeExtent.ymin,maxY:eyeExtent.ymax},
+      //       height:height>1200?1200:height,
+      //       size:size,
+      //       gridEnabled : true,
+      //       netEnabled : true,
+      //       opacity:opacity,
+      //       layerHeight:layerHeight,
+      //     })
+      //     addThreeGridEvent.start();
+      //   }
+      //
+      // }
+      //
+      //格网范围限制
+      // function extentGridLimit(params){
+      //   try{
+      //     //let size = [7.73,61.84,123.69,1850];
+      //     let size = [
+      //       {
+      //         value:7.73,
+      //         opacity:0.05
+      //       },
+      //       {
+      //         value:61.84,
+      //         opacity:0.05
+      //       },
+      //       {
+      //         value:123.69,
+      //         opacity:0.15
+      //       },
+      //       {
+      //         value:1850,
+      //         opacity:0.3
+      //       }
+      //     ]
+      //     params.eyeExtent = {
+      //       xmin: params.eyeExtent.xmin < -60000?-60000:params.eyeExtent.xmin,
+      //       ymin: params.eyeExtent.ymin < -60000?-60000:params.eyeExtent.ymin,
+      //       xmax: params.eyeExtent.xmax > 60000?60000:params.eyeExtent.xmax,
+      //       ymax: params.eyeExtent.ymax > 70000?70000:params.eyeExtent.ymax,
+      //     }
+      //     params.height = params.height < 1200?params.height:1200;
+      //     for(let i = 0;i<size.length;i++){
+      //       let xCount = Math.floor((params.eyeExtent.xmax - params.eyeExtent.xmin) / size[i].value);
+      //       let yCount = Math.floor((params.eyeExtent.ymax - params.eyeExtent.ymin) / size[i].value);
+      //       let zCount = Math.floor(params.height / size[i].value);
+      //       let count = xCount * yCount * zCount;
+      //       if(count < 200000){
+      //         return {
+      //           size: size[i].value,
+      //           opacity: size[i].opacity
+      //         }
+      //       }
+      //     }
+      //   }catch(e){
+      //     debugger
+      //     console.log("params",params)
+      //   }
+      // }
+
+
+      //不同比例尺加载白膜
       // function showLayersWithScaleEventsReturn(scaleValue){
       //   let layer = m_map.layers.find(item => item.id === "WhiteMold");
       //   if(scaleValue > 50000){
@@ -849,6 +928,22 @@ export default {
         m_map.add(symbolPathPipeEvent.graphicsLayer);
       }
 
+      function symbolPointCube(params){
+        let status = params.status;
+        let f_layer = m_map.layers.find(item => item.id === "symbolPointCubeEvent");
+        if (f_layer) {
+          m_map.remove(f_layer);
+        }
+        if(status == "hide"){
+          return
+        }
+        debugger
+        symbolPointCubeEvent = new SymbolPointCubeEvent({
+          view:m_view,
+          points:params.points,
+        })
+        m_map.add(symbolPointCubeEvent.graphicsLayer);
+      }
     })
   }
 }

+ 180 - 56
src/config/basicTool.json

@@ -58,7 +58,7 @@
             "title":"WhiteMold",
             "visible": true,
             "opacity": 1,
-            "url": "https://cimweb.zjw.sh.cegn.cn:2008/MapServiceProxy/eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3MzMyOTMwMDksImtleSI6IjA1MTk1NDE4Iiwic2VydmljZU5vIjoiRDkwMDMwMDA2MjAyMzA4MDEiLCJ1c2VybmFtZSI6InB0Z2wifQ.cbmzULPKfqUTfpeBD7_9sQqkLQaCbr-dMnVc0qCrve8",
+            "url": "https://cimweb.zjw.sh.cegn.cn:2008/MapServiceProxy/eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3MzM5OTczMDYsImtleSI6IjA1MTk1NDE4Iiwic2VydmljZU5vIjoiRDkwMDMwMDA2MjAyMzA4MDEiLCJ1c2VybmFtZSI6InB0Z2wifQ.fWZuIUgQZhpSZPpK-y819W6nn89kK-Si_DPf0x1DhV8",
             "token": ""
           }
         }
@@ -459,58 +459,98 @@
             "status": "show",
             "paths": [
               [
-                [
-                  4419.489284,
-                  7361.3196348,
-                  0
-                ],
-                [
-                  4722.45233401,
-                  7353.53178799,
-                  112.6
-                ],
-                [
-                  5082.94702425,
-                  7512.13693485,
-                  112.6
-                ],
-                [
-                  5757.15146837,
-                  7714.98006736,
-                  112.6
-                ],
-                [
-                  5775.16196758,
-                  7551.31840959,
-                  112.6
-                ],
-
-
-                [
-                  5774.80167843,
-                  7449.51383181,
-                  112.6
-                ],
-                [
-                  5737.21978829,
-                  7127.43709037,
-                  112.6
-                ],
-                [
-                  5591.31188012,
-                  6784.34449701,
-                  61.6
-                ],
-                [
-                  5542.67695791,
-                  6669.98448716,
-                  41
-                ],
-                [
-                  5533.43949585,
-                  6674.18149397,
-                  26
-                ]
+                [4399.5433631362393, 7370.3376136757433,0],
+                [4307.0713031925261, 7251.5063864272088,100],
+                [4207.5877708923072, 7308.6565007288009,100],
+                [4050.9541242914274, 7308.6565007288009,100],
+                [3661.4866786887869, 7162.6062086299062,100],
+                [2960.8686107881367, 6910.7223715279251,100],
+                [2910.0685091875494, 6045.003973422572,100],
+                [2793.651609685272, 5721.1533257234842,0]
+              ],
+              [
+                [4399.5433631362393, 7370.3376136757433,0],
+                [4307.0713031925261, 7251.5063864272088,100],
+                [4207.5877708923072, 7308.6565007288009,100],
+                [4050.9541242914274, 7308.6565007288009,100],
+                [3661.4866786887869, 7162.6062086299062,100],
+                [3113.2689155880362, 7162.6062086299062,100]
+              ],
+              [
+                [4399.5433631362393, 7370.3376136757433,0],
+                [4307.0713031925261, 7251.5063864272088,100],
+                [4207.5877708923072, 7308.6565007288009,100],
+                [4050.9541242914274, 7308.6565007288009,100],
+                [3661.4866786887869, 7162.6062086299062,100],
+                [3542.9531082902104, 7171.0728922281414,100],
+                [3352.6202267482877, 7543.2479691505432,100],
+                [2515.309386334382, 7247.2730446271598,100],
+                [2481.4426519349217, 7477.9901727326214,100]
+              ],
+              [
+                [4399.5433631362393, 7370.3376136757433,0],
+                [4307.0713031925261, 7251.5063864272088,100],
+                [4207.5877708923072, 7308.6565007288009,100],
+                [4050.9541242914274, 7308.6565007288009,100],
+                [3661.4866786887869, 7162.6062086299062,100],
+                [3542.9531082902104, 7171.0728922281414,100],
+                [3352.6202267482877, 7543.2479691505432,100],
+                [3084.568078446202, 8067.3945490997285,100],
+                [2648.6596530349925, 8013.507910432294,0]
+              ],
+              [
+                [4399.5433631362393, 7370.3376136757433,0],
+                [4307.0713031925261, 7251.5063864272088,100],
+                [4207.5877708923072, 7308.6565007288009,100],
+                [4050.9541242914274, 7308.6565007288009,100],
+                [3661.4866786887869, 7162.6062086299062,100],
+                [3542.9531082902104, 7171.0728922281414,100],
+                [2973.5686361864209, 8284.441785633564,100],
+                [3316.469321988523, 8288.6751274317503,100],
+                [3316.469321988523, 8417.7920523341745,0]
+              ],
+              [
+                [4399.5433631362393, 7370.3376136757433,0],
+                [4673.2553688948974, 7064.3463766910136,100],
+                [4946.3059149952605, 5978.4942049868405,100],
+                [5183.24076386448, 5030.0933498516679,100],
+                [5095.9280892377719, 4891.1868220418692,100],
+                [5508.6789147406816, 4220.4667305964977,0]
+              ],
+              [
+                [4399.5433631362393, 7370.3376136757433,0],
+                [4645.6063552629203, 7362.4000978022814,100],
+                [5751.5669005159289, 7709.0049576759338,100],
+                [6475.7329321820289, 7954.5387820750475,100],
+                [6469.3829194819555, 8229.7059990745038,100],
+                [7199.6343799848109, 8585.3067102786154,100],
+                [7504.4349895855412, 9167.3912077825516,100],
+                [7280.0678741866723, 9861.6592629849911,0]
+              ],
+              [
+                [5533.4394958499997, 6674.1814939699998,0],
+                [5565.1395865100003, 6664.3312929399999,100],
+                [5771.0319604699998, 7084.9363842700004,100],
+                [5747.4897482899996, 7181.6602556999997,100],
+                [5775.4378630900001, 7452.3969179300002,100],
+                [5773.1627494000004, 7551.3616085399999,100],
+                [5756.9613519900004, 7714.4921131499996,100],
+                [5090.5727929900004, 7511.65297938,100],
+                [4777.61920852, 7378.2719266800004,100],
+                [4445.5372873599999, 7295.6718325900001,100],
+                [4413.6341138199996, 7361.9600904199997,0]
+              ],
+              [
+                [4419.4892839994282, 7361.3196348026395,0],
+                [4722.4523340091109, 7353.5317879915237,100],
+                [5082.947024250403, 7512.1369348522276,100],
+                [5757.1514683701098, 7714.9800673611462,100],
+                [5775.1619675792754, 7551.3184095919132,100],
+                [5774.801678430289, 7449.5138318110257,100],
+                [5737.2197882905602, 7127.4370903726667,100],
+                [5591.3118801191449, 6784.3444970101118,100],
+                [5542.6769579108804, 6669.9844871591777,100],
+                [5533.4394958522171, 6674.1814939714968,0]
               ]
             ],
             "color": "#00FF7F",
@@ -584,7 +624,7 @@
       },
       {
         "code": "1-20",
-        "title": "绘制",
+        "title": "绘制_管道",
         "data": {
           "ActionName": "Draw",
           "Parameters": {
@@ -609,7 +649,28 @@
       },
       {
         "code": "1-21",
-        "title": "绘制_几何拉高",
+        "title": "绘制_空域",
+        "data": {
+          "ActionName": "Draw",
+          "Parameters": {
+            "type": "polygon",
+            "hasZ": true,
+            "status":"show",
+            "symbol": {
+              "type": "polygon-3d",
+              "symbolLayers": [{
+                "type": "extrude",
+                "size": 300,
+                "material": { "color": [4,138,255,0.3] }
+              }]
+            },
+            "token": ""
+          }
+        }
+      },
+      {
+        "code": "1-22",
+        "title": "绘制_几何拉高_组合",
         "data": {
           "ActionName": "Draw_GeometryMeshPrismEffect",
           "Parameters": {
@@ -632,7 +693,7 @@
         }
       },
       {
-        "code": "1-22",
+        "code": "1-23",
         "title": "样式路径管线",
         "data": {
           "ActionName": "SymbolPathPipe",
@@ -693,6 +754,69 @@
             "token": ""
           }
         }
+      },
+      {
+        "code": "1-24",
+        "title": "样式网格体绘制",
+        "data": {
+          "ActionName": "SymbolPointCube",
+          "Parameters": {
+            "status":"show",
+            "points":  [
+              [
+                4419.489284,
+                7361.3196348,
+                0
+              ],
+              [
+                4722.45233401,
+                7353.53178799,
+                112.6
+              ],
+              [
+                5082.94702425,
+                7512.13693485,
+                112.6
+              ],
+              [
+                5757.15146837,
+                7714.98006736,
+                112.6
+              ],
+              [
+                5775.16196758,
+                7551.31840959,
+                112.6
+              ],
+              [
+                5774.80167843,
+                7449.51383181,
+                112.6
+              ],
+              [
+                5737.21978829,
+                7127.43709037,
+                112.6
+              ],
+              [
+                5591.31188012,
+                6784.34449701,
+                61.6
+              ],
+              [
+                5542.67695791,
+                6669.98448716,
+                41
+              ],
+              [
+                5533.43949585,
+                6674.18149397,
+                26
+              ]
+            ],
+            "token": ""
+          }
+        }
       }
     ]
   }

File diff suppressed because it is too large
+ 41769 - 0
src/config/buildingCamera.json


+ 1 - 0
src/service/config.js

@@ -0,0 +1 @@
+export const timeout = 30000

+ 28 - 0
src/service/http.js

@@ -0,0 +1,28 @@
+import {requestGet,requestPost} from "./index.js";
+
+
+//查询服务列表
+export function getBuildingPoint(params){
+    return requestPost({
+        url:'/LowAltitudeGrid/LowAltitudeGridFw/queryPageList',
+        data:{
+            "locationPoint": {
+                "mapX":  params.x,
+                "mapY": params.y
+            },
+            "radiusInMeters": 100000,
+            "minZ": 0,
+            "maxZ": 300,
+            "routes": [
+                //  "G001133223-031112-303001.1|000000000000000000000001"
+            ],
+            "fields":["gridCode","x","y","z"],
+            "scrollPage": {
+                "pageIndex": 1,
+                "pageSize": 10000,
+                "scrollId": params.scrollId
+            }
+        }
+    })
+}
+

+ 20 - 0
src/service/index.js

@@ -0,0 +1,20 @@
+import axios from "axios";
+import {timeout} from "./config.js";
+const requestPost = axios.create({
+    baseURL:import.meta.env.VITE_BASE_API,
+    timeout,
+    method:"post"
+})
+
+const requestGet = axios.create({
+    baseURL:import.meta.env.VITE_BASE_API,
+    timeout,
+    method:"get",
+})
+
+export {
+    requestPost,
+	requestGet
+}
+
+

+ 38 - 0
src/units/map/AddThreeCubeEvent.js

@@ -0,0 +1,38 @@
+import RenderNode from '@arcgis/core/views/3d/webgl/RenderNode.js';
+import * as webgl from "@arcgis/core/views/3d/webgl.js";
+import {ThreeCubeClass} from "../threejs/threeCube.js";
+
+
+class AddThreeCubeEvent{
+    constructor(options){
+        this.view = options.view;
+        this.points = options.points;
+        this.addThreeCubeEvent = null;
+    }
+    start() {
+        let that = this;
+        if (this.addThreeCubeEvent) {
+            this.clear();
+        }
+        let subRenderClass = RenderNode.createSubclass(ThreeCubeClass);
+        this.view.when(()=>{
+            this.addThreeCubeEvent = new subRenderClass({
+                view:that.view,
+                points:that.points,
+                webgl,
+            })
+        })
+    }
+    update(){
+        this.addThreeCubeEvent.points = this.points;
+    }
+
+    clear(){
+        if(this.addThreeCubeEvent){
+            this.addThreeCubeEvent.destroy();
+            this.addThreeCubeEvent = null;
+        }
+    }
+}
+
+export default AddThreeCubeEvent;

+ 52 - 0
src/units/map/AddThreeNetEvent.js

@@ -0,0 +1,52 @@
+import RenderNode from '@arcgis/core/views/3d/webgl/RenderNode.js';
+import * as webgl from "@arcgis/core/views/3d/webgl.js";
+import {ThreeNetClass} from "../threejs/threeNet.js";
+
+
+class  AddThreeNetEvent{
+    constructor(options){
+        this.view = options.view;
+        this.radius = options.radius;
+        this.center = options.center;
+        this.height = null;
+        this.extent = {
+            minX:null,
+            maxX:null,
+            minY:null,
+            maxY:null,
+            minZ:null,
+            maxZ:null,
+        };
+        this.addThreeNetEvent = null;
+    }
+
+    start() {
+        let that = this;
+        if (this.addThreeNetEvent) {
+            this.clear();
+        }
+        let subRenderClass = RenderNode.createSubclass(ThreeNetClass);
+        this.height = this.view.camera.position.z + 30;
+        this.extent.minX = this.center.x - this.radius;
+        this.extent.maxX = this.center.x + this.radius;
+        this.extent.minY = this.center.y - this.radius;
+        this.extent.maxY = this.center.y + this.radius;
+        this.extent.minZ = 0;
+        this.extent.maxZ =  this.center.z + 30;
+        this.view.when(()=>{
+            this.addThreeNetEvent = new subRenderClass({
+                view:that.view,
+                webgl,
+                extent:that.extent
+            })
+        })
+    }
+    clear(){
+        if(this.addThreeNetEvent){
+            this.addThreeNetEvent.destroy();
+            this.addThreeNetEvent = null;
+        }
+    }
+}
+
+export default AddThreeNetEvent;

+ 54 - 0
src/units/map/SymbolPointCubeEvent.js

@@ -0,0 +1,54 @@
+import GraphicsLayer from "@arcgis/core/layers/GraphicsLayer.js";
+import Graphic from "@arcgis/core/Graphic.js";
+import Point from "@arcgis/core/geometry/Point.js";
+//测试数据
+import Path from '../../config/pathJson.json'
+
+
+class SymbolPointCubeEvent{
+    constructor(options) {
+        this.view = options.view;
+        this.points = options.points;
+        this.graphicsLayer = null;
+        this.add();
+    }
+    add(){
+        this.graphicsLayer = new GraphicsLayer({
+            id: "symbolPointCubeEvent",
+            title: "绘制立方体"
+        });
+        debugger
+        this.points = Path.ypPath;
+        this.points.forEach((point)=>{
+            let geometry = new Point({
+                type:"point",
+                spatialReference:this.view.spatialReference,
+                x:point[0]* 7.73,
+                y:point[1]* 7.73,
+                z:point[2]* 7.73
+            });
+            let symbol = {
+                type: "point-3d",
+                symbolLayers: [{
+                    type: "object",
+                    material: {
+                        color: [0, 255, 0,0.3]
+                    },
+                    resource: { primitive: "cube" },
+                    width: 7.73, // the width in m
+                    height: 7.73, // the height in m
+                    depth:7.73
+                }]
+            };
+            let graphic = new Graphic({
+                geometry: geometry,
+                symbol: symbol
+            });
+            this.graphicsLayer.add(graphic);
+        })
+    }
+    clear(){
+        this.graphicsLayer.removeAll();
+    }
+}
+export default SymbolPointCubeEvent;

+ 163 - 0
src/units/threejs/threeCube.js

@@ -0,0 +1,163 @@
+import * as THREE from 'three';
+//import Points from '../../config/buildingCamera.json'
+export const ThreeCubeClass = {
+    constructor(options) {
+        this.webgl = options.webgl;
+        this.view = options.view;
+        this.Points = options.points;
+        this.mesh = null;
+        this._camera = null;
+    },
+
+    initialize(){
+        this.renderer = new THREE.WebGLRenderer({
+            context:this.gl,
+            premultipliedAlpha:false
+        })
+        this.renderer.setPixelRatio(window.devicePixelRatio);
+        this.renderer.setViewport(0,0,this.view.width,this.view.height);
+
+        this.renderer.autoClear = false;
+        this.renderer.autoClearDepth = false;
+        this.renderer.autoClearColor = false;
+        let originalSetRenderTarget = this.renderer.setRenderTarget.bind(this.renderer);
+        this.renderer.setRenderTarget = function (target) {
+            originalSetRenderTarget(target);
+            if (target == null) {
+                context.bindRenderTarget();
+            }
+        };
+        // 场景和相机
+        this.scene = new THREE.Scene();
+        let cam = this.camera;
+        this._camera = new THREE.PerspectiveCamera(cam.fovY, cam.aspect, 0.1, 1000000000);
+        // 添加坐标轴辅助工具
+        const axesHelper = new THREE.AxesHelper(1);
+        axesHelper.position.copy(1000000, 100000, 100000);
+        this.scene.add(axesHelper);
+        let grid = new THREE.GridHelper(30, 10, 0xf0f0f0, 0xffffff);
+        this.scene.add(grid);
+
+        this.createInstancedMesh();
+        this.scene.add(this.mesh);
+        // 添加灯光(确保物体在场景中可以被看见)
+        const ambientLight = new THREE.AmbientLight(0xffffff, 0.5);
+        this.scene.add(ambientLight);
+
+        const directionalLight = new THREE.DirectionalLight(0xffffff, 0.5);
+        directionalLight.position.set(10, 10, 10);
+        this.scene.add(directionalLight);
+
+
+    },
+    createInstancedMesh() {
+        const geometry = new THREE.BoxGeometry(2.9144308,3.3874536,3.367898882);
+        geometry.computeVertexNormals();  //计算并更新顶点法线
+        const material = new THREE.MeshPhongMaterial({
+            transparent:true,
+            opacity:0.5,
+            depthTest:true,
+            side:THREE.DoubleSide,
+            depthWrite: false // 关闭深度写入
+        });
+        // 修改材质支持 instanceColor
+        material.onBeforeCompile = (shader) => {
+            shader.vertexShader = `
+            attribute vec3 instanceColor;
+            varying vec3 vColor;
+        ` + shader.vertexShader;
+
+            shader.vertexShader = shader.vertexShader.replace(
+                `#include <begin_vertex>`,
+                `
+            #include <begin_vertex>
+            vColor = instanceColor;
+            `
+            );
+
+            shader.fragmentShader = `
+            varying vec3 vColor;
+        ` + shader.fragmentShader;
+
+            shader.fragmentShader = shader.fragmentShader.replace(
+                `#include <dithering_fragment>`,
+                `
+            #include <dithering_fragment>
+            gl_FragColor.rgb = vColor;
+            `
+            );
+        };
+
+        this.mesh = new THREE.InstancedMesh(geometry, material, this.Points.length);
+        // 为实例添加颜色属性
+        const instanceColors = new Float32Array(this.Points.length * 3);
+        const dummy = new THREE.Object3D();
+        const color = new THREE.Color();
+        let index = 0;
+        // debugger
+        // let dataX_CJ = Points.map(point => point.x);
+        // let dataY_CJ = Points.map(point => point.y);
+        //
+        // let dataX_84 = Points.map(point => point.locationPoint.lat);
+        // let dataY_84 = Points.map(point => point.locationPoint.lon);
+        //
+        // console.log("dataX_CJ",dataX_CJ)
+        // console.log("dataY_CJ",dataY_CJ)
+        // console.log("dataX_84",dataX_84)
+        // console.log("dataY_84",dataY_84)
+        // debugger
+        for(let i = 0; i < this.Points.length; i++){
+            let worldX = this.Points[i].x;
+            let worldY = this.Points[i].y;
+            let worldZ = this.Points[i].z;
+            let renderPos = [];
+            this.webgl.toRenderCoordinates(this.view, [worldX, worldY, worldZ], 0, this.view.spatialReference, renderPos, 0, 1);
+            dummy.position.set(renderPos[0], renderPos[1], renderPos[2]);
+            dummy.updateMatrix();
+            this.mesh.setMatrixAt(index, dummy.matrix);
+
+            instanceColors[index * 3] = 255;
+            instanceColors[index * 3 + 1] = 0;
+            instanceColors[index * 3 + 2] = 0;
+            index++;
+
+        }
+
+        // 为实例化的网格设置颜色
+        geometry.setAttribute('instanceColor', new THREE.InstancedBufferAttribute(instanceColors, 3));
+        geometry.attributes.instanceColor.needsUpdate = true;
+        this.mesh.instanceMatrix.needsUpdate = true;
+
+
+        // 将网格和边框分别添加到场景中
+        this.scene.add(this.mesh);
+        // 网格的光照
+        const ambientLight = new THREE.AmbientLight(0xffffff, 0.5);
+        this.scene.add(ambientLight);
+
+        const directionalLight = new THREE.DirectionalLight(0xffffff, 0.5);
+        directionalLight.position.set(10, 10, 10);
+        this.scene.add(directionalLight);
+
+    },
+    render(){
+        let cam = this.camera;
+        //需要调整相机的视角
+        this._camera.position.set(cam.eye[0], cam.eye[1], cam.eye[2]);
+        this._camera.up.set(cam.up[0], cam.up[1], cam.up[2]);
+        this._camera.lookAt(new THREE.Vector3(cam.center[0], cam.center[1], cam.center[2]));
+        // Projection matrix can be copied directly
+        this._camera.projectionMatrix.fromArray(cam.projectionMatrix);
+
+        this.renderer.state.reset();
+
+        this.bindRenderTarget();
+
+        this.renderer.render(this.scene, this._camera);
+        // as we want to smoothly animate the ISS movement, immediately request a re-render
+        this.requestRender();
+
+        // cleanup
+        this.resetWebGLState();
+    }
+}

+ 145 - 0
src/units/threejs/threeNet.js

@@ -0,0 +1,145 @@
+import * as THREE from 'three';
+
+export const ThreeNetClass = {
+    constructor(options) {
+        this.webgl = options.webgl;
+        this.view = options.view;
+        this.extent = options.extent;
+        this._camera = null;
+        this.sizeX = null;
+        this.sizeY = null;
+        this.sizeZ = null;
+    },
+    initialize(){
+        this.renderer = new THREE.WebGLRenderer({
+            context:this.gl,
+            premultipliedAlpha:false
+        });
+        this.renderer.setPixelRatio(window.devicePixelRatio);
+        this.renderer.setViewport(0,0,this.view.width,this.view.height);
+
+        this.renderer.autoClear = false;
+        this.renderer.autoClearDepth = false;
+        this.renderer.autoClearColor = false;
+        let originalSetRenderTarget = this.renderer.setRenderTarget.bind(this);
+        this.renderer.setRenderTarget = function (target){
+            originalSetRenderTarget(target);
+            if(target == null){
+                context.bindRenderTarget();
+            }
+        }
+        //场景和相机
+        this.scene = new THREE.Scene();
+        let cam = this.camera;
+        this._camera = new THREE.PerspectiveCamera(cam.forY,cam.aspect,0.1,1000000000);
+        //添加坐标轴辅助工具
+        const axesHelper = new THREE.AxesHelper(1);
+        axesHelper.position.copy(1000000,1000000,1000000);
+        this.scene.add(axesHelper);
+
+        let grid = new THREE.GridHelper(30,10,0xf0f0f0,0xffffff);
+        this.scene.add(grid);
+
+        this.createGridLines()
+    },
+    createGridLines(){
+        this.sizeX = 2.9144308;
+        this.sizeY = 3.3874536;
+        this.sizeZ = 3.367898882;
+        let linePositions = [];
+        const minX = Math.ceil((this.extent.minX - 0)/this.sizeX -1) * this.sizeX;
+        const maxX = Math.floor((this.extent.maxX - 0)/this.sizeX +1) * this.sizeX;
+        const minY = Math.ceil((this.extent.minY - 0)/this.sizeY -1) * this.sizeY;
+        const maxY =  Math.floor((this.extent.maxY - 0)/this.sizeY +1) * this.sizeY;
+        const minZ = Math.ceil((this.extent.minZ - 0)/this.sizeZ -1) > 0?Math.ceil((this.extent.minZ - 0)/this.sizeZ -1):0;
+        const maxZ = Math.floor((this.extent.maxZ - 0)/this.sizeZ +1) * this.sizeY;
+
+        const transformCoordinates = (x,y,z)=>{
+            const renderPos = [];
+            this.webgl.toRenderCoordinates(
+                this.view,
+                [x,y,z],
+                0,
+                this.view.spatialReference,
+                renderPos,
+                0,
+                1
+            );
+            return renderPos;
+        };
+
+        const addBatchToScene = () => {
+            if(linePositions.length === 0){
+                return
+            }
+            const lineGeometry = new THREE.BufferGeometry();
+            lineGeometry.setAttribute(
+                "position",
+                new THREE.Float32BufferAttribute(linePositions,3)
+            );
+            const lineMaterial = new THREE.LineBasicMaterial({
+                color: 0xffffff,
+                opacity:0.2,
+                lineWidth:1,
+                transparent:true
+            });
+            const lines = new THREE.LineSegments(lineGeometry, lineMaterial);
+            this.scene.add(lines);
+            linePositions = []; // 清空当前批次
+        }
+
+        debugger
+
+        // X方向的线
+        for (let y = minY; y <= maxY; y += this.sizeY) {
+            for (let z = minZ; z <= maxZ; z += this.sizeZ) {
+                const start = transformCoordinates(minX, y, z);
+                const end = transformCoordinates(maxX, y, z);
+                linePositions.push(...start, ...end);
+            }
+        }
+
+        // Y方向的线
+        for (let x = minX; x <= maxX; x += this.sizeX) {
+            for (let z = minZ; z <= maxZ; z += this.sizeZ) {
+                const start = transformCoordinates(x, minY, z);
+                const end = transformCoordinates(x, maxY, z);
+                linePositions.push(...start, ...end);
+            }
+        }
+
+        // Z方向的线
+        for (let x = minX; x <= maxX; x +=  this.sizeX) {
+            for (let y = minY; y <= maxY; y += this.sizeZ) {
+                const start = transformCoordinates(x, y, minZ);
+                const end = transformCoordinates(x, y, maxZ);
+                linePositions.push(...start, ...end);
+            }
+        }
+
+        // 添加剩余的线条
+        addBatchToScene();
+
+    },
+    render(){
+        let cam = this.camera;
+        //需要调整相机的视角
+        this._camera.position.set(cam.eye[0], cam.eye[1], cam.eye[2]);
+        this._camera.up.set(cam.up[0], cam.up[1], cam.up[2]);
+        this._camera.lookAt(new THREE.Vector3(cam.center[0], cam.center[1], cam.center[2]));
+        // Projection matrix can be copied directly
+        this._camera.projectionMatrix.fromArray(cam.projectionMatrix);
+
+        this.renderer.state.reset();
+
+        this.bindRenderTarget();
+
+        this.renderer.render(this.scene, this._camera);
+        // as we want to smoothly animate the ISS movement, immediately request a re-render
+        this.requestRender();
+
+        // cleanup
+        this.resetWebGLState();
+    }
+
+}

+ 15 - 0
vite.config.js

@@ -7,6 +7,21 @@ import { defineConfig } from 'vite'
 import vue from '@vitejs/plugin-vue'
 // https://vitejs.dev/config/
 export default defineConfig({
+  server:{
+    cors: true,
+    proxy: {
+      '/api': {
+        // 代理请求之后的请求地址(你的真实接口地址)
+        target: 'http://10.90.9.143:9252/DataSearch/',
+        //target: 'http://localhost:9250/',
+        secure: false,
+        ws: true,
+        // 跨域
+        changeOrigin: true,
+        rewrite: (path) => path.replace(/^\/api/, '')
+      },
+    }
+  },
   plugins: [vue()],
   base:'./',
   publicDir: resolve('static'),