Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
CivWeb
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
ReactWeb5
CivWeb
Commits
8b0749ce
Commit
8b0749ce
authored
Jan 12, 2024
by
杨思琦
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 消息通知刷新
parent
1dd77bcf
Pipeline
#84099
passed with stages
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
7 deletions
+22
-7
NoticeIconView.js
src/components/GlobalHeader/NoticeIconView.js
+17
-6
notice.js
src/layouts/AppLayout/notifier/notice.js
+5
-1
No files found.
src/components/GlobalHeader/NoticeIconView.js
View file @
8b0749ce
...
...
@@ -167,12 +167,23 @@ class NoticeIconView extends Component {
}
onPopupVisibleChange
=
value
=>
{
this
.
setState
({
popupVisible
:
value
,
platformVisible
:
this
.
platformMessages
.
length
>
0
?
true
:
this
.
state
.
platformVisible
,
sysTopVisible
:
false
,
videoVisible
:
false
,
});
if
(
value
&&
this
.
notifier
?.
loadHisMessages
)
{
this
.
notifier
.
loadHisMessages
(
this
.
notifier
.
currentPageIndex
||
1
,
this
.
notifier
.
currentPageSize
||
10
).
then
(()
=>
{
this
.
setState
({
popupVisible
:
value
,
platformVisible
:
this
.
platformMessages
.
length
>
0
?
true
:
this
.
state
.
platformVisible
,
sysTopVisible
:
false
,
videoVisible
:
false
,
});
});
}
else
{
this
.
setState
({
popupVisible
:
value
,
platformVisible
:
this
.
platformMessages
.
length
>
0
?
true
:
this
.
state
.
platformVisible
,
sysTopVisible
:
false
,
videoVisible
:
false
,
});
}
};
onNewMessage
=
messages
=>
{
...
...
src/layouts/AppLayout/notifier/notice.js
View file @
8b0749ce
...
...
@@ -563,7 +563,11 @@ class Notifier {
self.messageCache.totalCount = result.totalCount;
(result.messages || []).forEach(message => {
const index = self.messageCache.messages.findIndex(item => item.id === message.id);
index === -1 && self.messageCache.messages.push(message);
if (index === -1) {
self.messageCache.messages.push(message);
} else {
self.messageCache.messages[index].time = message.time;
}
});
if (self.messageCache.totalCount > self.messageCache.messages.length && data.list.length === 0) {
// 服务端返回总数还有,但是查不到数据了,前端修正服务端返回的总数
...
...
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