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
Hide 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
React
from
'
react
'
;
import
{
Avatar
,
Icon
,
List
}
from
'
antd
'
;
import
{
Avatar
,
List
}
from
'
antd
'
;
import
classNames
from
'
classnames
'
;
import
classNames
from
'
classnames
'
;
import
styles
from
'
./NoticeList.less
'
;
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
)
{
if
(
data
.
length
===
0
)
{
return
(
return
(
<
div
className
=
{
styles
.
notFound
}
>
<
div
className
=
{
styles
.
notFound
}
>
<
Icon
type
=
"
frown-o
"
/>
{
emptyImage
?
(
{
locale
.
emptyText
}
<
img
src
=
{
emptyImage
}
alt
=
"
not found
"
/>
)
:
null
}
<
div
>
{
emptyText
||
locale
.
emptyText
}
<
/div
>
<
/div
>
<
/div
>
);
);
}
}
...
...
src/components/NoticeIcon/NoticeList.less
View file @
4f2f9e57
...
@@ -54,15 +54,12 @@
...
@@ -54,15 +54,12 @@
.notFound {
.notFound {
text-align: center;
text-align: center;
height: 120px;
padding: 73px 0 88px 0;
line-height: 120px;
font-size: 14px;
color: @text-color-secondary;
color: @text-color-secondary;
> i {
img {
font-size: 16px;
display: inline-block;
margin-right: 8px;
margin-bottom: 16px;
vertical-align: middle;
height: 76px;
margin-top: -1px;
}
}
}
}
...
...
src/components/NoticeIcon/demo/popover.md
View file @
4f2f9e57
...
@@ -51,9 +51,24 @@ ReactDOM.render(
...
@@ -51,9 +51,24 @@ ReactDOM.render(
}
}
}
}
>
>
<
NoticeIcon
count
=
{
5
}
onItemClick
=
{
onItemClick
}
onClear
=
{
onClear
}
>
<
NoticeIcon
count
=
{
5
}
onItemClick
=
{
onItemClick
}
onClear
=
{
onClear
}
>
<
NoticeIcon
.
Tab
list
=
{
data
}
title
=
"通知"
/>
<
NoticeIcon
.
Tab
<
NoticeIcon
.
Tab
list
=
{
data
}
title
=
"消息"
/>
list
=
{
noticeData
[
'
通知
'
]
}
<
NoticeIcon
.
Tab
list
=
{
[]
}
title
=
"待办"
/>
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
>
</
NoticeIcon
>
</
div
>
</
div
>
,
mountNode
);
,
mountNode
);
...
...
src/components/NoticeIcon/index.js
View file @
4f2f9e57
...
@@ -17,6 +17,7 @@ export default class NoticeIcon extends PureComponent {
...
@@ -17,6 +17,7 @@ export default class NoticeIcon extends PureComponent {
emptyText
:
'
暂无数据
'
,
emptyText
:
'
暂无数据
'
,
clear
:
'
清空
'
,
clear
:
'
清空
'
,
},
},
emptyImage
:
'
https://gw.alipayobjects.com/zos/rmsportal/wAhyIChODzsoKIOBHcBk.svg
'
,
};
};
static
Tab
=
TabPane
;
static
Tab
=
TabPane
;
constructor
(
props
)
{
constructor
(
props
)
{
...
@@ -45,6 +46,7 @@ export default class NoticeIcon extends PureComponent {
...
@@ -45,6 +46,7 @@ export default class NoticeIcon extends PureComponent {
return
(
return
(
<
TabPane
tab
=
{
title
}
key
=
{
child
.
props
.
title
}
>
<
TabPane
tab
=
{
title
}
key
=
{
child
.
props
.
title
}
>
<
List
<
List
{...
child
.
props
}
data
=
{
child
.
props
.
list
}
data
=
{
child
.
props
.
list
}
onClick
=
{
item
=>
this
.
onItemClick
(
item
,
child
.
props
)}
onClick
=
{
item
=>
this
.
onItemClick
(
item
,
child
.
props
)}
onClear
=
{()
=>
this
.
props
.
onClear
(
child
.
props
.
title
)}
onClear
=
{()
=>
this
.
props
.
onClear
(
child
.
props
.
title
)}
...
...
src/layouts/BasicLayout.js
View file @
4f2f9e57
...
@@ -239,9 +239,24 @@ class BasicLayout extends React.PureComponent {
...
@@ -239,9 +239,24 @@ class BasicLayout extends React.PureComponent {
loading
=
{
fetchingNotices
}
loading
=
{
fetchingNotices
}
popupAlign
=
{{
offset
:
[
20
,
-
16
]
}}
popupAlign
=
{{
offset
:
[
20
,
-
16
]
}}
>
>
<
NoticeIcon
.
Tab
list
=
{
noticeData
[
'
通知
'
]}
title
=
"
通知
"
/>
<
NoticeIcon
.
Tab
<
NoticeIcon
.
Tab
list
=
{
noticeData
[
'
消息
'
]}
title
=
"
消息
"
/>
list
=
{
noticeData
[
'
通知
'
]}
<
NoticeIcon
.
Tab
list
=
{
noticeData
[
'
待办
'
]}
title
=
"
待办
"
/>
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
>
<
/NoticeIcon
>
{
currentUser
.
name
?
(
{
currentUser
.
name
?
(
<
Dropdown
overlay
=
{
menu
}
>
<
Dropdown
overlay
=
{
menu
}
>
...
...
src/layouts/BasicLayout.less
View file @
4f2f9e57
...
@@ -45,7 +45,7 @@
...
@@ -45,7 +45,7 @@
transition: all .3s;
transition: all .3s;
padding: 0 24px;
padding: 0 24px;
&:hover {
&: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