Commit f6304f91 by zhaochengxiang

1104资产管理

parent 89a52121
......@@ -19,6 +19,7 @@ export const Holder = 'holder';
//资产
export const AssetManageReference = 'asset-manage';
export const Asset1104ManageReference = 'asset-1104-manage';
export const AssetBrowseReference = 'asset-browse';
export const ResourceBrowseReference = 'resource-browse';
export const AssetRecycleReference = 'asset-recycle';
......
......@@ -9,16 +9,13 @@ import AssetTable from '../AssetManage/Component/AssetTable';
import AssetAction from '../AssetManage/Component/AssetAction';
import Separate from '../AssetManage/Component/Separate';
import { getQueryParam } from '../../../util';
import { AssetManageReference, AnchorDirId } from '../../../util/constant';
import { Asset1104ManageReference, AssetManageReference } from '../../../util/constant';
import './index.less';
import '../AssetManage/index.less';
const Asset1104Manage = (props) => {
const did = getQueryParam(AnchorDirId, props?.location?.search);
const [ nodeId, setNodeId ] = useState(did||'');
const [ nodeId, setNodeId ] = useState('');
const [ nodeType, setNodeType ] = useState('');
const [ assetParams, setAssetParams ] = useState({ assetId: '', assetDirId: '' })
const [ expandTree, setExpandTree ] = useState(true);
......@@ -60,12 +57,18 @@ const Asset1104Manage = (props) => {
setAssetCount(count);
}
const classes = classNames('asset-1104-manage', {
const classes = classNames('asset-manage', {
'asset-manage-collapse': !expandTree
});
return (
<div className={classes}>
<div className='left'>
<AssetTree reference={Asset1104ManageReference} onSelect={onTreeSelect} onDirectoryChange={onDirectoryChange} {...props} />
</div>
{
expandTree && <Separate width={15} />
}
<div className='middle'>
<AssetDirectory id={nodeId} assetCount={assetCount} directoryChanged={directoryChanged} onElementsChange={onElementsChange} />
<Separate height={15} />
......@@ -75,6 +78,9 @@ const Asset1104Manage = (props) => {
<div className='right'>
<AssetAction form={form} id={assetId} dirId={assetDirId} action='detail' onChange={onAssetActionChange} />
</div>
<div className='tree-toggle' onClick={treeToggleClick}>
{ expandTree ? <CaretLeftOutlined /> : <CaretRightOutlined /> }
</div>
</div>
)
}
......
.asset-1104-manage {
display: flex;
position: relative;
background-color: #fff;
height: 100%;
.middle {
width: calc(100% - 400px - 30px);
}
.right {
width: 400px;
border-left: 1px solid #EFEFEF;
}
}
\ No newline at end of file
......@@ -10,7 +10,7 @@ import ImportDirectory from './ImportDirectory';
import UpdateDirectoryModal from './UpdateDirectoryModal';
import CustomDirectoryModal from './CustomDirectoryModal';
import { showMessage, getQueryParam } from '../../../../util';
import { AnchorTimestamp, AnchorId, AssetManageReference, AssetBrowseReference, ResourceBrowseReference, AssetMountReference, AnchorDirId } from '../../../../util/constant';
import { AnchorTimestamp, AnchorId, AssetManageReference, AssetBrowseReference, ResourceBrowseReference, AssetMountReference, AnchorDirId, Asset1104ManageReference } from '../../../../util/constant';
import { highlightSearchContentByTerms } from '../../../../util';
import './AssetTree.less';
......@@ -135,7 +135,7 @@ const AssetTree = (props) => {
}
let url = '';
if (reference === AssetManageReference || reference === AssetMountReference) {
if (reference === AssetManageReference || reference === AssetMountReference || reference === Asset1104ManageReference) {
url = 'assetmanage.queryAllDirectoryAsTree';
} else if (reference === AssetBrowseReference) {
url = 'assetmanage.queryAssetDirectoryAsTree';
......@@ -150,6 +150,24 @@ const AssetTree = (props) => {
let newData = [...data];
if (reference === Asset1104ManageReference) {
function recursion1104(subCatalogs) {
if ((subCatalogs||[]).length===0) return;
(subCatalogs||[]).forEach(catalog=> {
if (catalog.text === '合规数据') {
newData = [catalog];
return;
}
recursion1104(catalog.children);
})
}
recursion1104(data);
}
if (reference === AssetMountReference) {
newData = newData.filter(item => item.type!=='custom');
}
......
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