feat(admin): 增加站点后台标识与本站统计口径
This commit is contained in:
@@ -42,12 +42,14 @@ import { changeAdminPassword, logoutAdmin, updateSupportStatus } from '@/feature
|
||||
import { useAdminNotificationUnreadCount } from '@/features/admin/composables/useAdminNotificationUnreadCount'
|
||||
import { usePendingRefundCount } from '@/features/admin/composables/usePendingRefundCount'
|
||||
import { useAdminSessionStore } from '@/stores/adminSession'
|
||||
import { useDistributionSiteStore } from '@/stores/distributionSite'
|
||||
import { adminPath, ADMIN_DASHBOARD_PATH, ADMIN_LOGIN_PATH } from '@/shared/utils/adminPath'
|
||||
import { readError } from '@/shared/utils/error'
|
||||
|
||||
const router = useRouter()
|
||||
const route = useRoute()
|
||||
const adminSession = useAdminSessionStore()
|
||||
const siteStore = useDistributionSiteStore()
|
||||
const isCollapsed = ref(false)
|
||||
const updatingStatus = ref(false)
|
||||
const passwordSubmitting = ref(false)
|
||||
@@ -364,6 +366,20 @@ const defaultOpeneds = computed(() => {
|
||||
})
|
||||
|
||||
const adminName = computed(() => adminSession.nickname || adminSession.username || '管理员')
|
||||
const currentSiteName = computed(() => siteStore.siteName || '大锤商行')
|
||||
const currentSiteScope = computed(() => {
|
||||
if (siteStore.isTenant) return '经营站点'
|
||||
if (siteStore.isDistribution) return '分销站点'
|
||||
return '主站'
|
||||
})
|
||||
const currentSiteHint = computed(() =>
|
||||
siteStore.isTenant ? '用户、商品、订单与财务均按本站口径统计' : '历史分销站点管理视图'
|
||||
)
|
||||
const adminScopeNote = computed(() =>
|
||||
adminSession.isSuperAdmin
|
||||
? '平台超级管理员 · 当前仅查看本站数据'
|
||||
: '站点管理员 · 数据仅限当前站点'
|
||||
)
|
||||
const adminRoleText = computed(() => {
|
||||
if (adminSession.isSuperAdmin) return '超级管理员'
|
||||
const names = adminSession.roles.map(role => role.name).filter(Boolean)
|
||||
@@ -455,8 +471,11 @@ async function handleForcedPasswordChange() {
|
||||
<aside class="admin-sidebar">
|
||||
<div class="admin-sidebar-header">
|
||||
<RouterLink class="admin-brand" :to="ADMIN_DASHBOARD_PATH">
|
||||
<span class="brand-mark">H</span>
|
||||
<span class="brand-text" v-show="!isCollapsed">哈夫币后台</span>
|
||||
<span class="brand-mark">{{ siteStore.brandMark }}</span>
|
||||
<span v-show="!isCollapsed" class="brand-copy">
|
||||
<strong>{{ currentSiteName }}</strong>
|
||||
<small>{{ currentSiteScope }}后台</small>
|
||||
</span>
|
||||
</RouterLink>
|
||||
<el-icon class="collapse-btn" @click="isCollapsed = !isCollapsed">
|
||||
<Fold v-if="!isCollapsed" />
|
||||
@@ -562,6 +581,15 @@ async function handleForcedPasswordChange() {
|
||||
</aside>
|
||||
|
||||
<section class="admin-workspace">
|
||||
<header class="admin-context-bar">
|
||||
<div class="admin-context-site">
|
||||
<span class="context-label">当前后台</span>
|
||||
<strong>{{ currentSiteName }}</strong>
|
||||
<span class="context-scope">{{ currentSiteScope }}</span>
|
||||
<span class="context-hint">{{ currentSiteHint }}</span>
|
||||
</div>
|
||||
<span class="admin-scope-note">{{ adminScopeNote }}</span>
|
||||
</header>
|
||||
<main class="admin-main">
|
||||
<slot />
|
||||
</main>
|
||||
|
||||
Reference in New Issue
Block a user