perf: 优化通知

This commit is contained in:
kuaifan 2022-02-12 09:50:02 +08:00
parent f7921bf388
commit 2fc039dd70
2 changed files with 44 additions and 36 deletions

View File

@ -337,6 +337,7 @@ export default {
'taskId',
'wsOpenNum',
'columnTemplate',
'dialogOpenId',
'themeMode',
'themeList',
@ -449,7 +450,7 @@ export default {
natificationHidden(val) {
clearTimeout(this.notificationTimeout);
if (!val) {
if (!val && this.notificationClass) {
this.notificationTimeout = setTimeout(() => {
this.notificationClass.close();
}, 6000);
@ -674,7 +675,13 @@ export default {
},
addDialogMsg(data) {
if (this.natificationHidden && this.natificationReady) {
if (!this.natificationReady) {
return;
}
if (!this.natificationHidden && this.curPath == "/manage/messenger" && this.dialogOpenId == data.dialog_id) {
return;
}
//
const {id, dialog_id, type, msg} = data;
let body = '';
switch (type) {
@ -707,7 +714,6 @@ export default {
}
}).catch(() => {})
}
}
},
taskVisibleChange(visible) {

View File

@ -199,6 +199,10 @@ export default {
this.getContactsList(1);
}
},
dialogId(id) {
$A.setStorage("messenger::dialogId", id);
this.$store.state.dialogOpenId = id;
},
dialogOpenId(id) {
this.dialogId = id;
},
@ -247,11 +251,9 @@ export default {
closeDialog() {
this.dialogId = 0;
$A.setStorage("messenger::dialogId", 0)
},
openDialog(dialog, smooth) {
$A.setStorage("messenger::dialogId", dialog.id)
this.dialogId = dialog.id;
this.scrollIntoActive(smooth);
},