Browse Source

merge master

pull/1452/head
jim 8 years ago
parent
commit
2835ffae49
  1. 71
      .eslintrc
  2. 71
      .eslintrc.js
  3. 9
      package.json
  4. 2
      src/components/Charts/ChartCard/index.d.ts
  5. 2
      src/components/Charts/Pie/index.d.ts
  6. 4
      src/components/DescriptionList/DescriptionList.js
  7. 3
      src/components/DescriptionList/index.less
  8. 4
      src/components/Exception/index.js
  9. 1
      src/components/GlobalFooter/index.d.ts
  10. 4
      src/components/GlobalFooter/index.js
  11. 4
      src/components/Login/LoginSubmit.js
  12. 4
      src/components/NumberInfo/index.js
  13. 22
      src/components/PageHeader/index.js
  14. 3
      src/components/PageHeader/index.less
  15. 6
      src/components/SiderMenu/index.js
  16. 4
      src/components/StandardFormRow/index.js
  17. 3
      src/layouts/UserLayout.less

71
.eslintrc

@ -1,71 +0,0 @@
{
"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"]
}
}

71
.eslintrc.js

@ -0,0 +1,71 @@
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'],
},
};

9
package.json

@ -25,12 +25,13 @@
"@babel/polyfill": "^7.0.0-beta.36",
"@types/react": "^16.3.8",
"@types/react-dom": "^16.0.5",
"antd": "^3.4.1",
"bizcharts-plugin-slider": "^2.0.3",
"antd": "^3.4.3",
"babel-plugin-transform-decorators-legacy": "^1.3.4",
"babel-runtime": "^6.9.2",
"bizcharts": "^3.1.5",
"bizcharts-plugin-slider": "^2.0.3",
"classnames": "^2.2.5",
"dva": "^2.2.2",
"dva": "^2.2.3",
"dva-loading": "^1.0.4",
"enquire-js": "^0.2.1",
"lodash": "^4.17.4",
@ -76,7 +77,7 @@
"redbox-react": "^1.5.0",
"regenerator-runtime": "^0.11.1",
"roadhog": "^2.3.0",
"roadhog-api-doc": "^0.3.4",
"roadhog-api-doc": "^1.0.2",
"stylelint": "^8.4.0",
"stylelint-config-prettier": "^3.0.4",
"stylelint-config-standard": "^18.0.0"

2
src/components/Charts/ChartCard/index.d.ts

@ -2,7 +2,7 @@ import * as React from 'react';
export interface IChartCardProps {
title: React.ReactNode;
action?: React.ReactNode;
total?: React.ReactNode | function | number;
total?: React.ReactNode | number | (() => React.ReactNode | number);
footer?: React.ReactNode;
contentHeight?: number;
avatar?: React.ReactNode;

2
src/components/Charts/Pie/index.d.ts

@ -10,7 +10,7 @@ export interface IPieProps {
x: string | string;
y: number;
}>;
total?: string | function;
total?: React.ReactNode | number | (() => React.ReactNode | number);
title?: React.ReactNode;
tooltip?: boolean;
valueFormat?: (value: string) => string | React.ReactNode;

4
src/components/DescriptionList/DescriptionList.js

@ -3,7 +3,7 @@ import classNames from 'classnames';
import { Row } from 'antd';
import styles from './index.less';
export default ({
const DescriptionList = ({
className,
title,
col = 3,
@ -27,3 +27,5 @@ export default ({
</div>
);
};
export default DescriptionList;

3
src/components/DescriptionList/index.less

@ -17,7 +17,8 @@
}
.term {
line-height: 22px;
// Line-height is 22px IE dom height will calculate error
line-height: 20px;
padding-bottom: 16px;
margin-right: 8px;
color: @heading-color;

4
src/components/Exception/index.js

@ -4,7 +4,7 @@ import { Button } from 'antd';
import config from './typeConfig';
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 clsString = classNames(styles.exception, className);
return (
@ -33,3 +33,5 @@ export default ({ className, linkElement = 'a', type, title, desc, img, actions,
</div>
);
};
export default Exception;

1
src/components/GlobalFooter/index.d.ts

@ -1,6 +1,7 @@
import * as React from 'react';
export interface IGlobalFooterProps {
links?: Array<{
key?: string;
title: React.ReactNode;
href: string;
blankTarget?: boolean;

4
src/components/GlobalFooter/index.js

@ -2,7 +2,7 @@ import React from 'react';
import classNames from 'classnames';
import styles from './index.less';
export default ({ className, links, copyright }) => {
const GlobalFooter = ({ className, links, copyright }) => {
const clsString = classNames(styles.globalFooter, className);
return (
<div className={clsString}>
@ -19,3 +19,5 @@ export default ({ className, links, copyright }) => {
</div>
);
};
export default GlobalFooter;

4
src/components/Login/LoginSubmit.js

@ -5,7 +5,7 @@ import styles from './index.less';
const FormItem = Form.Item;
export default ({ className, ...rest }) => {
const LoginSubmit = ({ className, ...rest }) => {
const clsString = classNames(styles.submit, className);
return (
<FormItem>
@ -13,3 +13,5 @@ export default ({ className, ...rest }) => {
</FormItem>
);
};
export default LoginSubmit;

4
src/components/NumberInfo/index.js

@ -3,7 +3,7 @@ import { Icon } from 'antd';
import classNames from 'classnames';
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
className={classNames(styles.numberInfo, {
[styles[`numberInfo${theme}`]]: theme,
@ -26,3 +26,5 @@ export default ({ theme, title, subTitle, total, subTotal, status, suffix, gap,
</div>
</div>
);
export default NumberInfo;

22
src/components/PageHeader/index.js

@ -17,8 +17,18 @@ export function getBreadcrumb(breadcrumbNameMap, url) {
}
return breadcrumb || {};
}
export default class PageHeader extends PureComponent {
state = {
breadcrumb: null,
};
componentDidMount() {
this.getBreadcrumbDom();
}
componentWillReceiveProps() {
this.getBreadcrumbDom();
}
onChange = key => {
if (this.props.onTabChange) {
this.props.onTabChange(key);
@ -32,6 +42,12 @@ export default class PageHeader extends PureComponent {
breadcrumbNameMap: this.props.breadcrumbNameMap,
};
};
getBreadcrumbDom = () => {
const breadcrumb = this.conversionBreadcrumbList();
this.setState({
breadcrumb,
});
};
// Generated according to props
conversionFromProps = () => {
const { breadcrumbList, breadcrumbSeparator, linkElement = 'a' } = this.props;
@ -151,8 +167,8 @@ export default class PageHeader extends PureComponent {
tabDefaultActiveKey,
tabBarExtraContent,
} = this.props;
const clsString = classNames(styles.pageHeader, className);
const breadcrumb = this.conversionBreadcrumbList();
const activeKeyProps = {};
if (tabDefaultActiveKey !== undefined) {
activeKeyProps.defaultActiveKey = tabDefaultActiveKey;
@ -163,7 +179,7 @@ export default class PageHeader extends PureComponent {
return (
<div className={clsString}>
{breadcrumb}
{this.state.breadcrumb}
<div className={styles.detail}>
{logo && <div className={styles.logo}>{logo}</div>}
<div className={styles.main}>

3
src/components/PageHeader/index.less

@ -66,7 +66,8 @@
.content,
.extraContent,
.main {
flex: auto;
// IE auto is no have height
flex: 1;
}
.title,

6
src/components/SiderMenu/index.js

@ -19,8 +19,8 @@ const getFlatMenuKeys = menuData => {
return keys;
};
export default props =>
props.isMobile || props.fixSiderbar ? (
const SiderMenuWrapper = props =>
props.isMobile ? (
<DrawerMenu
parent={null}
level={null}
@ -40,3 +40,5 @@ export default props =>
) : (
<SiderMenu {...props} flatMenuKeys={getFlatMenuKeys(props.menuData)} />
);
export default SiderMenuWrapper;

4
src/components/StandardFormRow/index.js

@ -2,7 +2,7 @@ import React from 'react';
import classNames from 'classnames';
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, {
[styles.standardFormRowBlock]: block,
[styles.standardFormRowLast]: last,
@ -20,3 +20,5 @@ export default ({ title, children, last, block, grid, ...rest }) => {
</div>
);
};
export default StandardFormRow;

3
src/layouts/UserLayout.less

@ -3,7 +3,8 @@
.container {
display: flex;
flex-direction: column;
min-height: 100%;
height: 100vh;
overflow: auto;
background: #f0f2f5;
}

Loading…
Cancel
Save