Commit 65e7da60 by zhaochengxiang

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

parent c43d74d3
...@@ -589,10 +589,10 @@ const AssetTree = (props) => { ...@@ -589,10 +589,10 @@ const AssetTree = (props) => {
); );
if (item.children) { 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, { const classes = classNames('asset-tree', className, {
...@@ -672,6 +672,7 @@ const AssetTree = (props) => { ...@@ -672,6 +672,7 @@ const AssetTree = (props) => {
checkStrictly checkStrictly
onRightClick={({event, node}) => { onRightClick={({event, node}) => {
if (reference === AssetManageReference) { if (reference === AssetManageReference) {
console.log('node', node);
setCurrentRightClickDir(node); setCurrentRightClickDir(node);
displayMenu(event); displayMenu(event);
} }
...@@ -706,11 +707,12 @@ const AssetTree = (props) => { ...@@ -706,11 +707,12 @@ const AssetTree = (props) => {
</RcItem> </RcItem>
<RcItem id="down" onClick={() => { moveNode(-1); }}> <RcItem id="down" onClick={() => { moveNode(-1); }}>
下移目录 下移目录
</RcItem>
<RcItem id="delete" onClick={deleteDir}>
删除目录
</RcItem> </RcItem>
{
currentRightClickDir && (currentRightClickDir.type!=='custom'||(currentRightClickDir.type==='custom'&&currentRightClickDir.isRootLeaf)) && <RcItem id="delete" onClick={deleteDir}>
删除目录
</RcItem>
}
</RcMenu> </RcMenu>
} }
{contextHolder} {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