Commit c59842ca authored by afc163's avatar afc163 Committed by 陈帅

make setting names easy to understand

parent ef3653a8
...@@ -6,7 +6,7 @@ class GridContent extends PureComponent { ...@@ -6,7 +6,7 @@ class GridContent extends PureComponent {
render() { render() {
const { grid, children } = this.props; const { grid, children } = this.props;
let className = `${styles.main}`; let className = `${styles.main}`;
if (grid === 'Wide') { if (grid === 'Fixed') {
className = `${styles.main} ${styles.wide}`; className = `${styles.main} ${styles.wide}`;
} }
return <div className={className}>{children}</div>; return <div className={className}>{children}</div>;
......
...@@ -13,7 +13,7 @@ const PageHeaderWrapper = ({ children, grid, wrapperClassName, top, ...restProps ...@@ -13,7 +13,7 @@ const PageHeaderWrapper = ({ children, grid, wrapperClassName, top, ...restProps
<MenuContext.Consumer> <MenuContext.Consumer>
{value => ( {value => (
<PageHeader <PageHeader
wide={grid === 'Wide'} wide={grid === 'Fixed'}
home={<FormattedMessage id="menu.home" defaultMessage="Home" />} home={<FormattedMessage id="menu.home" defaultMessage="Home" />}
{...value} {...value}
key="pageheader" key="pageheader"
......
...@@ -3,6 +3,7 @@ import { Select, message, Drawer, List, Switch, Divider, Icon, Button, Alert } f ...@@ -3,6 +3,7 @@ import { Select, message, Drawer, List, Switch, Divider, Icon, Button, Alert } f
import { formatMessage } from 'umi/locale'; import { formatMessage } from 'umi/locale';
import { CopyToClipboard } from 'react-copy-to-clipboard'; import { CopyToClipboard } from 'react-copy-to-clipboard';
import { connect } from 'dva'; import { connect } from 'dva';
import omit from 'omit.js';
import styles from './index.less'; import styles from './index.less';
import ThemeColor from './ThemeColor'; import ThemeColor from './ThemeColor';
import BlockChecbox from './BlockChecbox'; import BlockChecbox from './BlockChecbox';
...@@ -39,8 +40,8 @@ class SettingDrawer extends PureComponent { ...@@ -39,8 +40,8 @@ class SettingDrawer extends PureComponent {
onSelect={value => this.changeSetting('grid', value)} onSelect={value => this.changeSetting('grid', value)}
style={{ width: 80 }} style={{ width: 80 }}
> >
<Select.Option value="Wide"> <Select.Option value="Fixed">
{formatMessage({ id: 'app.setting.gridmode.wide' })} {formatMessage({ id: 'app.setting.gridmode.fixed' })}
</Select.Option> </Select.Option>
<Select.Option value="Fluid"> <Select.Option value="Fluid">
{formatMessage({ id: 'app.setting.gridmode.fluid' })} {formatMessage({ id: 'app.setting.gridmode.fluid' })}
...@@ -88,7 +89,7 @@ class SettingDrawer extends PureComponent { ...@@ -88,7 +89,7 @@ class SettingDrawer extends PureComponent {
const nextState = { ...setting }; const nextState = { ...setting };
nextState[key] = value; nextState[key] = value;
if (key === 'layout') { if (key === 'layout') {
nextState.grid = value === 'topmenu' ? 'Wide' : 'Fluid'; nextState.grid = value === 'topmenu' ? 'Fixed' : 'Fluid';
} else if (key === 'fixedHeader' && !value) { } else if (key === 'fixedHeader' && !value) {
nextState.autoHideHeader = false; nextState.autoHideHeader = false;
} }
...@@ -198,7 +199,7 @@ class SettingDrawer extends PureComponent { ...@@ -198,7 +199,7 @@ class SettingDrawer extends PureComponent {
</Body> </Body>
<Divider /> <Divider />
<CopyToClipboard <CopyToClipboard
text={JSON.stringify(setting)} text={JSON.stringify(omit(setting, ['colorWeak']), null, 2)}
onCopy={() => message.success(formatMessage({ id: 'app.setting.copyinfo' }))} onCopy={() => message.success(formatMessage({ id: 'app.setting.copyinfo' }))}
> >
<Button block icon="copy"> <Button block icon="copy">
......
...@@ -9,13 +9,13 @@ export default class TopNavHeader extends PureComponent { ...@@ -9,13 +9,13 @@ export default class TopNavHeader extends PureComponent {
super(props); super(props);
this.state = { this.state = {
maxWidth: (props.grid === 'Wide' ? 1200 : window.innerWidth) - 324 - 165 - 4, maxWidth: (props.grid === 'Fixed' ? 1200 : window.innerWidth) - 324 - 165 - 4,
}; };
} }
static getDerivedStateFromProps(props) { static getDerivedStateFromProps(props) {
return { return {
maxWidth: (props.grid === 'Wide' ? 1200 : window.innerWidth) - 324 - 165 - 4, maxWidth: (props.grid === 'Fixed' ? 1200 : window.innerWidth) - 324 - 165 - 4,
}; };
} }
...@@ -28,7 +28,7 @@ export default class TopNavHeader extends PureComponent { ...@@ -28,7 +28,7 @@ export default class TopNavHeader extends PureComponent {
ref={ref => { ref={ref => {
this.maim = ref; this.maim = ref;
}} }}
className={`${styles.main} ${grid === 'Wide' ? styles.wide : ''}`} className={`${styles.main} ${grid === 'Fixed' ? styles.wide : ''}`}
> >
<div className={styles.left}> <div className={styles.left}>
<div className={styles.logo} key="logo" id="logo"> <div className={styles.logo} key="logo" id="logo">
......
module.exports = { module.exports = {
navTheme: 'dark', navTheme: 'dark', // theme for nav menu
primaryColor: '#1890FF', primaryColor: '#1890FF', // primary color of ant design
layout: 'sidemenu', layout: 'sidemenu', // nav menu position: sidemenu or topmenu
grid: 'Fluid', contentWidth: 'Fluid', // layout of content: Fluid or Fixed, only works when layout is topmenu
fixedHeader: false, fixedHeader: false, // sticky header
autoHideHeader: false, autoHideHeader: false, // auto hide header
fixSiderbar: false, fixSiderbar: false, // sticky siderbar
colorWeak: false,
}; };
...@@ -156,9 +156,9 @@ export default { ...@@ -156,9 +156,9 @@ export default {
'app.result.success.btn-project': 'View project', 'app.result.success.btn-project': 'View project',
'app.result.success.btn-print': 'Print', 'app.result.success.btn-print': 'Print',
'app.setting.pagestyle': 'Page style setting', 'app.setting.pagestyle': 'Page style setting',
'app.setting.gridmode': 'Grid Mode', 'app.setting.content-width': 'Content Width',
'app.setting.gridmode.wide': 'Wide', 'app.setting.content-width.fixed': 'Fixed',
'app.setting.gridmode.fluid': 'Fluid', 'app.setting.content-width.fluid': 'Fluid',
'app.setting.themecolor': 'Theme Color', 'app.setting.themecolor': 'Theme Color',
'app.setting.navigationmode': 'Navigation Mode', 'app.setting.navigationmode': 'Navigation Mode',
'app.setting.fixedheader': 'Fixed Header', 'app.setting.fixedheader': 'Fixed Header',
......
...@@ -151,10 +151,10 @@ export default { ...@@ -151,10 +151,10 @@ export default {
'app.result.success.btn-return': '返回列表', 'app.result.success.btn-return': '返回列表',
'app.result.success.btn-project': '查看项目', 'app.result.success.btn-project': '查看项目',
'app.result.success.btn-print': '打印', 'app.result.success.btn-print': '打印',
'app.setting.pagestyle': '风格设置', 'app.setting.pagestyle': '风格设置',
'app.setting.gridmode': '栅格模式', 'app.setting.content-width': '内容区域宽度',
'app.setting.gridmode.wide': '定宽', 'app.setting.content-width.fixed': '定宽',
'app.setting.gridmode.fluid': '流式', 'app.setting.content-width.fluid': '流式',
'app.setting.themecolor': '主题色', 'app.setting.themecolor': '主题色',
'app.setting.navigationmode': '导航模式', 'app.setting.navigationmode': '导航模式',
'app.setting.fixedheader': '固定 Header', 'app.setting.fixedheader': '固定 Header',
......
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