NEZ-2865 fix:chart-Group 内部chart移动时 chart-Group高度计算错误 导致dashboard错位

This commit is contained in:
zhangyu
2023-06-09 14:03:16 +08:00
parent 5f8fb7ea50
commit a5f72d69e7

View File

@@ -129,25 +129,19 @@ export function isTopology (type) {
export function getGroupHeight (arr) {
if (arr.length) {
let lastItem = []
let maxY = arr[0].y
let maxY = arr[0].y + arr[0].height
arr.forEach((children, index) => {
if (maxY == children.y) {
if (maxY == (children.y + children.height)) {
lastItem.push(children)
} else if (maxY < children.y) {
maxY = children.y
} else if (maxY < (children.y + children.height)) {
maxY = children.y + children.height
lastItem = [children]
}
})
let maxHeight = 0
lastItem.forEach(last => {
if (maxHeight < last.height) {
maxHeight = last.height
}
})
if (maxY < 0) {
maxY = 0
}
return maxHeight + maxY
return maxY
} else {
return 1
}