Commit f604e79b by zhaochengxiang

资产目录拉伸

parent cddbe2d1
import React, { useState } from 'react'; import React, { useState } from 'react';
import classNames from 'classnames'; import classNames from 'classnames';
import { CaretLeftOutlined, CaretRightOutlined } from '@ant-design/icons'; import { CaretLeftOutlined, CaretRightOutlined } from '@ant-design/icons';
import { ResizableBox } from 'react-resizable';
import AssetTree from '../AssetManage/Component/AssetTree'; import AssetTree from '../AssetManage/Component/AssetTree';
import AssetDirectory from '../AssetManage/Component/AssetDirectory'; import AssetDirectory from '../AssetManage/Component/AssetDirectory';
...@@ -60,9 +61,15 @@ const AssetBrowse = (props) => { ...@@ -60,9 +61,15 @@ const AssetBrowse = (props) => {
return ( return (
<div className={classes}> <div className={classes}>
<div className='left'> <ResizableBox
className='left'
width={230}
height={Infinity}
axis='x'
minConstraints={[230, Infinity]} maxConstraints={[500, Infinity]}
>
<AssetTree centerId={centerId} onSelect={onTreeSelect} reference={reference} {...props} /> <AssetTree centerId={centerId} onSelect={onTreeSelect} reference={reference} {...props} />
</div> </ResizableBox>
{ {
expandTree && <Separate width={15} /> expandTree && <Separate width={15} />
} }
...@@ -82,12 +89,12 @@ const AssetBrowse = (props) => { ...@@ -82,12 +89,12 @@ const AssetBrowse = (props) => {
<AssetTable nodeId={nodeId} nodeType={nodeParams.nodeType} reference={reference} onCountChange={onAssetCountChange} {...props} /> <AssetTable nodeId={nodeId} nodeType={nodeParams.nodeType} reference={reference} onCountChange={onAssetCountChange} {...props} />
</div> </div>
</div> </div>
</div> <div className='tree-toggle' onClick={treeToggleClick}>
<div className='tree-toggle' onClick={treeToggleClick}>
{ expandTree ? <CaretLeftOutlined /> : <CaretRightOutlined /> } { expandTree ? <CaretLeftOutlined /> : <CaretRightOutlined /> }
</div> </div>
<div className='relation-toggle' onClick={relationToggleClick}> <div className='relation-toggle' onClick={relationToggleClick}>
{ expandRelation ? <CaretLeftOutlined /> : <CaretRightOutlined /> } { expandRelation ? <CaretLeftOutlined /> : <CaretRightOutlined /> }
</div>
</div> </div>
</div> </div>
) )
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
height: 100%; height: 100%;
.left { .left {
width: 230px; flex: 0 0 auto;
border-right: 1px solid #EFEFEF; border-right: 1px solid #EFEFEF;
overflow: hidden; overflow: hidden;
} }
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
right: 0; right: 0;
background: #f2f5fc; background: #f2f5fc;
position: absolute; position: absolute;
left: 245px; left: 0px;
top: calc(50% - 40px); top: calc(50% - 40px);
width: 12px; width: 12px;
height: 80px; height: 80px;
...@@ -29,8 +29,10 @@ ...@@ -29,8 +29,10 @@
} }
.right { .right {
position: relative;
display: flex; display: flex;
width: calc(100% - 245px); flex: 1;
overflow: hidden;
flex-direction: column; flex-direction: column;
} }
...@@ -40,7 +42,7 @@ ...@@ -40,7 +42,7 @@
align-items: center; align-items: center;
background: #f2f5fc; background: #f2f5fc;
position: absolute; position: absolute;
left: calc(50% + 130px); left: calc(50% + 7.5px);
top: calc(50% - 40px); top: calc(50% - 40px);
width: 12px; width: 12px;
height: 80px; height: 80px;
...@@ -52,24 +54,20 @@ ...@@ -52,24 +54,20 @@
&.asset-browse-relation-collapse { &.asset-browse-relation-collapse {
.relation-toggle { .relation-toggle {
left: 245px; left: 0px;
} }
} }
} }
.asset-browse-tree-collapse { .asset-browse-tree-collapse {
.left { .left {
width: 0; width: 0 !important;
} }
.tree-toggle { .tree-toggle {
left: 0; left: 0;
} }
.right {
width: 100%;
}
.relation-toggle { .relation-toggle {
left: calc(50% + 7.5px); left: calc(50% + 7.5px);
} }
......
...@@ -2,6 +2,7 @@ import React, { useState } from 'react'; ...@@ -2,6 +2,7 @@ import React, { useState } from 'react';
import classNames from 'classnames'; import classNames from 'classnames';
import { Form } from 'antd'; import { Form } from 'antd';
import { CaretLeftOutlined, CaretRightOutlined } from '@ant-design/icons'; import { CaretLeftOutlined, CaretRightOutlined } from '@ant-design/icons';
import { ResizableBox } from 'react-resizable';
import AssetTree from './Component/AssetManageTree'; import AssetTree from './Component/AssetManageTree';
import AssetDirectory from './Component/AssetDirectory'; import AssetDirectory from './Component/AssetDirectory';
...@@ -66,9 +67,15 @@ const AssetManage = (props) => { ...@@ -66,9 +67,15 @@ const AssetManage = (props) => {
return ( return (
<div className={classes}> <div className={classes}>
<div className='left'> <ResizableBox
className='left'
width={230}
height={Infinity}
axis='x'
minConstraints={[230, Infinity]} maxConstraints={[500, Infinity]}
>
<AssetTree onSelect={onTreeSelect} onDirectoryChange={onDirectoryChange} {...props} /> <AssetTree onSelect={onTreeSelect} onDirectoryChange={onDirectoryChange} {...props} />
</div> </ResizableBox>
{ {
expandTree && <Separate width={15} /> expandTree && <Separate width={15} />
} }
...@@ -76,14 +83,14 @@ const AssetManage = (props) => { ...@@ -76,14 +83,14 @@ const AssetManage = (props) => {
<AssetDirectory id={nodeId} assetCount={assetCount} directoryChanged={directoryChanged} onElementsChange={onElementsChange} /> <AssetDirectory id={nodeId} assetCount={assetCount} directoryChanged={directoryChanged} onElementsChange={onElementsChange} />
<Separate height={15} /> <Separate height={15} />
<AssetTable nodeId={nodeId} nodeType={nodeType} nodeLevel={nodeLevel} reference={AssetManageReference} elementsChanged={elementsChanged} assetActionChanged={assetActionChanged} onSelect={onTableSelect} onCountChange={onAssetCountChange} {...props} /> <AssetTable nodeId={nodeId} nodeType={nodeType} nodeLevel={nodeLevel} reference={AssetManageReference} elementsChanged={elementsChanged} assetActionChanged={assetActionChanged} onSelect={onTableSelect} onCountChange={onAssetCountChange} {...props} />
<div className='tree-toggle' onClick={treeToggleClick}>
{ expandTree ? <CaretLeftOutlined /> : <CaretRightOutlined /> }
</div>
</div> </div>
<Separate width='15px' /> <Separate width='15px' />
<div className='right'> <div className='right'>
<AssetAction form={form} id={assetId} dirId={assetDirId} action='detail' onChange={onAssetActionChange} /> <AssetAction form={form} id={assetId} dirId={assetDirId} action='detail' onChange={onAssetActionChange} />
</div> </div>
<div className='tree-toggle' onClick={treeToggleClick}>
{ expandTree ? <CaretLeftOutlined /> : <CaretRightOutlined /> }
</div>
</div> </div>
) )
} }
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
height: 100%; height: 100%;
.left { .left {
width: 230px; flex: 0 0 auto;
border-right: 1px solid #EFEFEF; border-right: 1px solid #EFEFEF;
overflow: hidden; overflow: hidden;
} }
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
left: 245px; left: 0px;
right: 0; right: 0;
background: #f2f5fc; background: #f2f5fc;
position: absolute; position: absolute;
...@@ -28,7 +28,9 @@ ...@@ -28,7 +28,9 @@
} }
.middle { .middle {
width: calc(100% - 230px - 400px - 30px); position: relative;
flex: 1;
overflow: hidden;
} }
.right { .right {
...@@ -39,14 +41,10 @@ ...@@ -39,14 +41,10 @@
.asset-manage-collapse { .asset-manage-collapse {
.left { .left {
width: 0; width: 0 !important;
} }
.tree-toggle { .tree-toggle {
left: 0; left: 0;
} }
.middle {
width: calc(100% - 400px - 30px);
}
} }
\ 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