fix: 修改默认折叠 block 高度不对的问题

This commit is contained in:
zhangyu
2022-02-15 10:39:16 +08:00
parent f9285b8a6f
commit 0b5531a342
2 changed files with 21 additions and 1 deletions

View File

@@ -134,7 +134,6 @@ export default {
this.emitter.emit('groupParentCalcHeight', { chart, childrenList: this.copyDataList })
},
groupParentCalcHeight (chart, childrenList) {
// console.log(chart, childrenList)
setTimeout(() => {
const parent = this.copyDataList.find(chartitem => chartitem.id === chart.parent.id)
const children = parent.children.find(item => item.id === chart.id)
@@ -192,6 +191,26 @@ export default {
setTimeout(() => {
this.gridLayoutShow = true
})
setTimeout(() => {
this.copyDataList.forEach(item => {
// if (item.type === 95) {
// console.log(item.h, item.name)
// item.children.forEach(children => {
// console.log(children.name, children.h, children.y)
// })
// let parentH = 1.5
// parentH += getGroupHeight(item.children)
// if (parentH !== item.h) {
// item.h = parentH
// }
// }
if (item.type === 94 && !item.firstShow) {
item.firstShow = true
this.copyDataList = [...this.copyDataList]
this.emitter.emit('groupParentCalcHeight', { chart: item, childrenList: this.copyDataList })
}
})
}, 200)
this.gridLayoutLoading = false
})
}