From 8a82006a0b181eb18eefd9dea7b7448d72f9131c Mon Sep 17 00:00:00 2001 From: fanxb Date: Fri, 31 Jan 2020 00:55:10 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E4=BF=AE=E5=A4=8Dweb=E7=AB=AF=E6=A0=B9?= =?UTF-8?q?=E8=8A=82=E7=82=B9=E6=95=B0=E6=8D=AE=E6=97=A0=E6=B3=95=E5=88=A0?= =?UTF-8?q?=E9=99=A4bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- front/src/pages/manage/OverView/function.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/front/src/pages/manage/OverView/function.js b/front/src/pages/manage/OverView/function.js index 9e6cd0f..1ff5ffc 100644 --- a/front/src/pages/manage/OverView/function.js +++ b/front/src/pages/manage/OverView/function.js @@ -168,7 +168,12 @@ function deleteBookmark(nodeList) { .then(() => { //遍历节点树数据,并删除 deleteNodes(dataNodeList); - // deleteTreeData(treeData, set); + //删除根节点下的数据 + dataNodeList + .filter(item => item.path === "") + .forEach(item => { + treeData.splice(treeData.indexOf(item), 1); + }); changeCheckedKeys([], null); updateTreeData([...treeData]); resolve(); @@ -191,7 +196,7 @@ export async function onDrop(info) { return; } this.setState({ isLoading: true }); - let body =await moveNode(info); + let body = await moveNode(info); //目标未加载且当前节点为已经展开的目录情况下需要把当前节点从已加载列表中移除,否则在目标节点中展开时会不显示当前节点的子节点 let index = loadedKeys.indexOf(body.bookmarkId.toString()); if (index > -1) {