sunzehao 3 viikkoa sitten
vanhempi
commit
60075800a5

+ 1 - 1
.env.development

@@ -5,4 +5,4 @@ VITE_APP_API=https://api.openweathermap.org
 VITE_APP_BD_API=http://127.0.0.1:3007
 
 # 获取外网天气数据
-VITE_APP_WW_API=http://192.168.2.180:3000
+VITE_APP_WW_API=http://192.168.2.180:3007

+ 9 - 0
src/api/index.js

@@ -26,4 +26,13 @@ export function getWWTempData() {
       url: `/api/getLevel`,
       method: "get",
     });
+}
+
+//获取瓦片数据
+export function getmapData() {
+    return request({
+      baseURL: import.meta.env.VITE_APP_WW_API,
+      url: `/api/getLevel`,
+      method: "get",
+    });
 }

BIN
src/assets/windimgs/fanSvg/bwshan.png


+ 54 - 0
src/assets/windimgs/fanSvg/bwshan.svg

@@ -0,0 +1,54 @@
+<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 93.5 96.5"
+    enable-background="new 0 0 93.5 96.5" xml:space="preserve">
+    <defs>
+        <rect id="SVGID_1_" x="-260.14" y="-365.945" width="595.28" height="841.89" />
+        <rect id="SVGID_3_" x="-260.14" y="-365.945" width="595.28" height="841.89" />
+    </defs>
+    <clipPath id="SVGID_2_">
+        <use xlink:href="#SVGID_1_" overflow="visible" />
+    </clipPath>
+    <clipPath id="SVGID_4_">
+        <use xlink:href="#SVGID_3_" overflow="visible" />
+    </clipPath>
+    <!-- 风扇 -->
+    <g>
+        <!-- 风扇灰色部分 -->
+        <g>
+            <path fill="#4b55ae"
+                d="M45.427,37.35l3.854,1.471c0,0,10.131-21.287,10.834-32.815C52.61,15.16,45.427,37.35,45.427,37.35" />
+            <path fill="#4b55ae"
+                d="M49.088,38.821l-3.163,2.647c0,0,13.648,19.221,23.373,25.454C64.962,55.908,49.088,38.821,49.088,38.821" />
+            <path fill="#4b55ae"
+                d="M45.749,41.592l0.022-4.125c0,0-23.489-2-34.528,1.396C22.452,42.669,45.749,41.592,45.749,41.592" />
+        </g>
+        <!-- 风扇白色部分 -->
+        <g>
+            <path fill="#D8D8D8" d="M49.095,38.328l11.02-32.752c0,0-0.102,2.009-0.186,2.674c-0.068,0.56-0.282,1.67-0.402,2.222
+        c-0.1,0.454-0.421,1.81-0.421,1.81s-0.583,2.35-0.815,3.123c-0.767,2.562-2.484,7.63-3.438,10.129
+        c-0.805,2.119-2.529,6.314-3.434,8.393c-0.492,1.132-2.029,4.5-2.029,4.5" />
+            <path fill="#D8D8D8" d="M46.446,41.545l23.227,25.585c0,0-1.705-1.066-2.244-1.465c-0.457-0.334-1.32-1.061-1.744-1.436
+        c-0.348-0.307-1.375-1.248-1.375-1.248s-1.769-1.656-2.33-2.234c-1.863-1.918-5.451-5.889-7.17-7.938
+        c-1.456-1.737-4.28-5.287-5.654-7.091c-0.748-0.98-2.939-3.965-2.939-3.965" />
+            <path fill="#D8D8D8" d="M45.376,37.815l-34.535,1.201c0,0,1.915-0.614,2.569-0.768c0.548-0.131,1.662-0.324,2.22-0.406
+        c0.459-0.066,1.843-0.241,1.843-0.241s2.405-0.28,3.211-0.335c2.667-0.181,8.015-0.356,10.691-0.345
+        c2.267,0.01,6.798,0.149,9.064,0.265c1.231,0.064,4.926,0.318,4.926,0.318" />
+        </g>
+        <animateTransform attributeName="transform"
+            attributeType="XML"
+            type="rotate"
+            from="0 46.75 39.182"
+            to="359 46.75 39.182"
+            dur="4s"
+            repeatCount="indefinite"/>
+    </g>
+    <!-- 中心圆大 -->
+    <g>
+        <path fill="#60BFD6" d="M42.686,39.182c0,2.504,2.117,4.545,4.732,4.545s4.733-2.041,4.733-4.545c0-2.512-2.118-4.544-4.733-4.544
+        S42.686,36.67,42.686,39.182" />
+    </g>
+    <!-- 中心圆小 -->
+    <g>
+        <path fill="#B1E1EB" d="M44.4,39.182c0,1.561,1.353,2.831,3.017,2.831c1.663,0,3.02-1.27,3.02-2.831c0-1.56-1.356-2.829-3.02-2.829
+        C45.753,36.353,44.4,37.622,44.4,39.182" />
+    </g>
+</svg>

+ 18 - 0
src/assets/windimgs/fanSvg/bwzhu.svg

@@ -0,0 +1,18 @@
+<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 93.5 96.5"
+    enable-background="new 0 0 93.5 96.5" xml:space="preserve">
+    <defs>
+        <rect id="SVGID_1_" x="-260.14" y="-365.945" width="595.28" height="841.89" />
+        <rect id="SVGID_3_" x="-260.14" y="-365.945" width="595.28" height="841.89" />
+    </defs>
+    <clipPath id="SVGID_2_">
+        <use xlink:href="#SVGID_1_" overflow="visible" />
+    </clipPath>
+    <clipPath id="SVGID_4_">
+        <use xlink:href="#SVGID_3_" overflow="visible" />
+    </clipPath>
+    <!-- 柱 -->
+    <g>
+        <path fill="#D8D8D8" d="M45.96,39.183l-2.22,50.288c0,0,1.916,0.747,3.605,0.747c1.738,0,3.752-0.747,3.752-0.747l-2.181-50.288
+        H45.96z" />
+    </g>
+</svg>

+ 4 - 3
src/views/cesium.vue

@@ -266,7 +266,8 @@ export default {
       });
       
       const imageryProvider = new Cesium.UrlTemplateImageryProvider({
-        url: "https://webst02.is.autonavi.com/appmaptile?style=6&x={x}&y={y}&z={z}",
+        // url: "https://webst02.is.autonavi.com/appmaptile?style=6&x={x}&y={y}&z={z}",
+        url: "http://192.168.2.180:3007/tiles/map/{z}/{x}/{y}",
         credit: "影像地图",
       });
       imageryProvider.alpha = 0.55; // 透明度
@@ -991,8 +992,8 @@ export default {
 
       // 调用温度底图
       const temperatureLayer = new Cesium.UrlTemplateImageryProvider({
-        // url: "https://tile.openweathermap.org/map/temp_new/{z}/{x}/{y}.png?appid=3b66d35579770393051599f8d518df4a",
-        url: "http://localhost:3007/weather/tempapi/{z}/{x}/{y}.png",
+        url: "https://tile.openweathermap.org/map/temp_new/{z}/{x}/{y}.png?appid=3b66d35579770393051599f8d518df4a",
+        // url: "http://localhost:3007/weather/tempapi/{z}/{x}/{y}.png",
         credit: "温度影像地图",
       });
 

+ 4 - 2
src/views/cesiumComponents/fjLonLat.json

@@ -1408,14 +1408,16 @@
             "longitude": 114.49562,
             "latitude": 35.35543,
             "name": "F01号风机",
-            "aname": "F01"
+            "aname": "F01",
+            "status": 1
         },
         {
             "nemCode": "F02",
             "longitude": 114.48977,
             "latitude": 35.35685,
             "name": "F02号风机",
-            "aname": "F02"
+            "aname": "F02",
+            "status": 2
         },
         {
             "nemCode": "F03",

+ 86 - 21
src/views/cesiumComponents/topographicMap.vue

@@ -72,7 +72,10 @@ import comModelDialog from "@/components/comModelDialog.vue";
 import windView from "./windView.vue";
 import menuCom from "../menuCom.vue";
 
-import bw from "@/assets/windimgs/fanSvg/bw.svg"
+// import bw from "@/assets/windimgs/fanSvg/bw.svg"
+import dj from "@/assets/windimgs/fanSvg/dj.svg"
+import bwzhu from "@/assets/windimgs/fanSvg/bwzhu.svg"
+import bwshan from "@/assets/windimgs/fanSvg/bwshan.png"
 
 import windHome from "@/components/windHome/index.vue";
 import windPro from "@/components/windProDetail/windProblem.vue";
@@ -154,30 +157,67 @@ export default {
         selectionIndicator: false,
         shouldAnimate: true,
       });
-      viewer.scene.globe.enableLighting = false;
-      viewer.scene.sun.show = false;
-      viewer.scene.moon.show = false;
-      viewer.shadows = false;
-      viewer.scene.skyAtmosphere.show = true;
-      viewer._cesiumWidget._creditContainer.style.display = "none";
-      viewer.terrainProvider = await Cesium.createWorldTerrainAsync({
-        requestWaterMask: true,
-        requestVertexNormals: true,
+
+      const imageryProvider = new Cesium.UrlTemplateImageryProvider({
+        // url: "https://webst02.is.autonavi.com/appmaptile?style=6&x={x}&y={y}&z={z}",
+        url: "http://192.168.2.180:3007/tiles/map/{z}/{x}/{y}",
+        credit: "影像地图",
       });
-      this.csceneElliposid(viewer)
+      imageryProvider.alpha = 0.55; // 透明度
+      imageryProvider.brightness = 1; // 亮度
+      imageryProvider.contrast = 1; // 对比度
+
+      viewer.imageryLayers.addImageryProvider(imageryProvider);
+    //   viewer.scene.globe.enableLighting = false;
+    //   viewer.scene.sun.show = false;
+    //   viewer.scene.moon.show = false;
+    //   viewer.shadows = false;
+    //   viewer.scene.skyAtmosphere.show = true;
+      viewer._cesiumWidget._creditContainer.style.display = "none";
+    //   viewer.terrainProvider = await Cesium.createWorldTerrainAsync({
+    //     requestWaterMask: true,
+    //     requestVertexNormals: true,
+    //   });
+    //   this.csceneElliposid(viewer)
 
       // 添加一些3D风机模型
       fjLonLatJson.data.forEach((e) => {
-        this.addSvg(
-          viewer,
-        //   "./static/model/fjSolo/model.glb",
-          bw,
-          "风机",
-          e.longitude,
-          e.latitude,
-          0.5,
-          e
-        );
+        if (e.status) {
+            if (e.status === 1) {
+                this.addSvg(
+                    viewer,
+                    //   "./static/model/fjSolo/model.glb",
+                    dj,
+                    "风机",
+                    e.longitude,
+                    e.latitude,
+                    0.5,
+                    e
+                );
+            }
+        } else {
+            this.addSvg(
+                viewer,
+                //   "./static/model/fjSolo/model.glb",
+                bwzhu,
+                "风机",
+                e.longitude,
+                e.latitude,
+                0.5,
+                e
+                );
+                this.addSvgs(
+                viewer,
+                //   "./static/model/fjSolo/model.glb",
+                bwshan,
+                "风机",
+                e.longitude,
+                e.latitude,
+                0.5,
+                e
+                );
+        }
+        
       });
       //添加3D光伏模型
     //   this.addModel(
@@ -356,6 +396,31 @@ export default {
         }
       }, Cesium.ScreenSpaceEventType.RIGHT_CLICK);
     },
+    addSvgs(viewer, uri, name, lon, lat, scale, val) {
+      const position = Cesium.Cartesian3.fromDegrees(lon, lat);
+      const entity = viewer.entities.add({
+        position, // 模型位置
+        billboard: {
+            image: uri, // 也可以是 SVG 路径,如 'icon.svg'
+            scale: 0.5,
+            pixelOffset: new Cesium.Cartesian2(0, -10),
+            verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
+            horizontalOrigin: Cesium.HorizontalOrigin.CENTER,
+            // 模型贴地
+            heightReference: Cesium.HeightReference.CLAMP_TO_GROUND,
+            // 核心:使用 CallbackProperty 实现旋转动画
+            rotation: new Cesium.CallbackProperty(function(time) {
+            // 每 3 秒转一圈(可调速度)
+            const seconds = time.secondsOfDay;
+            const angle = Cesium.Math.toRadians((seconds % 3) * 360 / 3); // 每3秒一圈
+            return angle;
+            }, false),
+            // 确保绕中心旋转
+            rotationAlignment: Cesium.HeightReference.CENTER,
+            alignedAxis: Cesium.Cartesian3.UNIT_Z
+        }
+      });
+    },
     showRightClickPopup(screenPosition, viewer, val) {
       // 创建或获取弹框元素
       var popup = document.getElementById("rightClickPopup");