[update 拆分详情树节点排序] 拖拽后保留上次展开节点
This commit is contained in:
@@ -231,7 +231,9 @@ export default {
|
|||||||
const treeData = res.result || []
|
const treeData = res.result || []
|
||||||
treeData.forEach(node => this.addTitleToNodes(node))
|
treeData.forEach(node => this.addTitleToNodes(node))
|
||||||
this.treeData = treeData
|
this.treeData = treeData
|
||||||
this.expandedKeys = this.treeData.length > 0 ? [this.treeData[0].id] : []
|
if (this.treeData.length > 0 && this.expandedKeys <= 0) {
|
||||||
|
this.expandedKeys = [this.treeData[0].id]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}).finally(() => {
|
}).finally(() => {
|
||||||
this.confirmLoading = false
|
this.confirmLoading = false
|
||||||
@@ -249,6 +251,7 @@ export default {
|
|||||||
this.$emit('close')
|
this.$emit('close')
|
||||||
this.model = {}
|
this.model = {}
|
||||||
this.treeData = []
|
this.treeData = []
|
||||||
|
this.expandedKeys = []
|
||||||
this.visible = false
|
this.visible = false
|
||||||
},
|
},
|
||||||
handleCancel () {
|
handleCancel () {
|
||||||
|
|||||||
Reference in New Issue
Block a user