From abca36bd4c8413202676be4a22ee425b3dadc176 Mon Sep 17 00:00:00 2001
From: nikogu <644506165@qq.com>
Date: Wed, 30 Aug 2017 14:17:41 +0800
Subject: [PATCH] fixed list loading
---
src/routes/List/CardList.js | 62 +++++++++++++++---------------
src/routes/List/CoverCardList.js | 27 ++++++-------
src/routes/List/CoverCardList.less | 3 ++
3 files changed, 44 insertions(+), 48 deletions(-)
diff --git a/src/routes/List/CardList.js b/src/routes/List/CardList.js
index af5fdbea..36c15e7b 100644
--- a/src/routes/List/CardList.js
+++ b/src/routes/List/CardList.js
@@ -1,6 +1,6 @@
import React, { PureComponent } from 'react';
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';
@@ -53,37 +53,35 @@ export default class CardList extends PureComponent {
extraContent={extraContent}
>
- {
- loading ?
-
- :
-
-
-
-
- {
- list && list.map(item => (
-
- 操作一, 操作二]}
- >
- }
- title={item.title}
- description={(
-
- {item.description}
-
- )}
- />
-
-
- ))
- }
-
- }
+
+
+
+
+ {
+ list && list.map(item => (
+
+ 操作一, 操作二]}
+ >
+ }
+ title={item.title}
+ description={(
+
+ {item.description}
+
+ )}
+ />
+
+
+ ))
+ }
+
);
diff --git a/src/routes/List/CoverCardList.js b/src/routes/List/CoverCardList.js
index 2c4699a5..e0869866 100644
--- a/src/routes/List/CoverCardList.js
+++ b/src/routes/List/CoverCardList.js
@@ -2,7 +2,7 @@ import React, { PureComponent } from 'react';
import moment from 'moment';
import { connect } from 'dva';
import { routerRedux } from 'dva/router';
-import { Row, Col, Form, Card, Select, Spin } from 'antd';
+import { Row, Col, Form, Card, Select, List } from 'antd';
import PageHeaderLayout from '../../layouts/PageHeaderLayout';
import StandardFormRow from '../../components/StandardFormRow';
@@ -72,10 +72,13 @@ export default class CoverCardList extends PureComponent {
const { getFieldDecorator } = form;
const cardList = list ? (
-
+
{
list.map(item => (
-
+
}
>
@@ -100,10 +103,10 @@ export default class CoverCardList extends PureComponent {
-
+
))
}
-
+
) : null;
const tabList = [
@@ -209,17 +212,9 @@ export default class CoverCardList extends PureComponent {
- {
- loading && (list.length > 0) &&
- {cardList}
-
- }
- {
- loading && (list.length < 1) &&
- }
- {
- !loading && cardList
- }
+
+ { cardList }
+
);
diff --git a/src/routes/List/CoverCardList.less b/src/routes/List/CoverCardList.less
index d4c7eade..d2b9d162 100644
--- a/src/routes/List/CoverCardList.less
+++ b/src/routes/List/CoverCardList.less
@@ -21,4 +21,7 @@
flex: 0 1 auto;
}
}
+ .cardList {
+ margin-top: 24px;
+ }
}
--
GitLab