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
dd41c130
Commit
dd41c130
authored
Mar 12, 2019
by
chen shuai
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of github.com:ant-design/ant-design-pro
parents
a9f0a18b
a9efb31b
Changes
22
Show whitespace changes
Inline
Side-by-side
Showing
22 changed files
with
313 additions
and
457 deletions
+313
-457
mock/notices.js
mock/notices.js
+98
-111
src/components/Charts/index.js
src/components/Charts/index.js
+5
-9
src/components/DescriptionList/index.less
src/components/DescriptionList/index.less
+16
-0
src/components/GlobalHeader/RightContent.js
src/components/GlobalHeader/RightContent.js
+13
-36
src/components/NoticeIcon/NoticeIconTab.d.ts
src/components/NoticeIcon/NoticeIconTab.d.ts
+1
-4
src/components/NoticeIcon/NoticeList.js
src/components/NoticeIcon/NoticeList.js
+30
-62
src/components/NoticeIcon/NoticeList.less
src/components/NoticeIcon/NoticeList.less
+16
-5
src/components/NoticeIcon/demo/popover.md
src/components/NoticeIcon/demo/popover.md
+90
-106
src/components/NoticeIcon/index.d.ts
src/components/NoticeIcon/index.d.ts
+3
-3
src/components/NoticeIcon/index.en-US.md
src/components/NoticeIcon/index.en-US.md
+5
-10
src/components/NoticeIcon/index.js
src/components/NoticeIcon/index.js
+12
-30
src/components/NoticeIcon/index.zh-CN.md
src/components/NoticeIcon/index.zh-CN.md
+4
-9
src/components/PageHeader/index.md
src/components/PageHeader/index.md
+1
-0
src/components/SiderMenu/BaseMenu.js
src/components/SiderMenu/BaseMenu.js
+2
-2
src/layouts/Header.js
src/layouts/Header.js
+0
-1
src/locales/en-US/globalHeader.js
src/locales/en-US/globalHeader.js
+1
-2
src/locales/pt-BR/globalHeader.js
src/locales/pt-BR/globalHeader.js
+1
-1
src/locales/zh-CN/globalHeader.js
src/locales/zh-CN/globalHeader.js
+1
-2
src/locales/zh-TW/globalHeader.js
src/locales/zh-TW/globalHeader.js
+1
-2
src/models/global.js
src/models/global.js
+1
-41
src/pages/Authorized.js
src/pages/Authorized.js
+12
-20
src/pages/Dashboard/Analysis.js
src/pages/Dashboard/Analysis.js
+0
-1
No files found.
mock/notices.js
View file @
dd41c130
const
fakeNotices
=
[
const
getNotices
=
(
req
,
res
)
=>
res
.
json
([
{
{
id
:
'
000000001
'
,
id
:
'
000000001
'
,
avatar
:
'
https://gw.alipayobjects.com/zos/rmsportal/ThXAXghbEsBCCSDihZxY.png
'
,
avatar
:
'
https://gw.alipayobjects.com/zos/rmsportal/ThXAXghbEsBCCSDihZxY.png
'
,
...
@@ -94,21 +95,7 @@ const fakeNotices = [
...
@@ -94,21 +95,7 @@ const fakeNotices = [
status
:
'
processing
'
,
status
:
'
processing
'
,
type
:
'
event
'
,
type
:
'
event
'
,
},
},
];
]);
const
getNotices
=
(
req
,
res
)
=>
{
if
(
req
.
query
&&
req
.
query
.
type
)
{
const
startFrom
=
parseInt
(
req
.
query
.
lastItemId
,
10
)
+
1
;
const
result
=
fakeNotices
.
filter
(({
type
})
=>
type
===
req
.
query
.
type
)
.
map
((
notice
,
index
)
=>
({
...
notice
,
id
:
`0000000
${
startFrom
+
index
}
`
,
}));
return
res
.
json
(
startFrom
>
24
?
result
.
concat
(
null
)
:
result
);
}
return
res
.
json
(
fakeNotices
);
};
export
default
{
export
default
{
'
GET /api/notices
'
:
getNotices
,
'
GET /api/notices
'
:
getNotices
,
...
...
src/components/Charts/index.js
View file @
dd41c130
...
@@ -3,15 +3,11 @@ import numeral from 'numeral';
...
@@ -3,15 +3,11 @@ import numeral from 'numeral';
import
ChartCard
from
'
./ChartCard
'
;
import
ChartCard
from
'
./ChartCard
'
;
import
Field
from
'
./Field
'
;
import
Field
from
'
./Field
'
;
const
getComponent
=
Component
=>
{
const
getComponent
=
Component
=>
props
=>
(
return
props
=>
{
return
(
<
Suspense
fallback
=
"
...
"
>
<
Suspense
fallback
=
"
...
"
>
<
Component
{...
props
}
/
>
<
Component
{...
props
}
/
>
<
/Suspense
>
<
/Suspense
>
);
);
};
};
const
Bar
=
getComponent
(
React
.
lazy
(()
=>
import
(
'
./Bar
'
)));
const
Bar
=
getComponent
(
React
.
lazy
(()
=>
import
(
'
./Bar
'
)));
const
Pie
=
getComponent
(
React
.
lazy
(()
=>
import
(
'
./Pie
'
)));
const
Pie
=
getComponent
(
React
.
lazy
(()
=>
import
(
'
./Pie
'
)));
...
...
src/components/DescriptionList/index.less
View file @
dd41c130
...
@@ -8,6 +8,14 @@
...
@@ -8,6 +8,14 @@
overflow: hidden;
overflow: hidden;
}
}
}
}
// fix margin top error of following descriptionList
& + & {
:global {
.ant-row {
margin-top: 16px;
}
}
}
.title {
.title {
margin-bottom: 16px;
margin-bottom: 16px;
...
@@ -47,6 +55,14 @@
...
@@ -47,6 +55,14 @@
margin-bottom: -8px;
margin-bottom: -8px;
}
}
}
}
// fix margin top error of following descriptionList
& + .descriptionList {
:global {
.ant-row {
margin-top: 8px;
}
}
}
.title {
.title {
margin-bottom: 12px;
margin-bottom: 12px;
color: @text-color;
color: @text-color;
...
...
src/components/GlobalHeader/RightContent.js
View file @
dd41c130
import
React
,
{
PureComponent
}
from
'
react
'
;
import
React
,
{
PureComponent
}
from
'
react
'
;
import
{
FormattedMessage
,
formatMessage
}
from
'
umi/locale
'
;
import
{
FormattedMessage
,
formatMessage
}
from
'
umi/locale
'
;
import
{
Spin
,
Tag
,
Menu
,
Icon
,
Avatar
,
Tooltip
}
from
'
antd
'
;
import
{
Spin
,
Tag
,
Menu
,
Icon
,
Avatar
,
Tooltip
,
message
}
from
'
antd
'
;
import
moment
from
'
moment
'
;
import
moment
from
'
moment
'
;
import
groupBy
from
'
lodash/groupBy
'
;
import
groupBy
from
'
lodash/groupBy
'
;
import
NoticeIcon
from
'
../NoticeIcon
'
;
import
NoticeIcon
from
'
../NoticeIcon
'
;
...
@@ -63,30 +63,13 @@ export default class GlobalHeaderRight extends PureComponent {
...
@@ -63,30 +63,13 @@ export default class GlobalHeaderRight extends PureComponent {
});
});
};
};
fetchMoreNotices
=
tabProps
=>
{
const
{
list
,
name
}
=
tabProps
;
const
{
dispatch
,
notices
=
[]
}
=
this
.
props
;
const
lastItemId
=
notices
[
notices
.
length
-
1
].
id
;
dispatch
({
type
:
'
global/fetchMoreNotices
'
,
payload
:
{
lastItemId
,
type
:
name
,
offset
:
list
.
length
,
},
});
};
render
()
{
render
()
{
const
{
const
{
currentUser
,
currentUser
,
fetchingMoreNotices
,
fetchingNotices
,
fetchingNotices
,
loadedAllNotices
,
onNoticeVisibleChange
,
onNoticeVisibleChange
,
onMenuClick
,
onMenuClick
,
onNoticeClear
,
onNoticeClear
,
skeletonCount
,
theme
,
theme
,
}
=
this
.
props
;
}
=
this
.
props
;
const
menu
=
(
const
menu
=
(
...
@@ -110,11 +93,6 @@ export default class GlobalHeaderRight extends PureComponent {
...
@@ -110,11 +93,6 @@ export default class GlobalHeaderRight extends PureComponent {
<
/Menu.Item
>
<
/Menu.Item
>
<
/Menu
>
<
/Menu
>
);
);
const
loadMoreProps
=
{
skeletonCount
,
loadedAll
:
loadedAllNotices
,
loading
:
fetchingMoreNotices
,
};
const
noticeData
=
this
.
getNoticeData
();
const
noticeData
=
this
.
getNoticeData
();
const
unreadMsg
=
this
.
getUnreadData
(
noticeData
);
const
unreadMsg
=
this
.
getUnreadData
(
noticeData
);
let
className
=
styles
.
right
;
let
className
=
styles
.
right
;
...
@@ -155,44 +133,43 @@ export default class GlobalHeaderRight extends PureComponent {
...
@@ -155,44 +133,43 @@ export default class GlobalHeaderRight extends PureComponent {
console
.
log
(
item
,
tabProps
);
// eslint-disable-line
console
.
log
(
item
,
tabProps
);
// eslint-disable-line
this
.
changeReadState
(
item
,
tabProps
);
this
.
changeReadState
(
item
,
tabProps
);
}}
}}
loading
=
{
fetchingNotices
}
locale
=
{{
locale
=
{{
emptyText
:
formatMessage
({
id
:
'
component.noticeIcon.empty
'
}),
emptyText
:
formatMessage
({
id
:
'
component.noticeIcon.empty
'
}),
clear
:
formatMessage
({
id
:
'
component.noticeIcon.clear
'
}),
clear
:
formatMessage
({
id
:
'
component.noticeIcon.clear
'
}),
loadedAll
:
formatMessage
({
id
:
'
component.noticeIcon.loaded
'
}),
viewMore
:
formatMessage
({
id
:
'
component.noticeIcon.view-more
'
}),
loadMore
:
formatMessage
({
id
:
'
component.noticeIcon.loading-more
'
}),
notification
:
formatMessage
({
id
:
'
component.globalHeader.notification
'
}),
message
:
formatMessage
({
id
:
'
component.globalHeader.message
'
}),
event
:
formatMessage
({
id
:
'
component.globalHeader.event
'
}),
}}
}}
onClear
=
{
onNoticeClear
}
onClear
=
{
onNoticeClear
}
onLoadMore
=
{
this
.
fetchMoreNotices
}
onPopupVisibleChange
=
{
onNoticeVisibleChange
}
onPopupVisibleChange
=
{
onNoticeVisibleChange
}
loading
=
{
fetchingNotices
}
onViewMore
=
{()
=>
message
.
info
(
'
Click on view more
'
)
}
clearClose
clearClose
>
>
<
NoticeIcon
.
Tab
<
NoticeIcon
.
Tab
count
=
{
unreadMsg
.
notification
}
count
=
{
unreadMsg
.
notification
}
list
=
{
noticeData
.
notification
}
list
=
{
noticeData
.
notification
}
title
=
{
formatMessage
({
id
:
'
component.globalHeader.notification
'
})}
title
=
"
notification
"
name
=
"
notification
"
emptyText
=
{
formatMessage
({
id
:
'
component.globalHeader.notification.empty
'
})}
emptyText
=
{
formatMessage
({
id
:
'
component.globalHeader.notification.empty
'
})}
emptyImage
=
"
https://gw.alipayobjects.com/zos/rmsportal/wAhyIChODzsoKIOBHcBk.svg
"
emptyImage
=
"
https://gw.alipayobjects.com/zos/rmsportal/wAhyIChODzsoKIOBHcBk.svg
"
{...
loadMoreProps
}
showViewMore
/>
/>
<
NoticeIcon
.
Tab
<
NoticeIcon
.
Tab
count
=
{
unreadMsg
.
message
}
count
=
{
unreadMsg
.
message
}
list
=
{
noticeData
.
message
}
list
=
{
noticeData
.
message
}
title
=
{
formatMessage
({
id
:
'
component.globalHeader.message
'
})}
title
=
"
message
"
name
=
"
message
"
emptyText
=
{
formatMessage
({
id
:
'
component.globalHeader.message.empty
'
})}
emptyText
=
{
formatMessage
({
id
:
'
component.globalHeader.message.empty
'
})}
emptyImage
=
"
https://gw.alipayobjects.com/zos/rmsportal/sAuJeJzSKbUmHfBQRzmZ.svg
"
emptyImage
=
"
https://gw.alipayobjects.com/zos/rmsportal/sAuJeJzSKbUmHfBQRzmZ.svg
"
{...
loadMoreProps
}
showViewMore
/>
/>
<
NoticeIcon
.
Tab
<
NoticeIcon
.
Tab
count
=
{
unreadMsg
.
event
}
count
=
{
unreadMsg
.
event
}
list
=
{
noticeData
.
event
}
list
=
{
noticeData
.
event
}
title
=
{
formatMessage
({
id
:
'
component.globalHeader.event
'
})}
title
=
"
event
"
name
=
"
event
"
emptyText
=
{
formatMessage
({
id
:
'
component.globalHeader.event.empty
'
})}
emptyText
=
{
formatMessage
({
id
:
'
component.globalHeader.event.empty
'
})}
emptyImage
=
"
https://gw.alipayobjects.com/zos/rmsportal/HsIsxMZiWKrNUavQUXqx.svg
"
emptyImage
=
"
https://gw.alipayobjects.com/zos/rmsportal/HsIsxMZiWKrNUavQUXqx.svg
"
{...
loadMoreProps
}
showViewMore
/>
/>
<
/NoticeIcon
>
<
/NoticeIcon
>
{
currentUser
.
name
?
(
{
currentUser
.
name
?
(
...
...
src/components/NoticeIcon/NoticeIconTab.d.ts
View file @
dd41c130
...
@@ -15,12 +15,9 @@ export interface INoticeIconTabProps {
...
@@ -15,12 +15,9 @@ export interface INoticeIconTabProps {
emptyText
?:
React
.
ReactNode
;
emptyText
?:
React
.
ReactNode
;
emptyImage
?:
string
;
emptyImage
?:
string
;
list
?:
INoticeIconData
[];
list
?:
INoticeIconData
[];
loadedAll
?:
boolean
;
loading
?:
boolean
;
name
?:
string
;
name
?:
string
;
showClear
?:
boolean
;
showClear
?:
boolean
;
skeletonCount
?:
number
;
showViewMore
?:
boolean
;
skeletonProps
?:
SkeletonProps
;
style
?:
React
.
CSSProperties
;
style
?:
React
.
CSSProperties
;
title
?:
string
;
title
?:
string
;
}
}
...
...
src/components/NoticeIcon/NoticeList.js
View file @
dd41c130
import
React
from
'
react
'
;
import
React
from
'
react
'
;
import
{
Avatar
,
List
,
Skeleton
}
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
'
;
let
ListElement
=
null
;
export
default
function
NoticeList
({
export
default
function
NoticeList
({
data
=
[],
data
=
[],
onClick
,
onClick
,
...
@@ -13,14 +11,9 @@ export default function NoticeList({
...
@@ -13,14 +11,9 @@ export default function NoticeList({
locale
,
locale
,
emptyText
,
emptyText
,
emptyImage
,
emptyImage
,
loading
,
onViewMore
=
null
,
onLoadMore
,
visible
,
loadedAll
=
true
,
scrollToLoad
=
true
,
showClear
=
true
,
showClear
=
true
,
skeletonCount
=
5
,
showViewMore
=
false
,
skeletonProps
=
{},
})
{
})
{
if
(
data
.
length
===
0
)
{
if
(
data
.
length
===
0
)
{
return
(
return
(
...
@@ -30,36 +23,10 @@ export default function NoticeList({
...
@@ -30,36 +23,10 @@ export default function NoticeList({
<
/div
>
<
/div
>
);
);
}
}
const
loadingList
=
Array
.
from
({
length
:
loading
?
skeletonCount
:
0
}).
map
(()
=>
({
loading
}));
const
LoadMore
=
loadedAll
?
(
<
div
className
=
{
classNames
(
styles
.
loadMore
,
styles
.
loadedAll
)}
>
<
span
>
{
locale
.
loadedAll
}
<
/span
>
<
/div
>
)
:
(
<
div
className
=
{
styles
.
loadMore
}
onClick
=
{
onLoadMore
}
>
<
span
>
{
locale
.
loadMore
}
<
/span
>
<
/div
>
);
const
onScroll
=
event
=>
{
if
(
!
scrollToLoad
||
loading
||
loadedAll
)
return
;
if
(
typeof
onLoadMore
!==
'
function
'
)
return
;
const
{
currentTarget
:
t
}
=
event
;
if
(
t
.
scrollHeight
-
t
.
scrollTop
-
t
.
clientHeight
<=
40
)
{
onLoadMore
(
event
);
ListElement
=
t
;
}
};
if
(
!
visible
&&
ListElement
)
{
try
{
ListElement
.
scrollTo
(
null
,
0
);
}
catch
(
err
)
{
ListElement
=
null
;
}
}
return
(
return
(
<
div
>
<
div
>
<
List
className
=
{
styles
.
list
}
loadMore
=
{
LoadMore
}
onScroll
=
{
onScroll
}
>
<
List
className
=
{
styles
.
list
}
>
{
[...
data
,
...
loadingList
]
.
map
((
item
,
i
)
=>
{
{
data
.
map
((
item
,
i
)
=>
{
const
itemCls
=
classNames
(
styles
.
item
,
{
const
itemCls
=
classNames
(
styles
.
item
,
{
[
styles
.
read
]:
item
.
read
,
[
styles
.
read
]:
item
.
read
,
});
});
...
@@ -74,7 +41,6 @@ export default function NoticeList({
...
@@ -74,7 +41,6 @@ export default function NoticeList({
return
(
return
(
<
List
.
Item
className
=
{
itemCls
}
key
=
{
item
.
key
||
i
}
onClick
=
{()
=>
onClick
(
item
)}
>
<
List
.
Item
className
=
{
itemCls
}
key
=
{
item
.
key
||
i
}
onClick
=
{()
=>
onClick
(
item
)}
>
<
Skeleton
avatar
title
=
{
false
}
active
{...
skeletonProps
}
loading
=
{
item
.
loading
}
>
<
List
.
Item
.
Meta
<
List
.
Item
.
Meta
className
=
{
styles
.
meta
}
className
=
{
styles
.
meta
}
avatar
=
{
leftIcon
}
avatar
=
{
leftIcon
}
...
@@ -93,16 +59,18 @@ export default function NoticeList({
...
@@ -93,16 +59,18 @@ export default function NoticeList({
<
/div
>
<
/div
>
}
}
/
>
/
>
<
/Skeleton
>
<
/List.Item
>
<
/List.Item
>
);
);
})}
})}
<
/List
>
<
/List
>
<
div
className
=
{
styles
.
bottomBar
}
>
{
showClear
?
(
{
showClear
?
(
<
div
className
=
{
styles
.
clear
}
onClick
=
{
onClear
}
>
<
div
onClick
=
{
onClear
}
>
{
locale
.
clear
}
{
title
}
{
locale
.
clear
}
{
locale
[
title
]
||
title
}
<
/div
>
<
/div
>
)
:
null
}
)
:
null
}
{
showViewMore
?
<
div
onClick
=
{
onViewMore
}
>
{
locale
.
viewMore
}
<
/div> : null
}
<
/div
>
<
/div
>
<
/div
>
);
);
}
}
src/components/NoticeIcon/NoticeList.less
View file @
dd41c130
...
@@ -78,17 +78,28 @@
...
@@ -78,17 +78,28 @@
}
}
}
}
.
cle
ar {
.
bottomB
ar {
height: 46px;
height: 46px;
color: @text-color;
color: @text-color;
line-height: 46px;
line-height: 46px;
text-align: center;
text-align: center;
border-top: 1px solid @border-color-split;
border-top: 1px solid @border-color-split;
border-radius: 0 0 @border-radius-base @border-radius-base;
border-radius: 0 0 @border-radius-base @border-radius-base;
transition: all 0.3s;
div {
display: inline-block;
width: 50%;
cursor: pointer;
cursor: pointer;
transition: all 0.3s;
transition: all 0.3s;
user-select: none;
&:hover {
&:hover {
color: @heading-color;
color: @heading-color;
}
}
&:only-child {
width: 100%;
}
&:not(:only-child):last-child {
border-left: 1px solid @border-color-split;
}
}
}
}
src/components/NoticeIcon/demo/popover.md
View file @
dd41c130
...
@@ -9,103 +9,90 @@ title: 带浮层卡片
...
@@ -9,103 +9,90 @@ title: 带浮层卡片
import
NoticeIcon
from
'
ant-design-pro/lib/NoticeIcon
'
;
import
NoticeIcon
from
'
ant-design-pro/lib/NoticeIcon
'
;
import
{
Tag
}
from
'
antd
'
;
import
{
Tag
}
from
'
antd
'
;
const
data
=
[
const
data
=
[{
{
id
:
'
000000001
'
,
id
:
'
000000001
'
,
avatar
:
'
https://gw.alipayobjects.com/zos/rmsportal/ThXAXghbEsBCCSDihZxY.png
'
,
avatar
:
'
https://gw.alipayobjects.com/zos/rmsportal/ThXAXghbEsBCCSDihZxY.png
'
,
title
:
'
你收到了 14 份新周报
'
,
title
:
'
你收到了 14 份新周报
'
,
datetime
:
'
2017-08-09
'
,
datetime
:
'
2017-08-09
'
,
type
:
'
通知
'
,
type
:
'
notification
'
,
},
},
{
{
id
:
'
000000002
'
,
id
:
'
000000002
'
,
avatar
:
'
https://gw.alipayobjects.com/zos/rmsportal/OKJXDXrmkNshAMvwtvhu.png
'
,
avatar
:
'
https://gw.alipayobjects.com/zos/rmsportal/OKJXDXrmkNshAMvwtvhu.png
'
,
title
:
'
你推荐的 曲妮妮 已通过第三轮面试
'
,
title
:
'
你推荐的 曲妮妮 已通过第三轮面试
'
,
datetime
:
'
2017-08-08
'
,
datetime
:
'
2017-08-08
'
,
type
:
'
通知
'
,
type
:
'
notification
'
,
},
},
{
{
id
:
'
000000003
'
,
id
:
'
000000003
'
,
avatar
:
'
https://gw.alipayobjects.com/zos/rmsportal/kISTdvpyTAhtGxpovNWd.png
'
,
avatar
:
'
https://gw.alipayobjects.com/zos/rmsportal/kISTdvpyTAhtGxpovNWd.png
'
,
title
:
'
这种模板可以区分多种通知类型
'
,
title
:
'
这种模板可以区分多种通知类型
'
,
datetime
:
'
2017-08-07
'
,
datetime
:
'
2017-08-07
'
,
read
:
true
,
read
:
true
,
type
:
'
通知
'
,
type
:
'
notification
'
,
},
},
{
{
id
:
'
000000004
'
,
id
:
'
000000004
'
,
avatar
:
'
https://gw.alipayobjects.com/zos/rmsportal/GvqBnKhFgObvnSGkDsje.png
'
,
avatar
:
'
https://gw.alipayobjects.com/zos/rmsportal/GvqBnKhFgObvnSGkDsje.png
'
,
title
:
'
左侧图标用于区分不同的类型
'
,
title
:
'
左侧图标用于区分不同的类型
'
,
datetime
:
'
2017-08-07
'
,
datetime
:
'
2017-08-07
'
,
type
:
'
通知
'
,
type
:
'
notification
'
,
},
},
{
{
id
:
'
000000005
'
,
id
:
'
000000005
'
,
avatar
:
'
https://gw.alipayobjects.com/zos/rmsportal/ThXAXghbEsBCCSDihZxY.png
'
,
avatar
:
'
https://gw.alipayobjects.com/zos/rmsportal/ThXAXghbEsBCCSDihZxY.png
'
,
title
:
'
内容不要超过两行字,超出时自动截断
'
,
title
:
'
内容不要超过两行字,超出时自动截断
'
,
datetime
:
'
2017-08-07
'
,
datetime
:
'
2017-08-07
'
,
type
:
'
通知
'
,
type
:
'
notification
'
,
},
},
{
{
id
:
'
000000006
'
,
id
:
'
000000006
'
,
avatar
:
'
https://gw.alipayobjects.com/zos/rmsportal/fcHMVNCjPOsbUGdEduuv.jpeg
'
,
avatar
:
'
https://gw.alipayobjects.com/zos/rmsportal/fcHMVNCjPOsbUGdEduuv.jpeg
'
,
title
:
'
曲丽丽 评论了你
'
,
title
:
'
曲丽丽 评论了你
'
,
description
:
'
描述信息描述信息描述信息
'
,
description
:
'
描述信息描述信息描述信息
'
,
datetime
:
'
2017-08-07
'
,
datetime
:
'
2017-08-07
'
,
type
:
'
消息
'
,
type
:
'
message
'
,
clickClose
:
true
,
clickClose
:
true
,
},
},
{
{
id
:
'
000000007
'
,
id
:
'
000000007
'
,
avatar
:
'
https://gw.alipayobjects.com/zos/rmsportal/fcHMVNCjPOsbUGdEduuv.jpeg
'
,
avatar
:
'
https://gw.alipayobjects.com/zos/rmsportal/fcHMVNCjPOsbUGdEduuv.jpeg
'
,
title
:
'
朱偏右 回复了你
'
,
title
:
'
朱偏右 回复了你
'
,
description
:
'
这种模板用于提醒谁与你发生了互动,左侧放『谁』的头像
'
,
description
:
'
这种模板用于提醒谁与你发生了互动,左侧放『谁』的头像
'
,
datetime
:
'
2017-08-07
'
,
datetime
:
'
2017-08-07
'
,
type
:
'
消息
'
,
type
:
'
message
'
,
clickClose
:
true
,
clickClose
:
true
,
},
},
{
{
id
:
'
000000008
'
,
id
:
'
000000008
'
,
avatar
:
'
https://gw.alipayobjects.com/zos/rmsportal/fcHMVNCjPOsbUGdEduuv.jpeg
'
,
avatar
:
'
https://gw.alipayobjects.com/zos/rmsportal/fcHMVNCjPOsbUGdEduuv.jpeg
'
,
title
:
'
标题
'
,
title
:
'
标题
'
,
description
:
'
这种模板用于提醒谁与你发生了互动,左侧放『谁』的头像
'
,
description
:
'
这种模板用于提醒谁与你发生了互动,左侧放『谁』的头像
'
,
datetime
:
'
2017-08-07
'
,
datetime
:
'
2017-08-07
'
,
type
:
'
消息
'
,
type
:
'
message
'
,
clickClose
:
true
,
clickClose
:
true
,
},
},
{
{
id
:
'
000000009
'
,
id
:
'
000000009
'
,
title
:
'
任务名称
'
,
title
:
'
任务名称
'
,
description
:
'
任务需要在 2017-01-12 20:00 前启动
'
,
description
:
'
任务需要在 2017-01-12 20:00 前启动
'
,
extra
:
'
未开始
'
,
extra
:
'
未开始
'
,
status
:
'
todo
'
,
status
:
'
todo
'
,
type
:
'
待办
'
,
type
:
'
event
'
,
},
},
{
{
id
:
'
000000010
'
,
id
:
'
000000010
'
,
title
:
'
第三方紧急代码变更
'
,
title
:
'
第三方紧急代码变更
'
,
description
:
'
冠霖提交于 2017-01-06,需在 2017-01-07 前完成代码变更任务
'
,
description
:
'
冠霖提交于 2017-01-06,需在 2017-01-07 前完成代码变更任务
'
,
extra
:
'
马上到期
'
,
extra
:
'
马上到期
'
,
status
:
'
urgent
'
,
status
:
'
urgent
'
,
type
:
'
待办
'
,
type
:
'
event
'
,
},
},
{
{
id
:
'
000000011
'
,
id
:
'
000000011
'
,
title
:
'
信息安全考试
'
,
title
:
'
信息安全考试
'
,
description
:
'
指派竹尔于 2017-01-09 前完成更新并发布
'
,
description
:
'
指派竹尔于 2017-01-09 前完成更新并发布
'
,
extra
:
'
已耗时 8 天
'
,
extra
:
'
已耗时 8 天
'
,
status
:
'
doing
'
,
status
:
'
doing
'
,
type
:
'
待办
'
,
type
:
'
event
'
,
},
},
{
{
id
:
'
000000012
'
,
id
:
'
000000012
'
,
title
:
'
ABCD 版本发布
'
,
title
:
'
ABCD 版本发布
'
,
description
:
'
冠霖提交于 2017-01-06,需在 2017-01-07 前完成代码变更任务
'
,
description
:
'
冠霖提交于 2017-01-06,需在 2017-01-07 前完成代码变更任务
'
,
extra
:
'
进行中
'
,
extra
:
'
进行中
'
,
status
:
'
processing
'
,
status
:
'
processing
'
,
type
:
'
待办
'
,
type
:
'
event
'
,
},
}];
];
function
onItemClick
(
item
,
tabProps
)
{
function
onItemClick
(
item
,
tabProps
)
{
console
.
log
(
item
,
tabProps
);
console
.
log
(
item
,
tabProps
);
...
@@ -163,23 +150,20 @@ const Demo = () => (
...
@@ -163,23 +150,20 @@ const Demo = () => (
>
>
<
NoticeIcon
className
=
"notice-icon"
count
=
{
5
}
onItemClick
=
{
onItemClick
}
onClear
=
{
onClear
}
>
<
NoticeIcon
className
=
"notice-icon"
count
=
{
5
}
onItemClick
=
{
onItemClick
}
onClear
=
{
onClear
}
>
<
NoticeIcon
.
Tab
<
NoticeIcon
.
Tab
list
=
{
noticeData
[
'
通知
'
]
}
list
=
{
noticeData
.
notification
}
name
=
"通知"
title
=
"notification"
title
=
"通知"
emptyText
=
"你已查看所有通知"
emptyText
=
"你已查看所有通知"
emptyImage
=
"https://gw.alipayobjects.com/zos/rmsportal/wAhyIChODzsoKIOBHcBk.svg"
emptyImage
=
"https://gw.alipayobjects.com/zos/rmsportal/wAhyIChODzsoKIOBHcBk.svg"
/>
/>
<
NoticeIcon
.
Tab
<
NoticeIcon
.
Tab
list
=
{
noticeData
[
'
消息
'
]
}
list
=
{
noticeData
.
message
}
name
=
"消息"
title
=
"message"
title
=
"消息"
emptyText
=
"您已读完所有消息"
emptyText
=
"您已读完所有消息"
emptyImage
=
"https://gw.alipayobjects.com/zos/rmsportal/sAuJeJzSKbUmHfBQRzmZ.svg"
emptyImage
=
"https://gw.alipayobjects.com/zos/rmsportal/sAuJeJzSKbUmHfBQRzmZ.svg"
/>
/>
<
NoticeIcon
.
Tab
<
NoticeIcon
.
Tab
list
=
{
noticeData
[
'
待办
'
]
}
list
=
{
noticeData
.
event
}
name
=
"待办"
title
=
"event"
title
=
"待办"
emptyText
=
"你已完成所有待办"
emptyText
=
"你已完成所有待办"
emptyImage
=
"https://gw.alipayobjects.com/zos/rmsportal/HsIsxMZiWKrNUavQUXqx.svg"
emptyImage
=
"https://gw.alipayobjects.com/zos/rmsportal/HsIsxMZiWKrNUavQUXqx.svg"
/>
/>
...
...
src/components/NoticeIcon/index.d.ts
View file @
dd41c130
...
@@ -8,7 +8,7 @@ export interface INoticeIconProps {
...
@@ -8,7 +8,7 @@ export interface INoticeIconProps {
loading
?:
boolean
;
loading
?:
boolean
;
onClear
?:
(
tabName
:
string
)
=>
void
;
onClear
?:
(
tabName
:
string
)
=>
void
;
onItemClick
?:
(
item
:
INoticeIconData
,
tabProps
:
INoticeIconProps
)
=>
void
;
onItemClick
?:
(
item
:
INoticeIconData
,
tabProps
:
INoticeIconProps
)
=>
void
;
on
Load
More
?:
(
tabProps
:
INoticeIconProps
)
=>
void
;
on
View
More
?:
(
tabProps
:
INoticeIconProps
)
=>
void
;
onTabChange
?:
(
tabTile
:
string
)
=>
void
;
onTabChange
?:
(
tabTile
:
string
)
=>
void
;
style
?:
React
.
CSSProperties
;
style
?:
React
.
CSSProperties
;
onPopupVisibleChange
?:
(
visible
:
boolean
)
=>
void
;
onPopupVisibleChange
?:
(
visible
:
boolean
)
=>
void
;
...
@@ -16,8 +16,8 @@ export interface INoticeIconProps {
...
@@ -16,8 +16,8 @@ export interface INoticeIconProps {
locale
?:
{
locale
?:
{
emptyText
:
string
;
emptyText
:
string
;
clear
:
string
;
clear
:
string
;
loadedAll
:
string
;
viewMore
:
string
;
loadMore
:
string
;
[
key
:
string
]
:
string
;
};
};
clearClose
?:
boolean
;
clearClose
?:
boolean
;
}
}
...
...
src/components/NoticeIcon/index.en-US.md
View file @
dd41c130
...
@@ -5,7 +5,7 @@ cols: 1
...
@@ -5,7 +5,7 @@ cols: 1
order
:
9
order
:
9
---
---
用在导航工具栏上,作为整个产品统一的通知中心。
Used in navigation toolbar as a unified notification center for the entire product.
## API
## API
...
@@ -16,11 +16,11 @@ bell | Change the bell Icon | ReactNode | `<Icon type='bell' />`
...
@@ -16,11 +16,11 @@ bell | Change the bell Icon | ReactNode | `<Icon type='bell' />`
loading | Popup card loading status | boolean |
`false`
loading | Popup card loading status | boolean |
`false`
onClear | Click to clear button the callback | function(tabName) | -
onClear | Click to clear button the callback | function(tabName) | -
onItemClick | Click on the list item's callback | function(item, tabProps) | -
onItemClick | Click on the list item's callback | function(item, tabProps) | -
onLoadMore | Callback of click for loading more | function(tabProps, event) | -
onPopupVisibleChange | Popup Card Showing or Hiding Callbacks | function(visible) | -
onPopupVisibleChange | Popup Card Showing or Hiding Callbacks | function(visible) | -
onTabChange | Switching callbacks for tabs | function(tabTitle) | -
onTabChange | Switching callbacks for tabs | function(tabTitle) | -
onViewMore | Callback of click for view more | function(tabProps, event) | -
popupVisible | Popup card display state | boolean | -
popupVisible | Popup card display state | boolean | -
locale | Default message text | Object |
`{ emptyText: 'No notifications', clear: 'Clear',
loadedAll: 'Loaded', load
More: 'Loading more' }`
locale | Default message text | Object |
`{ emptyText: 'No notifications', clear: 'Clear',
view
More: 'Loading more' }`
clearClose | Close menu after clear | boolean |
`false`
clearClose | Close menu after clear | boolean |
`false`
### NoticeIcon.Tab
### NoticeIcon.Tab
...
@@ -31,14 +31,9 @@ count | Unread messages count of this tab | number | list.length
...
@@ -31,14 +31,9 @@ count | Unread messages count of this tab | number | list.length
emptyText | Message text when list is empty | ReactNode | -
emptyText | Message text when list is empty | ReactNode | -
emptyImage | Image when list is empty | string | -
emptyImage | Image when list is empty | string | -
list | List data, format refer to the following table | Array |
`[]`
list | List data, format refer to the following table | Array |
`[]`
loadedAll | All messages have been loaded | boolean |
`true`
loading | Loading status of this tab | boolean |
`false`
name | identifier for message Tab | string | -
scrollToLoad | Scroll to load | boolean |
`true`
skeletonCount | Number of skeleton when tab is loading | number |
`5`
skeletonProps | Props of skeleton | SkeletonProps |
`{}`
showClear | Clear button display status | boolean |
`true`
showClear | Clear button display status | boolean |
`true`
title | header for message Tab | string | -
showViewMore | View more button display status | boolean |
`false`
title | header for message Tab, the actual text is
`locale[title] || title`
| string | -
### Tab data
### Tab data
...
...
src/components/NoticeIcon/index.js
View file @
dd41c130
...
@@ -16,13 +16,13 @@ export default class NoticeIcon extends PureComponent {
...
@@ -16,13 +16,13 @@ export default class NoticeIcon extends PureComponent {
onPopupVisibleChange
:
()
=>
{},
onPopupVisibleChange
:
()
=>
{},
onTabChange
:
()
=>
{},
onTabChange
:
()
=>
{},
onClear
:
()
=>
{},
onClear
:
()
=>
{},
onViewMore
:
()
=>
{},
loading
:
false
,
loading
:
false
,
clearClose
:
false
,
clearClose
:
false
,
locale
:
{
locale
:
{
emptyText
:
'
No notifications
'
,
emptyText
:
'
No notifications
'
,
clear
:
'
Clear
'
,
clear
:
'
Clear
'
,
loadedAll
:
'
Loaded
'
,
viewMore
:
'
More
'
,
loadMore
:
'
Loading more
'
,
},
},
emptyImage
:
'
https://gw.alipayobjects.com/zos/rmsportal/wAhyIChODzsoKIOBHcBk.svg
'
,
emptyImage
:
'
https://gw.alipayobjects.com/zos/rmsportal/wAhyIChODzsoKIOBHcBk.svg
'
,
};
};
...
@@ -53,53 +53,35 @@ export default class NoticeIcon extends PureComponent {
...
@@ -53,53 +53,35 @@ export default class NoticeIcon extends PureComponent {
onTabChange
(
tabType
);
onTabChange
(
tabType
);
};
};
on
Load
More
=
(
tabProps
,
event
)
=>
{
on
View
More
=
(
tabProps
,
event
)
=>
{
const
{
on
Load
More
}
=
this
.
props
;
const
{
on
View
More
}
=
this
.
props
;
on
Load
More
(
tabProps
,
event
);
on
View
More
(
tabProps
,
event
);
};
};
getNotificationBox
()
{
getNotificationBox
()
{
const
{
visible
}
=
this
.
state
;
const
{
children
,
loading
,
locale
}
=
this
.
props
;
const
{
children
,
loading
,
locale
}
=
this
.
props
;
if
(
!
children
)
{
if
(
!
children
)
{
return
null
;
return
null
;
}
}
const
panes
=
React
.
Children
.
map
(
children
,
child
=>
{
const
panes
=
React
.
Children
.
map
(
children
,
child
=>
{
const
{
const
{
list
,
title
,
count
,
emptyText
,
emptyImage
,
showClear
,
showViewMore
}
=
child
.
props
;
list
,
title
,
name
,
count
,
emptyText
,
emptyImage
,
showClear
,
loadedAll
,
scrollToLoad
,
skeletonCount
,
skeletonProps
,
loading
:
tabLoading
,
}
=
child
.
props
;
const
len
=
list
&&
list
.
length
?
list
.
length
:
0
;
const
len
=
list
&&
list
.
length
?
list
.
length
:
0
;
const
msgCount
=
count
||
count
===
0
?
count
:
len
;
const
msgCount
=
count
||
count
===
0
?
count
:
len
;
const
tabTitle
=
msgCount
>
0
?
`
${
title
}
(
${
msgCount
}
)`
:
title
;
const
localeTitle
=
locale
[
title
]
||
title
;
const
tabTitle
=
msgCount
>
0
?
`
${
localeTitle
}
(
${
msgCount
}
)`
:
localeTitle
;
return
(
return
(
<
TabPane
tab
=
{
tabTitle
}
key
=
{
nam
e
}
>
<
TabPane
tab
=
{
tabTitle
}
key
=
{
titl
e
}
>
<
List
<
List
data
=
{
list
}
data
=
{
list
}
emptyImage
=
{
emptyImage
}
emptyImage
=
{
emptyImage
}
emptyText
=
{
emptyText
}
emptyText
=
{
emptyText
}
loadedAll
=
{
loadedAll
}
loading
=
{
tabLoading
}
locale
=
{
locale
}
locale
=
{
locale
}
onClear
=
{()
=>
this
.
onClear
(
nam
e
)}
onClear
=
{()
=>
this
.
onClear
(
titl
e
)}
onClick
=
{
item
=>
this
.
onItemClick
(
item
,
child
.
props
)}
onClick
=
{
item
=>
this
.
onItemClick
(
item
,
child
.
props
)}
onLoadMore
=
{
event
=>
this
.
onLoadMore
(
child
.
props
,
event
)}
onViewMore
=
{
event
=>
this
.
onViewMore
(
child
.
props
,
event
)}
scrollToLoad
=
{
scrollToLoad
}
showClear
=
{
showClear
}
showClear
=
{
showClear
}
skeletonCount
=
{
skeletonCount
}
showViewMore
=
{
showViewMore
}
skeletonProps
=
{
skeletonProps
}
title
=
{
title
}
title
=
{
title
}
visible
=
{
visible
}
/
>
/
>
<
/TabPane
>
<
/TabPane
>
);
);
...
...
src/components/NoticeIcon/index.zh-CN.md
View file @
dd41c130
...
@@ -16,11 +16,11 @@ bell | translate this please -> Change the bell Icon | ReactNode | `<Icon type='
...
@@ -16,11 +16,11 @@ bell | translate this please -> Change the bell Icon | ReactNode | `<Icon type='
loading | 弹出卡片加载状态 | boolean |
`false`
loading | 弹出卡片加载状态 | boolean |
`false`
onClear | 点击清空按钮的回调 | function(tabName) | -
onClear | 点击清空按钮的回调 | function(tabName) | -
onItemClick | 点击列表项的回调 | function(item, tabProps) | -
onItemClick | 点击列表项的回调 | function(item, tabProps) | -
onLoadMore | 加载更多的回调 | function(tabProps, event) | -
onPopupVisibleChange | 弹出卡片显隐的回调 | function(visible) | -
onPopupVisibleChange | 弹出卡片显隐的回调 | function(visible) | -
onTabChange | 切换页签的回调 | function(tabTitle) | -
onTabChange | 切换页签的回调 | function(tabTitle) | -
onViewMore | 点击查看更多的回调 | function(tabProps, event) | -
popupVisible | 控制弹层显隐 | boolean | -
popupVisible | 控制弹层显隐 | boolean | -
locale | 默认文案 | Object |
`{ emptyText: 'No notifications', clear: 'Clear',
loadedAll: 'Loaded', load
More: 'Loading more' }`
locale | 默认文案 | Object |
`{ emptyText: 'No notifications', clear: 'Clear',
view
More: 'Loading more' }`
clearClose | 点击清空按钮后关闭通知菜单 | boolean |
`false`
clearClose | 点击清空按钮后关闭通知菜单 | boolean |
`false`
### NoticeIcon.Tab
### NoticeIcon.Tab
...
@@ -31,14 +31,9 @@ count | 当前 Tab 未读消息数量 | number | list.length
...
@@ -31,14 +31,9 @@ count | 当前 Tab 未读消息数量 | number | list.length
emptyText | 针对每个 Tab 定制空数据文案 | ReactNode | -
emptyText | 针对每个 Tab 定制空数据文案 | ReactNode | -
emptyImage | 针对每个 Tab 定制空数据图片 | string | -
emptyImage | 针对每个 Tab 定制空数据图片 | string | -
list | 列表数据,格式参照下表 | Array |
`[]`
list | 列表数据,格式参照下表 | Array |
`[]`
loadedAll | 已加载完所有消息 | boolean |
`true`
loading | 当前 Tab 的加载状态 | boolean |
`false`
name | 消息分类的标识符 | string | -
scrollToLoad | 允许滚动自加载 | boolean |
`true`
skeletonCount | 加载时占位骨架的数量 | number |
`5`
skeletonProps | 加载时占位骨架的属性 | SkeletonProps |
`{}`
showClear | 是否显示清空按钮 | boolean |
`true`
showClear | 是否显示清空按钮 | boolean |
`true`
title | 消息分类的页签标题 | string | -
showViewMore | 是否显示查看更多按钮 | boolean |
`false`
title | 消息分类的页签标题,实际的文案是
`locale[title] || title`
| string | -
### Tab data
### Tab data
...
...
src/components/PageHeader/index.md
View file @
dd41c130
...
@@ -12,6 +12,7 @@ order: 11
...
@@ -12,6 +12,7 @@ order: 11
| 参数 | 说明 | 类型 | 默认值 |
| 参数 | 说明 | 类型 | 默认值 |
|----------|------------------------------------------|-------------|-------|
|----------|------------------------------------------|-------------|-------|
| title | title 区域 | ReactNode | - |
| title | title 区域 | ReactNode | - |
| loading | 骨架屏loading状态 | boolean | false |
| logo | logo区域 | ReactNode | - |
| logo | logo区域 | ReactNode | - |
| action | 操作区,位于 title 行的行尾 | ReactNode | - |
| action | 操作区,位于 title 行的行尾 | ReactNode | - |
| home | 默认的主页说明文字 | ReactNode | - |
| home | 默认的主页说明文字 | ReactNode | - |
...
...
src/components/SiderMenu/BaseMenu.js
View file @
dd41c130
...
@@ -33,13 +33,13 @@ export default class BaseMenu extends PureComponent {
...
@@ -33,13 +33,13 @@ export default class BaseMenu extends PureComponent {
* 获得菜单子节点
* 获得菜单子节点
* @memberof SiderMenu
* @memberof SiderMenu
*/
*/
getNavMenuItems
=
(
menusData
,
parent
)
=>
{
getNavMenuItems
=
menusData
=>
{
if
(
!
menusData
)
{
if
(
!
menusData
)
{
return
[];
return
[];
}
}
return
menusData
return
menusData
.
filter
(
item
=>
item
.
name
&&
!
item
.
hideInMenu
)
.
filter
(
item
=>
item
.
name
&&
!
item
.
hideInMenu
)
.
map
(
item
=>
this
.
getSubMenuOrItem
(
item
,
parent
))
.
map
(
item
=>
this
.
getSubMenuOrItem
(
item
))
.
filter
(
item
=>
item
);
.
filter
(
item
=>
item
);
};
};
...
...
src/layouts/Header.js
View file @
dd41c130
...
@@ -155,7 +155,6 @@ export default connect(({ user, global, setting, loading }) => ({
...
@@ -155,7 +155,6 @@ export default connect(({ user, global, setting, loading }) => ({
collapsed
:
global
.
collapsed
,
collapsed
:
global
.
collapsed
,
fetchingMoreNotices
:
loading
.
effects
[
'
global/fetchMoreNotices
'
],
fetchingMoreNotices
:
loading
.
effects
[
'
global/fetchMoreNotices
'
],
fetchingNotices
:
loading
.
effects
[
'
global/fetchNotices
'
],
fetchingNotices
:
loading
.
effects
[
'
global/fetchNotices
'
],
loadedAllNotices
:
global
.
loadedAllNotices
,
notices
:
global
.
notices
,
notices
:
global
.
notices
,
setting
,
setting
,
}))(
HeaderView
);
}))(
HeaderView
);
src/locales/en-US/globalHeader.js
View file @
dd41c130
...
@@ -13,6 +13,5 @@ export default {
...
@@ -13,6 +13,5 @@ export default {
'
component.noticeIcon.clear
'
:
'
Clear
'
,
'
component.noticeIcon.clear
'
:
'
Clear
'
,
'
component.noticeIcon.cleared
'
:
'
Cleared
'
,
'
component.noticeIcon.cleared
'
:
'
Cleared
'
,
'
component.noticeIcon.empty
'
:
'
No notifications
'
,
'
component.noticeIcon.empty
'
:
'
No notifications
'
,
'
component.noticeIcon.loaded
'
:
'
Loaded
'
,
'
component.noticeIcon.view-more
'
:
'
View more
'
,
'
component.noticeIcon.loading-more
'
:
'
Loading more
'
,
};
};
src/locales/pt-BR/globalHeader.js
View file @
dd41c130
...
@@ -14,5 +14,5 @@ export default {
...
@@ -14,5 +14,5 @@ export default {
'
component.noticeIcon.cleared
'
:
'
Limpo
'
,
'
component.noticeIcon.cleared
'
:
'
Limpo
'
,
'
component.noticeIcon.empty
'
:
'
Sem notificações
'
,
'
component.noticeIcon.empty
'
:
'
Sem notificações
'
,
'
component.noticeIcon.loaded
'
:
'
Carregado
'
,
'
component.noticeIcon.loaded
'
:
'
Carregado
'
,
'
component.noticeIcon.
loading-more
'
:
'
Carregar
mais
'
,
'
component.noticeIcon.
view-more
'
:
'
Veja
mais
'
,
};
};
src/locales/zh-CN/globalHeader.js
View file @
dd41c130
...
@@ -13,6 +13,5 @@ export default {
...
@@ -13,6 +13,5 @@ export default {
'
component.noticeIcon.clear
'
:
'
清空
'
,
'
component.noticeIcon.clear
'
:
'
清空
'
,
'
component.noticeIcon.cleared
'
:
'
清空了
'
,
'
component.noticeIcon.cleared
'
:
'
清空了
'
,
'
component.noticeIcon.empty
'
:
'
暂无数据
'
,
'
component.noticeIcon.empty
'
:
'
暂无数据
'
,
'
component.noticeIcon.loaded
'
:
'
加载完毕
'
,
'
component.noticeIcon.view-more
'
:
'
查看更多
'
,
'
component.noticeIcon.loading-more
'
:
'
加载更多
'
,
};
};
src/locales/zh-TW/globalHeader.js
View file @
dd41c130
...
@@ -13,6 +13,5 @@ export default {
...
@@ -13,6 +13,5 @@ export default {
'
component.noticeIcon.clear
'
:
'
清空
'
,
'
component.noticeIcon.clear
'
:
'
清空
'
,
'
component.noticeIcon.cleared
'
:
'
清空了
'
,
'
component.noticeIcon.cleared
'
:
'
清空了
'
,
'
component.noticeIcon.empty
'
:
'
暫無資料
'
,
'
component.noticeIcon.empty
'
:
'
暫無資料
'
,
'
component.noticeIcon.loaded
'
:
'
加載完畢
'
,
'
component.noticeIcon.view-more
'
:
'
查看更多
'
,
'
component.noticeIcon.loading-more
'
:
'
加載更多
'
,
};
};
src/models/global.js
View file @
dd41c130
...
@@ -6,42 +6,14 @@ export default {
...
@@ -6,42 +6,14 @@ export default {
state
:
{
state
:
{
collapsed
:
false
,
collapsed
:
false
,
notices
:
[],
notices
:
[],
loadedAllNotices
:
false
,
},
},
effects
:
{
effects
:
{
*
fetchNotices
(
_
,
{
call
,
put
,
select
})
{
*
fetchNotices
(
_
,
{
call
,
put
,
select
})
{
const
data
=
yield
call
(
queryNotices
);
const
data
=
yield
call
(
queryNotices
);
const
loadedAllNotices
=
data
&&
data
.
length
&&
data
[
data
.
length
-
1
]
===
null
;
yield
put
({
type
:
'
setLoadedStatus
'
,
payload
:
loadedAllNotices
,
});
yield
put
({
yield
put
({
type
:
'
saveNotices
'
,
type
:
'
saveNotices
'
,
payload
:
data
.
filter
(
item
=>
item
),
payload
:
data
,
});
const
unreadCount
=
yield
select
(
state
=>
state
.
global
.
notices
.
filter
(
item
=>
!
item
.
read
).
length
);
yield
put
({
type
:
'
user/changeNotifyCount
'
,
payload
:
{
totalCount
:
data
.
length
,
unreadCount
,
},
});
},
*
fetchMoreNotices
({
payload
},
{
call
,
put
,
select
})
{
const
data
=
yield
call
(
queryNotices
,
payload
);
const
loadedAllNotices
=
data
&&
data
.
length
&&
data
[
data
.
length
-
1
]
===
null
;
yield
put
({
type
:
'
setLoadedStatus
'
,
payload
:
loadedAllNotices
,
});
yield
put
({
type
:
'
pushNotices
'
,
payload
:
data
.
filter
(
item
=>
item
),
});
});
const
unreadCount
=
yield
select
(
const
unreadCount
=
yield
select
(
state
=>
state
.
global
.
notices
.
filter
(
item
=>
!
item
.
read
).
length
state
=>
state
.
global
.
notices
.
filter
(
item
=>
!
item
.
read
).
length
...
@@ -114,18 +86,6 @@ export default {
...
@@ -114,18 +86,6 @@ export default {
notices
:
state
.
notices
.
filter
(
item
=>
item
.
type
!==
payload
),
notices
:
state
.
notices
.
filter
(
item
=>
item
.
type
!==
payload
),
};
};
},
},
pushNotices
(
state
,
{
payload
})
{
return
{
...
state
,
notices
:
[...
state
.
notices
,
...
payload
],
};
},
setLoadedStatus
(
state
,
{
payload
})
{
return
{
...
state
,
loadedAllNotices
:
payload
,
};
},
},
},
subscriptions
:
{
subscriptions
:
{
...
...
src/pages/Authorized.js
View file @
dd41c130
...
@@ -6,29 +6,21 @@ import Authorized from '@/utils/Authorized';
...
@@ -6,29 +6,21 @@ import Authorized from '@/utils/Authorized';
function
AuthComponent
({
children
,
location
,
routerData
,
status
})
{
function
AuthComponent
({
children
,
location
,
routerData
,
status
})
{
const
isLogin
=
status
===
'
ok
'
;
const
isLogin
=
status
===
'
ok
'
;
const
getRouteAuthority
=
(
path
,
routeData
)
=>
{
const
getRouteAuthority
=
(
pathname
,
routeData
)
=>
{
const
routes
=
routeData
.
slice
();
// clone
const
getAuthority
=
(
routeDatas
,
path
)
=>
{
let
authorities
;
let
authorities
;
routeDatas
.
forEach
(
route
=>
{
routeData
.
forEach
(
route
=>
{
// check partial route
// match prefix
if
(
pathToRegexp
(
`
${
route
.
path
}
(.*)`
).
test
(
path
))
{
if
(
pathToRegexp
(
`
${
route
.
path
}
(.*)`
).
test
(
path
))
{
if
(
route
.
authority
)
{
authorities
=
route
.
authority
||
authorities
;
authorities
=
route
.
authority
;
}
// get children authority recursively
// is exact route?
if
(
route
.
routes
)
{
if
(
!
pathToRegexp
(
route
.
path
).
test
(
path
)
&&
route
.
routes
)
{
authorities
=
getRouteAuthority
(
path
,
route
.
routes
)
||
authorities
;
authorities
=
getAuthority
(
route
.
routes
,
path
);
}
}
}
}
});
});
return
authorities
;
return
authorities
;
};
};
return
getAuthority
(
routes
,
pathname
);
};
return
(
return
(
<
Authorized
<
Authorized
authority
=
{
getRouteAuthority
(
location
.
pathname
,
routerData
)}
authority
=
{
getRouteAuthority
(
location
.
pathname
,
routerData
)}
...
...
src/pages/Dashboard/Analysis.js
View file @
dd41c130
...
@@ -39,7 +39,6 @@ class Analysis extends Component {
...
@@ -39,7 +39,6 @@ class Analysis extends Component {
type
:
'
chart/clear
'
,
type
:
'
chart/clear
'
,
});
});
cancelAnimationFrame
(
this
.
reqRef
);
cancelAnimationFrame
(
this
.
reqRef
);
clearTimeout
(
this
.
timeoutId
);
}
}
handleChangeSalesType
=
e
=>
{
handleChangeSalesType
=
e
=>
{
...
...
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