Commit 0bf01bc7 by zhaochengxiang

资产删除不要的回收站代码

parent e1fb04ff
......@@ -72,7 +72,6 @@ export class App extends React.Component {
reference='metadata'
readOnly={true}
showCustom={false}
showTrash={false}
checkable={true}
onCheck={(values) => {
callback&&callback(values);
......
......@@ -29,7 +29,7 @@ const AssetBrowse = (props) => {
return (
<div className={classes}>
<div className='left'>
<AssetTree onSelect={onTreeSelect} showTrash={false} readOnly {...props} />
<AssetTree onSelect={onTreeSelect} readOnly {...props} />
</div>
<div className='tree-toggle-wrap'>
<div className='tree-toggle' onClick={treeToggleClick}>
......
......@@ -13,7 +13,7 @@ import './AssetTree.less';
const AssetTree = (props) => {
const { readOnly = false, checkable = false, onSelect, className, onCheck, tableId, reference='', showCustom=true, showTrash=true } = props;
const { readOnly = false, checkable = false, onSelect, className, onCheck, tableId, reference='', showCustom=true } = props;
const [ keyword, setKeyword ] = useState('');
const [ loading, setLoading ] = useState(false);
const [ treeData, setTreeData ] = useState([]);
......@@ -96,9 +96,6 @@ const AssetTree = (props) => {
if (!showCustom) {
newData = (newData||[]).filter(item => item.type!=='custom');
}
if (!showTrash) {
newData = (newData||[]).filter(item => item.type!=='RecycleBin');
}
setTreeData(newData);
......@@ -238,7 +235,7 @@ const AssetTree = (props) => {
}
const addDir = () => {
if (currentDirType==='custom-root'||currentDirType==='custom'||currentDirType === 'RecycleBin') return;
if (currentDirType==='custom-root'||currentDirType==='custom') return;
setUpdateDirectoryAction('add');
setUpdateDirectoryModalVisible(true);
......@@ -246,8 +243,6 @@ const AssetTree = (props) => {
const editDir = () => {
if (currentDirType === 'RecycleBin') return;
if ((currentDirType||'') === '') {
setUpdateDirectoryAction('edit');
......@@ -266,7 +261,7 @@ const AssetTree = (props) => {
}
const importDir = () => {
if (currentDirType==='custom-root'||currentDirType==='custom'||currentDirType==='RecycleBin') return;
if (currentDirType==='custom-root'||currentDirType==='custom') return;
setImportDirectoryVisible(true);
}
......@@ -292,7 +287,7 @@ const AssetTree = (props) => {
}
const deleteDir = () => {
if (currentDirType === 'custom' || currentDirType==='RecycleBin') return;
if (currentDirType === 'custom') return;
if (currentDirId) {
modal.confirm({
......@@ -465,16 +460,16 @@ const AssetTree = (props) => {
}}
>
<Tooltip title="新增目录">
<PlusOutlined onClick={addDir} style={{ fontSize:16,cursor: (currentDirType==='custom-root'||currentDirType==='custom'||currentDirType==='RecycleBin')?'not-allowed':'pointer', color: (currentDirType==='custom-root'||currentDirType==='custom'||currentDirType==='RecycleBin')?'#bfbfbf': '' }}/>
<PlusOutlined onClick={addDir} style={{ fontSize:16,cursor: (currentDirType==='custom-root'||currentDirType==='custom')?'not-allowed':'pointer', color: (currentDirType==='custom-root'||currentDirType==='custom')?'#bfbfbf': '' }}/>
</Tooltip>
<Tooltip title="修改" className='ml-3'>
<EditOutlined onClick={editDir} style={{ fontSize:16,cursor: (currentDirType==='RecycleBin')?'not-allowed':'pointer', color: (currentDirType==='RecycleBin')?'#bfbfbf': '' }} />
<EditOutlined onClick={editDir} style={{ fontSize:16,cursor: 'pointer' }} />
</Tooltip>
<Tooltip title="刷新" className='ml-3'>
<SyncOutlined onClick={refreshTree} style={{ fontSize:16,cursor:'pointer' }} />
</Tooltip>
<Tooltip title="导入" className='ml-3'>
<ImportOutlined onClick={importDir} style={{ fontSize:16,cursor:(currentDirType==='custom-root'||currentDirType==='custom'||currentDirType==='RecycleBin')?'not-allowed':'pointer', color: (currentDirType==='custom-root'||currentDirType==='custom'||currentDirType==='RecycleBin')?'#bfbfbf': '' }} />
<ImportOutlined onClick={importDir} style={{ fontSize:16,cursor:(currentDirType==='custom-root'||currentDirType==='custom')?'not-allowed':'pointer', color: (currentDirType==='custom-root'||currentDirType==='custom')?'#bfbfbf': '' }} />
</Tooltip>
<Dropdown overlay={exportMenu} placement="bottomLeft" className='ml-3'>
<Tooltip title="导出">
......@@ -482,7 +477,7 @@ const AssetTree = (props) => {
</Tooltip>
</Dropdown>
<Tooltip title="删除" className='ml-3'>
<DeleteOutlined onClick={deleteDir} style={{ fontSize:16,cursor:(currentDirType==='custom'||currentDirType==='RecycleBin')?'not-allowed':'pointer', color: (currentDirType==='custom'||currentDirType==='RecycleBin')?'#bfbfbf': '' }} />
<DeleteOutlined onClick={deleteDir} style={{ fontSize:16,cursor:(currentDirType==='custom')?'not-allowed':'pointer', color: (currentDirType==='custom')?'#bfbfbf': '' }} />
</Tooltip>
<Tooltip title="自定义" className='ml-3'>
<SettingOutlined onClick={customDir} style={{ fontSize:16,cursor:'pointer' }} />
......
......@@ -62,7 +62,6 @@ const AssetMount = (props) => {
readOnly={true}
checkable={true}
showCustom={false}
showTrash={false}
onCheck={onCheck}
tableId={(refrence==='asset-manage'&&(ids||[].length>0))?ids[0]:''}
reference='mount'
......
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