添加个人中心及按角色展示内容
This commit is contained in:
@@ -63,8 +63,8 @@
|
||||
<!-- 内容展示区 (内部路由渲染) -->
|
||||
<view class="content-scroll">
|
||||
<view class="content-inner" :class="{ 'is-mobile': isMobile }">
|
||||
<slot></slot>
|
||||
<component :is="currentComponent" v-if="!isPageLoading && currentComponent != null"></component>
|
||||
<slot v-if="hasAccess"></slot>
|
||||
<component :is="currentComponent" v-if="hasAccess && !isPageLoading && currentComponent != null"></component>
|
||||
<AdminPageLoading v-if="isPageLoading"></AdminPageLoading>
|
||||
</view>
|
||||
<AdminFooter></AdminFooter>
|
||||
@@ -116,6 +116,7 @@ import {
|
||||
import type { TabItem } from '@/layouts/admin/store/adminNavStore.uts'
|
||||
|
||||
import { getComponent } from '@/layouts/admin/router/adminComponentMap.uts'
|
||||
import { hasAdminModuleAccess } from '@/layouts/admin/utils/role.uts'
|
||||
|
||||
const props = defineProps({
|
||||
currentPage: {
|
||||
@@ -131,6 +132,12 @@ const SUB_W = 200
|
||||
// 页面加载状态
|
||||
const isPageLoading = ref(false)
|
||||
|
||||
const hasAccess = computed<boolean>(() => {
|
||||
|
||||
|
||||
return hasAdminModuleAccess(activeTopMenuId.value)
|
||||
})
|
||||
|
||||
const hasNotification = ref<boolean>(false)
|
||||
|
||||
/**
|
||||
@@ -258,6 +265,8 @@ const breadcrumb = computed<Array<{id: string, title: string}>>(() => {
|
||||
|
||||
// 当前渲染的组件
|
||||
const currentComponent = computed<any>(() => {
|
||||
|
||||
|
||||
const route = findRouteById(activeRouteId.value)
|
||||
if (!route) return null
|
||||
return getComponent(route.componentKey)
|
||||
|
||||
Reference in New Issue
Block a user