xieqy 3 years ago
parent
commit
849891f458

+ 21 - 13
src/views/groupPage/baseMap/components/EchartsMap.vue

@@ -38,7 +38,10 @@ export default {
       domImg: null, //地图背景图片
       //
       backShow: false,
-      clickPermissions: false
+      clickPermissions: false,
+
+      //防抖
+      timeout: null
     }
   },
   computed: {
@@ -84,19 +87,25 @@ export default {
     resizeChart() {
       //图表大小自适应
       window.addEventListener('resize', () => {
-        setTimeout(() => {
+        this.debounce(() => {
           this.getData()
         }, 1000)
       })
     },
+    debounce(fn, wait) {
+      if (this.timeout !== null) clearTimeout(this.timeout)
+      this.timeout = setTimeout(fn, wait)
+    },
     getData() {
-      this.destroyChart()
-      // if(this.groupAttr!==true){
-      //     this.showWorkArea()
-      // }else{
-      //   this.composeScanInfo(this.groupInfoData)
-      // }
-      this.composeScanInfo(this.groupData)
+      this.debounce(() => {
+        this.destroyChart()
+        // if(this.groupAttr!==true){
+        //     this.showWorkArea()
+        // }else{
+        //   this.composeScanInfo(this.groupInfoData)
+        // }
+        this.composeScanInfo(this.groupData)
+      }, 1000)
     },
     /**
      * 项目信息模块
@@ -519,8 +528,7 @@ export default {
       domImg.crossOrigin = 'anonymous'
       domImg.src = require('@/views/groupPage/images/mapbj.png')
       setTimeout(() => {
-        // mapInit()
-        domImg.onload = mapInit()
+        domImg.onload = mapInitialize()
       }, 1000)
       function tooltipCustom(toolTipSource) {
         if (!toolTipSource) {
@@ -566,7 +574,7 @@ export default {
         center: [that.offset, 0, 0]
       }
       var option
-      let mapInit = () => {
+      let mapInitialize = () => {
         echarts.registerMap('riverBasin', this.mapname)
         this.groupChart.hideLoading()
         //地图背景图
@@ -707,7 +715,7 @@ export default {
             }
           ]
         }
-        this.groupChart.resize()
+        // this.groupChart.resize()
         this.groupChart.setOption(option, {
           notMerge: true
         })

+ 3 - 3
src/views/groupPage/baseMap/components/ProjectMap.vue

@@ -31,6 +31,9 @@ export default {
             this.addToMap()
           })
         })
+      } else {
+        window.viewer = null
+        this.$store.state.bigScreen.isInitViewer = false
       }
     }
   },
@@ -285,9 +288,6 @@ export default {
           break
       }
     }
-  },
-  destroyed() {
-    window.viewer = null
   }
 }
 </script>

+ 3 - 2
src/views/groupPage/components/BatteryChart/ComBatteryChart.vue

@@ -45,12 +45,13 @@ export default {
             color: '#01D8E2'
           },
           right: '10%',
-          bottom: '25%'
+          bottom: '10%'
         },
         grid: {
           top: '15%',
           left: '5%',
-          right: '10%'
+          right: '10%',
+          bottom: '15%'
         },
         xAxis: [{ show: false }, { show: false }],
         yAxis: [

+ 1 - 1
src/views/groupPage/districtPageModules/customTools/viewManagement.vue

@@ -53,7 +53,7 @@ export default class viewManagement extends Vue {
     return this.$store.state.bigScreen.isInitViewer
   }
   @Watch('isInitViewer')
-  onChangeViewerMethod() {
+  onChangeViewerMethod(val) {
     this.viewer = (window as any).viewer
   }
   //漫游数据

+ 4 - 4
src/views/groupPage/groupPageModules/ContractInfo.vue

@@ -270,13 +270,10 @@ export default {
     width: 100%;
     height: calc(100% - 0.166667rem);
     overflow: auto;
-    padding: 2px;
     font-family: Source Han Sans CN-MEDIUM;
     .content-item {
       width: 100%;
       height: 33%;
-      float: left;
-      overflow: hidden;
       .title {
         width: 100%;
         display: flex;
@@ -305,14 +302,16 @@ export default {
         width: 100%;
         display: flex;
         .chart-container {
+          height: 100%;
           width: 50%;
+          position: relative;
           .chart-title {
             position: absolute;
             left: 0.234375rem /* 45/192 */;
             font-size: 0.083333rem /* 16/192 */;
             font-family: Source Han Sans CN;
             font-weight: bold;
-            top: 0.520833rem /* 100/192 */;
+            top: 0.104167rem /* 20/192 */;
             color: #ffffff;
           }
           .bg {
@@ -373,6 +372,7 @@ export default {
       .epc {
         background: rgba(14, 167, 255, 0.08);
         margin-top: 0.15625rem /* 30/192 */;
+        height: calc(100% - 0.390625rem /* 75/192 */);
       }
     }
   }

+ 0 - 1
src/views/groupPage/groupPageModules/ProjectInfo.vue

@@ -294,7 +294,6 @@ export default {
     width: 100%;
     height: calc(100% - 0.166667rem);
     overflow: auto;
-    padding: 2px;
     .content-item {
       font-family: Source Han Sans CN-Medium;
       width: 100%;