no message

This commit is contained in:
kuaifan 2022-09-10 07:42:30 +08:00
parent a5b0a4f752
commit 6c81f828bd
6 changed files with 32 additions and 13 deletions

2
public/js/app.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
93963bf4915b01f9 d91eae413d63f47b

View File

@ -110,6 +110,14 @@ export default {
return mention ? `${num}·@${mention}` : String(num); return mention ? `${num}·@${mention}` : String(num);
}, },
msgAllUnread() {
let num = 0;
this.cacheDialogs.some(dialog => {
num += $A.getDialogUnread(dialog);
})
return num;
},
msgTodoTotal() { msgTodoTotal() {
let todoNum = this.cacheDialogs.reduce((total, current) => total + (current.todo_num || 0), 0) let todoNum = this.cacheDialogs.reduce((total, current) => total + (current.todo_num || 0), 0)
if (todoNum > 0) { if (todoNum > 0) {
@ -123,6 +131,15 @@ export default {
return null; return null;
}, },
unreadTotal() {
if (this.userId > 0) {
const todoNum = this.cacheDialogs.reduce((total, current) => total + (current.todo_num || 0), 0)
return this.msgAllUnread + this.dashboardTask.overdue_count + todoNum
} else {
return 0
}
},
activeName() { activeName() {
if (this.isMore || ['manage-calendar', 'manage-file', 'manage-setting'].includes(this.routeName)) { if (this.isMore || ['manage-calendar', 'manage-file', 'manage-setting'].includes(this.routeName)) {
return 'more'; return 'more';
@ -146,6 +163,17 @@ export default {
}, },
}, },
watch: {
windowActive(active) {
if (!active) {
$A.eeuiAppSendMessage({
action: 'setBdageNotify',
bdage: this.unreadTotal,
});
}
},
},
methods: { methods: {
toggleRoute(path) { toggleRoute(path) {
this.$emit("on-click", path) this.$emit("on-click", path)

View File

@ -689,15 +689,6 @@ export default {
} }
}, },
windowActive(active) {
if (!active) {
$A.eeuiAppSendMessage({
action: 'setBdageNotify',
bdage: this.unreadTotal,
});
}
},
'cacheProjects.length': { 'cacheProjects.length': {
handler() { handler() {
this.$nextTick(_ => { this.$nextTick(_ => {