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
4f2f9e57
Commit
4f2f9e57
authored
Oct 19, 2017
by
afc163
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update notification
parent
c0e2d671
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
52 additions
and
19 deletions
+52
-19
src/components/NoticeIcon/NoticeList.js
src/components/NoticeIcon/NoticeList.js
+8
-4
src/components/NoticeIcon/NoticeList.less
src/components/NoticeIcon/NoticeList.less
+5
-8
src/components/NoticeIcon/demo/popover.md
src/components/NoticeIcon/demo/popover.md
+18
-3
src/components/NoticeIcon/index.js
src/components/NoticeIcon/index.js
+2
-0
src/layouts/BasicLayout.js
src/layouts/BasicLayout.js
+18
-3
src/layouts/BasicLayout.less
src/layouts/BasicLayout.less
+1
-1
No files found.
src/components/NoticeIcon/NoticeList.js
View file @
4f2f9e57
import
React
from
'
react
'
;
import
{
Avatar
,
Icon
,
List
}
from
'
antd
'
;
import
{
Avatar
,
List
}
from
'
antd
'
;
import
classNames
from
'
classnames
'
;
import
styles
from
'
./NoticeList.less
'
;
export
default
function
NoticeList
({
data
=
[],
onClick
,
onClear
,
title
,
locale
})
{
export
default
function
NoticeList
({
data
=
[],
onClick
,
onClear
,
title
,
locale
,
emptyText
,
emptyImage
,
})
{
if
(
data
.
length
===
0
)
{
return
(
<
div
className
=
{
styles
.
notFound
}
>
<
Icon
type
=
"
frown-o
"
/>
{
locale
.
emptyText
}
{
emptyImage
?
(
<
img
src
=
{
emptyImage
}
alt
=
"
not found
"
/>
)
:
null
}
<
div
>
{
emptyText
||
locale
.
emptyText
}
<
/div
>
<
/div
>
);
}
...
...
src/components/NoticeIcon/NoticeList.less
View file @
4f2f9e57
...
...
@@ -54,15 +54,12 @@
.notFound {
text-align: center;
height: 120px;
line-height: 120px;
font-size: 14px;
padding: 73px 0 88px 0;
color: @text-color-secondary;
> i {
font-size: 16px;
margin-right: 8px;
vertical-align: middle;
margin-top: -1px;
img {
display: inline-block;
margin-bottom: 16px;
height: 76px;
}
}
...
...
src/components/NoticeIcon/demo/popover.md
View file @
4f2f9e57
...
...
@@ -51,9 +51,24 @@ ReactDOM.render(
}
}
>
<
NoticeIcon
count
=
{
5
}
onItemClick
=
{
onItemClick
}
onClear
=
{
onClear
}
>
<
NoticeIcon
.
Tab
list
=
{
data
}
title
=
"通知"
/>
<
NoticeIcon
.
Tab
list
=
{
data
}
title
=
"消息"
/>
<
NoticeIcon
.
Tab
list
=
{
[]
}
title
=
"待办"
/>
<
NoticeIcon
.
Tab
list
=
{
noticeData
[
'
通知
'
]
}
title
=
"通知"
emptyText
=
"你已查看所有通知"
emptyImage
=
"https://gw.alipayobjects.com/zos/rmsportal/sAuJeJzSKbUmHfBQRzmZ.svg"
/>
<
NoticeIcon
.
Tab
list
=
{
noticeData
[
'
消息
'
]
}
title
=
"消息"
emptyText
=
"您已读完所有消息"
emptyImage
=
"https://gw.alipayobjects.com/zos/rmsportal/wAhyIChODzsoKIOBHcBk.svg"
/>
<
NoticeIcon
.
Tab
list
=
{
noticeData
[
'
待办
'
]
}
title
=
"待办"
emptyText
=
"你已完成所有待办"
emptyImage
=
"https://gw.alipayobjects.com/zos/rmsportal/HsIsxMZiWKrNUavQUXqx.svg"
/>
</
NoticeIcon
>
</
div
>
,
mountNode
);
...
...
src/components/NoticeIcon/index.js
View file @
4f2f9e57
...
...
@@ -17,6 +17,7 @@ export default class NoticeIcon extends PureComponent {
emptyText
:
'
暂无数据
'
,
clear
:
'
清空
'
,
},
emptyImage
:
'
https://gw.alipayobjects.com/zos/rmsportal/wAhyIChODzsoKIOBHcBk.svg
'
,
};
static
Tab
=
TabPane
;
constructor
(
props
)
{
...
...
@@ -45,6 +46,7 @@ export default class NoticeIcon extends PureComponent {
return
(
<
TabPane
tab
=
{
title
}
key
=
{
child
.
props
.
title
}
>
<
List
{...
child
.
props
}
data
=
{
child
.
props
.
list
}
onClick
=
{
item
=>
this
.
onItemClick
(
item
,
child
.
props
)}
onClear
=
{()
=>
this
.
props
.
onClear
(
child
.
props
.
title
)}
...
...
src/layouts/BasicLayout.js
View file @
4f2f9e57
...
...
@@ -239,9 +239,24 @@ class BasicLayout extends React.PureComponent {
loading
=
{
fetchingNotices
}
popupAlign
=
{{
offset
:
[
20
,
-
16
]
}}
>
<
NoticeIcon
.
Tab
list
=
{
noticeData
[
'
通知
'
]}
title
=
"
通知
"
/>
<
NoticeIcon
.
Tab
list
=
{
noticeData
[
'
消息
'
]}
title
=
"
消息
"
/>
<
NoticeIcon
.
Tab
list
=
{
noticeData
[
'
待办
'
]}
title
=
"
待办
"
/>
<
NoticeIcon
.
Tab
list
=
{
noticeData
[
'
通知
'
]}
title
=
"
通知
"
emptyText
=
"
你已查看所有通知
"
emptyImage
=
"
https://gw.alipayobjects.com/zos/rmsportal/sAuJeJzSKbUmHfBQRzmZ.svg
"
/>
<
NoticeIcon
.
Tab
list
=
{
noticeData
[
'
消息
'
]}
title
=
"
消息
"
emptyText
=
"
您已读完所有消息
"
emptyImage
=
"
https://gw.alipayobjects.com/zos/rmsportal/wAhyIChODzsoKIOBHcBk.svg
"
/>
<
NoticeIcon
.
Tab
list
=
{
noticeData
[
'
待办
'
]}
title
=
"
待办
"
emptyText
=
"
你已完成所有待办
"
emptyImage
=
"
https://gw.alipayobjects.com/zos/rmsportal/HsIsxMZiWKrNUavQUXqx.svg
"
/>
<
/NoticeIcon
>
{
currentUser
.
name
?
(
<
Dropdown
overlay
=
{
menu
}
>
...
...
src/layouts/BasicLayout.less
View file @
4f2f9e57
...
...
@@ -45,7 +45,7 @@
transition: all .3s;
padding: 0 24px;
&:hover {
background:
rgba(0, 0, 0, .04)
;
background:
@primary-1
;
}
}
...
...
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