Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
pro-blocks
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
duanledexianxianxian
pro-blocks
Commits
abca36bd
Commit
abca36bd
authored
Aug 30, 2017
by
nikogu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed list loading
parent
bbb56769
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
44 additions
and
48 deletions
+44
-48
src/routes/List/CardList.js
src/routes/List/CardList.js
+30
-32
src/routes/List/CoverCardList.js
src/routes/List/CoverCardList.js
+11
-16
src/routes/List/CoverCardList.less
src/routes/List/CoverCardList.less
+3
-0
No files found.
src/routes/List/CardList.js
View file @
abca36bd
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,19 +53,18 @@ export default class CardList extends PureComponent {
extraContent
=
{
extraContent
}
>
<
div
className
=
{
styles
.
cardList
}
>
{
loading
?
<
Spin
/>
:
<
Row
gutter
=
{
16
}
>
<
Col
lg
=
{
8
}
md
=
{
12
}
sm
=
{
12
}
xs
=
{
24
}
style
=
{{
marginBottom
:
16
}}
>
<
List
loading
=
{
loading
}
grid
=
{{
gutter
:
16
,
lg
:
3
,
md
:
2
,
sm
:
1
,
xs
:
1
}}
>
<
List
.
Item
>
<
Button
type
=
"
dashed
"
className
=
{
styles
.
newButton
}
>
<
Icon
type
=
"
plus
"
/>
新增产品
<
/Button
>
<
/Col
>
<
/List.Item
>
{
list
&&
list
.
map
(
item
=>
(
<
Col
lg
=
{
8
}
md
=
{
12
}
sm
=
{
12
}
xs
=
{
24
}
key
=
{
item
.
id
}
style
=
{{
marginBottom
:
16
}
}
>
<
List
.
Item
key
=
{
item
.
id
}
>
<
Card
actions
=
{[
<
a
>
操作一
<
/a>, <a>操作二</
a
>
]}
>
...
...
@@ -79,11 +78,10 @@ export default class CardList extends PureComponent {
)}
/
>
<
/Card
>
<
/Col
>
<
/List.Item
>
))
}
<
/Row
>
}
<
/List
>
<
/div
>
<
/PageHeaderLayout
>
);
...
...
src/routes/List/CoverCardList.js
View file @
abca36bd
...
...
@@ -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
?
(
<
Row
gutter
=
{
16
}
style
=
{{
marginTop
:
16
}}
>
<
List
loading
=
{
loading
}
grid
=
{{
gutter
:
16
,
lg
:
4
,
md
:
3
,
sm
:
2
,
xs
:
1
}}
>
{
list
.
map
(
item
=>
(
<
Col
lg
=
{
6
}
md
=
{
8
}
sm
=
{
12
}
xs
=
{
24
}
style
=
{{
marginBottom
:
16
}}
key
=
{
item
.
id
}
>
<
List
.
Item
key
=
{
item
.
id
}
>
<
Card
cover
=
{
<
img
alt
=
{
item
.
title
}
src
=
{
item
.
cover
}
/>
}
>
...
...
@@ -100,10 +103,10 @@ export default class CoverCardList extends PureComponent {
<
/div
>
<
/div
>
<
/Card
>
<
/
Col
>
<
/
List.Item
>
))
}
<
/
Row
>
<
/
List
>
)
:
null
;
const
tabList
=
[
...
...
@@ -209,17 +212,9 @@ export default class CoverCardList extends PureComponent {
<
/StandardFormRow
>
<
/Form
>
<
/Card
>
{
loading
&&
(
list
.
length
>
0
)
&&
<
Spin
>
{
cardList
}
<
/Spin
>
}
{
loading
&&
(
list
.
length
<
1
)
&&
<
div
style
=
{{
marginTop
:
16
}}
><
Spin
/><
/div
>
}
{
!
loading
&&
cardList
}
<
div
className
=
{
styles
.
cardList
}
>
{
cardList
}
<
/div
>
<
/div
>
<
/PageHeaderLayout
>
);
...
...
src/routes/List/CoverCardList.less
View file @
abca36bd
...
...
@@ -21,4 +21,7 @@
flex: 0 1 auto;
}
}
.cardList {
margin-top: 24px;
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment