Commit c657a0f2 by zhaochengxiang

资产管理页面调整

parent 422fe99f
import React, { useState } from 'react'; import React, { useState } from 'react';
import classNames from 'classnames';
import { CaretLeftOutlined, CaretRightOutlined } from '@ant-design/icons';
import AssetTable from "../AssetManage/Component/AssetTable"; import AssetTable from "../AssetManage/Component/AssetTable";
import AssetTree from '../AssetManage/Component/AssetTree'; import AssetTree from '../AssetManage/Component/AssetTree';
...@@ -7,16 +10,30 @@ import '../AssetManage/index.less'; ...@@ -7,16 +10,30 @@ import '../AssetManage/index.less';
const AssetBrowse = (props) => { const AssetBrowse = (props) => {
const [ nodeId, setNodeId ] = useState(''); const [ nodeId, setNodeId ] = useState('');
const [ expandTree, setExpandTree ] = useState(true);
const onTreeSelect = (value) => { const onTreeSelect = (value) => {
setNodeId(value||''); setNodeId(value||'');
} }
const treeToggleClick = () => {
setExpandTree(!expandTree);
}
const classes = classNames('asset-manage', {
'asset-manage-collapse': !expandTree
});
return ( return (
<div className='asset-manage'> <div className={classes}>
<div className='left'> <div className='left'>
<AssetTree onSelect={onTreeSelect} readOnly {...props} /> <AssetTree onSelect={onTreeSelect} readOnly {...props} />
</div> </div>
<div className='tree-toggle-wrap'>
<div className='tree-toggle' onClick={treeToggleClick}>
{ expandTree ? <CaretLeftOutlined /> : <CaretRightOutlined /> }
</div>
</div>
<div className='right'> <div className='right'>
<AssetTable nodeId={nodeId} readOnly {...props} /> <AssetTable nodeId={nodeId} readOnly {...props} />
</div> </div>
......
import React, { useState } from 'react'; import React, { useState } from 'react';
import classNames from 'classnames';
import { CaretLeftOutlined, CaretRightOutlined } from '@ant-design/icons';
import AssetTable from './Component/AssetTable'; import AssetTable from './Component/AssetTable';
import AssetTree from './Component/AssetTree'; import AssetTree from './Component/AssetTree';
...@@ -8,16 +10,30 @@ import './index.less'; ...@@ -8,16 +10,30 @@ import './index.less';
const AssetManage = (props) => { const AssetManage = (props) => {
const [ nodeId, setNodeId ] = useState(''); const [ nodeId, setNodeId ] = useState('');
const [ expandTree, setExpandTree ] = useState(true);
const onTreeSelect = (value) => { const onTreeSelect = (value) => {
setNodeId(value||''); setNodeId(value||'');
} }
const treeToggleClick = () => {
setExpandTree(!expandTree);
}
const classes = classNames('asset-manage', {
'asset-manage-collapse': !expandTree
});
return ( return (
<div className='asset-manage'> <div className={classes}>
<div className='left'> <div className='left'>
<AssetTree onSelect={onTreeSelect} {...props} /> <AssetTree onSelect={onTreeSelect} {...props} />
</div> </div>
<div className='tree-toggle-wrap'>
<div className='tree-toggle' onClick={treeToggleClick}>
{ expandTree ? <CaretLeftOutlined /> : <CaretRightOutlined /> }
</div>
</div>
<div className='right'> <div className='right'>
<AssetTable nodeId={nodeId} {...props} /> <AssetTable nodeId={nodeId} {...props} />
</div> </div>
......
.asset-manage { .asset-manage {
display: flex; display: flex;
background-color: #F0F2F5; background-color: #fff;
height: 100%;
.left { .left {
width: 230px; width: 230px;
background-color: #fff; border-right: 1px solid #EFEFEF;
margin-right: 10px; overflow: hidden;
}
.tree-toggle-wrap {
position: relative;
width: 20px;
height: calc(100vh - 94px);
.tree-toggle {
display: flex;
justify-content: center;
align-items: center;
left: 0;
right: 0;
background: #f2f5fc;
position: absolute;
top: calc(50% - 40px);
width: 12px;
height: 80px;
border-radius: 0 12px 12px 0;
-ms-transform: translateY(-50%);
transform: translateY(-50%);
cursor: pointer;
}
}
.right {
width: calc(100% - 250px);
}
}
.asset-manage-collapse {
.left {
width: 0;
} }
.right { .right {
width:calc(100% - 240px); width: calc(100% - 20px);
background-color: #fff;
} }
} }
\ No newline at end of file
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