Commit 2985cb97 by zhaochengxiang

自定义目录 level=2时 允许删除

parent a3af38fb
......@@ -633,7 +633,7 @@ const AssetManageTree = (props) => {
</Menu>
);
const loop = (data, rootResourceType = null, isRoot = true) =>
const loop = (data, rootResourceType = null) =>
data.map(item => {
if (item.level === 1) {
......@@ -642,7 +642,7 @@ const AssetManageTree = (props) => {
const title = (
<span
className={isRoot?'title-color': 'text-color'}
className={(item.level===1)?'title-color': 'text-color'}
>
{item.text}
{
......@@ -652,14 +652,14 @@ const AssetManageTree = (props) => {
);
if (item.children && item.children.length>0) {
return { ...item, ...{title, key: item.nodeId, children: loop(item.children, rootResourceType, false), isRoot} };
return { ...item, ...{title, key: item.nodeId, children: loop(item.children, rootResourceType, false)} };
}
if (rootResourceType !== 'custom') {
return { ...item, ...{ title, key: item.nodeId, isRoot, isLeaf: true }};
return { ...item, ...{ title, key: item.nodeId, isLeaf: true }};
}
return { ...item, ...{ title, key: item.nodeId, isRoot, children: null}};
return { ...item, ...{ title, key: item.nodeId, children: null}};
});
const classes = classNames('asset-tree', className, {
......@@ -780,7 +780,7 @@ const AssetManageTree = (props) => {
下移目录
</RcItem>
{
currentRightClickDir && (currentRightClickDir.type!=='custom'||(currentRightClickDir.type==='custom'&&currentRightClickDir.isRoot)) && <RcItem id="delete" onClick={deleteDir}>
currentRightClickDir && (currentRightClickDir.type!=='custom'||(currentRightClickDir.type==='custom'&&currentRightClickDir.level===2)) && <RcItem id="delete" onClick={deleteDir}>
删除目录
</RcItem>
}
......
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