Commit a8ef08b6 authored by ι™ˆεΈ…'s avatar ι™ˆεΈ…

fixed #1750 Excessive loading in the workplace

parent eaf60da7
import React, { PureComponent, createElement } from 'react'; import React, { PureComponent, createElement } from 'react';
import pathToRegexp from 'path-to-regexp'; import pathToRegexp from 'path-to-regexp';
import { Breadcrumb, Tabs } from 'antd'; import { Breadcrumb, Tabs, Card } from 'antd';
import classNames from 'classnames'; import classNames from 'classnames';
import styles from './index.less'; import styles from './index.less';
import { urlToList } from '../_utils/pathTools'; import { urlToList } from '../_utils/pathTools';
...@@ -190,7 +190,7 @@ export default class PageHeader extends PureComponent { ...@@ -190,7 +190,7 @@ export default class PageHeader extends PureComponent {
} }
const { breadcrumb } = this.state; const { breadcrumb } = this.state;
return ( return (
<div className={clsString}> <Card className={clsString} bodyStyle={{ padding: 0 }}>
{breadcrumb} {breadcrumb}
<div className={styles.detail}> <div className={styles.detail}>
{logo && <div className={styles.logo}>{logo}</div>} {logo && <div className={styles.logo}>{logo}</div>}
...@@ -216,7 +216,7 @@ export default class PageHeader extends PureComponent { ...@@ -216,7 +216,7 @@ export default class PageHeader extends PureComponent {
{tabList.map(item => <TabPane tab={item.tab} key={item.key} />)} {tabList.map(item => <TabPane tab={item.tab} key={item.key} />)}
</Tabs> </Tabs>
)} )}
</div> </Card>
); );
} }
} }
...@@ -9,6 +9,7 @@ const defaultSetting = { ...@@ -9,6 +9,7 @@ const defaultSetting = {
fixSiderbar: false, fixSiderbar: false,
colorWeak: 'close', colorWeak: 'close',
}; };
export default { export default {
namespace: 'setting', namespace: 'setting',
state: defaultSetting, state: defaultSetting,
......
...@@ -2,7 +2,7 @@ import React, { PureComponent } from 'react'; ...@@ -2,7 +2,7 @@ import React, { PureComponent } from 'react';
import moment from 'moment'; import moment from 'moment';
import { connect } from 'dva'; import { connect } from 'dva';
import { Link } from 'dva/router'; import { Link } from 'dva/router';
import { Row, Col, Card, List, Avatar, Spin } from 'antd'; import { Row, Col, Card, List, Avatar } from 'antd';
import { Radar } from 'components/Charts'; import { Radar } from 'components/Charts';
import EditableLinkGroup from 'components/EditableLinkGroup'; import EditableLinkGroup from 'components/EditableLinkGroup';
...@@ -117,9 +117,8 @@ export default class Workplace extends PureComponent { ...@@ -117,9 +117,8 @@ export default class Workplace extends PureComponent {
chart: { radarData }, chart: { radarData },
} = this.props; } = this.props;
const pageHeaderContent = ( const pageHeaderContent =
<Spin spinning={currentUserLoading}> currentUser && Object.keys(currentUser).length ? (
{currentUser && Object.keys(currentUser).length ? (
<div className={styles.pageHeaderContent}> <div className={styles.pageHeaderContent}>
<div className={styles.avatar}> <div className={styles.avatar}>
<Avatar size="large" src={currentUser.avatar} /> <Avatar size="large" src={currentUser.avatar} />
...@@ -131,9 +130,7 @@ export default class Workplace extends PureComponent { ...@@ -131,9 +130,7 @@ export default class Workplace extends PureComponent {
</div> </div>
</div> </div>
</div> </div>
) : null} ) : null;
</Spin>
);
const extraContent = ( const extraContent = (
<div className={styles.extraContent}> <div className={styles.extraContent}>
...@@ -156,7 +153,11 @@ export default class Workplace extends PureComponent { ...@@ -156,7 +153,11 @@ export default class Workplace extends PureComponent {
); );
return ( return (
<PageHeaderLayout content={pageHeaderContent} extraContent={extraContent}> <PageHeaderLayout
loading={currentUserLoading}
content={pageHeaderContent}
extraContent={extraContent}
>
<Row gutter={24}> <Row gutter={24}>
<Col xl={16} lg={24} md={24} sm={24} xs={24}> <Col xl={16} lg={24} md={24} sm={24} xs={24}>
<Card <Card
......
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