Commit cddbe2d1 by zhaochengxiang

模型目录拖动

parent b796ce39
...@@ -2,6 +2,7 @@ import React from 'react'; ...@@ -2,6 +2,7 @@ import React from 'react';
import { Button, Space, Spin, Input, Select, Tooltip } from 'antd'; import { Button, Space, Spin, Input, Select, Tooltip } from 'antd';
import copy from "copy-to-clipboard"; import copy from "copy-to-clipboard";
import { CaretLeftOutlined, CaretRightOutlined } from '@ant-design/icons'; import { CaretLeftOutlined, CaretRightOutlined } from '@ant-design/icons';
import { ResizableBox } from 'react-resizable';
import classNames from 'classnames'; import classNames from 'classnames';
import ModelTree from './Component/ModelTree'; import ModelTree from './Component/ModelTree';
...@@ -452,9 +453,15 @@ class Model extends React.Component { ...@@ -452,9 +453,15 @@ class Model extends React.Component {
<AppContext.Consumer> <AppContext.Consumer>
{ {
value => <div className={classes}> value => <div className={classes}>
<div className='left'> <ResizableBox
className='left'
width={230}
height={Infinity}
axis='x'
minConstraints={[230, Infinity]} maxConstraints={[500, Infinity]}
>
<ModelTree onViewChange={this.onViewChange} onSelect={this.onTreeSelect} importStockModel={this.importStockModel} keyword={keyword} {...this.props} /> <ModelTree onViewChange={this.onViewChange} onSelect={this.onTreeSelect} importStockModel={this.importStockModel} keyword={keyword} {...this.props} />
</div> </ResizableBox>
<div className='tree-toggle-wrap'> <div className='tree-toggle-wrap'>
<div className='tree-toggle' onClick={this.treeToggleClick}> <div className='tree-toggle' onClick={this.treeToggleClick}>
{ expandTree ? <CaretLeftOutlined /> : <CaretRightOutlined /> } { expandTree ? <CaretLeftOutlined /> : <CaretRightOutlined /> }
......
.data-model { .data-model {
display: flex; display: flex;
background-color: #fff; background-color: #fff;
width: 100%;
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;
} }
...@@ -12,7 +13,7 @@ ...@@ -12,7 +13,7 @@
.tree-toggle-wrap { .tree-toggle-wrap {
position: relative; position: relative;
width: 20px; width: 20px;
height: '100%'; height: 100%;
.tree-toggle { .tree-toggle {
display: flex; display: flex;
...@@ -33,16 +34,13 @@ ...@@ -33,16 +34,13 @@
} }
.right { .right {
width: calc(100% - 250px); flex: 1;
overflow: hidden;
} }
} }
.data-model-collapse { .data-model-collapse {
.left { .left {
width: 0; width: 0 !important;
}
.right {
width: calc(100% - 20px);
} }
} }
\ 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