mirror of
https://github.com/kuaifan/dootask.git
synced 2026-02-07 14:25:40 +00:00
perf: 角标提示待办跟@一起
This commit is contained in:
parent
1ef33700ee
commit
367d7a0ae8
@ -88,28 +88,26 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
msgUnreadMention() {
|
msgUnreadMention() {
|
||||||
if (this.msgTodoTotal) {
|
|
||||||
return this.msgTodoTotal
|
|
||||||
}
|
|
||||||
let num = 0;
|
let num = 0;
|
||||||
let mention = 0;
|
let mention = 0;
|
||||||
this.cacheDialogs.some(dialog => {
|
this.cacheDialogs.some(dialog => {
|
||||||
num += $A.getDialogUnread(dialog);
|
num += $A.getDialogUnread(dialog);
|
||||||
mention += $A.getDialogMention(dialog);
|
mention += $A.getDialogMention(dialog);
|
||||||
})
|
})
|
||||||
if (num <= 0) {
|
|
||||||
return '';
|
|
||||||
}
|
|
||||||
if (num > 99) {
|
if (num > 99) {
|
||||||
num = "99+"
|
num = "99+"
|
||||||
}
|
}
|
||||||
if (mention > 0) {
|
|
||||||
if (mention > 99) {
|
if (mention > 99) {
|
||||||
return "@99+"
|
mention = "99+"
|
||||||
}
|
}
|
||||||
return `${num}·@${mention}`
|
const todoNum = this.msgTodoTotal
|
||||||
|
if (todoNum) {
|
||||||
|
return mention ? `${todoNum}·@${mention}` : todoNum;
|
||||||
}
|
}
|
||||||
return String(num);
|
if (!num) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
return mention ? `${num}·@${mention}` : String(num);
|
||||||
},
|
},
|
||||||
|
|
||||||
msgTodoTotal() {
|
msgTodoTotal() {
|
||||||
|
|||||||
@ -510,28 +510,26 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
msgUnreadMention() {
|
msgUnreadMention() {
|
||||||
if (this.msgTodoTotal) {
|
|
||||||
return this.msgTodoTotal
|
|
||||||
}
|
|
||||||
let num = 0;
|
let num = 0;
|
||||||
let mention = 0;
|
let mention = 0;
|
||||||
this.cacheDialogs.some(dialog => {
|
this.cacheDialogs.some(dialog => {
|
||||||
num += $A.getDialogUnread(dialog);
|
num += $A.getDialogUnread(dialog);
|
||||||
mention += $A.getDialogMention(dialog);
|
mention += $A.getDialogMention(dialog);
|
||||||
})
|
})
|
||||||
if (num <= 0) {
|
|
||||||
return '';
|
|
||||||
}
|
|
||||||
if (num > 99) {
|
if (num > 99) {
|
||||||
num = "99+"
|
num = "99+"
|
||||||
}
|
}
|
||||||
if (mention > 0) {
|
|
||||||
if (mention > 99) {
|
if (mention > 99) {
|
||||||
return "@99+"
|
mention = "99+"
|
||||||
}
|
}
|
||||||
return `${num}·@${mention}`
|
const todoNum = this.msgTodoTotal
|
||||||
|
if (todoNum) {
|
||||||
|
return mention ? `${todoNum}·@${mention}` : todoNum;
|
||||||
}
|
}
|
||||||
return String(num);
|
if (!num) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
return mention ? `${num}·@${mention}` : String(num);
|
||||||
},
|
},
|
||||||
|
|
||||||
msgAllUnread() {
|
msgAllUnread() {
|
||||||
@ -557,10 +555,8 @@ export default {
|
|||||||
|
|
||||||
unreadTotal() {
|
unreadTotal() {
|
||||||
if (this.userId > 0) {
|
if (this.userId > 0) {
|
||||||
if (this.msgTodoTotal) {
|
const todoNum = this.cacheDialogs.reduce((total, current) => total + (current.todo_num || 0), 0)
|
||||||
return this.msgTodoTotal
|
return this.msgAllUnread + this.dashboardTask.overdue_count + this.reportUnreadNumber + todoNum
|
||||||
}
|
|
||||||
return this.msgAllUnread + this.dashboardTask.overdue_count + this.reportUnreadNumber
|
|
||||||
} else {
|
} else {
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user