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

@@ -114,6 +114,7 @@ export default {
}, },
recursionParamsConvert (chart) { recursionParamsConvert (chart) {
chart.params = chart.params ? JSON.parse(chart.params) : {} chart.params = chart.params ? JSON.parse(chart.params) : {}
chart.firstShow = false
if (chart.type === 94) { if (chart.type === 94) {
chart.oldH = chart.h chart.oldH = chart.h
/* chart.params = { /* chart.params = {

View File

@@ -134,7 +134,6 @@ export default {
this.emitter.emit('groupParentCalcHeight', { chart, childrenList: this.copyDataList }) this.emitter.emit('groupParentCalcHeight', { chart, childrenList: this.copyDataList })
}, },
groupParentCalcHeight (chart, childrenList) { groupParentCalcHeight (chart, childrenList) {
// console.log(chart, childrenList)
setTimeout(() => { setTimeout(() => {
const parent = this.copyDataList.find(chartitem => chartitem.id === chart.parent.id) const parent = this.copyDataList.find(chartitem => chartitem.id === chart.parent.id)
const children = parent.children.find(item => item.id === chart.id) const children = parent.children.find(item => item.id === chart.id)
@@ -192,6 +191,26 @@ export default {
setTimeout(() => { setTimeout(() => {
this.gridLayoutShow = true 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 this.gridLayoutLoading = false
}) })
} }