优化组织结构图逻辑
This commit is contained in:
parent
e561e804be
commit
bb68575aca
@ -87,11 +87,11 @@ class CatalogOrganization extends Base {
|
|||||||
totalLeft += cur.width + marginX
|
totalLeft += cur.width + marginX
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
let totalTop = node.top + node.height + marginY + node.expandBtnSize
|
let totalTop = node.top + node.height + marginY + (this.getNodeActChildrenLength(node) > 0 ? node.expandBtnSize : 0)
|
||||||
node.children.forEach(cur => {
|
node.children.forEach(cur => {
|
||||||
cur.left = node.left + node.width * 0.5
|
cur.left = node.left + node.width * 0.5
|
||||||
cur.top = totalTop
|
cur.top = totalTop
|
||||||
totalTop += cur.height + marginY + node.expandBtnSize
|
totalTop += cur.height + marginY + (this.getNodeActChildrenLength(cur) > 0 ? cur.expandBtnSize : 0)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -124,10 +124,9 @@ class CatalogOrganization extends Base {
|
|||||||
let marginY = this.getMarginY(layerIndex + 1)
|
let marginY = this.getMarginY(layerIndex + 1)
|
||||||
let totalHeight =
|
let totalHeight =
|
||||||
node.children.reduce((h, item) => {
|
node.children.reduce((h, item) => {
|
||||||
return h + item.height
|
return h + item.height + (this.getNodeActChildrenLength(item) > 0 ? item.expandBtnSize : 0)
|
||||||
}, 0) +
|
}, 0) +
|
||||||
(len + 1) * marginY +
|
(len + 1) * marginY
|
||||||
len * node.expandBtnSize
|
|
||||||
this.updateBrothersTop(node, totalHeight)
|
this.updateBrothersTop(node, totalHeight)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user