diff --git a/src/index.less b/src/index.less index 06d5f3e5df244347d46c55f557964c0518433f0f..42b4d6ccf44f1910b12613f55cd1b8fc1aa49f28 100644 --- a/src/index.less +++ b/src/index.less @@ -1,3 +1,5 @@ +@import '~antd/lib/style/v2-compatible-reset.less'; + html, body, :global(#root) { height: 100%; } diff --git a/src/routes/List/BasicList.js b/src/routes/List/BasicList.js index b3e9a8d29b6bc86daf082c9d5d6c766fb9eca077..5dd0369c9a9972d419febb789aa8d3474ae6c6b5 100644 --- a/src/routes/List/BasicList.js +++ b/src/routes/List/BasicList.js @@ -119,25 +119,23 @@ export default class BasicList extends PureComponent { 添加 - { - list && list.map(item => ( - 编辑, ]} - > - } - title={{item.title}} - description={item.subDescription} - /> - - - )) - } - + dataSource={list} + renderItem={item => ( + 编辑, ]} + > + } + title={{item.title}} + description={item.subDescription} + /> + + + )} + /> diff --git a/src/routes/List/CardList.js b/src/routes/List/CardList.js index 098ec9ee25f2ecb9c96edc56c4382844d4287eed..9b7cda8bba8729890b61934fa1273a21f124b219 100644 --- a/src/routes/List/CardList.js +++ b/src/routes/List/CardList.js @@ -55,34 +55,35 @@ export default class CardList extends PureComponent { >
- - - - { - list && list.map(item => ( - - - 操作一, 操作二]}> - } - title={item.title} - description={( -

- {item.description} -

- )} - /> -
- + dataSource={['', ...list]} + renderItem={item => (item ? ( + + + 操作一, 操作二]}> + } + title={item.title} + description={( +

+ {item.description} +

+ )} + /> +
+ +
+ ) : ( + + - )) - } -
+ ) + )} + />
); diff --git a/src/routes/List/CoverCardList.js b/src/routes/List/CoverCardList.js index eacdceb9fa9a0f9325b47dba004cef35bcb1317e..0fef6b319f3e4302b88d4a4d0afd53f21e2fb210 100644 --- a/src/routes/List/CoverCardList.js +++ b/src/routes/List/CoverCardList.js @@ -73,40 +73,39 @@ export default class CoverCardList extends PureComponent { const cardList = list ? ( - { - list.map(item => ( - - } - > - -
- {moment(item.updatedAt).fromNow()} -
- - { - item.members.map((member, i) => ( - - )) - } - -
+ dataSource={list} + renderItem={item => ( + + } + > + +
+ {moment(item.updatedAt).fromNow()} +
+ + { + item.members.map((member, i) => ( + + )) + } +
- - - )) - } - +
+
+
+ )} + /> ) : null; const tabList = [ diff --git a/src/routes/List/FilterCardList.js b/src/routes/List/FilterCardList.js index 7486017efcacbf81a51a26c1b0565e48fe045356..0b93c1e6433e279c7e088237b597653d149669a4 100644 --- a/src/routes/List/FilterCardList.js +++ b/src/routes/List/FilterCardList.js @@ -195,36 +195,35 @@ export default class FilterCardList extends PureComponent { - { - list && list.map(item => ( - - , - , - , - , - ]} - > - } - title={item.title} + dataSource={list} + renderItem={item => ( + + , + , + , + , + ]} + > + } + title={item.title} + /> +
+ -
- -
- - - )) - } - +
+
+
+ )} + />
); diff --git a/src/routes/List/SearchList.js b/src/routes/List/SearchList.js index f01378cd2a691ce793b5a130a0cfe1f3f4717352..d0974e3ae18ddeaf39e52db79cfdaafe72e32fbd 100644 --- a/src/routes/List/SearchList.js +++ b/src/routes/List/SearchList.js @@ -2,7 +2,7 @@ import React, { Component } from 'react'; import moment from 'moment'; 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, Button } from 'antd'; import PageHeaderLayout from '../../layouts/PageHeaderLayout'; import StandardFormRow from '../../components/StandardFormRow'; @@ -90,7 +90,7 @@ export default class SearchList extends Component { render() { const { showLoadMore, loadingMore } = this.state; - const { form, list: { list } } = this.props; + const { form, list: { list, loading } } = this.props; const { getFieldDecorator } = form; const owners = [ @@ -161,6 +161,15 @@ export default class SearchList extends Component { }, }; + const loadMore = showLoadMore ? ( +
+ +
+ ) : null; + return ( 0) && showLoadMore} - onLoadMore={this.handleLoadMore} + loading={loading} + rowKey="id" itemLayout="vertical" - > - { - list && list.map(item => ( - , , ]} - extra={
} - > - {item.title}} - description={Ant Design设计语言蚂蚁金服} - /> - - - )) - } - + loadMore={loadMore} + dataSource={list} + renderItem={item => ( + , , ]} + extra={
} + > + {item.title}} + description={Ant Design设计语言蚂蚁金服} + /> + + + )} + />