新增退款待审核角标提醒

This commit is contained in:
yml2213
2026-08-28 23:10:07 +08:00
parent 41a5b49450
commit a9a9127076
8 changed files with 176 additions and 1 deletions
+46 -1
View File
@@ -36,6 +36,7 @@ import { useRoute, useRouter } from 'vue-router'
import { changeAdminPassword, logoutAdmin, updateSupportStatus } from '@/features/admin'
import { useAdminNotificationUnreadCount } from '@/features/admin/composables/useAdminNotificationUnreadCount'
import { usePendingRefundCount } from '@/features/admin/composables/usePendingRefundCount'
import { useAdminSessionStore } from '@/stores/adminSession'
import { adminPath, ADMIN_DASHBOARD_PATH, ADMIN_LOGIN_PATH } from '@/shared/utils/adminPath'
import { readError } from '@/shared/utils/error'
@@ -303,6 +304,8 @@ const hasNotificationPermission = computed(
)
const { unreadCount: adminNotificationUnreadCount, unreadLabel: adminNotificationUnreadLabel } =
useAdminNotificationUnreadCount(route)
const { pendingRefundCount, pendingRefundLabel } = usePendingRefundCount(route)
const refundReviewPath = adminPath('orders/refund-review')
const statusLabels: Record<string, string> = {
online: '在线',
@@ -410,7 +413,15 @@ async function handleForcedPasswordChange() {
</template>
<el-menu-item v-for="item in group.children" :key="item.to" :index="item.to">
<el-icon><component :is="item.icon" /></el-icon>
<template #title>{{ item.label }}</template>
<template #title>
<span class="menu-item-label">{{ item.label }}</span>
<em
v-if="item.to === refundReviewPath && pendingRefundCount > 0"
class="menu-item-badge"
>
{{ pendingRefundLabel }}
</em>
</template>
</el-menu-item>
</el-sub-menu>
</el-menu>
@@ -807,6 +818,40 @@ async function handleForcedPasswordChange() {
background-color: #1f2d3d;
}
.menu-item-label {
min-width: 0;
}
.menu-item-badge {
margin-left: auto;
min-width: 18px;
height: 18px;
padding: 0 5px;
border-radius: 9px;
background: #f43f5e;
color: #ffffff;
font-size: 11px;
font-style: normal;
font-weight: 700;
line-height: 18px;
text-align: center;
}
:deep(.el-menu--collapse .menu-item-badge) {
position: absolute;
top: 6px;
right: 5px;
min-width: 8px;
width: 8px;
height: 8px;
padding: 0;
border: 2px solid #304156;
border-radius: 50%;
color: transparent;
font-size: 0;
line-height: 0;
}
:global(.admin-menu-popper) {
--el-menu-bg-color: #304156;
--el-menu-text-color: #bfcbd9;