diff --git a/src/components/PageHeaderWrapper/GridContent.js b/src/components/PageHeaderWrapper/GridContent.js index 5f16c5d00f81f76705ccfab74d8a532d4aa39f42..931ea20c91b21724f8680a7cf12f3aaefb2fda75 100644 --- a/src/components/PageHeaderWrapper/GridContent.js +++ b/src/components/PageHeaderWrapper/GridContent.js @@ -4,9 +4,9 @@ import styles from './GridContent.less'; class GridContent extends PureComponent { render() { - const { grid, children } = this.props; + const { contentWidth, children } = this.props; let className = `${styles.main}`; - if (grid === 'Fixed') { + if (contentWidth === 'Fixed') { className = `${styles.main} ${styles.wide}`; } return
{children}
; @@ -14,5 +14,5 @@ class GridContent extends PureComponent { } export default connect(({ setting }) => ({ - grid: setting.grid, + contentWidth: setting.contentWidth, }))(GridContent); diff --git a/src/components/PageHeaderWrapper/index.js b/src/components/PageHeaderWrapper/index.js index 63082df74b03af2d6a1e3a0cc06d38e186cba774..660964046c0e0046043dacfbed5f8fbe3c194b60 100644 --- a/src/components/PageHeaderWrapper/index.js +++ b/src/components/PageHeaderWrapper/index.js @@ -7,13 +7,13 @@ import GridContent from './GridContent'; import styles from './index.less'; import MenuContext from '@/layouts/MenuContext'; -const PageHeaderWrapper = ({ children, grid, wrapperClassName, top, ...restProps }) => ( +const PageHeaderWrapper = ({ children, contentWidth, wrapperClassName, top, ...restProps }) => (
{top} {value => ( } {...value} key="pageheader" @@ -37,5 +37,5 @@ const PageHeaderWrapper = ({ children, grid, wrapperClassName, top, ...restProps ); export default connect(({ setting }) => ({ - grid: setting.grid, + contentWidth: setting.contentWidth, }))(PageHeaderWrapper); diff --git a/src/components/SettingDrawer/BlockChecbox.js b/src/components/SettingDrawer/BlockChecbox.js index be7e3ff1a11d4336c7ba1b53c2f74d56974db81e..49af42c730224cc76b9cac47f87c91cca0ef6da9 100644 --- a/src/components/SettingDrawer/BlockChecbox.js +++ b/src/components/SettingDrawer/BlockChecbox.js @@ -1,27 +1,23 @@ -import { Icon } from 'antd'; import React from 'react'; +import { Tooltip, Icon } from 'antd'; import style from './index.less'; const BlockChecbox = ({ value, onChange, list }) => (
{list.map(item => ( -
{ - onChange(item.key); - }} - > - {item.key} -
- + +
onChange(item.key)}> + {item.key} +
+ +
-
+ ))}
); diff --git a/src/components/SettingDrawer/ThemeColor.js b/src/components/SettingDrawer/ThemeColor.js index 6246dc61d481867321602b3210ba35164e71ff71..e5d66d4be5cb29a2684eff46734e06fba17d6923 100644 --- a/src/components/SettingDrawer/ThemeColor.js +++ b/src/components/SettingDrawer/ThemeColor.js @@ -1,5 +1,6 @@ -import { Icon } from 'antd'; import React from 'react'; +import { Tooltip, Icon } from 'antd'; +import { formatMessage } from 'umi/locale'; import styles from './ThemeColor.less'; const Tag = ({ color, check, ...rest }) => ( @@ -17,28 +18,53 @@ const ThemeColor = ({ colors, title, value, onChange }) => { let colorList = colors; if (!colors) { colorList = [ - '#F5222D', - '#FA541C', - '#FAAD14', - '#13C2C2', - '#52C41A', - '#1890FF', - '#2F54EB', - '#722ED1', + { + key: 'dust', + color: '#F5222D', + }, + { + key: 'volcano', + color: '#FA541C', + }, + { + key: 'sunset', + color: '#FAAD14', + }, + { + key: 'cyan', + color: '#13C2C2', + }, + { + key: 'green', + color: '#52C41A', + }, + { + key: 'daybreak', + color: '#1890FF', + }, + { + key: 'geekblue', + color: '#2F54EB', + }, + { + key: 'purple', + color: '#722ED1', + }, ]; } return (

{title}

- {colorList.map(color => ( - onChange && onChange(color)} - /> + {colorList.map(({ key, color }) => ( + + onChange && onChange(color)} + /> + ))}
diff --git a/src/components/SettingDrawer/index.js b/src/components/SettingDrawer/index.js index cb3592543c53ea3a37e23a82cdace7ce71a8810e..8950bb7a3af177d197e444265ab43ea9f8373a06 100644 --- a/src/components/SettingDrawer/index.js +++ b/src/components/SettingDrawer/index.js @@ -28,23 +28,23 @@ class SettingDrawer extends PureComponent { getLayOutSetting = () => { const { - setting: { grid, fixedHeader, layout, autoHideHeader, fixSiderbar }, + setting: { contentWidth, fixedHeader, layout, autoHideHeader, fixSiderbar }, } = this.props; return [ { - title: formatMessage({ id: 'app.setting.gridmode' }), + title: formatMessage({ id: 'app.setting.content-width' }), action: [ , ], @@ -89,7 +89,7 @@ class SettingDrawer extends PureComponent { const nextState = { ...setting }; nextState[key] = value; if (key === 'layout') { - nextState.grid = value === 'topmenu' ? 'Fixed' : 'Fluid'; + nextState.contentWidth = value === 'topmenu' ? 'Fixed' : 'Fluid'; } else if (key === 'fixedHeader' && !value) { nextState.autoHideHeader = false; } @@ -140,10 +140,12 @@ class SettingDrawer extends PureComponent { { key: 'dark', url: 'https://gw.alipayobjects.com/zos/rmsportal/LCkqqYNmvBEbokSDscrm.svg', + title: formatMessage({ id: 'app.setting.pagestyle.dark' }), }, { key: 'light', url: 'https://gw.alipayobjects.com/zos/rmsportal/jpRkZQMyYRryryPNtyIC.svg', + title: formatMessage({ id: 'app.setting.pagestyle.light' }), }, ]} value={navTheme} @@ -165,10 +167,12 @@ class SettingDrawer extends PureComponent { { key: 'sidemenu', url: 'https://gw.alipayobjects.com/zos/rmsportal/JopDzEhOqwOjeNTXkoje.svg', + title: formatMessage({ id: 'app.setting.sidemenu' }), }, { key: 'topmenu', url: 'https://gw.alipayobjects.com/zos/rmsportal/KDNDBbriJhLwuqMoxcAr.svg', + title: formatMessage({ id: 'app.setting.topmenu' }), }, ]} value={layout} diff --git a/src/components/TopNavHeader/index.js b/src/components/TopNavHeader/index.js index 347208c9a7a2cdbd2f0184c4dcf6de5d2229dbba..9c8575cebafdb8ece918f69ce2a683371a1dffb7 100644 --- a/src/components/TopNavHeader/index.js +++ b/src/components/TopNavHeader/index.js @@ -9,18 +9,18 @@ export default class TopNavHeader extends PureComponent { super(props); this.state = { - maxWidth: (props.grid === 'Fixed' ? 1200 : window.innerWidth) - 324 - 165 - 4, + maxWidth: (props.contentWidth === 'Fixed' ? 1200 : window.innerWidth) - 324 - 165 - 4, }; } static getDerivedStateFromProps(props) { return { - maxWidth: (props.grid === 'Fixed' ? 1200 : window.innerWidth) - 324 - 165 - 4, + maxWidth: (props.contentWidth === 'Fixed' ? 1200 : window.innerWidth) - 324 - 165 - 4, }; } render() { - const { theme, grid, logo } = this.props; + const { theme, contentWidth, logo } = this.props; const { maxWidth } = this.state; return (
@@ -28,7 +28,7 @@ export default class TopNavHeader extends PureComponent { ref={ref => { this.maim = ref; }} - className={`${styles.main} ${grid === 'Fixed' ? styles.wide : ''}`} + className={`${styles.main} ${contentWidth === 'Fixed' ? styles.wide : ''}`} >