Commit a8ef08b6 authored by 陈帅's avatar 陈帅

fixed #1750 Excessive loading in the workplace

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