[update 拆分详情树节点排序] 拖拽后保留上次展开节点

This commit is contained in:
danshihao
2024-09-11 12:01:49 +08:00
parent cc546eb289
commit 1fe97251df
@@ -231,7 +231,9 @@ export default {
const treeData = res.result || []
treeData.forEach(node => this.addTitleToNodes(node))
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(() => {
this.confirmLoading = false
@@ -249,6 +251,7 @@ export default {
this.$emit('close')
this.model = {}
this.treeData = []
this.expandedKeys = []
this.visible = false
},
handleCancel () {