Commit 8e75fc92 authored by niko's avatar niko Committed by GitHub

Merge pull request #2 from ant-design/List_Dashboard-optimize-again

修复二次List 和 Dashboard 的二次确认优化
parents 26910430 abca36bd
.miniChart { .miniChart {
overflow: hidden;
position: relative; position: relative;
width: 100%; width: 100%;
& > div { & > div {
......
...@@ -72,6 +72,9 @@ ...@@ -72,6 +72,9 @@
} }
@media screen and (max-width: @screen-lg) { @media screen and (max-width: @screen-lg) {
.salesExtra {
display: none;
}
.rankingList { .rankingList {
li { li {
span:first-child { span:first-child {
......
...@@ -3,7 +3,6 @@ import { connect } from 'dva'; ...@@ -3,7 +3,6 @@ import { connect } from 'dva';
import { Row, Col, Card } from 'antd'; import { Row, Col, Card } from 'antd';
import numeral from 'numeral'; import numeral from 'numeral';
import PageHeaderLayout from '../../layouts/PageHeaderLayout';
import { NumberInfo, MiniArea, Pie, WaterWave, Gauge } from '../../components/Charts'; import { NumberInfo, MiniArea, Pie, WaterWave, Gauge } from '../../components/Charts';
import MapChart from '../../components/MapChart'; import MapChart from '../../components/MapChart';
import TagCloud from '../../components/TagCloud'; import TagCloud from '../../components/TagCloud';
...@@ -45,12 +44,10 @@ export default class Monitor extends PureComponent { ...@@ -45,12 +44,10 @@ export default class Monitor extends PureComponent {
const { tags } = monitor; const { tags } = monitor;
return ( return (
<PageHeaderLayout <div>
title="大盘监控"
>
<Row gutter={24}> <Row gutter={24}>
<Col lg={16} md={24} sm={24} xs={24} style={{ marginBottom: 24 }}> <Col lg={16} md={24} sm={24} xs={24} style={{ marginBottom: 24 }}>
<Card title="活动实时交易情况"> <Card title="活动实时交易情况" bordered={false}>
<Row> <Row>
<Col sm={6} xs={12}> <Col sm={6} xs={12}>
<NumberInfo <NumberInfo
...@@ -85,7 +82,7 @@ export default class Monitor extends PureComponent { ...@@ -85,7 +82,7 @@ export default class Monitor extends PureComponent {
</Card> </Card>
</Col> </Col>
<Col lg={8} md={24} sm={24} xs={24}> <Col lg={8} md={24} sm={24} xs={24}>
<Card title="活动情况预测" style={{ marginBottom: 24 }}> <Card title="活动情况预测" style={{ marginBottom: 24 }} bordered={false}>
<div className={styles.activeChart}> <div className={styles.activeChart}>
<NumberInfo <NumberInfo
subTitle="目标评估" subTitle="目标评估"
...@@ -125,7 +122,12 @@ export default class Monitor extends PureComponent { ...@@ -125,7 +122,12 @@ export default class Monitor extends PureComponent {
} }
</div> </div>
</Card> </Card>
<Card title="券核效率" style={{ marginBottom: 24 }} bodyStyle={{ textAlign: 'center' }}> <Card
title="券核效率"
style={{ marginBottom: 24 }}
bodyStyle={{ textAlign: 'center' }}
bordered={false}
>
<Gauge <Gauge
title="跳出率" title="跳出率"
height={164} height={164}
...@@ -136,7 +138,11 @@ export default class Monitor extends PureComponent { ...@@ -136,7 +138,11 @@ export default class Monitor extends PureComponent {
</Row> </Row>
<Row gutter={24}> <Row gutter={24}>
<Col sm={8} xs={24}> <Col sm={8} xs={24}>
<Card title="各品类占比" style={{ marginBottom: 24 }}> <Card
title="各品类占比"
style={{ marginBottom: 24 }}
bordered={false}
>
<Row style={{ padding: '18px 0 19px 0' }}> <Row style={{ padding: '18px 0 19px 0' }}>
<Col span={8}> <Col span={8}>
<Pie <Pie
...@@ -168,7 +174,7 @@ export default class Monitor extends PureComponent { ...@@ -168,7 +174,7 @@ export default class Monitor extends PureComponent {
</Card> </Card>
</Col> </Col>
<Col sm={8} xs={24} style={{ marginBottom: 24 }}> <Col sm={8} xs={24} style={{ marginBottom: 24 }}>
<Card title="热门搜索"> <Card title="热门搜索" bordered={false}>
<TagCloud <TagCloud
data={tags} data={tags}
height={161} height={161}
...@@ -176,7 +182,7 @@ export default class Monitor extends PureComponent { ...@@ -176,7 +182,7 @@ export default class Monitor extends PureComponent {
</Card> </Card>
</Col> </Col>
<Col sm={8} xs={24} style={{ marginBottom: 24 }}> <Col sm={8} xs={24} style={{ marginBottom: 24 }}>
<Card title="资源剩余" bodyStyle={{ textAlign: 'center' }}> <Card title="资源剩余" bodyStyle={{ textAlign: 'center' }} bordered={false}>
<WaterWave <WaterWave
height={161} height={161}
title="补贴资金剩余" title="补贴资金剩余"
...@@ -185,7 +191,7 @@ export default class Monitor extends PureComponent { ...@@ -185,7 +191,7 @@ export default class Monitor extends PureComponent {
</Card> </Card>
</Col> </Col>
</Row> </Row>
</PageHeaderLayout> </div>
); );
} }
} }
...@@ -95,7 +95,7 @@ export default class BasicList extends PureComponent { ...@@ -95,7 +95,7 @@ export default class BasicList extends PureComponent {
return ( return (
<PageHeaderLayout> <PageHeaderLayout>
<div className={styles.standardList}> <div className={styles.standardList}>
<Card> <Card bordered={false}>
<Row> <Row>
<Col sm={8} xs={24}> <Col sm={8} xs={24}>
<Info title="我的代办" value="8个任务" bordered /> <Info title="我的代办" value="8个任务" bordered />
...@@ -110,6 +110,7 @@ export default class BasicList extends PureComponent { ...@@ -110,6 +110,7 @@ export default class BasicList extends PureComponent {
</Card> </Card>
<Card <Card
bordered={false}
title="基础列表" title="基础列表"
style={{ marginTop: 16 }} style={{ marginTop: 16 }}
extra={extraContent} extra={extraContent}
......
import React, { PureComponent } from 'react'; import React, { PureComponent } from 'react';
import { connect } from 'dva'; import { connect } from 'dva';
import { Row, Col, Card, Avatar, Spin, Button, Icon } from 'antd'; import { Card, Avatar, Button, Icon, List } from 'antd';
import PageHeaderLayout from '../../layouts/PageHeaderLayout'; import PageHeaderLayout from '../../layouts/PageHeaderLayout';
...@@ -42,7 +42,7 @@ export default class CardList extends PureComponent { ...@@ -42,7 +42,7 @@ export default class CardList extends PureComponent {
const extraContent = ( const extraContent = (
<div className={styles.extraImg}> <div className={styles.extraImg}>
<img alt="这是一个标题" src="https://gw.alipayobjects.com/zos/rmsportal/tTIFdlIcZFvvmCROhyBg.png" /> <img alt="这是一个标题" src="https://gw.alipayobjects.com/zos/rmsportal/QfpzdhbrqRtdSyZHKhjp.png" />
</div> </div>
); );
...@@ -53,37 +53,35 @@ export default class CardList extends PureComponent { ...@@ -53,37 +53,35 @@ export default class CardList extends PureComponent {
extraContent={extraContent} extraContent={extraContent}
> >
<div className={styles.cardList}> <div className={styles.cardList}>
{ <List
loading ? loading={loading}
<Spin /> grid={{ gutter: 16, lg: 3, md: 2, sm: 1, xs: 1 }}
: >
<Row gutter={16}> <List.Item>
<Col lg={8} md={12} sm={12} xs={24} style={{ marginBottom: 16 }}> <Button type="dashed" className={styles.newButton}>
<Button type="dashed" className={styles.newButton}> <Icon type="plus" /> 新增产品
<Icon type="plus" /> 新增产品 </Button>
</Button> </List.Item>
</Col> {
{ list && list.map(item => (
list && list.map(item => ( <List.Item key={item.id}>
<Col lg={8} md={12} sm={12} xs={24} key={item.id} style={{ marginBottom: 16 }}> <Card
<Card actions={[<a>操作一</a>, <a>操作二</a>]}
actions={[<a>操作一</a>, <a>操作二</a>]} >
> <Card.Meta
<Card.Meta avatar={<Avatar size="large" src={item.avatar} />}
avatar={<Avatar size="large" src={item.avatar} />} title={item.title}
title={item.title} description={(
description={( <p className={styles.cardDescription}>
<p className={styles.cardDescription}> <span>{item.description}</span>
<span>{item.description}</span> </p>
</p> )}
)} />
/> </Card>
</Card> </List.Item>
</Col> ))
)) }
} </List>
</Row>
}
</div> </div>
</PageHeaderLayout> </PageHeaderLayout>
); );
......
...@@ -12,6 +12,10 @@ ...@@ -12,6 +12,10 @@
.extraImg { .extraImg {
margin-top: -60px; margin-top: -60px;
text-align: center; text-align: center;
width: 195px;
img {
width: 100%;
}
} }
.newButton { .newButton {
......
import React, { PureComponent } from 'react'; import React, { PureComponent } from 'react';
import moment from 'moment'; import moment from 'moment';
import { connect } from 'dva'; import { connect } from 'dva';
import { Row, Col, Form, Card, Select, Spin } from 'antd'; import { routerRedux } from 'dva/router';
import { Row, Col, Form, Card, Select, List } from 'antd';
import PageHeaderLayout from '../../layouts/PageHeaderLayout'; import PageHeaderLayout from '../../layouts/PageHeaderLayout';
import StandardFormRow from '../../components/StandardFormRow'; import StandardFormRow from '../../components/StandardFormRow';
...@@ -49,15 +50,35 @@ export default class CoverCardList extends PureComponent { ...@@ -49,15 +50,35 @@ export default class CoverCardList extends PureComponent {
}, 0); }, 0);
} }
handleTabChange = (key) => {
const { dispatch } = this.props;
switch (key) {
case 'doc':
dispatch(routerRedux.push('/list/search'));
break;
case 'app':
dispatch(routerRedux.push('/list/filter-card-list'));
break;
case 'project':
dispatch(routerRedux.push('/list/cover-card-list'));
break;
default:
break;
}
}
render() { render() {
const { list: { list = [], loading }, form } = this.props; const { list: { list = [], loading }, form } = this.props;
const { getFieldDecorator } = form; const { getFieldDecorator } = form;
const cardList = list ? ( const cardList = list ? (
<Row gutter={16} style={{ marginTop: 16 }}> <List
loading={loading}
grid={{ gutter: 16, lg: 4, md: 3, sm: 2, xs: 1 }}
>
{ {
list.map(item => ( list.map(item => (
<Col lg={6} md={8} sm={12} xs={24} style={{ marginBottom: 16 }} key={item.id}> <List.Item key={item.id}>
<Card <Card
cover={<img alt={item.title} src={item.cover} />} cover={<img alt={item.title} src={item.cover} />}
> >
...@@ -82,15 +103,15 @@ export default class CoverCardList extends PureComponent { ...@@ -82,15 +103,15 @@ export default class CoverCardList extends PureComponent {
</div> </div>
</div> </div>
</Card> </Card>
</Col> </List.Item>
)) ))
} }
</Row> </List>
) : null; ) : null;
const tabList = [ const tabList = [
{ {
key: 'docs', key: 'doc',
tab: '文章', tab: '文章',
}, },
{ {
...@@ -100,6 +121,7 @@ export default class CoverCardList extends PureComponent { ...@@ -100,6 +121,7 @@ export default class CoverCardList extends PureComponent {
{ {
key: 'project', key: 'project',
tab: '项目', tab: '项目',
default: true,
}, },
]; ];
...@@ -121,9 +143,11 @@ export default class CoverCardList extends PureComponent { ...@@ -121,9 +143,11 @@ export default class CoverCardList extends PureComponent {
title="带封面的卡片列表" title="带封面的卡片列表"
content={pageHeaderContent} content={pageHeaderContent}
tabList={tabList} tabList={tabList}
onTabChange={this.handleTabChange}
> >
<div className={styles.coverCardList}> <div className={styles.coverCardList}>
<Card <Card
bordered={false}
noHovering noHovering
> >
<Form <Form
...@@ -188,17 +212,9 @@ export default class CoverCardList extends PureComponent { ...@@ -188,17 +212,9 @@ export default class CoverCardList extends PureComponent {
</StandardFormRow> </StandardFormRow>
</Form> </Form>
</Card> </Card>
{ <div className={styles.cardList}>
loading && (list.length > 0) && <Spin> { cardList }
{cardList} </div>
</Spin>
}
{
loading && (list.length < 1) && <div style={{ marginTop: 16 }}><Spin /></div>
}
{
!loading && cardList
}
</div> </div>
</PageHeaderLayout> </PageHeaderLayout>
); );
......
...@@ -21,4 +21,7 @@ ...@@ -21,4 +21,7 @@
flex: 0 1 auto; flex: 0 1 auto;
} }
} }
.cardList {
margin-top: 24px;
}
} }
import React, { PureComponent } from 'react'; import React, { PureComponent } from 'react';
import numeral from 'numeral'; import numeral from 'numeral';
import { connect } from 'dva'; import { connect } from 'dva';
import { routerRedux } from 'dva/router';
import { Row, Col, Form, Card, Select, Spin, Icon, Avatar } from 'antd'; import { Row, Col, Form, Card, Select, Spin, Icon, Avatar } from 'antd';
import PageHeaderLayout from '../../layouts/PageHeaderLayout'; import PageHeaderLayout from '../../layouts/PageHeaderLayout';
...@@ -60,22 +61,39 @@ export default class FilterCardList extends PureComponent { ...@@ -60,22 +61,39 @@ export default class FilterCardList extends PureComponent {
}, 0); }, 0);
} }
handleTabChange = (key) => {
const { dispatch } = this.props;
switch (key) {
case 'doc':
dispatch(routerRedux.push('/list/search'));
break;
case 'app':
dispatch(routerRedux.push('/list/filter-card-list'));
break;
case 'project':
dispatch(routerRedux.push('/list/cover-card-list'));
break;
default:
break;
}
}
render() { render() {
const { list: { list, loading }, form } = this.props; const { list: { list, loading }, form } = this.props;
const { getFieldDecorator } = form; const { getFieldDecorator } = form;
const tabList = [ const tabList = [
{ {
key: 'docs', key: 'doc',
tab: '文章', tab: '文章',
}, },
{ {
key: 'apps', key: 'app',
tab: '应用', tab: '应用',
default: true, default: true,
}, },
{ {
key: 'projects', key: 'project',
tab: '项目', tab: '项目',
}, },
]; ];
...@@ -112,10 +130,12 @@ export default class FilterCardList extends PureComponent { ...@@ -112,10 +130,12 @@ export default class FilterCardList extends PureComponent {
title="带筛选卡片列表" title="带筛选卡片列表"
content={pageHeaderContent} content={pageHeaderContent}
tabList={tabList} tabList={tabList}
onTabChange={this.handleTabChange}
> >
<div className={styles.filterCardList}> <div className={styles.filterCardList}>
<Card <Card
noHovering noHovering
bordered={false}
> >
<Form <Form
layout="inline" layout="inline"
......
import React, { Component } from 'react'; import React, { Component } from 'react';
import moment from 'moment'; import moment from 'moment';
import { connect } from 'dva'; import { connect } from 'dva';
import { routerRedux } from 'dva/router';
import { Form, Card, Select, List, Tag, Icon, Avatar, Row, Col } from 'antd'; import { Form, Card, Select, List, Tag, Icon, Avatar, Row, Col } from 'antd';
import PageHeaderLayout from '../../layouts/PageHeaderLayout'; import PageHeaderLayout from '../../layouts/PageHeaderLayout';
...@@ -70,6 +71,23 @@ export default class SearchList extends Component { ...@@ -70,6 +71,23 @@ export default class SearchList extends Component {
}); });
} }
handleTabChange = (key) => {
const { dispatch } = this.props;
switch (key) {
case 'docs':
dispatch(routerRedux.push('/list/search'));
break;
case 'app':
dispatch(routerRedux.push('/list/filter-card-list'));
break;
case 'project':
dispatch(routerRedux.push('/list/cover-card-list'));
break;
default:
break;
}
}
render() { render() {
const { showLoadMore, loadingMore } = this.state; const { showLoadMore, loadingMore } = this.state;
const { form, list: { list } } = this.props; const { form, list: { list } } = this.props;
...@@ -100,7 +118,7 @@ export default class SearchList extends Component { ...@@ -100,7 +118,7 @@ export default class SearchList extends Component {
const tabList = [ const tabList = [
{ {
key: 'docs', key: 'doc',
tab: '文章', tab: '文章',
}, },
{ {
...@@ -148,9 +166,10 @@ export default class SearchList extends Component { ...@@ -148,9 +166,10 @@ export default class SearchList extends Component {
title="搜索列表" title="搜索列表"
content={pageHeaderContent} content={pageHeaderContent}
tabList={tabList} tabList={tabList}
onTabChange={this.handleTabChange}
> >
<div> <div>
<Card noHovering> <Card noHovering bordered={false}>
<Form layout="inline"> <Form layout="inline">
<StandardFormRow title="所属类目" block> <StandardFormRow title="所属类目" block>
<FormItem> <FormItem>
...@@ -243,7 +262,7 @@ export default class SearchList extends Component { ...@@ -243,7 +262,7 @@ export default class SearchList extends Component {
</StandardFormRow> </StandardFormRow>
</Form> </Form>
</Card> </Card>
<Card style={{ marginTop: 16 }}> <Card style={{ marginTop: 16 }} bordered={false}>
<List <List
loadingMore={loadingMore} loadingMore={loadingMore}
showLoadMore={(list.length > 0) && showLoadMore} showLoadMore={(list.length > 0) && showLoadMore}
......
...@@ -164,15 +164,13 @@ export default class TableList extends PureComponent { ...@@ -164,15 +164,13 @@ export default class TableList extends PureComponent {
const menu = ( const menu = (
<Menu onClick={this.handleMenuClick} selectedKeys={[]}> <Menu onClick={this.handleMenuClick} selectedKeys={[]}>
<Menu.Item key="remove">删除</Menu.Item> <Menu.Item key="remove">删除</Menu.Item>
{ <Menu.Item key="approval">批量审批</Menu.Item>
selectedRows.length > 1 && <Menu.Item key="approval">批量审批</Menu.Item>
}
</Menu> </Menu>
); );
return ( return (
<PageHeaderLayout title="标准表格"> <PageHeaderLayout title="标准表格">
<Card noHovering> <Card noHovering bordered={false}>
<div className={styles.tableList}> <div className={styles.tableList}>
<div className={styles.tableListForm}> <div className={styles.tableListForm}>
<Form onSubmit={this.handleSearch}> <Form onSubmit={this.handleSearch}>
...@@ -229,12 +227,16 @@ export default class TableList extends PureComponent { ...@@ -229,12 +227,16 @@ export default class TableList extends PureComponent {
</div> </div>
<div className={styles.tableListOperator}> <div className={styles.tableListOperator}>
<Button icon="plus" type="primary" onClick={() => this.handleModalVisible(true)}>新建</Button> <Button icon="plus" type="primary" onClick={() => this.handleModalVisible(true)}>新建</Button>
<Button>批量操作</Button> {
<Dropdown overlay={menu}> selectedRows.length > 0 && <span>
<Button> <Button>批量操作</Button>
更多操作 <Icon type="down" /> <Dropdown overlay={menu}>
</Button> <Button>
</Dropdown> 更多操作 <Icon type="down" />
</Button>
</Dropdown>
</span>
}
</div> </div>
<StandardTable <StandardTable
selectedRows={selectedRows} selectedRows={selectedRows}
......
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