Commit e235ca5d authored by afc163's avatar afc163 Committed by 偏右

move out PageHeaderLayout and rename to PageHeaderWrapper

parent 4c3eef15
...@@ -4,10 +4,10 @@ import Link from 'umi/link'; ...@@ -4,10 +4,10 @@ import Link from 'umi/link';
import PageHeader from '@/components/PageHeader'; import PageHeader from '@/components/PageHeader';
import { connect } from 'dva'; import { connect } from 'dva';
import GridContent from './GridContent'; import GridContent from './GridContent';
import styles from './PageHeaderLayout.less'; import styles from './index.less';
import MenuContext from './MenuContext'; import MenuContext from '@/layouts/MenuContext';
const PageHeaderLayout = ({ children, grid, wrapperClassName, top, ...restProps }) => ( const PageHeaderWrapper = ({ children, grid, wrapperClassName, top, ...restProps }) => (
<div style={{ margin: '-24px -24px 0' }} className={wrapperClassName}> <div style={{ margin: '-24px -24px 0' }} className={wrapperClassName}>
{top} {top}
<MenuContext.Consumer> <MenuContext.Consumer>
...@@ -38,4 +38,4 @@ const PageHeaderLayout = ({ children, grid, wrapperClassName, top, ...restProps ...@@ -38,4 +38,4 @@ const PageHeaderLayout = ({ children, grid, wrapperClassName, top, ...restProps
export default connect(({ setting }) => ({ export default connect(({ setting }) => ({
grid: setting.grid, grid: setting.grid,
}))(PageHeaderLayout); }))(PageHeaderWrapper);
...@@ -3,7 +3,7 @@ import { connect } from 'dva'; ...@@ -3,7 +3,7 @@ import { connect } from 'dva';
import Link from 'umi/link'; import Link from 'umi/link';
import router from 'umi/router'; import router from 'umi/router';
import { Card, Row, Col, Icon, Avatar, Tag, Divider, Spin, Input } from 'antd'; import { Card, Row, Col, Icon, Avatar, Tag, Divider, Spin, Input } from 'antd';
import GridContent from '@/layouts/GridContent'; import GridContent from '@/components/PageHeaderWrapper/GridContent';
import styles from './Center.less'; import styles from './Center.less';
@connect(({ loading, user, project }) => ({ @connect(({ loading, user, project }) => ({
......
...@@ -3,7 +3,7 @@ import { connect } from 'dva'; ...@@ -3,7 +3,7 @@ import { connect } from 'dva';
import router from 'umi/router'; import router from 'umi/router';
import { FormattedMessage } from 'umi/locale'; import { FormattedMessage } from 'umi/locale';
import { Menu } from 'antd'; import { Menu } from 'antd';
import GridContent from '@/layouts/GridContent'; import GridContent from '@/components/PageHeaderWrapper/GridContent';
import styles from './Info.less'; import styles from './Info.less';
const { Item } = Menu; const { Item } = Menu;
......
...@@ -27,7 +27,7 @@ import { ...@@ -27,7 +27,7 @@ import {
import Trend from '@/components/Trend'; import Trend from '@/components/Trend';
import NumberInfo from '@/components/NumberInfo'; import NumberInfo from '@/components/NumberInfo';
import numeral from 'numeral'; import numeral from 'numeral';
import GridContent from '@/layouts/GridContent'; import GridContent from '@/components/PageHeaderWrapper/GridContent';
import Yuan from '@/utils/Yuan'; import Yuan from '@/utils/Yuan';
import { getTimeDistance } from '@/utils/utils'; import { getTimeDistance } from '@/utils/utils';
......
...@@ -6,7 +6,7 @@ import NumberInfo from '@/components/NumberInfo'; ...@@ -6,7 +6,7 @@ import NumberInfo from '@/components/NumberInfo';
import CountDown from '@/components/CountDown'; import CountDown from '@/components/CountDown';
import ActiveChart from '@/components/ActiveChart'; import ActiveChart from '@/components/ActiveChart';
import numeral from 'numeral'; import numeral from 'numeral';
import GridContent from '@/layouts/GridContent'; import GridContent from '@/components/PageHeaderWrapper/GridContent';
import Authorized from '@/utils/Authorized'; import Authorized from '@/utils/Authorized';
import styles from './Monitor.less'; import styles from './Monitor.less';
......
...@@ -6,7 +6,7 @@ import { Row, Col, Card, List, Avatar } from 'antd'; ...@@ -6,7 +6,7 @@ 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';
import PageHeaderLayout from '@/layouts/PageHeaderLayout'; import PageHeaderWrapper from '@/components/PageHeaderWrapper';
import styles from './Workplace.less'; import styles from './Workplace.less';
...@@ -156,7 +156,7 @@ export default class Workplace extends PureComponent { ...@@ -156,7 +156,7 @@ export default class Workplace extends PureComponent {
); );
return ( return (
<PageHeaderLayout <PageHeaderWrapper
loading={currentUserLoading} loading={currentUserLoading}
content={pageHeaderContent} content={pageHeaderContent}
extraContent={extraContent} extraContent={extraContent}
...@@ -248,7 +248,7 @@ export default class Workplace extends PureComponent { ...@@ -248,7 +248,7 @@ export default class Workplace extends PureComponent {
</Card> </Card>
</Col> </Col>
</Row> </Row>
</PageHeaderLayout> </PageHeaderWrapper>
); );
} }
} }
...@@ -14,7 +14,7 @@ import { ...@@ -14,7 +14,7 @@ import {
} from 'antd'; } from 'antd';
import { connect } from 'dva'; import { connect } from 'dva';
import FooterToolbar from '@/components/FooterToolbar'; import FooterToolbar from '@/components/FooterToolbar';
import PageHeaderLayout from '@/layouts/PageHeaderLayout'; import PageHeaderWrapper from '@/components/PageHeaderWrapper';
import TableForm from './TableForm'; import TableForm from './TableForm';
import styles from './style.less'; import styles from './style.less';
...@@ -142,7 +142,7 @@ export default class AdvancedForm extends PureComponent { ...@@ -142,7 +142,7 @@ export default class AdvancedForm extends PureComponent {
}; };
const { width } = this.state; const { width } = this.state;
return ( return (
<PageHeaderLayout <PageHeaderWrapper
title="高级表单" title="高级表单"
content="高级表单常见于一次性输入和提交大批量数据的场景。" content="高级表单常见于一次性输入和提交大批量数据的场景。"
wrapperClassName={styles.advancedForm} wrapperClassName={styles.advancedForm}
...@@ -303,7 +303,7 @@ export default class AdvancedForm extends PureComponent { ...@@ -303,7 +303,7 @@ export default class AdvancedForm extends PureComponent {
提交 提交
</Button> </Button>
</FooterToolbar> </FooterToolbar>
</PageHeaderLayout> </PageHeaderWrapper>
); );
} }
} }
...@@ -12,7 +12,7 @@ import { ...@@ -12,7 +12,7 @@ import {
Icon, Icon,
Tooltip, Tooltip,
} from 'antd'; } from 'antd';
import PageHeaderLayout from '@/layouts/PageHeaderLayout'; import PageHeaderWrapper from '@/components/PageHeaderWrapper';
import styles from './style.less'; import styles from './style.less';
const FormItem = Form.Item; const FormItem = Form.Item;
...@@ -64,7 +64,7 @@ export default class BasicForms extends PureComponent { ...@@ -64,7 +64,7 @@ export default class BasicForms extends PureComponent {
}; };
return ( return (
<PageHeaderLayout <PageHeaderWrapper
title="基础表单" title="基础表单"
content="表单页用于向用户收集或验证信息,基础表单常见于数据项较少的表单场景。" content="表单页用于向用户收集或验证信息,基础表单常见于数据项较少的表单场景。"
> >
...@@ -196,7 +196,7 @@ export default class BasicForms extends PureComponent { ...@@ -196,7 +196,7 @@ export default class BasicForms extends PureComponent {
</FormItem> </FormItem>
</Form> </Form>
</Card> </Card>
</PageHeaderLayout> </PageHeaderWrapper>
); );
} }
} }
import React, { PureComponent, Fragment } from 'react'; import React, { PureComponent, Fragment } from 'react';
import { Card, Steps } from 'antd'; import { Card, Steps } from 'antd';
import PageHeaderLayout from '@/layouts/PageHeaderLayout'; import PageHeaderWrapper from '@/components/PageHeaderWrapper';
import styles from '../style.less'; import styles from '../style.less';
// import { Route, Redirect, Switch } from 'dva/router'; // import { Route, Redirect, Switch } from 'dva/router';
...@@ -28,7 +28,7 @@ export default class StepForm extends PureComponent { ...@@ -28,7 +28,7 @@ export default class StepForm extends PureComponent {
render() { render() {
const { location, children } = this.props; const { location, children } = this.props;
return ( return (
<PageHeaderLayout <PageHeaderWrapper
title="分步表单" title="分步表单"
tabActiveKey={location.pathname} tabActiveKey={location.pathname}
content="将一个冗长或用户不熟悉的表单任务分成多个步骤,指导用户完成。" content="将一个冗长或用户不熟悉的表单任务分成多个步骤,指导用户完成。"
...@@ -43,7 +43,7 @@ export default class StepForm extends PureComponent { ...@@ -43,7 +43,7 @@ export default class StepForm extends PureComponent {
{children} {children}
</Fragment> </Fragment>
</Card> </Card>
</PageHeaderLayout> </PageHeaderWrapper>
); );
} }
} }
...@@ -21,7 +21,7 @@ import { ...@@ -21,7 +21,7 @@ import {
Select, Select,
} from 'antd'; } from 'antd';
import PageHeaderLayout from '@/layouts/PageHeaderLayout'; import PageHeaderWrapper from '@/components/PageHeaderWrapper';
import Result from '@/components/Result'; import Result from '@/components/Result';
import styles from './BasicList.less'; import styles from './BasicList.less';
...@@ -253,7 +253,7 @@ export default class BasicList extends PureComponent { ...@@ -253,7 +253,7 @@ export default class BasicList extends PureComponent {
); );
}; };
return ( return (
<PageHeaderLayout> <PageHeaderWrapper>
<div className={styles.standardList}> <div className={styles.standardList}>
<Card bordered={false}> <Card bordered={false}>
<Row> <Row>
...@@ -332,7 +332,7 @@ export default class BasicList extends PureComponent { ...@@ -332,7 +332,7 @@ export default class BasicList extends PureComponent {
> >
{getModalContent()} {getModalContent()}
</Modal> </Modal>
</PageHeaderLayout> </PageHeaderWrapper>
); );
} }
} }
...@@ -3,7 +3,7 @@ import { connect } from 'dva'; ...@@ -3,7 +3,7 @@ import { connect } from 'dva';
import { Card, Button, Icon, List } from 'antd'; import { Card, Button, Icon, List } from 'antd';
import Ellipsis from '@/components/Ellipsis'; import Ellipsis from '@/components/Ellipsis';
import PageHeaderLayout from '@/layouts/PageHeaderLayout'; import PageHeaderWrapper from '@/components/PageHeaderWrapper';
import styles from './CardList.less'; import styles from './CardList.less';
...@@ -61,7 +61,7 @@ export default class CardList extends PureComponent { ...@@ -61,7 +61,7 @@ export default class CardList extends PureComponent {
); );
return ( return (
<PageHeaderLayout title="卡片列表" content={content} extraContent={extraContent}> <PageHeaderWrapper title="卡片列表" content={content} extraContent={extraContent}>
<div className={styles.cardList}> <div className={styles.cardList}>
<List <List
rowKey="id" rowKey="id"
...@@ -93,7 +93,7 @@ export default class CardList extends PureComponent { ...@@ -93,7 +93,7 @@ export default class CardList extends PureComponent {
} }
/> />
</div> </div>
</PageHeaderLayout> </PageHeaderWrapper>
); );
} }
} }
...@@ -2,7 +2,7 @@ import React, { Component } from 'react'; ...@@ -2,7 +2,7 @@ import React, { Component } from 'react';
import router from 'umi/router'; import router from 'umi/router';
import { connect } from 'dva'; import { connect } from 'dva';
import { Input } from 'antd'; import { Input } from 'antd';
import PageHeaderLayout from '@/layouts/PageHeaderLayout'; import PageHeaderWrapper from '@/components/PageHeaderWrapper';
@connect() @connect()
export default class SearchList extends Component { export default class SearchList extends Component {
...@@ -54,7 +54,7 @@ export default class SearchList extends Component { ...@@ -54,7 +54,7 @@ export default class SearchList extends Component {
const { match, children, location } = this.props; const { match, children, location } = this.props;
return ( return (
<PageHeaderLayout <PageHeaderWrapper
title="搜索列表" title="搜索列表"
content={mainSearch} content={mainSearch}
tabList={tabList} tabList={tabList}
...@@ -67,7 +67,7 @@ export default class SearchList extends Component { ...@@ -67,7 +67,7 @@ export default class SearchList extends Component {
<Route key={item.key} path={item.path} component={item.component} exact={item.exact} /> <Route key={item.key} path={item.path} component={item.component} exact={item.exact} />
))} ))}
</Switch> */} </Switch> */}
</PageHeaderLayout> </PageHeaderWrapper>
); );
} }
} }
...@@ -22,7 +22,7 @@ import { ...@@ -22,7 +22,7 @@ import {
Radio, Radio,
} from 'antd'; } from 'antd';
import StandardTable from '@/components/StandardTable'; import StandardTable from '@/components/StandardTable';
import PageHeaderLayout from '@/layouts/PageHeaderLayout'; import PageHeaderWrapper from '@/components/PageHeaderWrapper';
import styles from './TableList.less'; import styles from './TableList.less';
...@@ -630,7 +630,7 @@ export default class TableList extends PureComponent { ...@@ -630,7 +630,7 @@ export default class TableList extends PureComponent {
handleUpdate: this.handleUpdate, handleUpdate: this.handleUpdate,
}; };
return ( return (
<PageHeaderLayout title="查询表格"> <PageHeaderWrapper title="查询表格">
<Card bordered={false}> <Card bordered={false}>
<div className={styles.tableList}> <div className={styles.tableList}>
<div className={styles.tableListForm}>{this.renderForm()}</div> <div className={styles.tableListForm}>{this.renderForm()}</div>
...@@ -667,7 +667,7 @@ export default class TableList extends PureComponent { ...@@ -667,7 +667,7 @@ export default class TableList extends PureComponent {
values={stepFormValues} values={stepFormValues}
/> />
) : null} ) : null}
</PageHeaderLayout> </PageHeaderWrapper>
); );
} }
} }
...@@ -19,7 +19,7 @@ import { ...@@ -19,7 +19,7 @@ import {
} from 'antd'; } from 'antd';
import classNames from 'classnames'; import classNames from 'classnames';
import DescriptionList from '@/components/DescriptionList'; import DescriptionList from '@/components/DescriptionList';
import PageHeaderLayout from '@/layouts/PageHeaderLayout'; import PageHeaderWrapper from '@/components/PageHeaderWrapper';
import styles from './AdvancedProfile.less'; import styles from './AdvancedProfile.less';
const { Step } = Steps; const { Step } = Steps;
...@@ -257,7 +257,7 @@ export default class AdvancedProfile extends Component { ...@@ -257,7 +257,7 @@ export default class AdvancedProfile extends Component {
}; };
return ( return (
<PageHeaderLayout <PageHeaderWrapper
title="单号:234231029431" title="单号:234231029431"
logo={ logo={
<img alt="" src="https://gw.alipayobjects.com/zos/rmsportal/nxkuOJlFJuAUhzlMTCEe.png" /> <img alt="" src="https://gw.alipayobjects.com/zos/rmsportal/nxkuOJlFJuAUhzlMTCEe.png" />
...@@ -345,7 +345,7 @@ export default class AdvancedProfile extends Component { ...@@ -345,7 +345,7 @@ export default class AdvancedProfile extends Component {
> >
{contentList[operationkey]} {contentList[operationkey]}
</Card> </Card>
</PageHeaderLayout> </PageHeaderWrapper>
); );
} }
} }
...@@ -2,7 +2,7 @@ import React, { Component } from 'react'; ...@@ -2,7 +2,7 @@ import React, { Component } from 'react';
import { connect } from 'dva'; import { connect } from 'dva';
import { Card, Badge, Table, Divider } from 'antd'; import { Card, Badge, Table, Divider } from 'antd';
import DescriptionList from '@/components/DescriptionList'; import DescriptionList from '@/components/DescriptionList';
import PageHeaderLayout from '@/layouts/PageHeaderLayout'; import PageHeaderWrapper from '@/components/PageHeaderWrapper';
import styles from './BasicProfile.less'; import styles from './BasicProfile.less';
const { Description } = DescriptionList; const { Description } = DescriptionList;
...@@ -142,7 +142,7 @@ export default class BasicProfile extends Component { ...@@ -142,7 +142,7 @@ export default class BasicProfile extends Component {
}, },
]; ];
return ( return (
<PageHeaderLayout title="基础详情页"> <PageHeaderWrapper title="基础详情页">
<Card bordered={false}> <Card bordered={false}>
<DescriptionList size="large" title="退款申请" style={{ marginBottom: 32 }}> <DescriptionList size="large" title="退款申请" style={{ marginBottom: 32 }}>
<Description term="取货单号">1000000000</Description> <Description term="取货单号">1000000000</Description>
...@@ -177,7 +177,7 @@ export default class BasicProfile extends Component { ...@@ -177,7 +177,7 @@ export default class BasicProfile extends Component {
columns={progressColumns} columns={progressColumns}
/> />
</Card> </Card>
</PageHeaderLayout> </PageHeaderWrapper>
); );
} }
} }
...@@ -2,7 +2,7 @@ import React, { Fragment } from 'react'; ...@@ -2,7 +2,7 @@ import React, { Fragment } from 'react';
import { formatMessage, FormattedMessage } from 'umi/locale'; import { formatMessage, FormattedMessage } from 'umi/locale';
import { Button, Icon, Card } from 'antd'; import { Button, Icon, Card } from 'antd';
import Result from '@/components/Result'; import Result from '@/components/Result';
import PageHeaderLayout from '@/layouts/PageHeaderLayout'; import PageHeaderWrapper from '@/components/PageHeaderWrapper';
const extra = ( const extra = (
<Fragment> <Fragment>
...@@ -51,7 +51,7 @@ const actions = ( ...@@ -51,7 +51,7 @@ const actions = (
); );
export default () => ( export default () => (
<PageHeaderLayout> <PageHeaderWrapper>
<Card bordered={false}> <Card bordered={false}>
<Result <Result
type="error" type="error"
...@@ -62,5 +62,5 @@ export default () => ( ...@@ -62,5 +62,5 @@ export default () => (
style={{ marginTop: 48, marginBottom: 16 }} style={{ marginTop: 48, marginBottom: 16 }}
/> />
</Card> </Card>
</PageHeaderLayout> </PageHeaderWrapper>
); );
...@@ -2,7 +2,7 @@ import React, { Fragment } from 'react'; ...@@ -2,7 +2,7 @@ import React, { Fragment } from 'react';
import { formatMessage, FormattedMessage } from 'umi/locale'; import { formatMessage, FormattedMessage } from 'umi/locale';
import { Button, Row, Col, Icon, Steps, Card } from 'antd'; import { Button, Row, Col, Icon, Steps, Card } from 'antd';
import Result from '@/components/Result'; import Result from '@/components/Result';
import PageHeaderLayout from '@/layouts/PageHeaderLayout'; import PageHeaderWrapper from '@/components/PageHeaderWrapper';
const { Step } = Steps; const { Step } = Steps;
...@@ -128,7 +128,7 @@ const actions = ( ...@@ -128,7 +128,7 @@ const actions = (
); );
export default () => ( export default () => (
<PageHeaderLayout> <PageHeaderWrapper>
<Card bordered={false}> <Card bordered={false}>
<Result <Result
type="success" type="success"
...@@ -139,5 +139,5 @@ export default () => ( ...@@ -139,5 +139,5 @@ export default () => (
style={{ marginTop: 48, marginBottom: 16 }} style={{ marginTop: 48, marginBottom: 16 }}
/> />
</Card> </Card>
</PageHeaderLayout> </PageHeaderWrapper>
); );
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