Commit 0bf01bc7 by zhaochengxiang

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

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