Merge branch 'dev-3.5' of https://git.mesalab.cn/nezha/nezha-fronted into dev-3.6
This commit is contained in:
@@ -135,25 +135,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
|
||||
}
|
||||
|
||||
@@ -270,7 +270,7 @@ export default {
|
||||
const length = this.object.name.length - 64
|
||||
this.object.name = u.name.substring(0, u.name.length - length) + '-copy'
|
||||
}
|
||||
if (this.object.type !== 'group') {
|
||||
if (this.object.type !== 'group' && this.object.elements) {
|
||||
this.object.elements = this.object.elements.map(item => {
|
||||
item.id = ''
|
||||
return item
|
||||
|
||||
Reference in New Issue
Block a user