Commit 30472299 authored by afc163's avatar afc163

Remove spinning of analysis page cards

parent c1f40265
...@@ -3,7 +3,9 @@ import { Card, Spin } from 'antd'; ...@@ -3,7 +3,9 @@ import { Card, Spin } from 'antd';
import styles from './index.less'; import styles from './index.less';
const ChartCard = ({ loading, contentHeight, title, action, total, footer, children, ...rest }) => { const ChartCard = ({
loading = false, contentHeight, title, action, total, footer, children, ...rest
}) => {
const content = ( const content = (
<div className={styles.chartCard}> <div className={styles.chartCard}>
<div className={styles.meta}> <div className={styles.meta}>
...@@ -34,11 +36,7 @@ const ChartCard = ({ loading, contentHeight, title, action, total, footer, child ...@@ -34,11 +36,7 @@ const ChartCard = ({ loading, contentHeight, title, action, total, footer, child
bodyStyle={{ padding: '20px 24px 8px 24px' }} bodyStyle={{ padding: '20px 24px 8px 24px' }}
{...rest} {...rest}
> >
{ {<Spin spinning={loading}>{content}</Spin>}
loading ? (
<Spin size="large">{content}</Spin>
) : content
}
</Card> </Card>
); );
}; };
......
...@@ -36,11 +36,7 @@ export default class Analysis extends Component { ...@@ -36,11 +36,7 @@ export default class Analysis extends Component {
componentDidMount() { componentDidMount() {
this.props.dispatch({ this.props.dispatch({
type: 'chart/fetch', type: 'chart/fetch',
}).then(() => { }).then(() => this.setState({ loading: false }));
this.setState({
loading: false,
});
});
} }
componentWillUnmount() { componentWillUnmount() {
...@@ -226,7 +222,6 @@ export default class Analysis extends Component { ...@@ -226,7 +222,6 @@ export default class Analysis extends Component {
<Row gutter={24}> <Row gutter={24}>
<Col {...topColResponsiveProps}> <Col {...topColResponsiveProps}>
<ChartCard <ChartCard
loading={loading}
bordered={false} bordered={false}
title="总销售额" title="总销售额"
action={<Tooltip title="指标说明"><Icon type="info-circle-o" /></Tooltip>} action={<Tooltip title="指标说明"><Icon type="info-circle-o" /></Tooltip>}
...@@ -244,7 +239,6 @@ export default class Analysis extends Component { ...@@ -244,7 +239,6 @@ export default class Analysis extends Component {
</Col> </Col>
<Col {...topColResponsiveProps}> <Col {...topColResponsiveProps}>
<ChartCard <ChartCard
loading={loading}
bordered={false} bordered={false}
title="访问量" title="访问量"
action={<Tooltip title="指标说明"><Icon type="info-circle-o" /></Tooltip>} action={<Tooltip title="指标说明"><Icon type="info-circle-o" /></Tooltip>}
...@@ -261,7 +255,6 @@ export default class Analysis extends Component { ...@@ -261,7 +255,6 @@ export default class Analysis extends Component {
</Col> </Col>
<Col {...topColResponsiveProps}> <Col {...topColResponsiveProps}>
<ChartCard <ChartCard
loading={loading}
bordered={false} bordered={false}
title="支付笔数" title="支付笔数"
action={<Tooltip title="指标说明"><Icon type="info-circle-o" /></Tooltip>} action={<Tooltip title="指标说明"><Icon type="info-circle-o" /></Tooltip>}
...@@ -277,7 +270,6 @@ export default class Analysis extends Component { ...@@ -277,7 +270,6 @@ export default class Analysis extends Component {
</Col> </Col>
<Col {...topColResponsiveProps}> <Col {...topColResponsiveProps}>
<ChartCard <ChartCard
loading={loading}
bordered={false} bordered={false}
title="运营活动效果" title="运营活动效果"
action={<Tooltip title="指标说明"><Icon type="info-circle-o" /></Tooltip>} action={<Tooltip title="指标说明"><Icon type="info-circle-o" /></Tooltip>}
......
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