fix:修改group内最大y计算错误的问题 以及 group内的移动未被保存的问题

This commit is contained in:
zhangyu
2021-12-14 16:16:38 +08:00
parent ea0a841aa7
commit 310a2c565e
2 changed files with 8 additions and 4 deletions

View File

@@ -93,7 +93,7 @@ export function getGroupHeight (arr) {
arr.forEach((children, index) => {
if (maxY == children.y) {
lastItem.push(children)
} else {
} else if (maxY < children.y) {
maxY = children.y
lastItem = [children]
}

View File

@@ -184,12 +184,16 @@ export default {
},
changeGroupHeight (copyList, group, flag) {
const height = getGroupHeight(copyList)
console.log(copyList, group, flag)
// console.log(height,copyList, group, flag)
// console.log(this.$refs.layout)
const groupFind = this.copyDataList.find(item => item.id === group.id)
const groupFind = this.copyDataList.find(item => item.id == group.id)
const groupFindndex = this.copyDataList.find(item => item.id == group.id)
console.log(groupFind)
if (group) {
groupFind.height = groupFind.h = height + this.headerHPadding
groupFind.children = copyList
this.copyDataList = [...this.copyDataList]
console.log(this.copyDataList)
}
if (flag) {
this.copyDataList = [...this.copyDataList]
@@ -243,7 +247,7 @@ export default {
panelId: this.panelId,
charts: charts
}
console.log(this.copyDataList)
// console.log(this.copyDataList)
this.$put('/visual/panel/chart/weights', params)
}, 200)
}