|
|
@@ -34,19 +34,19 @@ class ChartDesignerContent extends React.Component {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- componentDidMount() {
|
|
|
- window.setTimeout(() => {
|
|
|
- this.setState({
|
|
|
- animation: true
|
|
|
- });
|
|
|
- }, 2000);
|
|
|
- this.refreshContentSize();
|
|
|
- window.addEventListener('resize', this.refreshContentSize);
|
|
|
- }
|
|
|
+ // componentDidMount() {
|
|
|
+ // window.setTimeout(() => {
|
|
|
+ // this.setState({
|
|
|
+ // animation: true
|
|
|
+ // });
|
|
|
+ // }, 2000);
|
|
|
+ // this.refreshContentSize();
|
|
|
+ // window.addEventListener('resize', this.refreshContentSize);
|
|
|
+ // }
|
|
|
|
|
|
- componentWillUnmount() {
|
|
|
- window.removeEventListener('resize', this.refreshContentSize);
|
|
|
- }
|
|
|
+ // componentWillUnmount() {
|
|
|
+ // window.removeEventListener('resize', this.refreshContentSize);
|
|
|
+ // }
|
|
|
|
|
|
static getDerivedStateFromProps(nextProps, nextState) {
|
|
|
const { chartDesigner, main } = nextProps;
|
|
|
@@ -62,20 +62,20 @@ class ChartDesignerContent extends React.Component {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * 设置图表区域大小
|
|
|
- */
|
|
|
- refreshContentSize = () => {
|
|
|
- let contentEl = findDOMNode(this.refs.contentEl);
|
|
|
- if(!contentEl) { return; }
|
|
|
- let contentLayout = contentEl.getBoundingClientRect();
|
|
|
- this.setState({
|
|
|
- contentSize: {
|
|
|
- width: contentLayout.width,
|
|
|
- height: contentLayout.height
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
+ // /**
|
|
|
+ // * 设置图表区域大小
|
|
|
+ // */
|
|
|
+ // refreshContentSize = () => {
|
|
|
+ // let contentEl = findDOMNode(this.refs.contentEl);
|
|
|
+ // if(!contentEl) { return; }
|
|
|
+ // let contentLayout = contentEl.getBoundingClientRect();
|
|
|
+ // this.setState({
|
|
|
+ // contentSize: {
|
|
|
+ // width: contentLayout.width,
|
|
|
+ // height: contentLayout.height
|
|
|
+ // }
|
|
|
+ // });
|
|
|
+ // }
|
|
|
|
|
|
onCollapse = () => {
|
|
|
this.setState({
|
|
|
@@ -85,7 +85,7 @@ class ChartDesignerContent extends React.Component {
|
|
|
|
|
|
render() {
|
|
|
const { chartDesigner, dispatch } = this.props;
|
|
|
- const { isOwner, animation, autoRefresh, contentSize } = this.state;
|
|
|
+ const { isOwner, animation, autoRefresh } = this.state;
|
|
|
const { baseConfig } = chartDesigner;
|
|
|
const { viewType } = baseConfig;
|
|
|
const formItemLayout = {
|
|
|
@@ -97,22 +97,22 @@ class ChartDesignerContent extends React.Component {
|
|
|
|
|
|
if(viewType === 'aggregateTable') {
|
|
|
configForm = (<AggregateTableConfigForm autoRefresh={autoRefresh} formItemLayout={formItemLayout}/>);
|
|
|
- chartView = (<TableView contentSize={contentSize}/>);
|
|
|
+ chartView = (<TableView />);
|
|
|
}else if(viewType === 'dataView') {
|
|
|
configForm = (<DataViewConfigForm autoRefresh={autoRefresh} formItemLayout={formItemLayout}/>);
|
|
|
- chartView = (<TableView contentSize={contentSize}/>);
|
|
|
+ chartView = (<TableView inPage={true}/>);
|
|
|
}else if(viewType === 'line') {
|
|
|
configForm = (<LineConfigForm autoRefresh={autoRefresh} formItemLayout={formItemLayout}/>);
|
|
|
- chartView = (<EchartsView contentSize={contentSize} optionConfig={{ animation }}/>);
|
|
|
+ chartView = (<EchartsView optionConfig={{ animation }}/>);
|
|
|
}else if(viewType === 'bar') {
|
|
|
configForm = (<BarConfigForm autoRefresh={autoRefresh} formItemLayout={formItemLayout}/>);
|
|
|
- chartView = (<EchartsView contentSize={contentSize} optionConfig={{ animation }}/>);
|
|
|
+ chartView = (<EchartsView optionConfig={{ animation }}/>);
|
|
|
}else if(viewType === 'pie') {
|
|
|
configForm = (<PieConfigForm autoRefresh={autoRefresh} formItemLayout={formItemLayout}/>);
|
|
|
- chartView = (<EchartsView contentSize={contentSize} optionConfig={{ animation }}/>);
|
|
|
+ chartView = (<EchartsView optionConfig={{ animation }}/>);
|
|
|
}else if(viewType === 'scatter') {
|
|
|
configForm = (<ScatterConfigForm autoRefresh={autoRefresh} formItemLayout={formItemLayout}/>);
|
|
|
- chartView = (<EchartsView contentSize={contentSize} optionConfig={{ animation }}/>);
|
|
|
+ chartView = (<EchartsView optionConfig={{ animation }}/>);
|
|
|
}
|
|
|
|
|
|
return (
|