diff --git a/.webpackrc b/.webpackrc
deleted file mode 100755
index ab704dc9efc1361ca4318bd641a0bcd90dfae1f3..0000000000000000000000000000000000000000
--- a/.webpackrc
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "entry": "src/index.js",
- "extraBabelPlugins": [
- "transform-decorators-legacy",
- ["import", { "libraryName": "antd", "libraryDirectory": "es", "style": true }]
- ],
- "env": {
- "development": {
- "extraBabelPlugins": [
- "dva-hmr"
- ]
- }
- },
- "ignoreMomentLocale": true,
- "theme": "./src/theme.js",
- "html": {
- "template": "./src/index.ejs"
- },
- "publicPath": "/",
- "disableDynamicImport": true,
- "hash": true
-}
diff --git a/.webpackrc.js b/.webpackrc.js
new file mode 100755
index 0000000000000000000000000000000000000000..74bc5f6d2721bef8a6c086e0d5699df7e457e592
--- /dev/null
+++ b/.webpackrc.js
@@ -0,0 +1,25 @@
+const path = require('path');
+
+export default {
+ entry: 'src/index.js',
+ extraBabelPlugins: [
+ 'transform-decorators-legacy',
+ ['import', { libraryName: 'antd', libraryDirectory: 'es', style: true }],
+ ],
+ env: {
+ development: {
+ extraBabelPlugins: ['dva-hmr'],
+ },
+ },
+ alias: {
+ 'components': path.resolve(__dirname, 'src/components/'),
+ },
+ ignoreMomentLocale: true,
+ theme: './src/theme.js',
+ html: {
+ template: './src/index.ejs',
+ },
+ publicPath: '/',
+ disableDynamicImport: true,
+ hash: true,
+};
diff --git a/src/routes/Dashboard/Analysis.js b/src/routes/Dashboard/Analysis.js
index f6df44063c86b9cad082764c9a9b3a37438b8600..9cb55a9aeab5cce1aea8f02f8e4f92919ff1a870 100644
--- a/src/routes/Dashboard/Analysis.js
+++ b/src/routes/Dashboard/Analysis.js
@@ -24,9 +24,9 @@ import {
Bar,
Pie,
TimelineChart,
-} from '../../components/Charts';
-import Trend from '../../components/Trend';
-import NumberInfo from '../../components/NumberInfo';
+} from 'components/Charts';
+import Trend from 'components/Trend';
+import NumberInfo from 'components/NumberInfo';
import { getTimeDistance } from '../../utils/utils';
import styles from './Analysis.less';
diff --git a/src/routes/Dashboard/Monitor.js b/src/routes/Dashboard/Monitor.js
index 897dc9ce116573c4fd9a76f9c2309b141ff0bc2a..07bbae85f13d4acb9c0c3af8bc74d266e807bd21 100644
--- a/src/routes/Dashboard/Monitor.js
+++ b/src/routes/Dashboard/Monitor.js
@@ -2,11 +2,11 @@ import React, { PureComponent, Fragment } from 'react';
import { connect } from 'dva';
import { Row, Col, Card, Tooltip } from 'antd';
import numeral from 'numeral';
+import { Pie, WaterWave, Gauge, TagCloud } from 'components/Charts';
+import NumberInfo from 'components/NumberInfo';
+import CountDown from 'components/CountDown';
+import ActiveChart from 'components/ActiveChart';
import Authorized from '../../utils/Authorized';
-import { Pie, WaterWave, Gauge, TagCloud } from '../../components/Charts';
-import NumberInfo from '../../components/NumberInfo';
-import CountDown from '../../components/CountDown';
-import ActiveChart from '../../components/ActiveChart';
import styles from './Monitor.less';
const { Secured } = Authorized;
@@ -48,10 +48,7 @@ export default class Monitor extends PureComponent {
/>
-
+
} />
@@ -66,7 +63,10 @@ export default class Monitor extends PureComponent {
-
+
@@ -105,11 +105,7 @@ export default class Monitor extends PureComponent {
-
+
-
-
+
+
-
-
+
+
diff --git a/src/routes/Dashboard/Workplace.js b/src/routes/Dashboard/Workplace.js
index 9159cbf31a229e30657bfa860b3936c24fbba7da..e596118a1d9fb3ed6e2da0e8aaa839ad03f3423d 100644
--- a/src/routes/Dashboard/Workplace.js
+++ b/src/routes/Dashboard/Workplace.js
@@ -4,9 +4,9 @@ import { connect } from 'dva';
import { Link } from 'dva/router';
import { Row, Col, Card, List, Avatar } from 'antd';
+import { Radar } from 'components/Charts';
+import EditableLinkGroup from 'components/EditableLinkGroup';
import PageHeaderLayout from '../../layouts/PageHeaderLayout';
-import EditableLinkGroup from '../../components/EditableLinkGroup';
-import { Radar } from '../../components/Charts';
import styles from './Workplace.less';
diff --git a/src/routes/Exception/403.js b/src/routes/Exception/403.js
index 1e01b58a9aa376db385202eef5938c9d0c00b413..c6d86fe0ab1b5d7edee4c59d0b14d7a7f15dd241 100644
--- a/src/routes/Exception/403.js
+++ b/src/routes/Exception/403.js
@@ -1,6 +1,6 @@
import React from 'react';
import { Link } from 'dva/router';
-import Exception from '../../components/Exception';
+import Exception from 'components/Exception';
export default () => (
diff --git a/src/routes/Exception/404.js b/src/routes/Exception/404.js
index 7d76d938c30ec1d83bfd9324c917056ac58d4450..0a3d87669618364fc9a69139341b58e49eca807e 100644
--- a/src/routes/Exception/404.js
+++ b/src/routes/Exception/404.js
@@ -1,6 +1,6 @@
import React from 'react';
import { Link } from 'dva/router';
-import Exception from '../../components/Exception';
+import Exception from 'components/Exception';
export default () => (
diff --git a/src/routes/Exception/500.js b/src/routes/Exception/500.js
index fa84eee54a5c4c193e8f814afaf156a995cacd31..40f659cb616f1108fbabf89c5672aeb4b16c2184 100644
--- a/src/routes/Exception/500.js
+++ b/src/routes/Exception/500.js
@@ -1,6 +1,6 @@
import React from 'react';
import { Link } from 'dva/router';
-import Exception from '../../components/Exception';
+import Exception from 'components/Exception';
export default () => (
diff --git a/src/routes/Forms/AdvancedForm.js b/src/routes/Forms/AdvancedForm.js
index 1247e1d1b10efd93c4c0b048351a246e04b6600d..5b5576462e3a73b4afb3c55cf90f6ce56fb43936 100644
--- a/src/routes/Forms/AdvancedForm.js
+++ b/src/routes/Forms/AdvancedForm.js
@@ -1,8 +1,8 @@
import React, { PureComponent } from 'react';
import { Card, Button, Form, Icon, Col, Row, DatePicker, TimePicker, Input, Select, Popover } from 'antd';
import { connect } from 'dva';
+import FooterToolbar from 'components/FooterToolbar';
import PageHeaderLayout from '../../layouts/PageHeaderLayout';
-import FooterToolbar from '../../components/FooterToolbar';
import TableForm from './TableForm';
import styles from './style.less';
diff --git a/src/routes/Forms/StepForm/Step3.js b/src/routes/Forms/StepForm/Step3.js
index 8df6388d60e741b4c3eefa872454d1b07fd4a40e..549878e82342738297f60f4f0f646e9708197d2a 100644
--- a/src/routes/Forms/StepForm/Step3.js
+++ b/src/routes/Forms/StepForm/Step3.js
@@ -2,7 +2,7 @@ import React, { Fragment } from 'react';
import { connect } from 'dva';
import { Button, Row, Col } from 'antd';
import { routerRedux } from 'dva/router';
-import Result from '../../../components/Result';
+import Result from 'components/Result';
import styles from './style.less';
class Step3 extends React.PureComponent {
diff --git a/src/routes/List/Applications.js b/src/routes/List/Applications.js
index 83d1369ff0c31dfa952f0ac8a4a895e685390b4c..368a3e5865ffe8ead600979c1d20974c163f6933 100644
--- a/src/routes/List/Applications.js
+++ b/src/routes/List/Applications.js
@@ -3,8 +3,8 @@ import numeral from 'numeral';
import { connect } from 'dva';
import { Row, Col, Form, Card, Select, Icon, Avatar, List, Tooltip, Dropdown, Menu } from 'antd';
-import StandardFormRow from '../../components/StandardFormRow';
-import TagSelect from '../../components/TagSelect';
+import TagSelect from 'components/TagSelect';
+import StandardFormRow from 'components/StandardFormRow';
import styles from './Applications.less';
diff --git a/src/routes/List/Articles.js b/src/routes/List/Articles.js
index 436a7fa5ba3e6437734c03038341b6a0b0ad5498..a095ef8836221bb85ac07d68aa63ae3b28f7758d 100644
--- a/src/routes/List/Articles.js
+++ b/src/routes/List/Articles.js
@@ -3,8 +3,8 @@ import moment from 'moment';
import { connect } from 'dva';
import { Form, Card, Select, List, Tag, Icon, Avatar, Row, Col, Button } from 'antd';
-import StandardFormRow from '../../components/StandardFormRow';
-import TagSelect from '../../components/TagSelect';
+import TagSelect from 'components/TagSelect';
+import StandardFormRow from 'components/StandardFormRow';
import styles from './Articles.less';
const { Option } = Select;
diff --git a/src/routes/List/CardList.js b/src/routes/List/CardList.js
index 9e3818ec8382b4c52fe9ce20b168c161b8bef6e6..cd507865519c107c040d136c2d0ff5aae16e9168 100644
--- a/src/routes/List/CardList.js
+++ b/src/routes/List/CardList.js
@@ -2,8 +2,8 @@ import React, { PureComponent } from 'react';
import { connect } from 'dva';
import { Card, Button, Icon, List } from 'antd';
+import Ellipsis from 'components/Ellipsis';
import PageHeaderLayout from '../../layouts/PageHeaderLayout';
-import Ellipsis from '../../components/Ellipsis';
import styles from './CardList.less';
diff --git a/src/routes/List/Projects.js b/src/routes/List/Projects.js
index 48e83c8f284da49e336f9e2de523cae28342e243..d285dea375b90889b440357eb6f606a42555eb87 100644
--- a/src/routes/List/Projects.js
+++ b/src/routes/List/Projects.js
@@ -3,10 +3,10 @@ import moment from 'moment';
import { connect } from 'dva';
import { Row, Col, Form, Card, Select, List } from 'antd';
-import StandardFormRow from '../../components/StandardFormRow';
-import TagSelect from '../../components/TagSelect';
-import AvatarList from '../../components/AvatarList';
-import Ellipsis from '../../components/Ellipsis';
+import TagSelect from 'components/TagSelect';
+import AvatarList from 'components/AvatarList';
+import Ellipsis from 'components/Ellipsis';
+import StandardFormRow from 'components/StandardFormRow';
import styles from './Projects.less';
@@ -45,7 +45,7 @@ export default class CoverCardList extends PureComponent {
}
});
}, 0);
- }
+ };
render() {
const { list: { list = [] }, loading, form } = this.props;
@@ -72,15 +72,13 @@ export default class CoverCardList extends PureComponent {
{moment(item.updatedAt).fromNow()}
- {
- item.members.map((member, i) => (
-
- ))
- }
+ {item.members.map((member, i) => (
+
+ ))}
@@ -121,17 +119,10 @@ export default class CoverCardList extends PureComponent {
)}
-
+
-
+
{getFieldDecorator('author', {})(
-
- {cardList}
-
+ {cardList}
);
}
diff --git a/src/routes/List/TableList.js b/src/routes/List/TableList.js
index 776fde4a4be58739653281af930f461bdb817f9c..24d20ea9046a8c3e8f6fd0346f49ed5346430bc8 100644
--- a/src/routes/List/TableList.js
+++ b/src/routes/List/TableList.js
@@ -2,7 +2,7 @@ import React, { PureComponent, Fragment } from 'react';
import { connect } from 'dva';
import moment from 'moment';
import { Row, Col, Card, Form, Input, Select, Icon, Button, Dropdown, Menu, InputNumber, DatePicker, Modal, message, Badge, Divider } from 'antd';
-import StandardTable from '../../components/StandardTable';
+import StandardTable from 'components/StandardTable';
import PageHeaderLayout from '../../layouts/PageHeaderLayout';
import styles from './TableList.less';
diff --git a/src/routes/Profile/AdvancedProfile.js b/src/routes/Profile/AdvancedProfile.js
index 3c0bb252d3a1fb9898aebd68b04e321bf98d71f2..09065602ec3a11c1aab88007654d46f6682c2921 100644
--- a/src/routes/Profile/AdvancedProfile.js
+++ b/src/routes/Profile/AdvancedProfile.js
@@ -4,8 +4,8 @@ import Bind from 'lodash-decorators/bind';
import { connect } from 'dva';
import { Button, Menu, Dropdown, Icon, Row, Col, Steps, Card, Popover, Badge, Table, Tooltip, Divider } from 'antd';
import classNames from 'classnames';
+import DescriptionList from 'components/DescriptionList';
import PageHeaderLayout from '../../layouts/PageHeaderLayout';
-import DescriptionList from '../../components/DescriptionList';
import styles from './AdvancedProfile.less';
const { Step } = Steps;
diff --git a/src/routes/Profile/BasicProfile.js b/src/routes/Profile/BasicProfile.js
index ea006b01bf1d8461117d60635945ccace2b76160..ba585dc9c066352649b9d313ee425ec183ac3802 100644
--- a/src/routes/Profile/BasicProfile.js
+++ b/src/routes/Profile/BasicProfile.js
@@ -1,36 +1,45 @@
import React, { Component } from 'react';
import { connect } from 'dva';
import { Card, Badge, Table, Divider } from 'antd';
+import DescriptionList from 'components/DescriptionList';
import PageHeaderLayout from '../../layouts/PageHeaderLayout';
-import DescriptionList from '../../components/DescriptionList';
import styles from './BasicProfile.less';
const { Description } = DescriptionList;
-const progressColumns = [{
- title: '时间',
- dataIndex: 'time',
- key: 'time',
-}, {
- title: '当前进度',
- dataIndex: 'rate',
- key: 'rate',
-}, {
- title: '状态',
- dataIndex: 'status',
- key: 'status',
- render: text => (
- text === 'success' ? :
- ),
-}, {
- title: '操作员ID',
- dataIndex: 'operator',
- key: 'operator',
-}, {
- title: '耗时',
- dataIndex: 'cost',
- key: 'cost',
-}];
+const progressColumns = [
+ {
+ title: '时间',
+ dataIndex: 'time',
+ key: 'time',
+ },
+ {
+ title: '当前进度',
+ dataIndex: 'rate',
+ key: 'rate',
+ },
+ {
+ title: '状态',
+ dataIndex: 'status',
+ key: 'status',
+ render: text =>
+ (text === 'success' ? (
+
+ ) : (
+
+ )),
+ },
+ {
+ title: '操作员ID',
+ dataIndex: 'operator',
+ key: 'operator',
+ },
+ {
+ title: '耗时',
+ dataIndex: 'cost',
+ key: 'cost',
+ },
+];
@connect(({ profile, loading }) => ({
profile,
@@ -71,60 +80,67 @@ export default class BasicProfile extends Component {
}
return obj;
};
- const goodsColumns = [{
- title: '商品编号',
- dataIndex: 'id',
- key: 'id',
- render: (text, row, index) => {
- if (index < basicGoods.length) {
- return {text};
- }
- return {
- children: 总计,
- props: {
- colSpan: 4,
- },
- };
+ const goodsColumns = [
+ {
+ title: '商品编号',
+ dataIndex: 'id',
+ key: 'id',
+ render: (text, row, index) => {
+ if (index < basicGoods.length) {
+ return {text};
+ }
+ return {
+ children: 总计,
+ props: {
+ colSpan: 4,
+ },
+ };
+ },
},
- }, {
- title: '商品名称',
- dataIndex: 'name',
- key: 'name',
- render: renderContent,
- }, {
- title: '商品条码',
- dataIndex: 'barcode',
- key: 'barcode',
- render: renderContent,
- }, {
- title: '单价',
- dataIndex: 'price',
- key: 'price',
- align: 'right',
- render: renderContent,
- }, {
- title: '数量(件)',
- dataIndex: 'num',
- key: 'num',
- align: 'right',
- render: (text, row, index) => {
- if (index < basicGoods.length) {
- return text;
- }
- return {text};
+ {
+ title: '商品名称',
+ dataIndex: 'name',
+ key: 'name',
+ render: renderContent,
},
- }, {
- title: '金额',
- dataIndex: 'amount',
- key: 'amount',
- align: 'right',
- render: (text, row, index) => {
- if (index < basicGoods.length) {
- return text;
- }
- return {text};
+ {
+ title: '商品条码',
+ dataIndex: 'barcode',
+ key: 'barcode',
+ render: renderContent,
},
- }];
+ {
+ title: '单价',
+ dataIndex: 'price',
+ key: 'price',
+ align: 'right',
+ render: renderContent,
+ },
+ {
+ title: '数量(件)',
+ dataIndex: 'num',
+ key: 'num',
+ align: 'right',
+ render: (text, row, index) => {
+ if (index < basicGoods.length) {
+ return text;
+ }
+ return {text};
+ },
+ },
+ {
+ title: '金额',
+ dataIndex: 'amount',
+ key: 'amount',
+ align: 'right',
+ render: (text, row, index) => {
+ if (index < basicGoods.length) {
+ return text;
+ }
+ return {text};
+ },
+ },
+ ];
return (
diff --git a/src/routes/Result/Error.js b/src/routes/Result/Error.js
index 7ff6439336cecdb5edbca5567d9808d4f68554ee..41f5d826c70fa761c70d2bac5a96e5ab73150fe8 100644
--- a/src/routes/Result/Error.js
+++ b/src/routes/Result/Error.js
@@ -1,6 +1,6 @@
import React, { Fragment } from 'react';
import { Button, Icon, Card } from 'antd';
-import Result from '../../components/Result';
+import Result from 'components/Result';
import PageHeaderLayout from '../../layouts/PageHeaderLayout';
const extra = (
diff --git a/src/routes/Result/Success.js b/src/routes/Result/Success.js
index f7aabd7fe7bbb9b76fa53da13fc51b202a6a970f..76fde59334b49a04a12a5cff929ed36cd29c7c91 100644
--- a/src/routes/Result/Success.js
+++ b/src/routes/Result/Success.js
@@ -1,6 +1,6 @@
import React, { Fragment } from 'react';
import { Button, Row, Col, Icon, Steps, Card } from 'antd';
-import Result from '../../components/Result';
+import Result from 'components/Result';
import PageHeaderLayout from '../../layouts/PageHeaderLayout';
const { Step } = Steps;
diff --git a/src/routes/User/Login.js b/src/routes/User/Login.js
index 01a0f990bc947e98bf4905ed787317df2bca8758..e45fc82bcd7d8c2095dd9dc8025eb0aedafdb7f4 100644
--- a/src/routes/User/Login.js
+++ b/src/routes/User/Login.js
@@ -2,7 +2,7 @@ import React, { Component } from 'react';
import { connect } from 'dva';
import { Link } from 'dva/router';
import { Checkbox, Alert, Icon } from 'antd';
-import Login from '../../components/Login';
+import Login from 'components/Login';
import styles from './Login.less';
const { Tab, UserName, Password, Mobile, Captcha, Submit } = Login;
diff --git a/src/routes/User/RegisterResult.js b/src/routes/User/RegisterResult.js
index ba635607a9a724dac8c121fd55cedef3f28e7a9f..6dba5c1d84af55a0624bba468ed77539a88598fe 100644
--- a/src/routes/User/RegisterResult.js
+++ b/src/routes/User/RegisterResult.js
@@ -1,7 +1,7 @@
import React from 'react';
import { Button } from 'antd';
import { Link } from 'dva/router';
-import Result from '../../components/Result';
+import Result from 'components/Result';
import styles from './RegisterResult.less';
const actions = (