diff --git a/src/components/PageHeader/index.d.ts b/src/components/PageHeader/index.d.ts index 22423ef905b4de324c47105f77a367fc0642c2ad..f4d56c265b3f0be3ae1765ca1f0a1a8b723f533b 100644 --- a/src/components/PageHeader/index.d.ts +++ b/src/components/PageHeader/index.d.ts @@ -16,6 +16,7 @@ export interface IPageHeaderProps { linkElement?: React.ReactNode; style?: React.CSSProperties; home?: React.ReactNode; + wide?: boolean; } export default class PageHeader extends React.Component {} diff --git a/src/components/PageHeader/index.js b/src/components/PageHeader/index.js index ef0a563c301f0f7fac4dc5805e1ac9a7a25cdc78..60a372989cb6e3906acef0e23518cbfbce937977 100644 --- a/src/components/PageHeader/index.js +++ b/src/components/PageHeader/index.js @@ -188,6 +188,7 @@ export default class PageHeader extends PureComponent { tabDefaultActiveKey, tabBarExtraContent, loading = false, + wide = false, } = this.props; const { breadcrumb } = this.state; @@ -201,34 +202,36 @@ export default class PageHeader extends PureComponent { } return (
- - {breadcrumb} -
- {logo &&
{logo}
} -
-
- {title &&

{title}

} - {action &&
{action}
} -
-
- {content &&
{content}
} - {extraContent &&
{extraContent}
} +
+ + {breadcrumb} +
+ {logo &&
{logo}
} +
+
+ {title &&

{title}

} + {action &&
{action}
} +
+
+ {content &&
{content}
} + {extraContent &&
{extraContent}
} +
-
- {tabList && tabList.length ? ( - - {tabList.map(item => ( - - ))} - - ) : null} - + {tabList && tabList.length ? ( + + {tabList.map(item => ( + + ))} + + ) : null} + +
); } diff --git a/src/components/PageHeader/index.less b/src/components/PageHeader/index.less index efc581ab041ee8d247c720fb06bdb8c9f5f7b900..5de4d5a9a8f89b2ea459cef883e5bf718c2f7921 100644 --- a/src/components/PageHeader/index.less +++ b/src/components/PageHeader/index.less @@ -4,7 +4,10 @@ background: @component-background; padding: 16px 32px 0 32px; border-bottom: @border-width-base @border-style-base @border-color-split; - + .wide { + max-width: 1200px; + margin: auto; + } .detail { display: flex; } diff --git a/src/components/PageHeader/index.md b/src/components/PageHeader/index.md index c446d4106df40aa71d840ca947cb84e0e49432f6..c0de288efcfeafe9e40c7ef30344b522207176f2 100644 --- a/src/components/PageHeader/index.md +++ b/src/components/PageHeader/index.md @@ -27,6 +27,7 @@ order: 11 | tabList | tab 标题列表 | array<{key: string, tab: ReactNode}> | - | | tabActiveKey | 当前高亮的 tab 项 | string | - | | tabDefaultActiveKey | 默认高亮的 tab 项 | string | 第一项 | +| wide | 是否定宽 | boolean | false | | onTabChange | 切换面板的回调 | (key) => void | - | | itemRender | 自定义节点方法 | (menuItem) => ReactNode | - | | linkElement | 定义链接的元素,默认为 `a`,可传入 react-router 的 Link | string\|ReactElement | - | diff --git a/src/components/SettingDarwer/index.js b/src/components/SettingDarwer/index.js index 420b2c7c3d22ee9c64df4683a4cda395e78d2bb8..7cc0bd020aa9a31ce412e33059b7a0538d309e45 100644 --- a/src/components/SettingDarwer/index.js +++ b/src/components/SettingDarwer/index.js @@ -116,29 +116,32 @@ class SettingDarwer extends PureComponent { width={273} onClose={this.togglerContent} placement="right" + handler={ +
+ {!collapse ? ( + + ) : ( + + )} +
+ } + onHandleClick={this.togglerContent} style={{ zIndex: 999, }} > -
- {!collapse ? ( - - ) : ( - - )} -
- 拷贝代码 + + 拷贝代码
diff --git a/src/components/SettingDarwer/index.less b/src/components/SettingDarwer/index.less index 323390965290c44482d1bb229f31d1026d5a311c..6dd61b997ce585efc305a646784a3eb630be58b0 100644 --- a/src/components/SettingDarwer/index.less +++ b/src/components/SettingDarwer/index.less @@ -52,11 +52,10 @@ position: fixed; top: 240px; background: #1890ff; - width: 57px; + width: 48px; height: 48px; right: 273px; - padding: 14px 18px; - padding-left: 24px; + padding: 14px 14px; cursor: pointer; pointer-events: auto; z-index: 0; diff --git a/src/layouts/PageHeaderLayout.js b/src/layouts/PageHeaderLayout.js index 4801264a518928a5ce0d62206e953984ded3c1c2..9b8ae660ca1363906595b54e368bb3ae07e25acc 100644 --- a/src/layouts/PageHeaderLayout.js +++ b/src/layouts/PageHeaderLayout.js @@ -5,14 +5,16 @@ import PageHeader from '@/components/PageHeader'; import GridContent from './GridContent'; import styles from './PageHeaderLayout.less'; import MenuContext from './MenuContext'; +import { connect } from 'dva'; -const PageHeaderLayout = ({ children, wrapperClassName, top, ...restProps }) => ( +const PageHeaderLayout = ({ children, grid, wrapperClassName, top, ...restProps }) => (
{top} {value => { return ( } {...value} key="pageheader" @@ -36,4 +38,6 @@ const PageHeaderLayout = ({ children, wrapperClassName, top, ...restProps }) =>
); -export default PageHeaderLayout; +export default connect(({ setting }) => ({ + grid: setting.grid, +}))(PageHeaderLayout); diff --git a/src/models/setting.js b/src/models/setting.js index 7e978a780785f4f9f5c3128d3857c7335a9681a4..f968d6cefe935446f02539b60336d8629248383d 100644 --- a/src/models/setting.js +++ b/src/models/setting.js @@ -1,4 +1,5 @@ import { message } from 'antd'; + const defaultSetting = { collapse: false, silderTheme: 'dark',