chc 1 jaar geleden
bovenliggende
commit
42c40883c6
6 gewijzigde bestanden met toevoegingen van 56 en 47 verwijderingen
  1. 1 1
      src/App.vue
  2. 2 2
      src/views/header/Weather.vue
  3. 13 0
      src/views/map/Map.vue
  4. 14 16
      src/views/map/changeMap.vue
  5. 4 4
      src/views/map/legend.vue
  6. 22 24
      src/views/map/toolBox.vue

+ 1 - 1
src/App.vue

@@ -32,7 +32,7 @@ html body {
   height: 100%; */
   /* margin: 0; */
   padding: 0;
-  /* overflow: hidden !important; */
+  overflow: hidden !important;
   /* display: flex;
   justify-content: center;
   align-items: flex-start;  */

+ 2 - 2
src/views/header/Weather.vue

@@ -11,7 +11,7 @@
       <!-- <div class="date">
         <i class="time">{{ dateTime }}</i>
       </div> -->
-      <a-popconfirm
+      <!-- <a-popconfirm
             title="你确定要修改更新数据库中的站点高程吗?"
             ok-text="Yes"
             cancel-text="No"
@@ -25,7 +25,7 @@
                 alt=""
                 title="更新站点高程"
               />
-          </a-popconfirm>
+          </a-popconfirm> -->
       
       <img
         src="../../assets/images/reloading.png"

+ 13 - 0
src/views/map/Map.vue

@@ -901,6 +901,19 @@ export default defineComponent({
         this.lng = i.position?.y.toFixed(4);
         // console.log(i.position)
       });
+      map.viewer.cesiumWidget.screenSpaceEventHandler.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK);
+        
+          
+        // 添加一个双击事件监听器
+        map.viewer.screenSpaceEventHandler.setInputAction(function(event) {
+          var pickedObject = map.viewer.scene.pick(event.position);
+            if (Cesium.defined(pickedObject)&& pickedObject.id) {
+                // 这里处理双击事件
+                // console.log('Entity被双击了!',pickedObject,event.position);
+                map.viewer.zoomTo(pickedObject.id)
+                // 可以在这里进行更多的操作,比如弹出信息框等
+            }
+        }, Cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK);
     },
 
     setLegibility(id) {

+ 14 - 16
src/views/map/changeMap.vue

@@ -1,8 +1,6 @@
 <template>
   <div>
-    <div class="toolmap" :style="{
-      right: `${windowRight}px`
-    }">
+    <div class="toolmap" :style="mapStore.sideMenu? `right:${windowRight}px`:`right:20px`">
       <div @click="setClass(0)" @mouseover="getTip('面雨量分布图')" @mouseout="closetip"
         :class="bkclick[0] ? 'divclick' : ''">
         <img src="../../assets/images/changeMap/mianyuliang.png" />
@@ -94,17 +92,17 @@
         <img src="../../assets/images/changeMap/checktime.png" style="display: inline-block" @click="search" />
       </div>
     </div>
-    <div class="class-legend" v-show="mapLgendShow3">
+    <div class="class-legend" v-show="mapLgendShow3" :style="mapStore.sideMenu? `left:${windowRight+30}px`:`left:20px`">
       <div style="border-radius: 25px 25px 0 0; background-color: #3f3dbd; color: #fff">mm</div>
       <div v-for="item in rainLegendNow2" :style="item.style">{{ item.value }}</div>
       <div style="border-radius: 0 0 25px 25px; background-color: #fff; color: #000; font-size: 12px">0</div>
     </div>
-    <div class="class-legend" v-show="mapLgendShow">
+    <div class="class-legend" v-show="mapLgendShow" :style="mapStore.sideMenu? `left:${windowRight+30}px`:`left:20px`">
       <div style="border-radius: 25px 25px 0 0; background-color: #3f3dbd; color: #fff">mm</div>
       <div v-for="item in rainLegendNow" :style="item.style">{{ item.value }}</div>
       <div style="border-radius: 0 0 25px 25px; background-color: #eaeaea; color: #000; font-size: 12px">无数据</div>
     </div>
-    <div class="class-legendtwo" v-show="mapLgendShow2">
+    <div class="class-legendtwo" v-show="mapLgendShow2" :style="mapStore.sideMenu? `left:${windowRight+30}px`:`left:20px`">
       <div style="border-radius: 25px 25px 0 0; background-color: #3f3dbd; color: #fff">℃</div>
       <div v-for="item in wdLegendNow" :style="item.style">{{ item.value }}</div>
       <!-- <div style="border-radius: 0 0 25px 25px ;background-color: #3f3dbd;color: #fff;">0</div> -->
@@ -517,27 +515,27 @@ const getTip = (i) => {
   infoShow.value = true;
   if (mapStore.sideMenu) {
     if (i == '面雨量分布图') {
-      px.value = ' right: 500px;top: 370px;';
+      px.value = ` right: ${windowRight.value+50}px;top: 370px;`;
     } else if (i == '站点雨量图') {
-      px.value = ' right: 500px;top: 400px;';
+      px.value = ` right: ${windowRight.value+50}px;top: 400px;`;
     } else if (i == '分区雨量图') {
-      px.value = ' right: 500px;top: 420px;';
+      px.value = ` right: ${windowRight.value+50}px;top: 420px;`;
     } else if (i == '站点温度图') {
-      px.value = ' right: 500px;top: 450px;';
+      px.value = ` right: ${windowRight.value+50}px;top: 450px;`;
     } else if (i == '站点风速风向图') {
-      px.value = ' right: 500px;top: 480px;';
+      px.value = ` right: ${windowRight.value+50}px;top: 480px;`;
     }
   } else {
     if (i == '面雨量分布图') {
-      px.value = ' right: 70px;top: 370px;';
+      px.value = ` right: 70px;top: 370px;`;
     } else if (i == '站点雨量图') {
-      px.value = ' right: 70px;top: 400px;';
+      px.value = ` right: 70px;top: 400px;`;
     } else if (i == '分区雨量图') {
-      px.value = ' right: 70px;top: 420px;';
+      px.value = ` right: 70px;top: 420px;`;
     } else if (i == '站点温度图') {
-      px.value = ' right: 70px;top: 450px;';
+      px.value = ` right: 70px;top: 450px;`;
     } else if (i == '站点风速风向图') {
-      px.value = ' right: 70px;top: 480px;';
+      px.value = ` right: 70px;top: 480px;`;
     }
   }
 };

+ 4 - 4
src/views/map/legend.vue

@@ -11,14 +11,12 @@
           tuliType = !tuliType;
         }
       "
-       :style="{
-        right: `${windowRight}px`
-      }"
+       :style="mapStore.sideMenu? `right:${windowRight}px`:`right:20px`"
     >
       <img :src="'./static/img/legend/legend.png'" />
     </div>
     <!-- 图例模块 -->
-    <div v-drag class="tuli" v-show="tuliType">
+    <div v-drag class="tuli" v-show="tuliType" :style="mapStore.sideMenu? `right:${windowRight+50}px`:`right:70px`">
       <div class="box">
         <div class="title">
           <div class="close-legend" @click="tuliType = !tuliType;"></div>
@@ -103,7 +101,9 @@
 <script setup>
 import { ref, reactive } from 'vue';
 import { CloseOutlined } from '@ant-design/icons-vue';
+import { useMapStore } from '/@/store/modules/map';
 import eventBus from '/@/utils/eventBus';
+const mapStore = useMapStore();
 let windowRight = ref(350)
 eventBus.on('setWindowRight', (e) => {
   windowRight.value = e

+ 22 - 24
src/views/map/toolBox.vue

@@ -5,9 +5,7 @@
 -->
 <template>
   <div>
-    <div class="toolBox" :style="{
-      right: `${windowRight}px`
-    }">
+    <div class="toolBox" :style="mapStore.sideMenu? `right:${windowRight}px`:`right:20px`">
       <div @click="setClass(0)" @mouseover="getTip('初始范围')" @mouseout="closetip" :class="bkclick[0] ? 'divclick' : ''">
         <img src="../../assets/images/toolBox/reset.png" />
       </div>
@@ -330,21 +328,21 @@ export default defineComponent({
 
       if (mapStore.sideMenu) {
         if (navigation) navigation.style.right = '400px';
-        if (navigation) tool.style.right = '450px';
-        if (navigation) changeMap.style.right = '450px';
-        if (navigation) legendBox.style.right = '450px';
-        if (navigation) tuli.style.right = '500px';
-        if (navigation) classLegend.style.left = '470px';
-        if (navigation) classLegend2.style.left = '470px';
+        // if (navigation) tool.style.right = '450px';
+        // if (navigation) changeMap.style.right = '450px';
+        // if (navigation) legendBox.style.right = '450px';  
+        // if (navigation) tuli.style.right = '500px';
+        // if (navigation) classLegend.style.left = '470px';
+        // if (navigation) classLegend2.style.left = '470px';
 
       } else {
         if (navigation) navigation.style.right = '-10px';
-        if (navigation) tool.style.right = '20px';
-        if (navigation) changeMap.style.right = '20px';
-        if (navigation) legendBox.style.right = '20px';
-        if (navigation) tuli.style.right = '20px';
-        if (navigation) classLegend.style.left = '20px';
-        if (navigation) classLegend2.style.left = '20px';
+        // if (navigation) tool.style.right = '20px';
+        // if (navigation) changeMap.style.right = '20px';
+        // if (navigation) legendBox.style.right = '20px';
+        // if (navigation) tuli.style.right = '20px';
+        // if (navigation) classLegend.style.left = '20px';
+        // if (navigation) classLegend2.style.left = '20px';
 
       }
     };
@@ -536,23 +534,23 @@ export default defineComponent({
       this.infoShow = true;
       if (this.mapStore.sideMenu) {
         if (i == '初始范围') {
-          this.px = ' right: 500px;top: 540px;';
+          this.px = ` right: ${this.windowRight+50}px;top: 540px;`;
         } else if (i == '图层控制') {
-          this.px = ' right: 500px;top: 570px;';
+          this.px = ` right: ${this.windowRight+50}px;top: 570px;`;
         } else if (i == '底图切换') {
-          this.px = ' right: 500px;top: 600px;';
+          this.px = ` right: ${this.windowRight+50}px;top: 600px;`;
         } else if (i == '距离测量') {
-          this.px = ' right: 500px;top: 630px;';
+          this.px = ` right: ${this.windowRight+50}px;top: 630px;`;
         } else if (i == '面积测量') {
-          this.px = ' right: 500px;top: 660px;';
+          this.px = ` right: ${this.windowRight+50}px;top: 660px;`;
         } else if (i == '截图') {
-          this.px = ' right: 500px;top: 690px;';
+          this.px = ` right: ${this.windowRight+50}px;top: 690px;`;
         } else if (i == '收藏') {
-          this.px = ' right: 500px;top: 710px;';
+          this.px = ` right: ${this.windowRight+50}px;top: 710px;`;
         } else if (i == '面板收起') {
-          this.px = ' right: 500px;top: 750px;';
+          this.px = ` right: ${this.windowRight+50}px;top: 750px;`;
         } else if (i == '重要测站监测信息') {
-          this.px = ' right: 500px;top: 730px;';
+          this.px = ` right: ${this.windowRight+50}px;top: 730px;`;
         }
       } else {
         if (i == '初始范围') {