Commit b4858a6a authored by 陈帅's avatar 陈帅

fix #1945 and use Skeleton replace card

parent fc939795
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
}, },
"dependencies": { "dependencies": {
"@antv/data-set": "^0.9.0", "@antv/data-set": "^0.9.0",
"antd": "^3.8.2", "antd": "^3.9.0-beta.0",
"bizcharts": "^3.1.10", "bizcharts": "^3.1.10",
"bizcharts-plugin-slider": "^2.0.3", "bizcharts-plugin-slider": "^2.0.3",
"classnames": "^2.2.6", "classnames": "^2.2.6",
......
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, Card } from 'antd'; import { Breadcrumb, Tabs, Skeleton } 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';
...@@ -200,34 +200,36 @@ export default class PageHeader extends PureComponent { ...@@ -200,34 +200,36 @@ export default class PageHeader extends PureComponent {
activeKeyProps.activeKey = tabActiveKey; activeKeyProps.activeKey = tabActiveKey;
} }
return ( return (
<Card className={clsString} bodyStyle={{ padding: 0 }} loading={loading}> <div className={clsString}>
{breadcrumb} <Skeleton loading={loading}>
<div className={styles.detail}> {breadcrumb}
{logo && <div className={styles.logo}>{logo}</div>} <div className={styles.detail}>
<div className={styles.main}> {logo && <div className={styles.logo}>{logo}</div>}
<div className={styles.row}> <div className={styles.main}>
{title && <h1 className={styles.title}>{title}</h1>} <div className={styles.row}>
{action && <div className={styles.action}>{action}</div>} {title && <h1 className={styles.title}>{title}</h1>}
</div> {action && <div className={styles.action}>{action}</div>}
<div className={styles.row}> </div>
{content && <div className={styles.content}>{content}</div>} <div className={styles.row}>
{extraContent && <div className={styles.extraContent}>{extraContent}</div>} {content && <div className={styles.content}>{content}</div>}
{extraContent && <div className={styles.extraContent}>{extraContent}</div>}
</div>
</div> </div>
</div> </div>
</div> {tabList && tabList.length ? (
{tabList && tabList.length ? ( <Tabs
<Tabs className={styles.tabs}
className={styles.tabs} {...activeKeyProps}
{...activeKeyProps} onChange={this.onChange}
onChange={this.onChange} tabBarExtraContent={tabBarExtraContent}
tabBarExtraContent={tabBarExtraContent} >
> {tabList.map(item => (
{tabList.map(item => ( <TabPane tab={item.tab} key={item.key} />
<TabPane tab={item.tab} key={item.key} /> ))}
))} </Tabs>
</Tabs> ) : null}
) : null} </Skeleton>
</Card> </div>
); );
} }
} }
...@@ -27,6 +27,11 @@ body { ...@@ -27,6 +27,11 @@ body {
margin: 40px 0 !important; margin: 40px 0 !important;
} }
ul,
ol {
list-style: none;
}
:global { :global {
body .ant-drawer .ant-drawer-content { body .ant-drawer .ant-drawer-content {
opacity: 1; opacity: 1;
......
...@@ -71,6 +71,7 @@ class BasicLayout extends React.PureComponent { ...@@ -71,6 +71,7 @@ class BasicLayout extends React.PureComponent {
super(props); super(props);
const { menuData } = this.props; const { menuData } = this.props;
this.getPageTitle = memoizeOne(this.getPageTitle); this.getPageTitle = memoizeOne(this.getPageTitle);
// Because there are many places to be. So put it here
this.breadcrumbNameMap = getBreadcrumbNameMap(menuData); this.breadcrumbNameMap = getBreadcrumbNameMap(menuData);
} }
getContext() { getContext() {
...@@ -80,6 +81,10 @@ class BasicLayout extends React.PureComponent { ...@@ -80,6 +81,10 @@ class BasicLayout extends React.PureComponent {
breadcrumbNameMap: this.breadcrumbNameMap, breadcrumbNameMap: this.breadcrumbNameMap,
}; };
} }
componentDidUpdate() {
const { menuData } = this.props;
this.breadcrumbNameMap = getBreadcrumbNameMap(menuData);
}
getPageTitle = pathname => { getPageTitle = pathname => {
let currRouterData = null; let currRouterData = null;
// match params path // match params path
......
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