forked from github/dataease
Merge pull request #4352 from dataease/pr@dev@refactor_tree-map-scroll
refactor(视图): Echarts矩形树图支持获取焦点再滚动
This commit is contained in:
commit
b1dadbcf1e
@ -1021,6 +1021,7 @@ export const BASE_TREEMAP = {
|
|||||||
{
|
{
|
||||||
// name: '',
|
// name: '',
|
||||||
type: 'treemap',
|
type: 'treemap',
|
||||||
|
roam: true,
|
||||||
itemStyle: {
|
itemStyle: {
|
||||||
gapWidth: 2
|
gapWidth: 2
|
||||||
},
|
},
|
||||||
|
@ -128,6 +128,7 @@ export default {
|
|||||||
showSuspension: true,
|
showSuspension: true,
|
||||||
currentSeriesId: null,
|
currentSeriesId: null,
|
||||||
haveScrollType: [
|
haveScrollType: [
|
||||||
|
'treemap',
|
||||||
'map',
|
'map',
|
||||||
'chart-mix',
|
'chart-mix',
|
||||||
'bar',
|
'bar',
|
||||||
@ -198,8 +199,14 @@ export default {
|
|||||||
if (this.haveScrollType.includes(this.chart.type)) {
|
if (this.haveScrollType.includes(this.chart.type)) {
|
||||||
const opt = this.myChart.getOption()
|
const opt = this.myChart.getOption()
|
||||||
this.adaptorOpt(opt)
|
this.adaptorOpt(opt)
|
||||||
|
if (this.chart.type === 'treemap') {
|
||||||
|
this.myChart.dispose()
|
||||||
|
this.myChart = null
|
||||||
|
this.preDraw()
|
||||||
|
} else {
|
||||||
this.myChart.setOption(opt)
|
this.myChart.setOption(opt)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
adaptorOpt(opt) {
|
adaptorOpt(opt) {
|
||||||
const disabledStatus = !this.active
|
const disabledStatus = !this.active
|
||||||
@ -218,6 +225,10 @@ export default {
|
|||||||
opt.geo.roam = this.active
|
opt.geo.roam = this.active
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
//矩形树图
|
||||||
|
if (this.chart.type === 'treemap' && opt.series) {
|
||||||
|
opt.series[0].roam = this.active
|
||||||
|
}
|
||||||
},
|
},
|
||||||
changeSeriesId(param) {
|
changeSeriesId(param) {
|
||||||
const { id, seriesId } = param
|
const { id, seriesId } = param
|
||||||
|
Loading…
Reference in New Issue
Block a user