feat(platform-ops): 增加平台运营统计总览页面
This commit is contained in:
@@ -43,7 +43,12 @@ import { useAdminNotificationUnreadCount } from '@/features/admin/composables/us
|
||||
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 {
|
||||
adminPath,
|
||||
ADMIN_DASHBOARD_PATH,
|
||||
ADMIN_LOGIN_PATH,
|
||||
PLATFORM_OPS_PATH,
|
||||
} from '@/shared/utils/adminPath'
|
||||
import { readError } from '@/shared/utils/error'
|
||||
|
||||
const router = useRouter()
|
||||
@@ -350,6 +355,23 @@ function canAccessNavItem(item: NavItem) {
|
||||
}
|
||||
|
||||
const navGroups = computed(() => {
|
||||
if (siteStore.isPlatformOps) {
|
||||
return [
|
||||
{
|
||||
label: '平台运营',
|
||||
index: 'platform-ops',
|
||||
icon: DataLine,
|
||||
children: [
|
||||
{
|
||||
label: '平台总览',
|
||||
to: PLATFORM_OPS_PATH,
|
||||
icon: DataLine,
|
||||
permission: 'dashboard:view',
|
||||
},
|
||||
],
|
||||
},
|
||||
]
|
||||
}
|
||||
return allNavGroups
|
||||
.filter(group => (siteStore.isTenant ? !group.legacyOnly : !group.tenantOnly))
|
||||
.map(group => ({
|
||||
@@ -370,7 +392,7 @@ const activeMenu = computed(() => {
|
||||
})
|
||||
|
||||
const defaultOpeneds = computed(() => {
|
||||
const activeGroup = allNavGroups.find(group =>
|
||||
const activeGroup = navGroups.value.find(group =>
|
||||
group.children.some(item => item.to === activeMenu.value)
|
||||
)
|
||||
|
||||
@@ -380,18 +402,22 @@ const defaultOpeneds = computed(() => {
|
||||
const adminName = computed(() => adminSession.nickname || adminSession.username || '管理员')
|
||||
const currentSiteName = computed(() => siteStore.siteName || '大锤商行')
|
||||
const currentSiteScope = computed(() => {
|
||||
if (siteStore.isPlatformOps) return '平台运营'
|
||||
if (siteStore.isTenant) return '经营站点'
|
||||
if (siteStore.isDistribution) return '分销站点'
|
||||
return '主站'
|
||||
})
|
||||
const currentSiteHint = computed(() =>
|
||||
siteStore.isTenant ? '用户、商品、订单与财务均按本站口径统计' : '历史分销站点管理视图'
|
||||
)
|
||||
const adminScopeNote = computed(() =>
|
||||
adminSession.isSuperAdmin
|
||||
const currentSiteHint = computed(() => {
|
||||
if (siteStore.isPlatformOps) return '只读展示全平台及各经营站点统计'
|
||||
if (siteStore.isTenant) return '用户、商品、订单与财务均按本站口径统计'
|
||||
return '历史分销站点管理视图'
|
||||
})
|
||||
const adminScopeNote = computed(() => {
|
||||
if (siteStore.isPlatformOps) return '平台超级管理员 · 全平台只读总览'
|
||||
return adminSession.isSuperAdmin
|
||||
? '平台超级管理员 · 当前仅查看本站数据'
|
||||
: '站点管理员 · 数据仅限当前站点'
|
||||
)
|
||||
})
|
||||
const adminRoleText = computed(() => {
|
||||
if (adminSession.isSuperAdmin) return '超级管理员'
|
||||
const names = adminSession.roles.map(role => role.name).filter(Boolean)
|
||||
@@ -531,7 +557,7 @@ async function handleForcedPasswordChange() {
|
||||
|
||||
<div class="admin-sidebar-footer">
|
||||
<RouterLink
|
||||
v-if="hasNotificationPermission"
|
||||
v-if="hasNotificationPermission && !siteStore.isPlatformOps"
|
||||
class="sidebar-notification"
|
||||
:to="adminPath('notifications')"
|
||||
>
|
||||
@@ -544,7 +570,7 @@ async function handleForcedPasswordChange() {
|
||||
<span v-show="!isCollapsed" class="sidebar-notification-text">通知中心</span>
|
||||
</RouterLink>
|
||||
<el-dropdown
|
||||
v-if="hasChatPermission"
|
||||
v-if="hasChatPermission && !siteStore.isPlatformOps"
|
||||
trigger="click"
|
||||
@command="handleStatusChange"
|
||||
:disabled="updatingStatus"
|
||||
|
||||
Reference in New Issue
Block a user