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
dba0299a
Commit
dba0299a
authored
Sep 20, 2018
by
digz6666
Committed by
陈帅
Sep 25, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Localized GlobalHeader, NoticeIcon and Header.
parent
eaca60aa
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
38 additions
and
15 deletions
+38
-15
src/components/GlobalHeader/RightContent.js
src/components/GlobalHeader/RightContent.js
+10
-10
src/components/NoticeIcon/NoticeList.js
src/components/NoticeIcon/NoticeList.js
+1
-2
src/components/NoticeIcon/index.js
src/components/NoticeIcon/index.js
+3
-2
src/layouts/Header.js
src/layouts/Header.js
+2
-1
src/locales/en-US.js
src/locales/en-US.js
+11
-0
src/locales/zh-CN.js
src/locales/zh-CN.js
+11
-0
No files found.
src/components/GlobalHeader/RightContent.js
View file @
dba0299a
import
React
,
{
PureComponent
}
from
'
react
'
;
import
{
FormattedMessage
,
setLocale
,
getLocale
}
from
'
umi/locale
'
;
import
{
FormattedMessage
,
formatMessage
,
setLocale
,
getLocale
}
from
'
umi/locale
'
;
import
{
Spin
,
Tag
,
Menu
,
Icon
,
Dropdown
,
Avatar
,
Tooltip
,
Button
}
from
'
antd
'
;
import
moment
from
'
moment
'
;
import
groupBy
from
'
lodash/groupBy
'
;
...
...
@@ -87,7 +87,7 @@ export default class GlobalHeaderRight extends PureComponent {
<
div
className
=
{
className
}
>
<
HeaderSearch
className
=
{
`
${
styles
.
action
}
${
styles
.
search
}
`
}
placeholder
=
"
站内搜索
"
placeholder
=
{
formatMessage
({
id
:
'
component.globalHeader.search
'
})}
dataSource
=
{[
'
搜索提示一
'
,
'
搜索提示二
'
,
'
搜索提示三
'
]}
onSearch
=
{
value
=>
{
console
.
log
(
'
input
'
,
value
);
// eslint-disable-line
...
...
@@ -96,13 +96,13 @@ export default class GlobalHeaderRight extends PureComponent {
console
.
log
(
'
enter
'
,
value
);
// eslint-disable-line
}}
/
>
<
Tooltip
title
=
"
使用文档
"
>
<
Tooltip
title
=
{
formatMessage
({
id
:
'
component.globalHeader.help
'
})}
>
<
a
target
=
"
_blank
"
href
=
"
https://pro.ant.design/docs/getting-started
"
rel
=
"
noopener noreferrer
"
className
=
{
styles
.
action
}
title
=
"
使用文档
"
title
=
"
{ formatMessage({id: 'component.globalHeader.help'}) }
"
>
<
Icon
type
=
"
question-circle-o
"
/>
<
/a
>
...
...
@@ -120,20 +120,20 @@ export default class GlobalHeaderRight extends PureComponent {
>
<
NoticeIcon
.
Tab
list
=
{
noticeData
[
'
通知
'
]}
title
=
"
通知
"
emptyText
=
"
你已查看所有通知
"
title
=
{
formatMessage
({
id
:
'
component.globalHeader.notification
'
})}
emptyText
=
{
formatMessage
({
id
:
'
component.globalHeader.notification.empty
'
})}
emptyImage
=
"
https://gw.alipayobjects.com/zos/rmsportal/wAhyIChODzsoKIOBHcBk.svg
"
/>
<
NoticeIcon
.
Tab
list
=
{
noticeData
[
'
消息
'
]}
title
=
"
消息
"
emptyText
=
"
您已读完所有消息
"
title
=
{
formatMessage
({
id
:
'
component.globalHeader.message
'
})}
emptyText
=
{
formatMessage
({
id
:
'
component.globalHeader.message.empty
'
})}
emptyImage
=
"
https://gw.alipayobjects.com/zos/rmsportal/sAuJeJzSKbUmHfBQRzmZ.svg
"
/>
<
NoticeIcon
.
Tab
list
=
{
noticeData
[
'
待办
'
]}
title
=
"
待办
"
emptyText
=
"
你已完成所有待办
"
title
=
{
formatMessage
({
id
:
'
component.globalHeader.event
'
})}
emptyText
=
{
formatMessage
({
id
:
'
component.globalHeader.event.empty
'
})}
emptyImage
=
"
https://gw.alipayobjects.com/zos/rmsportal/HsIsxMZiWKrNUavQUXqx.svg
"
/>
<
/NoticeIcon
>
...
...
src/components/NoticeIcon/NoticeList.js
View file @
dba0299a
...
...
@@ -63,8 +63,7 @@ export default function NoticeList({
<
/List
>
{
showClear
?
(
<
div
className
=
{
styles
.
clear
}
onClick
=
{
onClear
}
>
{
locale
.
clear
}
{
title
}
{
locale
.
clear
}
{
title
}
<
/div
>
)
:
null
}
<
/div
>
...
...
src/components/NoticeIcon/index.js
View file @
dba0299a
import
React
,
{
PureComponent
}
from
'
react
'
;
import
{
formatMessage
}
from
'
umi/locale
'
;
import
{
Popover
,
Icon
,
Tabs
,
Badge
,
Spin
}
from
'
antd
'
;
import
classNames
from
'
classnames
'
;
import
List
from
'
./NoticeList
'
;
...
...
@@ -16,8 +17,8 @@ export default class NoticeIcon extends PureComponent {
onClear
:
()
=>
{},
loading
:
false
,
locale
:
{
emptyText
:
'
暂无数据
'
,
clear
:
'
清空
'
,
emptyText
:
formatMessage
({
id
:
'
component.noticeIcon.empty
'
})
,
clear
:
formatMessage
({
id
:
'
component.noticeIcon.clear
'
})
,
},
emptyImage
:
'
https://gw.alipayobjects.com/zos/rmsportal/wAhyIChODzsoKIOBHcBk.svg
'
,
};
...
...
src/layouts/Header.js
View file @
dba0299a
import
React
,
{
PureComponent
}
from
'
react
'
;
import
{
formatMessage
}
from
'
umi/locale
'
;
import
{
Layout
,
message
}
from
'
antd
'
;
import
Animate
from
'
rc-animate
'
;
import
{
connect
}
from
'
dva
'
;
...
...
@@ -42,7 +43,7 @@ class HeaderView extends PureComponent {
};
handleNoticeClear
=
type
=>
{
message
.
success
(
`
清空了
${
type
}
`
);
message
.
success
(
`
${
formatMessage
({
id
:
'
component.noticeIcon.cleared
'
})}
${
type
}
`
);
const
{
dispatch
}
=
this
.
props
;
dispatch
({
type
:
'
global/clearNotices
'
,
...
...
src/locales/en-US.js
View file @
dba0299a
export
default
{
'
navbar.lang
'
:
'
中文
'
,
'
component.globalHeader.search
'
:
'
Search
'
,
'
component.globalHeader.help
'
:
'
Help
'
,
'
component.globalHeader.notification
'
:
'
Notification
'
,
'
component.globalHeader.notification.empty
'
:
'
You have viewed all notifications.
'
,
'
component.globalHeader.message
'
:
'
Message
'
,
'
component.globalHeader.message.empty
'
:
'
You have viewed all messsages.
'
,
'
component.globalHeader.event
'
:
'
Event
'
,
'
component.globalHeader.event.empty
'
:
'
You have viewed all events.
'
,
'
component.noticeIcon.clear
'
:
'
Clear
'
,
'
component.noticeIcon.cleared
'
:
'
Cleared
'
,
'
component.noticeIcon.empty
'
:
'
No notifications
'
,
'
menu.home
'
:
'
Home
'
,
'
menu.dashboard
'
:
'
Dashboard
'
,
'
menu.dashboard.analysis
'
:
'
Analysis
'
,
...
...
src/locales/zh-CN.js
View file @
dba0299a
...
...
@@ -2,6 +2,17 @@
export
default
{
'
navbar.lang
'
:
'
English
'
,
'
component.globalHeader.search
'
:
'
站内搜索
'
,
'
component.globalHeader.help
'
:
'
使用文档
'
,
'
component.globalHeader.notification
'
:
'
通知
'
,
'
component.globalHeader.notification.empty
'
:
'
你已查看所有通知
'
,
'
component.globalHeader.message
'
:
'
消息"
'
,
'
component.globalHeader.message.empty
'
:
'
您已读完所有消息"
'
,
'
component.globalHeader.event
'
:
'
待办
'
,
'
component.globalHeader.event.empty
'
:
'
你已完成所有待办
'
,
'
component.noticeIcon.clear
'
:
'
清空
'
,
'
component.noticeIcon.cleared
'
:
'
清空了
'
,
'
component.noticeIcon.empty
'
:
'
暂无数据
'
,
'
menu.home
'
:
'
首页
'
,
'
menu.dashboard
'
:
'
Dashboard
'
,
'
menu.dashboard.analysis
'
:
'
分析页
'
,
...
...
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