fix:清除拓扑绑定事件
This commit is contained in:
@@ -282,6 +282,9 @@ export default {
|
|||||||
mounted () {
|
mounted () {
|
||||||
this.colorList = initColor(20)
|
this.colorList = initColor(20)
|
||||||
this.chartInfo.loaded && this.initChart()
|
this.chartInfo.loaded && this.initChart()
|
||||||
|
},
|
||||||
|
beforeDestroy () {
|
||||||
|
d3.select(`#bubble-svg-${this.chartId}`).selectAll('g').remove() // 清空作图区域
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -372,6 +372,9 @@ export default {
|
|||||||
mounted () {
|
mounted () {
|
||||||
this.colorList = initColor(20)
|
this.colorList = initColor(20)
|
||||||
this.chartInfo.loaded && this.initChart(true)
|
this.chartInfo.loaded && this.initChart(true)
|
||||||
|
},
|
||||||
|
beforeDestroy () {
|
||||||
|
d3.select(`#funnel-svg-${this.chartId}`).selectAll('g').remove() // 清空作图区域
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -294,6 +294,9 @@ export default {
|
|||||||
mounted () {
|
mounted () {
|
||||||
this.colorList = initColor(20)
|
this.colorList = initColor(20)
|
||||||
this.chartInfo.loaded && this.initChart()
|
this.chartInfo.loaded && this.initChart()
|
||||||
|
},
|
||||||
|
beforeDestroy () {
|
||||||
|
d3.select(`#rank-svg-${this.chartId}`).selectAll('g').remove() // 清空作图区域
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -136,8 +136,7 @@ export default {
|
|||||||
|
|
||||||
drawSankeyChart () {
|
drawSankeyChart () {
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
// 清空作图区域
|
d3.select(`#sankey-svg-${this.chartId}`).selectAll('g').remove() // 清空作图区域
|
||||||
d3.select(`#sankey-svg-${this.chartId}`).selectAll('g').remove()
|
|
||||||
|
|
||||||
// 获取svg宽高 初始化画布
|
// 获取svg宽高 初始化画布
|
||||||
const svgDom = document.getElementById(`sankey-svg-${this.chartId}`)
|
const svgDom = document.getElementById(`sankey-svg-${this.chartId}`)
|
||||||
@@ -395,6 +394,9 @@ export default {
|
|||||||
mounted () {
|
mounted () {
|
||||||
this.colorList = initColor(20)
|
this.colorList = initColor(20)
|
||||||
this.chartInfo.loaded && this.initChart()
|
this.chartInfo.loaded && this.initChart()
|
||||||
|
},
|
||||||
|
beforeDestroy () {
|
||||||
|
d3.select(`#sankey-svg-${this.chartId}`).selectAll('g').remove() // 清空作图区域
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -190,12 +190,22 @@ export default {
|
|||||||
},
|
},
|
||||||
beforeDestroy () {
|
beforeDestroy () {
|
||||||
if (getTopology(this.meta2dId)) {
|
if (getTopology(this.meta2dId)) {
|
||||||
getTopology(this.meta2dId).clear()
|
getTopology(this.meta2dId).off('translate', this.topTranslate) // 平移·
|
||||||
|
getTopology(this.meta2dId).off('scale', this.topoScale) // 缩放·
|
||||||
|
getTopology(this.meta2dId).off('active', this.pensActive) // 选中·
|
||||||
|
getTopology(this.meta2dId).off('translatePens', () => {}) // 移动画笔结束·
|
||||||
|
getTopology(this.meta2dId).off('translatingPens', () => {}) // 移动画笔进行中·
|
||||||
|
getTopology(this.meta2dId).off('enter', this.penEnter) // 移入画笔·
|
||||||
|
getTopology(this.meta2dId).off('leave', this.penLeave) // 移出画笔·
|
||||||
|
getTopology(this.meta2dId).off('add', this.appPen) // 添加新画笔·
|
||||||
|
getTopology(this.meta2dId).off('click', this.topoClick) // click画笔·
|
||||||
|
getTopology(this.meta2dId).destroy()
|
||||||
setTopology(this.meta2dId, null)
|
setTopology(this.meta2dId, null)
|
||||||
}
|
}
|
||||||
bus.$off('changeSelectPens', this.pensActive)
|
bus.$off('changeSelectPens', this.pensActive)
|
||||||
this.$refs.meta2dBox.removeEventListener('mousemove', this.mousemove)
|
this.$refs.meta2dBox.removeEventListener('mousemove', this.mousemove)
|
||||||
this.$refs.meta2dBox.removeEventListener('mouseup', this.mouseup)
|
this.$refs.meta2dBox.removeEventListener('mouseup', this.mouseup)
|
||||||
|
window.removeEventListener('click', this.contextmenuNone)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user