Commit 65e7da60 by zhaochengxiang

自定义目录下的子目录不允许删除

parent c43d74d3
......@@ -589,10 +589,10 @@ const AssetTree = (props) => {
);
if (item.children) {
return { ...item, ...{title, key: item.nodeId, children: loop(item.children, false)} };
return { ...item, ...{title, key: item.nodeId, children: loop(item.children, false), isRootLeaf} };
}
return { ...item, ...{ title, key: item.nodeId }};
return { ...item, ...{ title, key: item.nodeId, isRootLeaf }};
});
const classes = classNames('asset-tree', className, {
......@@ -672,6 +672,7 @@ const AssetTree = (props) => {
checkStrictly
onRightClick={({event, node}) => {
if (reference === AssetManageReference) {
console.log('node', node);
setCurrentRightClickDir(node);
displayMenu(event);
}
......@@ -706,11 +707,12 @@ const AssetTree = (props) => {
</RcItem>
<RcItem id="down" onClick={() => { moveNode(-1); }}>
下移目录
</RcItem>
<RcItem id="delete" onClick={deleteDir}>
删除目录
</RcItem>
{
currentRightClickDir && (currentRightClickDir.type!=='custom'||(currentRightClickDir.type==='custom'&&currentRightClickDir.isRootLeaf)) && <RcItem id="delete" onClick={deleteDir}>
删除目录
</RcItem>
}
</RcMenu>
}
{contextHolder}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment