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
A
ant-design-pro
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
ant-design-pro
Commits
99162c71
Commit
99162c71
authored
Oct 26, 2017
by
afc163
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update activities data
parent
348c62be
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
86 additions
and
31 deletions
+86
-31
mock/api.js
mock/api.js
+50
-6
src/routes/Dashboard/Workplace.js
src/routes/Dashboard/Workplace.js
+35
-24
src/routes/Dashboard/Workplace.less
src/routes/Dashboard/Workplace.less
+1
-1
No files found.
mock/api.js
View file @
99162c71
...
...
@@ -176,7 +176,15 @@ export const getActivities = [
name
:
'
林东东
'
,
avatar
:
imgMap
.
a
,
},
action
:
'
在 [高逼格设计天团](http://github.com/) 新建项目 [六月迭代](http://github.com/)
'
,
group
:
{
name
:
'
高逼格设计天团
'
,
link
:
'
http://github.com/
'
,
},
project
:
{
name
:
'
六月迭代
'
,
link
:
'
http://github.com/
'
,
},
template
:
'
在 @{group} 新建项目 @{project}
'
,
},
{
id
:
'
trend-2
'
,
...
...
@@ -185,7 +193,15 @@ export const getActivities = [
name
:
'
付小小
'
,
avatar
:
imgMap
.
c
,
},
action
:
'
在 [高逼格设计天团](http://github.com/) 新建项目 [六月迭代](http://github.com/)
'
,
group
:
{
name
:
'
高逼格设计天团
'
,
link
:
'
http://github.com/
'
,
},
project
:
{
name
:
'
六月迭代
'
,
link
:
'
http://github.com/
'
,
},
template
:
'
在 @{group} 新建项目 @{project}
'
,
},
{
id
:
'
trend-3
'
,
...
...
@@ -194,7 +210,15 @@ export const getActivities = [
name
:
'
曲丽丽
'
,
avatar
:
imgMap
.
b
,
},
action
:
'
在 [中二少女团](http://github.com/) 新建项目 [六月迭代](http://github.com/)
'
,
group
:
{
name
:
'
中二少女团
'
,
link
:
'
http://github.com/
'
,
},
project
:
{
name
:
'
六月迭代
'
,
link
:
'
http://github.com/
'
,
},
template
:
'
在 @{group} 新建项目 @{project}
'
,
},
{
id
:
'
trend-4
'
,
...
...
@@ -203,7 +227,11 @@ export const getActivities = [
name
:
'
周星星
'
,
avatar
:
imgMap
.
c
,
},
action
:
'
在 [5 月日常迭代](http://github.com/) 更新至已发布状态
'
,
project
:
{
name
:
'
5 月日常迭代
'
,
link
:
'
http://github.com/
'
,
},
template
:
'
将 @{project} 更新至已发布状态
'
,
},
{
id
:
'
trend-5
'
,
...
...
@@ -212,7 +240,15 @@ export const getActivities = [
name
:
'
朱偏右
'
,
avatar
:
imgMap
.
a
,
},
action
:
'
在 [工程效能](http://github.com/) 发布了 [留言](http://github.com/)
'
,
project
:
{
name
:
'
工程效能
'
,
link
:
'
http://github.com/
'
,
},
comment
:
{
name
:
'
留言
'
,
link
:
'
http://github.com/
'
,
},
template
:
'
在 @{project} 发布了 @{comment}
'
,
},
{
id
:
'
trend-6
'
,
...
...
@@ -221,7 +257,15 @@ export const getActivities = [
name
:
'
乐哥
'
,
avatar
:
imgMap
.
d
,
},
action
:
'
在 [程序员日常](http://github.com/) 新建项目 [品牌迭代](http://github.com/)
'
,
group
:
{
name
:
'
程序员日常
'
,
link
:
'
http://github.com/
'
,
},
project
:
{
name
:
'
品牌迭代
'
,
link
:
'
http://github.com/
'
,
},
template
:
'
在 @{group} 新建项目 @{project}
'
,
},
];
...
...
src/routes/Dashboard/Workplace.js
View file @
99162c71
...
...
@@ -96,10 +96,43 @@ export default class Workplace extends PureComponent {
});
}
renderActivities
()
{
const
{
activities
:
{
list
},
}
=
this
.
props
;
return
list
.
map
((
item
)
=>
{
const
events
=
item
.
template
.
split
(
/@
\{([^
{}
]
*
)\}
/gi
).
map
((
key
)
=>
{
if
(
item
[
key
])
{
return
<
a
href
=
{
item
[
key
].
link
}
key
=
{
item
[
key
].
name
}
>
{
item
[
key
].
name
}
<
/a>
;
}
return
key
;
});
return
(
<
List
.
Item
key
=
{
item
.
id
}
>
<
List
.
Item
.
Meta
avatar
=
{
<
Avatar
src
=
{
item
.
user
.
avatar
}
/>
}
title
=
{
<
span
>
<
a
className
=
{
styles
.
username
}
>
{
item
.
user
.
name
}
<
/a
>
&
nbsp
;
<
span
className
=
{
styles
.
event
}
>
{
events
}
<
/span
>
<
/span
>
}
description
=
{
<
span
className
=
{
styles
.
datetime
}
title
=
{
item
.
updatedAt
}
>
{
moment
(
item
.
updatedAt
).
fromNow
()}
<
/span
>
}
/
>
<
/List.Item
>
);
});
}
render
()
{
const
{
project
:
{
loading
:
projectLoading
,
notice
},
activities
:
{
loading
:
activitiesLoading
,
list
:
activitiesList
},
activities
:
{
loading
:
activitiesLoading
},
chart
:
{
radarData
},
}
=
this
.
props
;
...
...
@@ -183,29 +216,7 @@ export default class Workplace extends PureComponent {
>
<
List
loading
=
{
activitiesLoading
}
size
=
"
large
"
>
<
div
className
=
{
styles
.
activitiesList
}
>
{
activitiesList
.
map
(
item
=>
(
<
List
.
Item
key
=
{
item
.
id
}
>
<
List
.
Item
.
Meta
avatar
=
{
<
Avatar
src
=
{
item
.
user
.
avatar
}
/>
}
title
=
{
<
span
>
<
a
className
=
{
styles
.
username
}
>
{
item
.
user
.
name
}
<
/a
>
&
nbsp
;
<
span
className
=
{
styles
.
operation
}
>
在
<
a
>
xx
<
/a> 新建了项目 <a>xxxx</
a
>
<
/span
>
<
/span
>
}
description
=
{
<
span
className
=
{
styles
.
datetime
}
title
=
{
item
.
updatedAt
}
>
{
moment
(
item
.
updatedAt
).
fromNow
()}
<
/span
>
}
/
>
<
/List.Item
>
))
}
{
this
.
renderActivities
()}
<
/div
>
<
/List
>
<
/Card
>
...
...
src/routes/Dashboard/Workplace.less
View file @
99162c71
...
...
@@ -6,7 +6,7 @@
.username {
color: @text-color;
}
.
operation
{
.
event
{
font-weight: normal;
}
}
...
...
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