fix: macOS客户端首次不加载角标的问题

This commit is contained in:
kuaifan 2022-01-25 23:06:08 +08:00
parent 417017add9
commit 7baa37ccd1
2 changed files with 21 additions and 18 deletions

View File

@ -214,6 +214,7 @@
@on-click="show768Menu=!show768Menu"> @on-click="show768Menu=!show768Menu">
<div class="manage-mini-menu"> <div class="manage-mini-menu">
<Icon :type="show768Menu ? 'md-close' : 'md-menu'" /> <Icon :type="show768Menu ? 'md-close' : 'md-menu'" />
<Badge :count="unreadTotal"/>
</div> </div>
</DragBallComponent> </DragBallComponent>
</div> </div>
@ -357,6 +358,10 @@ export default {
return this.dashboardTask.today.length + this.dashboardTask.overdue.length return this.dashboardTask.today.length + this.dashboardTask.overdue.length
}, },
unreadTotal() {
return this.msgAllUnread + this.dashboardTotal + this.reportUnreadNumber;
},
currentLanguage() { currentLanguage() {
return this.languageList[this.languageType] || 'Language' return this.languageList[this.languageType] || 'Language'
}, },
@ -421,24 +426,6 @@ export default {
} }
}, },
msgAllUnread() {
if (this.$Electron) {
this.$Electron.ipcRenderer.send('setDockBadge', this.msgAllUnread + this.dashboardTotal + this.reportUnreadNumber);
}
},
dashboardTotal() {
if (this.$Electron) {
this.$Electron.ipcRenderer.send('setDockBadge', this.msgAllUnread + this.dashboardTotal + this.reportUnreadNumber);
}
},
reportUnreadNumber() {
if (this.$Electron) {
this.$Electron.ipcRenderer.send('setDockBadge', this.msgAllUnread + this.dashboardTotal + this.reportUnreadNumber);
}
},
projectKeyValue(val) { projectKeyValue(val) {
if (val == '') { if (val == '') {
return; return;
@ -468,6 +455,15 @@ export default {
}, 5000) }, 5000)
}, },
unreadTotal: {
handler(num) {
if (this.$Electron) {
this.$Electron.ipcRenderer.send('setDockBadge', num);
}
},
immediate: true
},
wsMsg: { wsMsg: {
handler(info) { handler(info) {
const {type, action} = info; const {type, action} = info;

View File

@ -298,6 +298,13 @@
} }
.manage-mini-menu { .manage-mini-menu {
display: none; display: none;
position: relative;
.ivu-badge {
position: absolute;
top: -6px;
left: 30px;
transform: scale(0.9);
}
} }
} }