|
@@ -470,22 +470,23 @@ export default {
|
|
|
.then((res) => {
|
|
|
this.loading = false;
|
|
|
this.handleData(res, 0);
|
|
|
- this.treeData = JSON.parse(JSON.stringify(res.nodes));
|
|
|
- this.oldLists = JSON.parse(JSON.stringify(res.nodes));
|
|
|
- this.changeTreeData(res.nodes);
|
|
|
+ let nodesData = res.nodes ? res.nodes : []
|
|
|
+ this.treeData = JSON.parse(JSON.stringify(nodesData));
|
|
|
+ this.oldLists = JSON.parse(JSON.stringify(nodesData));
|
|
|
+ this.changeTreeData(nodesData);
|
|
|
|
|
|
_this.$nextTick(() => {
|
|
|
_this.foldAll();
|
|
|
if (this.type) {
|
|
|
this.curINdexArr = this.curIndex.split("-");
|
|
|
this.handleFold(res, 0);
|
|
|
- this.treeData = JSON.parse(JSON.stringify(res.nodes));
|
|
|
- this.changeTreeData(res.nodes);
|
|
|
+ this.treeData = JSON.parse(JSON.stringify(nodesData));
|
|
|
+ this.changeTreeData(nodesData);
|
|
|
} else if (this.bookLevel) {
|
|
|
this.curINdexArr = this.bookLevel.split("-");
|
|
|
this.handleFold(res, 0);
|
|
|
- this.treeData = JSON.parse(JSON.stringify(res.nodes));
|
|
|
- this.changeTreeData(res.nodes);
|
|
|
+ this.treeData = JSON.parse(JSON.stringify(nodesData));
|
|
|
+ this.changeTreeData(nodesData);
|
|
|
}
|
|
|
});
|
|
|
})
|
|
@@ -559,8 +560,10 @@ export default {
|
|
|
type: "success",
|
|
|
message: "删除成功!",
|
|
|
});
|
|
|
- this.activeIndex = "";
|
|
|
- this.emptyQustion();
|
|
|
+ if(this.currentTreeID==data.id){
|
|
|
+ this.activeIndex = "";
|
|
|
+ this.emptyQustion();
|
|
|
+ }
|
|
|
})
|
|
|
.catch(() => {
|
|
|
this.loading = false;
|