|
@ -189,12 +189,17 @@ export default { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
getMinMapLayers(); |
|
|
getMinMapLayers(); |
|
|
|
|
|
this.$root.$on('delete-event', this.handleRefresh); |
|
|
|
|
|
|
|
|
}, |
|
|
}, |
|
|
beforeDestroy() { |
|
|
beforeDestroy() { |
|
|
this.emitter.off("selectedCompleted", this.selectedCompletedHandle); |
|
|
this.emitter.off("selectedCompleted", this.selectedCompletedHandle); |
|
|
Object.keys(lngLatMap).forEach(key => delete lngLatMap[key]); |
|
|
Object.keys(lngLatMap).forEach(key => delete lngLatMap[key]); |
|
|
markerClusterIns.clear(); |
|
|
markerClusterIns.clear(); |
|
|
window.renderData = undefined; |
|
|
window.renderData = undefined; |
|
|
|
|
|
|
|
|
|
|
|
this.$root.$off('delete-event', this.handleRefresh); |
|
|
|
|
|
|
|
|
}, |
|
|
}, |
|
|
methods: { |
|
|
methods: { |
|
|
selectedCompletedHandle(item) { |
|
|
selectedCompletedHandle(item) { |
|
@ -262,19 +267,21 @@ export default { |
|
|
handleDevice: debounce(async function (item) { |
|
|
handleDevice: debounce(async function (item) { |
|
|
await this.handleDeviceImmediate(item); |
|
|
await this.handleDeviceImmediate(item); |
|
|
}, 360), |
|
|
}, 360), |
|
|
handleRefresh(){ |
|
|
async handleRefresh(){ |
|
|
// 先清空图层 |
|
|
const tab = _.filter(this.tabContentData,{status:'_active'}) |
|
|
const { mapIns } = this.getMap(); |
|
|
try{ |
|
|
console.log(mapIns.getLayers(),'-----') |
|
|
this.handleCleared(); |
|
|
mapIns.getLayers().forEach((layer, index) => index > this.minLayers && mapIns.remove(layer)) |
|
|
} catch(e){ |
|
|
|
|
|
} |
|
|
|
|
|
tab.forEach(async item=>{ |
|
|
|
|
|
await this.handleDeviceImmediate(item); |
|
|
|
|
|
}) |
|
|
}, |
|
|
}, |
|
|
handleCleared() { |
|
|
handleCleared() { |
|
|
const { mapIns } = this.getMap(); |
|
|
const { mapIns } = this.getMap(); |
|
|
|
|
|
|
|
|
this.layerData.forEach(({ children }) => { |
|
|
this.layerData.forEach(({ children }) => { |
|
|
children.forEach(item => item.status = "") |
|
|
children.forEach(item => item.status = "") |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
if (!mapIns) return; |
|
|
if (!mapIns) return; |
|
|
|
|
|
|
|
|
for (const key in cacheRemoveFunc) { |
|
|
for (const key in cacheRemoveFunc) { |
|
|