|
|
@@ -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
|
|
|
})
|