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