Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
jinfa-platform
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
黄庭坚
jinfa-platform
Commits
cce83c4f
Commit
cce83c4f
authored
Nov 13, 2020
by
Bill
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改消息中心数据问题
parent
75881666
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
16 deletions
+34
-16
RightContent.tsx
src/layouts/components/RightContent.tsx
+5
-7
index.less
src/pages/systemSetting/message/index.less
+4
-1
index.tsx
src/pages/systemSetting/message/index.tsx
+25
-8
No files found.
src/layouts/components/RightContent.tsx
View file @
cce83c4f
import
{
Tooltip
}
from
'antd'
;
import
{
Tooltip
,
Badge
}
from
'antd'
;
import
{
BellOutlined
,
CustomerServiceOutlined
}
from
'@ant-design/icons'
;
import
{
BellOutlined
,
CustomerServiceOutlined
}
from
'@ant-design/icons'
;
import
React
,
{
useCallback
,
useRef
,
useLayoutEffect
}
from
'react'
;
import
React
,
{
useCallback
,
useRef
,
useLayoutEffect
}
from
'react'
;
// import { connect, ConnectProps } from 'umi';
// import { ConnectState } from '@/models/connect';
import
Avatar
from
'./AvatarDropdown'
;
import
Avatar
from
'./AvatarDropdown'
;
import
SelectLang
from
'./SelectLang'
;
import
SelectLang
from
'./SelectLang'
;
import
Location
from
'./Location'
;
import
Location
from
'./Location'
;
...
@@ -18,7 +16,7 @@ import { getAuth } from '@/utils/auth'
...
@@ -18,7 +16,7 @@ import { getAuth } from '@/utils/auth'
// }
// }
const
GlobalHeaderRight
:
React
.
S
FC
<
{}
>
=
(
props
)
=>
{
const
GlobalHeaderRight
:
React
.
FC
<
{}
>
=
(
props
)
=>
{
// const { theme, layout } = props;
// const { theme, layout } = props;
let
className
=
styles
.
right
;
let
className
=
styles
.
right
;
...
@@ -63,12 +61,12 @@ const GlobalHeaderRight: React.SFC<{}> = (props) => {
...
@@ -63,12 +61,12 @@ const GlobalHeaderRight: React.SFC<{}> = (props) => {
<
SelectLang
/>
<
SelectLang
/>
<
Tooltip
title=
"消息"
>
<
Tooltip
title=
"消息"
>
<
a
<
a
target=
"_blank"
href=
"/memberCenter/systemSetting/message"
href=
""
rel=
"noopener noreferrer"
className=
{
styles
.
action
}
className=
{
styles
.
action
}
>
>
<
Badge
count=
{
5
}
size=
{
"small"
}
>
<
BellOutlined
/>
<
BellOutlined
/>
</
Badge
>
</
a
>
</
a
>
</
Tooltip
>
</
Tooltip
>
<
Tooltip
title=
"服务"
>
<
Tooltip
title=
"服务"
>
...
...
src/pages/systemSetting/message/index.less
View file @
cce83c4f
...
@@ -8,11 +8,13 @@
...
@@ -8,11 +8,13 @@
font-size: 14px;
font-size: 14px;
font-weight: 400;
font-weight: 400;
color: #606266;
color: #606266;
cursor: pointer;
}
}
.messageTitle{
.messageTitle{
margin: 0 30px;
margin: 0
px 0px 0px
30px;
font-size: 14px;
font-size: 14px;
font-weight: 500;
font-weight: 500;
color: #303133;
color: #303133;
display: inline-block;
}
}
}
}
\ No newline at end of file
src/pages/systemSetting/message/index.tsx
View file @
cce83c4f
...
@@ -8,7 +8,8 @@ import StatusTag from '@/components/StatusTag';
...
@@ -8,7 +8,8 @@ import StatusTag from '@/components/StatusTag';
import
{
PublicApi
}
from
'@/services/api'
;
import
{
PublicApi
}
from
'@/services/api'
;
import
moment
from
'moment'
;
import
moment
from
'moment'
;
import
msg_system
from
'@/assets/imgs/msg_system.png'
import
msg_system
from
'@/assets/imgs/msg_system.png'
import
msg_platform
from
'@/assets/imgs/msg_platform.png'
import
msg_platform
from
'@/assets/imgs/msg_platform.png'
;
import
cx
from
'classnames'
;
const
Message
:
React
.
FC
<
{}
>
=
()
=>
{
const
Message
:
React
.
FC
<
{}
>
=
()
=>
{
const
[
dataSource
,
setDataSource
]
=
useState
<
any
>
([])
const
[
dataSource
,
setDataSource
]
=
useState
<
any
>
([])
...
@@ -40,19 +41,35 @@ const Message: React.FC<{}> = () => {
...
@@ -40,19 +41,35 @@ const Message: React.FC<{}> = () => {
}
}
const
handlePaginationChange
=
(
page
,
pageSize
)
=>
{
const
handlePaginationChange
=
(
page
,
pageSize
)
=>
{
console
.
log
(
page
,
pageSize
);
getList
({
page
,
pageSize
})
getList
({
page
,
pageSize
})
.
then
((
data
)
=>
{
.
then
((
data
)
=>
{
console
.
log
(
data
);
setDataSource
(
data
);
setDataSource
(
data
);
})
})
}
}
const
renderMessage
=
(
data
)
=>
{
const
handleRead
=
(
id
,
url
:
string
)
=>
{
console
.
log
(
url
);
// /report/message/member/read
PublicApi
.
getReportMessageMemberRead
({
id
:
id
})
.
then
((
data
)
=>
{
if
(
url
)
{
history
.
push
(
url
);
}
})
}
const
renderMessage
=
(
data
)
=>
{
const
isRead
=
cx
({
[
styles
.
messageTitle
]:
!
data
.
status
,
[
styles
.
messageText
]:
data
.
status
})
return
(
return
(
<>
<>
<
StatusTag
type=
{
data
.
status
}
title=
{
data
.
type
}
/>
<
StatusTag
type=
{
data
.
type
==
1
?
'primary'
:
'success'
}
title=
{
data
.
type
==
1
?
'系统消息'
:
'平台消息'
}
/>
<
span
className=
{
styles
.
messageTitle
}
>
{
data
.
title
}
</
span
>
<
span
className=
{
isRead
}
style=
{
{
minWidth
:
'100px'
}
}
>
{
data
.
title
}
</
span
>
<
span
className=
{
styles
.
messageText
}
>
{
data
.
message
}
</
span
>
<
span
className=
{
isRead
}
onClick=
{
()
=>
handleRead
(
data
.
id
,
data
.
url
)
}
>
{
data
.
content
}
</
span
>
</>
</>
)
)
}
}
...
@@ -78,13 +95,13 @@ const Message: React.FC<{}> = () => {
...
@@ -78,13 +95,13 @@ const Message: React.FC<{}> = () => {
total
:
dataSource
.
totalCount
,
total
:
dataSource
.
totalCount
,
showTotal
:
showTotal
showTotal
:
showTotal
}
}
}
}
renderItem=
{
item
=>
(
renderItem=
{
(
item
:
any
)
=>
(
<
List
.
Item
>
<
List
.
Item
>
<
List
.
Item
.
Meta
<
List
.
Item
.
Meta
avatar=
{
<
Avatar
src=
{
msg_syste
m
}
/>
}
avatar=
{
<
Avatar
src=
{
item
.
type
==
1
?
msg_system
:
msg_platfor
m
}
/>
}
title=
{
renderMessage
(
item
)
}
title=
{
renderMessage
(
item
)
}
/>
/>
<
div
>
{
moment
(
item
.
create
Time
).
format
(
'YYYY-MM-DD HH:mm:ss'
)
}
</
div
>
<
div
>
{
moment
(
item
.
send
Time
).
format
(
'YYYY-MM-DD HH:mm:ss'
)
}
</
div
>
</
List
.
Item
>
</
List
.
Item
>
)
}
)
}
/>
/>
...
...
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