|
|
@@ -1,5 +1,5 @@
|
|
|
import React from 'react'
|
|
|
-import { Layout, Tabs, Switch, Button } from 'antd'
|
|
|
+import { Layout, Tabs, Switch, Button, Icon } from 'antd'
|
|
|
import BaseConfigForm from './sections/baseConfigForm'
|
|
|
import AggregateTableConfigForm from './sections/aggregateTableConfigForm'
|
|
|
import DataViewConfigForm from './sections/dataViewConfigForm'
|
|
|
@@ -22,9 +22,15 @@ class ChartDesignerContent extends React.Component {
|
|
|
constructor(props) {
|
|
|
super(props);
|
|
|
this.state = {
|
|
|
- autoRefresh: true
|
|
|
+ autoRefresh: true,
|
|
|
+ collapsed: false
|
|
|
}
|
|
|
}
|
|
|
+ onCollapse = () => {
|
|
|
+ this.setState({
|
|
|
+ collapsed: !this.state.collapsed,
|
|
|
+ })
|
|
|
+ }
|
|
|
|
|
|
render() {
|
|
|
const { chartDesigner, dispatch } = this.props;
|
|
|
@@ -61,7 +67,16 @@ class ChartDesignerContent extends React.Component {
|
|
|
console.log(autoRefresh);
|
|
|
return (
|
|
|
<Layout className='chartdesigner'>
|
|
|
- <Sider className='sider-left' width={300}>
|
|
|
+ <Sider
|
|
|
+ className={`sider-left${this.state.collapsed ? ' sider-left-collapsed' : ''}`}>
|
|
|
+ <Icon type= {`${this.state.collapsed?'right':'left'}`}
|
|
|
+ style={{
|
|
|
+ position: 'absolute',
|
|
|
+ right: this.state.collapsed?'-20px':'5px',
|
|
|
+ top: '10px',
|
|
|
+ zIndex: 100
|
|
|
+ }}
|
|
|
+ onClick={this.onCollapse}/>
|
|
|
<Tabs className='sider-tabs'>
|
|
|
<TabPane className='chartconfig' tab='图表设置' key='1'>
|
|
|
<BaseConfigForm formItemLayout={formItemLayout}/>
|