优化
This commit is contained in:
+17
-10
@@ -24,7 +24,6 @@ const notifications = useNotificationsStore()
|
||||
const workspace = useWorkspaceTabsStore()
|
||||
const unsaved = useUnsavedWorkStore()
|
||||
const pageTitle = computed(() => route.meta.title || '业务总览')
|
||||
const pageDescription = computed(() => route.meta.description || '')
|
||||
const breadcrumbs = computed(() => getRouteBreadcrumbs(route.path, String(pageTitle.value)))
|
||||
const mobileMenuOpen = ref(false)
|
||||
const desktopViewport = ref(true)
|
||||
@@ -185,7 +184,7 @@ async function handleLogout() {
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="client-shell" :class="{ 'mobile-menu-open': mobileMenuOpen }">
|
||||
<div class="client-shell" :class="{ 'mobile-menu-open': mobileMenuOpen, 'is-dashboard-route': route.path === '/' }">
|
||||
<header class="top-header" :inert="mobileMenuOpen" :aria-hidden="mobileMenuOpen ? 'true' : undefined">
|
||||
<button
|
||||
ref="menuButtonRef"
|
||||
@@ -198,14 +197,22 @@ async function handleLogout() {
|
||||
>
|
||||
<Menu :size="20" />
|
||||
</button>
|
||||
<div class="client-header-heading">
|
||||
<h1>{{ pageTitle }}</h1>
|
||||
<p v-if="pageDescription">{{ pageDescription }}</p>
|
||||
</div>
|
||||
<p class="client-header-greeting">Hi, 客户</p>
|
||||
<div class="client-user">
|
||||
<RouterLink v-if="auth.hasPermission('merchant:notification:view')" class="client-header-notifications" to="/notifications" 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></RouterLink>
|
||||
<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>
|
||||
<RouterLink
|
||||
v-if="auth.hasPermission('account:profile:view')"
|
||||
class="client-header-profile"
|
||||
to="/account/profile"
|
||||
aria-label="打开我的信息"
|
||||
>
|
||||
<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>
|
||||
</RouterLink>
|
||||
<template v-else>
|
||||
<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>
|
||||
</template>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
@@ -227,7 +234,6 @@ async function handleLogout() {
|
||||
<div class="client-sidebar-brand">
|
||||
<RouterLink class="client-sidebar-brand-link" to="/" aria-label="返回业务总览" @click="closeMobileMenu">
|
||||
<img class="client-sidebar-brand-logo" :src="baiyueLogoDark" alt="柏悦物流" />
|
||||
<span class="client-sidebar-brand-copy"><small>客户工作台</small></span>
|
||||
</RouterLink>
|
||||
<button
|
||||
ref="sidebarCloseButtonRef"
|
||||
@@ -251,6 +257,7 @@ async function handleLogout() {
|
||||
</aside>
|
||||
|
||||
<WorkspaceTabs
|
||||
v-if="route.path !== '/'"
|
||||
:inert="mobileMenuOpen"
|
||||
:aria-hidden="mobileMenuOpen ? 'true' : undefined"
|
||||
/>
|
||||
@@ -260,7 +267,7 @@ async function handleLogout() {
|
||||
:inert="mobileMenuOpen"
|
||||
:aria-hidden="mobileMenuOpen ? 'true' : undefined"
|
||||
>
|
||||
<nav class="client-breadcrumb" aria-label="页面路径">
|
||||
<nav v-if="route.path !== '/'" class="client-breadcrumb" aria-label="页面路径">
|
||||
<template v-for="(item, index) in breadcrumbs" :key="`${item.title}-${index}`">
|
||||
<span v-if="index" aria-hidden="true">/</span>
|
||||
<RouterLink v-if="item.path" :to="item.path">{{ item.title }}</RouterLink>
|
||||
|
||||
Reference in New Issue
Block a user