优化
This commit is contained in:
@@ -2,11 +2,12 @@
|
||||
import { computed, nextTick, onBeforeUnmount, onMounted, ref, watch } from 'vue'
|
||||
import { useRoute, useRouter } from 'vue-router'
|
||||
import { ElMessageBox } from 'element-plus'
|
||||
import { LogOut, Menu, X } from '@lucide/vue'
|
||||
import { Bell, LogOut, Menu, X } from '@lucide/vue'
|
||||
import baiyueLogoDark from '@/assets/brand/baiyue-logo-dark.png'
|
||||
import ClientSidebarMenu from '@/components/ClientSidebarMenu.vue'
|
||||
import WorkspaceTabs from '@/components/WorkspaceTabs.vue'
|
||||
import { useAuthStore } from '@/modules/auth/public'
|
||||
import { useNotificationsStore } from '@/modules/notifications/public'
|
||||
import { getFirstAccessiblePath } from '@/navigation/clientNavigation'
|
||||
import { useUnsavedWorkStore } from '@/navigation/workspace-tabs/unsavedWork'
|
||||
import {
|
||||
@@ -19,6 +20,7 @@ import {
|
||||
const route = useRoute()
|
||||
const router = useRouter()
|
||||
const auth = useAuthStore()
|
||||
const notifications = useNotificationsStore()
|
||||
const workspace = useWorkspaceTabsStore()
|
||||
const unsaved = useUnsavedWorkStore()
|
||||
const pageTitle = computed(() => route.meta.title || '业务总览')
|
||||
@@ -139,6 +141,7 @@ watch(mobileMenuOpen, async (open, wasOpen) => {
|
||||
})
|
||||
|
||||
onMounted(() => {
|
||||
void notifications.refreshUnreadCount()
|
||||
document.addEventListener('keydown', handleKeydown)
|
||||
window.addEventListener('beforeunload', handleBeforeUnload)
|
||||
desktopMediaQuery = window.matchMedia('(min-width: 721px)')
|
||||
@@ -199,6 +202,7 @@ async function handleLogout() {
|
||||
<p v-if="pageDescription">{{ pageDescription }}</p>
|
||||
</div>
|
||||
<div class="client-user">
|
||||
<button class="client-header-notifications" type="button" disabled title="消息中心接口待接入" aria-label="我的消息,接口待接入"><Bell :size="19" /><span v-if="notifications.unreadCount !== null && notifications.unreadCount > 0" class="client-header-notifications-badge">{{ notifications.unreadCount > 99 ? '99+' : notifications.unreadCount }}</span></button>
|
||||
<span class="client-avatar">{{ auth.user?.name.slice(0, 1) }}</span>
|
||||
<span class="client-user-copy"><strong>{{ auth.user?.name }}</strong><small>{{ auth.user?.roles.join('、') }}</small></span>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user