Commit 2835ffae authored by jim's avatar jim

merge master

parents deccafe6 df0ffd6d
{
"parser": "babel-eslint",
"extends": ["airbnb", "prettier"],
"env": {
"browser": true,
"node": true,
"es6": true,
"mocha": true,
"jest": true,
"jasmine": true
},
"rules": {
"generator-star-spacing": [0],
"consistent-return": [0],
"react/forbid-prop-types": [0],
"react/jsx-filename-extension": [1, { "extensions": [".js"] }],
"global-require": [1],
"import/prefer-default-export": [0],
"react/jsx-no-bind": [0],
"react/prop-types": [0],
"react/prefer-stateless-function": [0],
"react/jsx-wrap-multilines": [
"error",
{
"declaration": "parens-new-line",
"assignment": "parens-new-line",
"return": "parens-new-line",
"arrow": "parens-new-line",
"condition": "parens-new-line",
"logical": "parens-new-line",
"prop": "ignore"
}
],
"no-else-return": [0],
"no-restricted-syntax": [0],
"import/no-extraneous-dependencies": [0],
"no-use-before-define": [0],
"jsx-a11y/no-static-element-interactions": [0],
"jsx-a11y/no-noninteractive-element-interactions": [0],
"jsx-a11y/click-events-have-key-events": [0],
"jsx-a11y/anchor-is-valid": [0],
"no-nested-ternary": [0],
"arrow-body-style": [0],
"import/extensions": [0],
"no-bitwise": [0],
"no-cond-assign": [0],
"import/no-unresolved": [0],
"comma-dangle": [
"error",
{
"arrays": "always-multiline",
"objects": "always-multiline",
"imports": "always-multiline",
"exports": "always-multiline",
"functions": "ignore"
}
],
"object-curly-newline": [0],
"function-paren-newline": [0],
"no-restricted-globals": [0],
"require-yield": [1]
},
"parserOptions": {
"ecmaFeatures": {
"experimentalObjectRestSpread": true
}
},
"settings": {
"polyfills": ["fetch", "promises"]
}
}
module.exports = {
parser: 'babel-eslint',
extends: ['airbnb', 'prettier'],
env: {
browser: true,
node: true,
es6: true,
mocha: true,
jest: true,
jasmine: true,
},
rules: {
'generator-star-spacing': [0],
'consistent-return': [0],
'react/forbid-prop-types': [0],
'react/jsx-filename-extension': [1, { extensions: ['.js'] }],
'global-require': [1],
'import/prefer-default-export': [0],
'react/jsx-no-bind': [0],
'react/prop-types': [0],
'react/prefer-stateless-function': [0],
'react/jsx-wrap-multilines': [
'error',
{
declaration: 'parens-new-line',
assignment: 'parens-new-line',
return: 'parens-new-line',
arrow: 'parens-new-line',
condition: 'parens-new-line',
logical: 'parens-new-line',
prop: 'ignore',
},
],
'no-else-return': [0],
'no-restricted-syntax': [0],
'import/no-extraneous-dependencies': [0],
'no-use-before-define': [0],
'jsx-a11y/no-static-element-interactions': [0],
'jsx-a11y/no-noninteractive-element-interactions': [0],
'jsx-a11y/click-events-have-key-events': [0],
'jsx-a11y/anchor-is-valid': [0],
'no-nested-ternary': [0],
'arrow-body-style': [0],
'import/extensions': [0],
'no-bitwise': [0],
'no-cond-assign': [0],
'import/no-unresolved': [0],
'comma-dangle': [
'error',
{
arrays: 'always-multiline',
objects: 'always-multiline',
imports: 'always-multiline',
exports: 'always-multiline',
functions: 'ignore',
},
],
'object-curly-newline': [0],
'function-paren-newline': [0],
'no-restricted-globals': [0],
'require-yield': [1],
},
parserOptions: {
ecmaFeatures: {
experimentalObjectRestSpread: true,
},
},
settings: {
polyfills: ['fetch', 'promises'],
},
};
...@@ -2,7 +2,7 @@ import * as React from 'react'; ...@@ -2,7 +2,7 @@ import * as React from 'react';
export interface IChartCardProps { export interface IChartCardProps {
title: React.ReactNode; title: React.ReactNode;
action?: React.ReactNode; action?: React.ReactNode;
total?: React.ReactNode | function | number; total?: React.ReactNode | number | (() => React.ReactNode | number);
footer?: React.ReactNode; footer?: React.ReactNode;
contentHeight?: number; contentHeight?: number;
avatar?: React.ReactNode; avatar?: React.ReactNode;
......
...@@ -10,7 +10,7 @@ export interface IPieProps { ...@@ -10,7 +10,7 @@ export interface IPieProps {
x: string | string; x: string | string;
y: number; y: number;
}>; }>;
total?: string | function; total?: React.ReactNode | number | (() => React.ReactNode | number);
title?: React.ReactNode; title?: React.ReactNode;
tooltip?: boolean; tooltip?: boolean;
valueFormat?: (value: string) => string | React.ReactNode; valueFormat?: (value: string) => string | React.ReactNode;
......
...@@ -3,7 +3,7 @@ import classNames from 'classnames'; ...@@ -3,7 +3,7 @@ import classNames from 'classnames';
import { Row } from 'antd'; import { Row } from 'antd';
import styles from './index.less'; import styles from './index.less';
export default ({ const DescriptionList = ({
className, className,
title, title,
col = 3, col = 3,
...@@ -27,3 +27,5 @@ export default ({ ...@@ -27,3 +27,5 @@ export default ({
</div> </div>
); );
}; };
export default DescriptionList;
...@@ -17,7 +17,8 @@ ...@@ -17,7 +17,8 @@
} }
.term { .term {
line-height: 22px; // Line-height is 22px IE dom height will calculate error
line-height: 20px;
padding-bottom: 16px; padding-bottom: 16px;
margin-right: 8px; margin-right: 8px;
color: @heading-color; color: @heading-color;
......
...@@ -4,7 +4,7 @@ import { Button } from 'antd'; ...@@ -4,7 +4,7 @@ import { Button } from 'antd';
import config from './typeConfig'; import config from './typeConfig';
import styles from './index.less'; import styles from './index.less';
export default ({ className, linkElement = 'a', type, title, desc, img, actions, ...rest }) => { const Exception = ({ className, linkElement = 'a', type, title, desc, img, actions, ...rest }) => {
const pageType = type in config ? type : '404'; const pageType = type in config ? type : '404';
const clsString = classNames(styles.exception, className); const clsString = classNames(styles.exception, className);
return ( return (
...@@ -33,3 +33,5 @@ export default ({ className, linkElement = 'a', type, title, desc, img, actions, ...@@ -33,3 +33,5 @@ export default ({ className, linkElement = 'a', type, title, desc, img, actions,
</div> </div>
); );
}; };
export default Exception;
import * as React from 'react'; import * as React from 'react';
export interface IGlobalFooterProps { export interface IGlobalFooterProps {
links?: Array<{ links?: Array<{
key?: string;
title: React.ReactNode; title: React.ReactNode;
href: string; href: string;
blankTarget?: boolean; blankTarget?: boolean;
......
...@@ -2,7 +2,7 @@ import React from 'react'; ...@@ -2,7 +2,7 @@ import React from 'react';
import classNames from 'classnames'; import classNames from 'classnames';
import styles from './index.less'; import styles from './index.less';
export default ({ className, links, copyright }) => { const GlobalFooter = ({ className, links, copyright }) => {
const clsString = classNames(styles.globalFooter, className); const clsString = classNames(styles.globalFooter, className);
return ( return (
<div className={clsString}> <div className={clsString}>
...@@ -19,3 +19,5 @@ export default ({ className, links, copyright }) => { ...@@ -19,3 +19,5 @@ export default ({ className, links, copyright }) => {
</div> </div>
); );
}; };
export default GlobalFooter;
...@@ -5,7 +5,7 @@ import styles from './index.less'; ...@@ -5,7 +5,7 @@ import styles from './index.less';
const FormItem = Form.Item; const FormItem = Form.Item;
export default ({ className, ...rest }) => { const LoginSubmit = ({ className, ...rest }) => {
const clsString = classNames(styles.submit, className); const clsString = classNames(styles.submit, className);
return ( return (
<FormItem> <FormItem>
...@@ -13,3 +13,5 @@ export default ({ className, ...rest }) => { ...@@ -13,3 +13,5 @@ export default ({ className, ...rest }) => {
</FormItem> </FormItem>
); );
}; };
export default LoginSubmit;
...@@ -3,7 +3,7 @@ import { Icon } from 'antd'; ...@@ -3,7 +3,7 @@ import { Icon } from 'antd';
import classNames from 'classnames'; import classNames from 'classnames';
import styles from './index.less'; import styles from './index.less';
export default ({ theme, title, subTitle, total, subTotal, status, suffix, gap, ...rest }) => ( const NumberInfo = ({ theme, title, subTitle, total, subTotal, status, suffix, gap, ...rest }) => (
<div <div
className={classNames(styles.numberInfo, { className={classNames(styles.numberInfo, {
[styles[`numberInfo${theme}`]]: theme, [styles[`numberInfo${theme}`]]: theme,
...@@ -26,3 +26,5 @@ export default ({ theme, title, subTitle, total, subTotal, status, suffix, gap, ...@@ -26,3 +26,5 @@ export default ({ theme, title, subTitle, total, subTotal, status, suffix, gap,
</div> </div>
</div> </div>
); );
export default NumberInfo;
...@@ -17,8 +17,18 @@ export function getBreadcrumb(breadcrumbNameMap, url) { ...@@ -17,8 +17,18 @@ export function getBreadcrumb(breadcrumbNameMap, url) {
} }
return breadcrumb || {}; return breadcrumb || {};
} }
export default class PageHeader extends PureComponent { export default class PageHeader extends PureComponent {
state = {
breadcrumb: null,
};
componentDidMount() {
this.getBreadcrumbDom();
}
componentWillReceiveProps() {
this.getBreadcrumbDom();
}
onChange = key => { onChange = key => {
if (this.props.onTabChange) { if (this.props.onTabChange) {
this.props.onTabChange(key); this.props.onTabChange(key);
...@@ -32,6 +42,12 @@ export default class PageHeader extends PureComponent { ...@@ -32,6 +42,12 @@ export default class PageHeader extends PureComponent {
breadcrumbNameMap: this.props.breadcrumbNameMap, breadcrumbNameMap: this.props.breadcrumbNameMap,
}; };
}; };
getBreadcrumbDom = () => {
const breadcrumb = this.conversionBreadcrumbList();
this.setState({
breadcrumb,
});
};
// Generated according to props // Generated according to props
conversionFromProps = () => { conversionFromProps = () => {
const { breadcrumbList, breadcrumbSeparator, linkElement = 'a' } = this.props; const { breadcrumbList, breadcrumbSeparator, linkElement = 'a' } = this.props;
...@@ -151,8 +167,8 @@ export default class PageHeader extends PureComponent { ...@@ -151,8 +167,8 @@ export default class PageHeader extends PureComponent {
tabDefaultActiveKey, tabDefaultActiveKey,
tabBarExtraContent, tabBarExtraContent,
} = this.props; } = this.props;
const clsString = classNames(styles.pageHeader, className); const clsString = classNames(styles.pageHeader, className);
const breadcrumb = this.conversionBreadcrumbList();
const activeKeyProps = {}; const activeKeyProps = {};
if (tabDefaultActiveKey !== undefined) { if (tabDefaultActiveKey !== undefined) {
activeKeyProps.defaultActiveKey = tabDefaultActiveKey; activeKeyProps.defaultActiveKey = tabDefaultActiveKey;
...@@ -163,7 +179,7 @@ export default class PageHeader extends PureComponent { ...@@ -163,7 +179,7 @@ export default class PageHeader extends PureComponent {
return ( return (
<div className={clsString}> <div className={clsString}>
{breadcrumb} {this.state.breadcrumb}
<div className={styles.detail}> <div className={styles.detail}>
{logo && <div className={styles.logo}>{logo}</div>} {logo && <div className={styles.logo}>{logo}</div>}
<div className={styles.main}> <div className={styles.main}>
......
...@@ -66,7 +66,8 @@ ...@@ -66,7 +66,8 @@
.content, .content,
.extraContent, .extraContent,
.main { .main {
flex: auto; // IE auto is no have height
flex: 1;
} }
.title, .title,
......
...@@ -19,8 +19,8 @@ const getFlatMenuKeys = menuData => { ...@@ -19,8 +19,8 @@ const getFlatMenuKeys = menuData => {
return keys; return keys;
}; };
export default props => const SiderMenuWrapper = props =>
props.isMobile || props.fixSiderbar ? ( props.isMobile ? (
<DrawerMenu <DrawerMenu
parent={null} parent={null}
level={null} level={null}
...@@ -40,3 +40,5 @@ export default props => ...@@ -40,3 +40,5 @@ export default props =>
) : ( ) : (
<SiderMenu {...props} flatMenuKeys={getFlatMenuKeys(props.menuData)} /> <SiderMenu {...props} flatMenuKeys={getFlatMenuKeys(props.menuData)} />
); );
export default SiderMenuWrapper;
...@@ -2,7 +2,7 @@ import React from 'react'; ...@@ -2,7 +2,7 @@ import React from 'react';
import classNames from 'classnames'; import classNames from 'classnames';
import styles from './index.less'; import styles from './index.less';
export default ({ title, children, last, block, grid, ...rest }) => { const StandardFormRow = ({ title, children, last, block, grid, ...rest }) => {
const cls = classNames(styles.standardFormRow, { const cls = classNames(styles.standardFormRow, {
[styles.standardFormRowBlock]: block, [styles.standardFormRowBlock]: block,
[styles.standardFormRowLast]: last, [styles.standardFormRowLast]: last,
...@@ -20,3 +20,5 @@ export default ({ title, children, last, block, grid, ...rest }) => { ...@@ -20,3 +20,5 @@ export default ({ title, children, last, block, grid, ...rest }) => {
</div> </div>
); );
}; };
export default StandardFormRow;
...@@ -3,7 +3,8 @@ ...@@ -3,7 +3,8 @@
.container { .container {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
min-height: 100%; height: 100vh;
overflow: auto;
background: #f0f2f5; background: #f0f2f5;
} }
......
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