Unverified Commit adca7f5c authored by niko's avatar niko Committed by GitHub

alias ant-design-pro (#1035)

* alias ant-design-pro

* fixed lint

* change alias ant-design-pro/lib -> components

* change alias ant-design-pro/lib -> components
parent 9c49d4b8
{
"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
}
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,
};
...@@ -24,9 +24,9 @@ import { ...@@ -24,9 +24,9 @@ import {
Bar, Bar,
Pie, Pie,
TimelineChart, TimelineChart,
} from '../../components/Charts'; } from 'components/Charts';
import Trend from '../../components/Trend'; import Trend from 'components/Trend';
import NumberInfo from '../../components/NumberInfo'; import NumberInfo from 'components/NumberInfo';
import { getTimeDistance } from '../../utils/utils'; import { getTimeDistance } from '../../utils/utils';
import styles from './Analysis.less'; import styles from './Analysis.less';
......
...@@ -2,11 +2,11 @@ import React, { PureComponent, Fragment } from 'react'; ...@@ -2,11 +2,11 @@ import React, { PureComponent, Fragment } from 'react';
import { connect } from 'dva'; import { connect } from 'dva';
import { Row, Col, Card, Tooltip } from 'antd'; import { Row, Col, Card, Tooltip } from 'antd';
import numeral from 'numeral'; 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 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'; import styles from './Monitor.less';
const { Secured } = Authorized; const { Secured } = Authorized;
...@@ -48,10 +48,7 @@ export default class Monitor extends PureComponent { ...@@ -48,10 +48,7 @@ export default class Monitor extends PureComponent {
/> />
</Col> </Col>
<Col md={6} sm={12} xs={24}> <Col md={6} sm={12} xs={24}>
<NumberInfo <NumberInfo subTitle="销售目标完成率" total="92%" />
subTitle="销售目标完成率"
total="92%"
/>
</Col> </Col>
<Col md={6} sm={12} xs={24}> <Col md={6} sm={12} xs={24}>
<NumberInfo subTitle="活动剩余时间" total={<CountDown target={targetTime} />} /> <NumberInfo subTitle="活动剩余时间" total={<CountDown target={targetTime} />} />
...@@ -66,7 +63,10 @@ export default class Monitor extends PureComponent { ...@@ -66,7 +63,10 @@ export default class Monitor extends PureComponent {
</Row> </Row>
<div className={styles.mapChart}> <div className={styles.mapChart}>
<Tooltip title="等待后期实现"> <Tooltip title="等待后期实现">
<img src="https://gw.alipayobjects.com/zos/rmsportal/HBWnDEUXCnGnGrRfrpKa.png" alt="map" /> <img
src="https://gw.alipayobjects.com/zos/rmsportal/HBWnDEUXCnGnGrRfrpKa.png"
alt="map"
/>
</Tooltip> </Tooltip>
</div> </div>
</Card> </Card>
...@@ -105,11 +105,7 @@ export default class Monitor extends PureComponent { ...@@ -105,11 +105,7 @@ export default class Monitor extends PureComponent {
</Row> </Row>
<Row gutter={24}> <Row gutter={24}>
<Col xl={12} lg={24} sm={24} xs={24}> <Col xl={12} lg={24} sm={24} xs={24}>
<Card <Card title="各品类占比" bordered={false} className={styles.pieCard}>
title="各品类占比"
bordered={false}
className={styles.pieCard}
>
<Row style={{ padding: '16px 0' }}> <Row style={{ padding: '16px 0' }}>
<Col span={8}> <Col span={8}>
<Pie <Pie
...@@ -147,20 +143,22 @@ export default class Monitor extends PureComponent { ...@@ -147,20 +143,22 @@ export default class Monitor extends PureComponent {
</Card> </Card>
</Col> </Col>
<Col xl={6} lg={12} sm={24} xs={24}> <Col xl={6} lg={12} sm={24} xs={24}>
<Card title="热门搜索" loading={loading} bordered={false} bodyStyle={{ overflow: 'hidden' }}> <Card
<TagCloud title="热门搜索"
data={tags} loading={loading}
height={161} bordered={false}
/> bodyStyle={{ overflow: 'hidden' }}
>
<TagCloud data={tags} height={161} />
</Card> </Card>
</Col> </Col>
<Col xl={6} lg={12} sm={24} xs={24}> <Col xl={6} lg={12} sm={24} xs={24}>
<Card title="资源剩余" bodyStyle={{ textAlign: 'center', fontSize: 0 }} bordered={false}> <Card
<WaterWave title="资源剩余"
height={161} bodyStyle={{ textAlign: 'center', fontSize: 0 }}
title="补贴资金剩余" bordered={false}
percent={34} >
/> <WaterWave height={161} title="补贴资金剩余" percent={34} />
</Card> </Card>
</Col> </Col>
</Row> </Row>
......
...@@ -4,9 +4,9 @@ import { connect } from 'dva'; ...@@ -4,9 +4,9 @@ import { connect } from 'dva';
import { Link } from 'dva/router'; import { Link } from 'dva/router';
import { Row, Col, Card, List, Avatar } from 'antd'; import { Row, Col, Card, List, Avatar } from 'antd';
import { Radar } from 'components/Charts';
import EditableLinkGroup from 'components/EditableLinkGroup';
import PageHeaderLayout from '../../layouts/PageHeaderLayout'; import PageHeaderLayout from '../../layouts/PageHeaderLayout';
import EditableLinkGroup from '../../components/EditableLinkGroup';
import { Radar } from '../../components/Charts';
import styles from './Workplace.less'; import styles from './Workplace.less';
......
import React from 'react'; import React from 'react';
import { Link } from 'dva/router'; import { Link } from 'dva/router';
import Exception from '../../components/Exception'; import Exception from 'components/Exception';
export default () => ( export default () => (
<Exception type="403" style={{ minHeight: 500, height: '80%' }} linkElement={Link} /> <Exception type="403" style={{ minHeight: 500, height: '80%' }} linkElement={Link} />
......
import React from 'react'; import React from 'react';
import { Link } from 'dva/router'; import { Link } from 'dva/router';
import Exception from '../../components/Exception'; import Exception from 'components/Exception';
export default () => ( export default () => (
<Exception type="404" style={{ minHeight: 500, height: '80%' }} linkElement={Link} /> <Exception type="404" style={{ minHeight: 500, height: '80%' }} linkElement={Link} />
......
import React from 'react'; import React from 'react';
import { Link } from 'dva/router'; import { Link } from 'dva/router';
import Exception from '../../components/Exception'; import Exception from 'components/Exception';
export default () => ( export default () => (
<Exception type="500" style={{ minHeight: 500, height: '80%' }} linkElement={Link} /> <Exception type="500" style={{ minHeight: 500, height: '80%' }} linkElement={Link} />
......
import React, { PureComponent } from 'react'; import React, { PureComponent } from 'react';
import { Card, Button, Form, Icon, Col, Row, DatePicker, TimePicker, Input, Select, Popover } from 'antd'; import { Card, Button, Form, Icon, Col, Row, DatePicker, TimePicker, Input, Select, Popover } from 'antd';
import { connect } from 'dva'; import { connect } from 'dva';
import FooterToolbar from 'components/FooterToolbar';
import PageHeaderLayout from '../../layouts/PageHeaderLayout'; import PageHeaderLayout from '../../layouts/PageHeaderLayout';
import FooterToolbar from '../../components/FooterToolbar';
import TableForm from './TableForm'; import TableForm from './TableForm';
import styles from './style.less'; import styles from './style.less';
......
...@@ -2,7 +2,7 @@ import React, { Fragment } from 'react'; ...@@ -2,7 +2,7 @@ import React, { Fragment } from 'react';
import { connect } from 'dva'; import { connect } from 'dva';
import { Button, Row, Col } from 'antd'; import { Button, Row, Col } from 'antd';
import { routerRedux } from 'dva/router'; import { routerRedux } from 'dva/router';
import Result from '../../../components/Result'; import Result from 'components/Result';
import styles from './style.less'; import styles from './style.less';
class Step3 extends React.PureComponent { class Step3 extends React.PureComponent {
......
...@@ -3,8 +3,8 @@ import numeral from 'numeral'; ...@@ -3,8 +3,8 @@ import numeral from 'numeral';
import { connect } from 'dva'; import { connect } from 'dva';
import { Row, Col, Form, Card, Select, Icon, Avatar, List, Tooltip, Dropdown, Menu } from 'antd'; 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'; import styles from './Applications.less';
......
...@@ -3,8 +3,8 @@ import moment from 'moment'; ...@@ -3,8 +3,8 @@ import moment from 'moment';
import { connect } from 'dva'; import { connect } from 'dva';
import { Form, Card, Select, List, Tag, Icon, Avatar, Row, Col, Button } from 'antd'; 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'; import styles from './Articles.less';
const { Option } = Select; const { Option } = Select;
......
...@@ -2,8 +2,8 @@ import React, { PureComponent } from 'react'; ...@@ -2,8 +2,8 @@ import React, { PureComponent } from 'react';
import { connect } from 'dva'; import { connect } from 'dva';
import { Card, Button, Icon, List } from 'antd'; import { Card, Button, Icon, List } from 'antd';
import Ellipsis from 'components/Ellipsis';
import PageHeaderLayout from '../../layouts/PageHeaderLayout'; import PageHeaderLayout from '../../layouts/PageHeaderLayout';
import Ellipsis from '../../components/Ellipsis';
import styles from './CardList.less'; import styles from './CardList.less';
......
...@@ -3,10 +3,10 @@ import moment from 'moment'; ...@@ -3,10 +3,10 @@ import moment from 'moment';
import { connect } from 'dva'; import { connect } from 'dva';
import { Row, Col, Form, Card, Select, List } from 'antd'; import { Row, Col, Form, Card, Select, List } from 'antd';
import StandardFormRow from '../../components/StandardFormRow'; import TagSelect from 'components/TagSelect';
import TagSelect from '../../components/TagSelect'; import AvatarList from 'components/AvatarList';
import AvatarList from '../../components/AvatarList'; import Ellipsis from 'components/Ellipsis';
import Ellipsis from '../../components/Ellipsis'; import StandardFormRow from 'components/StandardFormRow';
import styles from './Projects.less'; import styles from './Projects.less';
...@@ -45,7 +45,7 @@ export default class CoverCardList extends PureComponent { ...@@ -45,7 +45,7 @@ export default class CoverCardList extends PureComponent {
} }
}); });
}, 0); }, 0);
} };
render() { render() {
const { list: { list = [] }, loading, form } = this.props; const { list: { list = [] }, loading, form } = this.props;
...@@ -72,15 +72,13 @@ export default class CoverCardList extends PureComponent { ...@@ -72,15 +72,13 @@ export default class CoverCardList extends PureComponent {
<span>{moment(item.updatedAt).fromNow()}</span> <span>{moment(item.updatedAt).fromNow()}</span>
<div className={styles.avatarList}> <div className={styles.avatarList}>
<AvatarList size="mini"> <AvatarList size="mini">
{ {item.members.map((member, i) => (
item.members.map((member, i) => ( <AvatarList.Item
<AvatarList.Item key={`${item.id}-avatar-${i}`}
key={`${item.id}-avatar-${i}`} src={member.avatar}
src={member.avatar} tips={member.name}
tips={member.name} />
/> ))}
))
}
</AvatarList> </AvatarList>
</div> </div>
</div> </div>
...@@ -121,17 +119,10 @@ export default class CoverCardList extends PureComponent { ...@@ -121,17 +119,10 @@ export default class CoverCardList extends PureComponent {
)} )}
</FormItem> </FormItem>
</StandardFormRow> </StandardFormRow>
<StandardFormRow <StandardFormRow title="其它选项" grid last>
title="其它选项"
grid
last
>
<Row gutter={16}> <Row gutter={16}>
<Col lg={8} md={10} sm={10} xs={24}> <Col lg={8} md={10} sm={10} xs={24}>
<FormItem <FormItem {...formItemLayout} label="作者">
{...formItemLayout}
label="作者"
>
{getFieldDecorator('author', {})( {getFieldDecorator('author', {})(
<Select <Select
onChange={this.handleFormSubmit} onChange={this.handleFormSubmit}
...@@ -144,10 +135,7 @@ export default class CoverCardList extends PureComponent { ...@@ -144,10 +135,7 @@ export default class CoverCardList extends PureComponent {
</FormItem> </FormItem>
</Col> </Col>
<Col lg={8} md={10} sm={10} xs={24}> <Col lg={8} md={10} sm={10} xs={24}>
<FormItem <FormItem {...formItemLayout} label="好评度">
{...formItemLayout}
label="好评度"
>
{getFieldDecorator('rate', {})( {getFieldDecorator('rate', {})(
<Select <Select
onChange={this.handleFormSubmit} onChange={this.handleFormSubmit}
...@@ -164,9 +152,7 @@ export default class CoverCardList extends PureComponent { ...@@ -164,9 +152,7 @@ export default class CoverCardList extends PureComponent {
</StandardFormRow> </StandardFormRow>
</Form> </Form>
</Card> </Card>
<div className={styles.cardList}> <div className={styles.cardList}>{cardList}</div>
{cardList}
</div>
</div> </div>
); );
} }
......
...@@ -2,7 +2,7 @@ import React, { PureComponent, Fragment } from 'react'; ...@@ -2,7 +2,7 @@ import React, { PureComponent, Fragment } from 'react';
import { connect } from 'dva'; import { connect } from 'dva';
import moment from 'moment'; import moment from 'moment';
import { Row, Col, Card, Form, Input, Select, Icon, Button, Dropdown, Menu, InputNumber, DatePicker, Modal, message, Badge, Divider } from 'antd'; 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 PageHeaderLayout from '../../layouts/PageHeaderLayout';
import styles from './TableList.less'; import styles from './TableList.less';
......
...@@ -4,8 +4,8 @@ import Bind from 'lodash-decorators/bind'; ...@@ -4,8 +4,8 @@ import Bind from 'lodash-decorators/bind';
import { connect } from 'dva'; import { connect } from 'dva';
import { Button, Menu, Dropdown, Icon, Row, Col, Steps, Card, Popover, Badge, Table, Tooltip, Divider } from 'antd'; import { Button, Menu, Dropdown, Icon, Row, Col, Steps, Card, Popover, Badge, Table, Tooltip, Divider } from 'antd';
import classNames from 'classnames'; import classNames from 'classnames';
import DescriptionList from 'components/DescriptionList';
import PageHeaderLayout from '../../layouts/PageHeaderLayout'; import PageHeaderLayout from '../../layouts/PageHeaderLayout';
import DescriptionList from '../../components/DescriptionList';
import styles from './AdvancedProfile.less'; import styles from './AdvancedProfile.less';
const { Step } = Steps; const { Step } = Steps;
......
import React, { Component } from 'react'; import React, { Component } from 'react';
import { connect } from 'dva'; import { connect } from 'dva';
import { Card, Badge, Table, Divider } from 'antd'; import { Card, Badge, Table, Divider } from 'antd';
import DescriptionList from 'components/DescriptionList';
import PageHeaderLayout from '../../layouts/PageHeaderLayout'; import PageHeaderLayout from '../../layouts/PageHeaderLayout';
import DescriptionList from '../../components/DescriptionList';
import styles from './BasicProfile.less'; import styles from './BasicProfile.less';
const { Description } = DescriptionList; const { Description } = DescriptionList;
const progressColumns = [{ const progressColumns = [
title: '时间', {
dataIndex: 'time', title: '时间',
key: 'time', dataIndex: 'time',
}, { key: 'time',
title: '当前进度', },
dataIndex: 'rate', {
key: 'rate', title: '当前进度',
}, { dataIndex: 'rate',
title: '状态', key: 'rate',
dataIndex: 'status', },
key: 'status', {
render: text => ( title: '状态',
text === 'success' ? <Badge status="success" text="成功" /> : <Badge status="processing" text="进行中" /> dataIndex: 'status',
), key: 'status',
}, { render: text =>
title: '操作员ID', (text === 'success' ? (
dataIndex: 'operator', <Badge status="success" text="成功" />
key: 'operator', ) : (
}, { <Badge status="processing" text="进行中" />
title: '耗时', )),
dataIndex: 'cost', },
key: 'cost', {
}]; title: '操作员ID',
dataIndex: 'operator',
key: 'operator',
},
{
title: '耗时',
dataIndex: 'cost',
key: 'cost',
},
];
@connect(({ profile, loading }) => ({ @connect(({ profile, loading }) => ({
profile, profile,
...@@ -71,60 +80,67 @@ export default class BasicProfile extends Component { ...@@ -71,60 +80,67 @@ export default class BasicProfile extends Component {
} }
return obj; return obj;
}; };
const goodsColumns = [{ const goodsColumns = [
title: '商品编号', {
dataIndex: 'id', title: '商品编号',
key: 'id', dataIndex: 'id',
render: (text, row, index) => { key: 'id',
if (index < basicGoods.length) { render: (text, row, index) => {
return <a href="">{text}</a>; if (index < basicGoods.length) {
} return <a href="">{text}</a>;
return { }
children: <span style={{ fontWeight: 600 }}>总计</span>, return {
props: { children: <span style={{ fontWeight: 600 }}>总计</span>,
colSpan: 4, props: {
}, colSpan: 4,
}; },
};
},
}, },
}, { {
title: '商品名称', title: '商品名称',
dataIndex: 'name', dataIndex: 'name',
key: 'name', key: 'name',
render: renderContent, 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 <span style={{ fontWeight: 600 }}>{text}</span>;
}, },
}, { {
title: '金额', title: '商品条码',
dataIndex: 'amount', dataIndex: 'barcode',
key: 'amount', key: 'barcode',
align: 'right', render: renderContent,
render: (text, row, index) => {
if (index < basicGoods.length) {
return text;
}
return <span style={{ fontWeight: 600 }}>{text}</span>;
}, },
}]; {
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 <span style={{ fontWeight: 600 }}>{text}</span>;
},
},
{
title: '金额',
dataIndex: 'amount',
key: 'amount',
align: 'right',
render: (text, row, index) => {
if (index < basicGoods.length) {
return text;
}
return <span style={{ fontWeight: 600 }}>{text}</span>;
},
},
];
return ( return (
<PageHeaderLayout title="基础详情页"> <PageHeaderLayout title="基础详情页">
<Card bordered={false}> <Card bordered={false}>
......
import React, { Fragment } from 'react'; import React, { Fragment } from 'react';
import { Button, Icon, Card } from 'antd'; import { Button, Icon, Card } from 'antd';
import Result from '../../components/Result'; import Result from 'components/Result';
import PageHeaderLayout from '../../layouts/PageHeaderLayout'; import PageHeaderLayout from '../../layouts/PageHeaderLayout';
const extra = ( const extra = (
......
import React, { Fragment } from 'react'; import React, { Fragment } from 'react';
import { Button, Row, Col, Icon, Steps, Card } from 'antd'; import { Button, Row, Col, Icon, Steps, Card } from 'antd';
import Result from '../../components/Result'; import Result from 'components/Result';
import PageHeaderLayout from '../../layouts/PageHeaderLayout'; import PageHeaderLayout from '../../layouts/PageHeaderLayout';
const { Step } = Steps; const { Step } = Steps;
......
...@@ -2,7 +2,7 @@ import React, { Component } from 'react'; ...@@ -2,7 +2,7 @@ import React, { Component } from 'react';
import { connect } from 'dva'; import { connect } from 'dva';
import { Link } from 'dva/router'; import { Link } from 'dva/router';
import { Checkbox, Alert, Icon } from 'antd'; import { Checkbox, Alert, Icon } from 'antd';
import Login from '../../components/Login'; import Login from 'components/Login';
import styles from './Login.less'; import styles from './Login.less';
const { Tab, UserName, Password, Mobile, Captcha, Submit } = Login; const { Tab, UserName, Password, Mobile, Captcha, Submit } = Login;
......
import React from 'react'; import React from 'react';
import { Button } from 'antd'; import { Button } from 'antd';
import { Link } from 'dva/router'; import { Link } from 'dva/router';
import Result from '../../components/Result'; import Result from 'components/Result';
import styles from './RegisterResult.less'; import styles from './RegisterResult.less';
const actions = ( const actions = (
......
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