fix: 图表重复点击tab坍缩问题
This commit is contained in:
@@ -375,13 +375,11 @@ export default {
|
||||
if (this.myChart) {
|
||||
this.myChart.dispose()
|
||||
}
|
||||
this.myChart = echarts.init(dom)
|
||||
} else {
|
||||
dom = document.getElementById('link-traffic-sankey-1')
|
||||
if (this.myChart2) {
|
||||
this.myChart2.dispose()
|
||||
}
|
||||
this.myChart2 = echarts.init(dom)
|
||||
}
|
||||
this.chartOption = this.$_.cloneDeep(linksTrafficSankeyOption)
|
||||
this.chartOption.tooltip.formatter = function (param) {
|
||||
@@ -413,11 +411,15 @@ export default {
|
||||
}
|
||||
this.chartOption.series[0].data = data
|
||||
this.chartOption.series[0].links = links
|
||||
this.$nextTick(() => {
|
||||
if (tab === 0) {
|
||||
this.myChart = echarts.init(dom)
|
||||
this.myChart.setOption(this.chartOption)
|
||||
} else {
|
||||
this.myChart2 = echarts.init(dom)
|
||||
this.myChart2.setOption(this.chartOption)
|
||||
}
|
||||
})
|
||||
},
|
||||
resize () {
|
||||
if (this.tab === 0) {
|
||||
|
||||
@@ -388,12 +388,9 @@ export default {
|
||||
// 此处为验证是否因dom未销毁,导致图表出错,后续可能会改
|
||||
let dom = null
|
||||
dom = document.getElementById('overviewLineChart')
|
||||
// this.myChart = null
|
||||
if (this.myChart) {
|
||||
this.myChart.dispose()
|
||||
this.myChart = null
|
||||
}
|
||||
this.myChart = echarts.init(dom)
|
||||
this.chartOption = stackedLineChartOption
|
||||
const chartOption = this.chartOption.series[0]
|
||||
this.chartOption.series = echartsData.map((t, i) => {
|
||||
@@ -491,8 +488,9 @@ export default {
|
||||
return str
|
||||
}
|
||||
this.showMarkLine = true
|
||||
this.$nextTick(() => {
|
||||
this.myChart = echarts.init(dom)
|
||||
this.myChart.setOption(this.chartOption)
|
||||
|
||||
// 设置参见官网:https://echarts.apache.org/zh/api.html#action.brush.brush
|
||||
this.myChart.dispatchAction({
|
||||
// 刷选模式的开关。使用此 action 可将当前鼠标变为可刷选状态。事实上,点击 toolbox 中的 brush 按钮时,就是通过这个 action,将当前普通鼠标变为刷选器的。
|
||||
@@ -538,6 +536,7 @@ export default {
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
activeChange (item, index) {
|
||||
if (this.isNoData) return
|
||||
|
||||
Reference in New Issue
Block a user