feat: add business line permissions and Wayne namespace mapping
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
class="bl-ic"
|
||||
:style="{ background: currentBL?.iconBg, color: currentBL?.iconColor }"
|
||||
>
|
||||
{{ currentBL?.iconText }}
|
||||
{{ currentBL?.iconText || 'BL' }}
|
||||
</div>
|
||||
<span class="bl-name-trigger">{{ currentBL?.name || '未选择' }}</span>
|
||||
<span class="bl-role" v-if="currentBL">{{ currentBL.role }} · 授权 {{ authCount }} 子系统</span>
|
||||
@@ -32,7 +32,7 @@
|
||||
<div class="bl-sub">{{ bl.ou }} · {{ bl.role }}</div>
|
||||
</div>
|
||||
<span v-if="bl.authorized" class="bl-check">✓</span>
|
||||
<span v-else class="bl-lock">🔒 无权限</span>
|
||||
<span v-else class="bl-lock">无权限</span>
|
||||
</div>
|
||||
</div>
|
||||
</Transition>
|
||||
@@ -72,6 +72,9 @@ function onClickOutside(e: MouseEvent) {
|
||||
|
||||
onMounted(() => {
|
||||
document.addEventListener('click', onClickOutside)
|
||||
blStore.loadMine().catch(() => {
|
||||
// 页面其他接口会统一展示登录状态,这里只保持切换器为空态。
|
||||
})
|
||||
})
|
||||
|
||||
onUnmounted(() => {
|
||||
|
||||
@@ -63,6 +63,12 @@
|
||||
<router-link to="/subsystem/authz" class="nav-item" active-class="active">
|
||||
<span class="ic">▦</span>子系统赋权
|
||||
</router-link>
|
||||
<router-link v-if="isPlatformAdmin" to="/business-line/manage" class="nav-item" active-class="active">
|
||||
<span class="ic">▤</span>业务线管理
|
||||
</router-link>
|
||||
<router-link v-if="isBusinessLineAdmin" to="/business-line/assignment" class="nav-item" active-class="active">
|
||||
<span class="ic">▥</span>业务线分配
|
||||
</router-link>
|
||||
</div>
|
||||
<div class="nav-group">
|
||||
<div class="nav-label">审计</div>
|
||||
@@ -81,9 +87,15 @@
|
||||
<script setup lang="ts">
|
||||
import { ref, computed } from 'vue'
|
||||
import { useRoute } from 'vue-router'
|
||||
import { useAuthStore } from '@/stores/auth'
|
||||
import { useBusinessLineStore } from '@/stores/businessLine'
|
||||
|
||||
const route = useRoute()
|
||||
const authStore = useAuthStore()
|
||||
const businessLineStore = useBusinessLineStore()
|
||||
const portalExpanded = ref(true)
|
||||
const isPlatformAdmin = computed(() => authStore.user?.is_admin === true)
|
||||
const isBusinessLineAdmin = computed(() => businessLineStore.isCurrentAdmin)
|
||||
|
||||
const subsystems = [
|
||||
{ name: 'Wayne', label: '多集群发布平台', icon: 'W' },
|
||||
|
||||
Reference in New Issue
Block a user