Feat:将节点实例的isParent方法改名为isAncestor
This commit is contained in:
parent
6723250266
commit
d32588763c
@ -903,7 +903,7 @@ class Node {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 检测当前节点是否是某个节点的祖先节点
|
// 检测当前节点是否是某个节点的祖先节点
|
||||||
isParent(node) {
|
isAncestor(node) {
|
||||||
if (this.uid === node.uid) {
|
if (this.uid === node.uid) {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|||||||
@ -677,7 +677,7 @@ class Drag extends Base {
|
|||||||
// 检查某个节点是否在被拖拽节点内
|
// 检查某个节点是否在被拖拽节点内
|
||||||
checkIsInBeingDragNodeList(node) {
|
checkIsInBeingDragNodeList(node) {
|
||||||
return !!this.beingDragNodeList.find(item => {
|
return !!this.beingDragNodeList.find(item => {
|
||||||
return item.uid === node.uid || item.isParent(node)
|
return item.uid === node.uid || item.isAncestor(node)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -713,7 +713,7 @@ export const getTopAncestorsFomNodeList = list => {
|
|||||||
list.forEach(node => {
|
list.forEach(node => {
|
||||||
if (
|
if (
|
||||||
!list.find(item => {
|
!list.find(item => {
|
||||||
return item.uid !== node.uid && item.isParent(node)
|
return item.uid !== node.uid && item.isAncestor(node)
|
||||||
})
|
})
|
||||||
) {
|
) {
|
||||||
res.push(node)
|
res.push(node)
|
||||||
@ -728,7 +728,7 @@ export const checkHasSupSubRelation = list => {
|
|||||||
const cur = list[i]
|
const cur = list[i]
|
||||||
if (
|
if (
|
||||||
list.find(item => {
|
list.find(item => {
|
||||||
return item.uid !== cur.uid && cur.isParent(item)
|
return item.uid !== cur.uid && cur.isAncestor(item)
|
||||||
})
|
})
|
||||||
) {
|
) {
|
||||||
return true
|
return true
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user