diff --git a/src/layouts/AdminLayout.vue b/src/layouts/AdminLayout.vue index e67b8df..71ae5e3 100644 --- a/src/layouts/AdminLayout.vue +++ b/src/layouts/AdminLayout.vue @@ -3,6 +3,7 @@ import { computed, defineComponent, h, onMounted, provide, ref } from 'vue' import { useRoute, useRouter } from 'vue-router' import { Message } from '@arco-design/web-vue' import * as ArcoIcons from '@arco-design/web-vue/es/icon' +import { IconExport, IconUser } from '@arco-design/web-vue/es/icon' import { ReloadAdminMenusKey } from '../constants/injectionKeys' import { http, TOKEN_KEY } from '../api/http' import { resetDynamicAdminRoutes } from '../router/dynamicAdminRoutes' @@ -37,6 +38,9 @@ const profileForm = ref({ const activePath = computed(() => route.path) +/** 右上角用户区展示名:优先姓名/用户名,否则「管理员」 */ +const headerUserLabel = computed(() => currentUser.value?.name || currentUser.value?.username || '管理员') + const DynamicIcon = defineComponent({ name: 'DynamicIcon', props: { @@ -193,9 +197,29 @@ onMounted(async () => {
{{ route.meta?.title ?? '后台管理' }}
- {{ currentUser?.name || currentUser?.username || '未登录' }} - 修改资料 - 退出登录 + +
+ + {{ headerUserLabel }} +
+ +
@@ -207,7 +231,7 @@ onMounted(async () => { { align-items: center; } +.header-user-trigger { + display: inline-flex; + align-items: center; + gap: 8px; + cursor: pointer; + padding: 4px 10px 4px 6px; + border-radius: 6px; + outline: none; + user-select: none; +} + +.header-user-trigger:hover { + background: var(--color-fill-2); +} + +.header-user-trigger:focus-visible { + box-shadow: 0 0 0 2px var(--color-primary-light-3); +} + +.header-user-trigger__avatar { + width: 32px; + height: 32px; + border-radius: 50%; + border: 1px solid var(--color-border-3); + display: inline-flex; + align-items: center; + justify-content: center; + color: var(--color-text-3); + flex-shrink: 0; + box-sizing: border-box; +} + +.header-user-trigger__avatar :deep(svg) { + font-size: 18px; +} + +.header-user-trigger__name { + font-size: 14px; + color: var(--color-text-2); + line-height: 22px; +} + +.header-user-menu-divider { + height: 1px; + margin: 4px 10px; + background: var(--color-border-2); +} + +.header-dropdown-option--profile :deep(.arco-dropdown-option-icon) { + color: rgb(var(--primary-6)); +} + +.header-dropdown-option--logout { + color: rgb(var(--red-6)); +} + +.header-dropdown-option--logout :deep(.arco-dropdown-option-icon) { + color: var(--color-text-3); +} + +.header-actions :deep(.arco-dropdown-list-wrapper) { + min-width: 168px; +} + .admin-content { padding: 14px; background: #f2f4f8; diff --git a/src/views/Dashboard.vue b/src/views/Dashboard.vue index e669886..10f3e8a 100644 --- a/src/views/Dashboard.vue +++ b/src/views/Dashboard.vue @@ -138,10 +138,30 @@ const totalPendingTodoCount = computed(() => pendingActivityCount.value) const pendingActivityItems = computed(() => stats.value.pending_audits?.activities.items ?? []) const hasPendingTodoRows = computed(() => pendingActivityItems.value.length > 0) +const dashOverviewSplit = computed(() => isSuperAdmin.value || isVenueAdmin.value) + +const todoEmptyPlaceholder = computed(() => + isVenueAdmin.value ? '暂无已退回活动' : '暂无待审核事项', +) + +const todoLineKindLabel = computed(() => (isVenueAdmin.value ? '活动退回' : '活动审核')) + function gotoActivityAuditList() { void router.push({ path: '/activities', query: { audit_status: 'pending' } }) } +function gotoVenueRejectedActivities() { + void router.push({ path: '/activities', query: { audit_status: 'rejected' } }) +} + +function gotoTodoFromDashboard() { + if (isVenueAdmin.value) { + gotoVenueRejectedActivities() + } else { + gotoActivityAuditList() + } +} + const ticketGrabVerifyRatePctStr = computed(() => { const t = stats.value.ticket_grab_schedule_counts if (!t || t.booked_people <= 0) { @@ -306,7 +326,7 @@ onMounted(async () => {
-
+
@@ -326,14 +346,14 @@ onMounted(async () => {
{{ stats.summary.user_count }}
用户数
-
预约用户
+
{{ isVenueAdmin ? '预约本场馆活动用户' : '预约用户' }}
-
+
- 暂无待审核事项 + {{ todoEmptyPlaceholder }}
- + + + +