Commit 8b0749ce authored by 杨思琦's avatar 杨思琦

fix: 消息通知刷新

parent 1dd77bcf
Pipeline #84099 passed with stages
......@@ -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 => {
......
......@@ -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) {
// 服务端返回总数还有,但是查不到数据了,前端修正服务端返回的总数
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment