Browse Source

冲突处理

Koishi 1 tuần trước cách đây
mục cha
commit
6c64a1a22e

+ 28 - 25
src/views/cesiumComponents/windMap3D.vue

@@ -73,6 +73,7 @@
       :currentHeight="currentHeight"
       @showDetail="menuComTSty"
       @backStations="backStations"
+      @initView="resetWindViewport"
     />
   </div>
 </template>
@@ -252,7 +253,7 @@ export default {
         // url: "http://localhost:3007/tiles/map/{z}/{x}/{y}",
         url: "/static/ditu/{z}/{x}/{y}.png",
         // minimumLevel: 11,
-        maximumLevel: 18,
+        maximumLevel: 24,
         credit: "影像地图",
       });
       imageryProvider.alpha = 0.55; // 透明度
@@ -599,17 +600,18 @@ export default {
           uri: `/static/model/fjStatus/fj_${statueFJ}.glb`,
           scale: 0.5,
           // 模型贴地
-          //   heightReference: Cesium.HeightReference.CLAMP_TO_GROUND,
+            heightReference: Cesium.HeightReference.CLAMP_TO_GROUND,
           // heightReference: Cesium.HeightReference.NONE,
           //   silhouetteSize: this.dixingAdd ? 2 : 0,
           //   silhouetteColor: Cesium.Color.fromCssColorString(statueColor),
           //   runAnimations: wtStatue !== 7 ? false : true,
         },
-        // label: {
-        //   text: name,
-        //   font: "14px sans-serif",
-        //   fillColor: Cesium.Color.fromBytes(255, 255, 255),
-        // },
+        label: {
+          text: name,
+          font: "14px sans-serif",
+          fillColor: Cesium.Color.fromBytes(255, 255, 255),
+          heightReference: Cesium.HeightReference.CLAMP_TO_GROUND,
+        },
       });
 
       // 使用高级灯牌生成器
@@ -999,23 +1001,24 @@ export default {
     },
     // 重置风场中所有风机视角
     resetWindViewport() {
-      let fromLon = this.$route.query.longitude * 1;
-      let fromLat = this.$route.query.latitude * 1;
-      let fromheight = this.$route.query.height * 1;
-      let fromname = this.$route.query.nameEn;
-      // 设置镜头到指定的经纬度(度)、高度(米)
-      this.viewer.camera.setView({
-        destination: Cesium.Cartesian3.fromDegrees(
-          fromLon, // 经度 (degrees)
-          fromLat, // 纬度 (degrees)
-          fromheight // 高度 (meters)
-        ),
-        orientation: {
-          heading: Cesium.Math.toRadians(0.0), // 偏航角 (方向,0 指向北方)
-          pitch: Cesium.Math.toRadians(-90.0), // 俯仰角 (-90 是垂直向下)
-          roll: 0.0, // 翻滚角
-        },
-      });
+        let fromLon = this.$route.query.longitude * 1;
+        let fromLat = this.$route.query.latitude * 1;
+        let fromheight = this.$route.query.height * 1;
+        let fromname = this.$route.query.nameEn;
+        // 设置镜头到指定的经纬度(度)、高度(米)
+        this.viewer.camera.setView({
+            destination: Cesium.Cartesian3.fromDegrees(
+            fromLon, // 经度 (degrees)
+            fromLat, // 纬度 (degrees)
+            fromheight // 高度 (meters)
+            ),
+            orientation: {
+            heading: Cesium.Math.toRadians(0.0), // 偏航角 (方向,0 指向北方)
+            pitch: Cesium.Math.toRadians(-90.0), // 俯仰角 (-90 是垂直向下)
+            roll: 0.0, // 翻滚角
+            },
+        });
+      
       // 目标位置:经度、纬度、高度
       //   const targetLon = 107.034945;
       //   const targetLat = 37.309099;
@@ -1030,7 +1033,7 @@ export default {
       const targetHeight = 5000;
 
       const draggableHeightTolerance = 5000; // 允许拖拽的高度范围:20,000 ~ 30,000
-      const minHeight = 1000; // 最低高度
+      const minHeight = 500; // 最低高度
       const maxHeight = 10000; // 最高高度
 
       const allowedOffsetDegrees = 2; // 允许拖拽的最大偏移(经纬度)

+ 13 - 1
src/views/cesiumComponents/windView.vue

@@ -12,6 +12,11 @@
           <p class="label" v-else>查看详情</p>
         </div>
       </aside>
+      <aside class="sidebar-left-top btnms3">
+        <div class="stat-block-lefttop" @click="initView">
+          <p class="label">初始化</p>
+        </div>
+      </aside>
     </div>
 
     <!-- Left Sidebar -->
@@ -109,7 +114,7 @@
         <div class="op-progress-bar">
           <div
             class="op-progress-bar-inner"
-            :style="`width: ${progressPoint}` + '%'"
+            :style="`width: ${progressPoint > 100 ? 100 : progressPoint}` + '%'"
           ></div>
         </div>
         <span class="values"> 10000(m)</span>
@@ -1054,6 +1059,9 @@ export default {
     showMessages() {
       this.showMessagesB = !this.showMessagesB;
     },
+    initView() {
+        this.$emit("initView")
+    },
     valueOnChange(it) {
       this.heightArr.forEach((it) => {
         it.check = false;
@@ -1296,6 +1304,9 @@ export default {
 .btnms2 {
   left: 90px;
 }
+.btnms3{
+    left: 192px;
+}
 .sidebar-left-top {
   top: 110px;
   padding: 5px 15px;
@@ -1589,6 +1600,7 @@ export default {
       height: 100%;
       background: #134ac0;
       border-radius: 3px;
+      overflow: hidden;
     }
   }
   .labels {

+ 51 - 2
src/views/weatherComponents/cesiumweatherView.vue

@@ -1,7 +1,28 @@
 <template>
     <div class="cesiumWeatherView">
+        <aside class="sidebar-svg panelx" v-if="!isShowWeather">
+            <div class="showSty">
+                <el-tooltip
+                    class="box-item"
+                    effect="light"
+                    content="天气详情"
+                    placement="bottom"
+                >
+                    <svg viewBox="0 0 1024 1024" width="1.8em" height="1.8em" @click="showWeatherMsg">
+                        <path d="M600.96 677.92a329.12 329.12 0 1 0-94.08 68.16L606.72 880a58.4 58.4 0 0 0 93.6-69.76zM112 449.12a252.16 252.16 0 1 1 252.64 251.52A252.48 252.48 0 0 1 112 449.12z m829.76-187.68a39.04 39.04 0 0 0 0-77.6H743.2a39.04 39.04 0 0 0 0 77.6h198.56z m41.76 181.76a38.72 38.72 0 0 0-27.52-11.2H790.56a39.04 39.04 0 0 0 0 77.6h165.44a38.56 38.56 0 0 0 38.72-38.4 39.36 39.36 0 0 0-11.2-27.52z m-115.2 236.32a39.04 39.04 0 0 0 0 77.6h82.4a39.04 39.04 0 1 0 7.84-77.6 32 32 0 0 0-7.84 0z" fill="#ffffff" p-id="3690">
+                        </path>
+                    </svg>
+                </el-tooltip>
+            </div>
+        </aside>
         <!-- Left Sidebar -->
-        <aside class="sidebar-left panel" :style="showWeatherDetail ? 'top: 100px' : 'bottom: 20px;'">
+        <aside class="sidebar-left panel" :style="showWeatherDetail ? 'top: 100px' : 'bottom: 20px;'" v-if="isShowWeather">
+            <div class="cancelSty">
+                <svg viewBox="0 0 1024 1024" width="2em" height="2em" @click="showWeatherMsg">
+                    <path d="M512 177.8c45.1 0 88.9 8.8 130.1 26.2 39.8 16.8 75.5 40.9 106.2 71.6 30.7 30.7 54.8 66.4 71.6 106.2 17.4 41.2 26.2 84.9 26.2 130.1s-8.8 88.9-26.2 130.1c-16.8 39.8-40.9 75.5-71.6 106.2-30.7 30.7-66.4 54.8-106.2 71.6C600.9 837.2 557.2 846 512 846s-88.9-8.8-130.1-26.2c-39.8-16.8-75.5-40.9-106.2-71.6-30.7-30.7-54.8-66.4-71.6-106.2-17.4-41.2-26.2-84.9-26.2-130.1s8.8-88.9 26.2-130.1c16.8-39.8 40.9-75.5 71.6-106.2s66.4-54.8 106.2-71.6c41.2-17.3 85-26.2 130.1-26.2m0-50c-212.2 0-384.2 172-384.2 384.2s172 384.2 384.2 384.2 384.2-172 384.2-384.2-172-384.2-384.2-384.2z" p-id="2551" fill="#8a8a8a"></path><path d="M688.1 622.3L568.6 509.1 684 402.3l-49.7-61.8-123.2 114-118.4-112.1-50.3 61.2 110.5 104.7-117 108.4 49.6 61.8 125-115.6 127.3 120.6z" p-id="2552" fill="#8a8a8a">
+                    </path>
+                </svg>
+            </div>
             <div class="stat-block">
                 <span class="labels">数据 </span>
                 <span class="values">{{showCover}} @ {{showHeight}}hpa </span>
@@ -330,7 +351,8 @@ export default {
                 }
             ],
             today: '',
-            weatherSvg: ['晴', '多云', '风', '雾', '阴', '雷雨', '雨', '雨加雪', '雪']
+            weatherSvg: ['晴', '多云', '风', '雾', '阴', '雷雨', '雨', '雨加雪', '雪'],
+            isShowWeather: true
         }
     },
     computed: {
@@ -347,6 +369,9 @@ export default {
         this.today = DAYJS().format("YYYY年MM月DD日")
     },
     methods: {
+        showWeatherMsg() {
+            this.isShowWeather = !this.isShowWeather
+        },
         valueOnChange(it) {
             this.heightArr.forEach(it => {
                 it.check = false
@@ -922,6 +947,7 @@ export default {
 </script>
 
 <style lang="less" scoped>
+
 .panel {
     background: rgba(248, 249, 252, 0.85);
     backdrop-filter: blur(15px);
@@ -931,12 +957,35 @@ export default {
     box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.08);
     padding: 20px;
 }
+.panelx {
+    background: #134ac0;
+    border: 1px solid rgba(255, 255, 255, 0.2);
+    border-radius: 20px;
+    padding: 20px;
+}
 /* --- Left Sidebar --- */
+.sidebar-svg{
+    position: absolute;
+    left: 20px;
+    bottom: 320px;
+}
 .sidebar-left {
     position: absolute;
     left: 20px;
     width: 600px;
 }
+.showSty{
+    cursor: pointer;
+    position: absolute;
+    top: 6px;
+    left: 6px;
+}
+.cancelSty{
+    position: absolute;
+    right: 10px;
+    top: 10px;
+    cursor: pointer;
+}
 .stat-block { margin-bottom: 10px; display: flex; }
 .stat-block .labels { font-size: 15px; color: #6c757d; width: 40px;font-weight: 600;
 display: block;border-right: 2px solid #6c757d; }