From a8ef08b67814ef3ab6462ac4bcba6f1e0731850c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=B8=85?= Date: Fri, 29 Jun 2018 00:06:11 +0800 Subject: [PATCH] fixed #1750 Excessive loading in the workplace --- src/components/PageHeader/index.js | 6 ++--- src/models/setting.js | 1 + src/routes/Dashboard/Workplace.js | 35 +++++++++++++++--------------- 3 files changed, 22 insertions(+), 20 deletions(-) diff --git a/src/components/PageHeader/index.js b/src/components/PageHeader/index.js index 301e5bd2..c8662864 100644 --- a/src/components/PageHeader/index.js +++ b/src/components/PageHeader/index.js @@ -1,6 +1,6 @@ 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 ( -
+ {breadcrumb}
{logo &&
{logo}
} @@ -216,7 +216,7 @@ export default class PageHeader extends PureComponent { {tabList.map(item => )} )} -
+
); } } diff --git a/src/models/setting.js b/src/models/setting.js index cf5a8380..72b7caca 100644 --- a/src/models/setting.js +++ b/src/models/setting.js @@ -9,6 +9,7 @@ const defaultSetting = { fixSiderbar: false, colorWeak: 'close', }; + export default { namespace: 'setting', state: defaultSetting, diff --git a/src/routes/Dashboard/Workplace.js b/src/routes/Dashboard/Workplace.js index 07c3cbd4..91e5dd28 100644 --- a/src/routes/Dashboard/Workplace.js +++ b/src/routes/Dashboard/Workplace.js @@ -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 = ( - - {currentUser && Object.keys(currentUser).length ? ( -
-
- -
-
-
早安,{currentUser.name},祝你开心每一天!
-
- {currentUser.title} | {currentUser.group} -
+ const pageHeaderContent = + currentUser && Object.keys(currentUser).length ? ( +
+
+ +
+
+
早安,{currentUser.name},祝你开心每一天!
+
+ {currentUser.title} | {currentUser.group}
- ) : null} - - ); +
+ ) : null; const extraContent = (
@@ -156,7 +153,11 @@ export default class Workplace extends PureComponent { ); return ( - +