[update 拆分排序] 调整拖拽到内部,传最底层的最后一个节点的序号
This commit is contained in:
@@ -406,9 +406,15 @@ export default {
|
||||
const targetId = info.node.eventKey
|
||||
// 序号,拖拽到节点里面,就把序号设置成最后一个节点的序号
|
||||
let displaySeq = info.node.dataRef.displaySeq
|
||||
const children = info.node.dataRef.children || []
|
||||
let children = info.node.dataRef.children || []
|
||||
// 递归拿到最内层的最后一个节点的序号
|
||||
while (true) {
|
||||
if (children && children.length) {
|
||||
displaySeq = children[children.length - 1].displaySeq
|
||||
children = children[children.length - 1].children || []
|
||||
} else {
|
||||
break
|
||||
}
|
||||
}
|
||||
this.treeNodeSort({ sourceId, targetId, displaySeq })
|
||||
},
|
||||
|
||||
@@ -134,12 +134,19 @@ export default {
|
||||
const targetId = info.node.eventKey
|
||||
// 序号,拖拽到节点里面,就把序号设置成最后一个节点的序号
|
||||
let displaySeq = info.node.dataRef.displaySeq
|
||||
const children = info.node.dataRef.children || []
|
||||
let children = info.node.dataRef.children || []
|
||||
// 递归拿到最内层的最后一个节点的序号
|
||||
while (true) {
|
||||
if (children && children.length) {
|
||||
displaySeq = children[children.length - 1].displaySeq
|
||||
children = children[children.length - 1].children || []
|
||||
} else {
|
||||
break
|
||||
}
|
||||
}
|
||||
this.treeNodeSort({ sourceId, targetId, displaySeq })
|
||||
},
|
||||
|
||||
// 发请求
|
||||
treeNodeSort (params) {
|
||||
this.confirmLoading = true
|
||||
|
||||
Reference in New Issue
Block a user