fix: 管理员用户详情弹窗崩溃与多俱乐部分配UI

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
XingQue
2026-07-06 18:00:00 +08:00
parent 37a1a15f90
commit 58be204448
5 changed files with 356 additions and 65 deletions

View File

@@ -268,6 +268,7 @@ import {
canSwitchClubByMenu,
ensureMenuAccess,
canShowMenuPage,
clearMenuAccess,
} from '@/utils/club-context'
const menuAccessState = ref(getMenuAccess())
@@ -359,14 +360,18 @@ const onScopeSelectChange = (val) => {
})
ElMessage.success('已切换至:集团汇总(全部子公司)')
} else {
const assign = (ctx.assignments || []).find((a) => a.club_id === val)
setAdminClubContext({
...ctx,
scope: 'SINGLE_CLUB',
club_id: val,
role_code: assign?.role_code || ctx.role_code,
role_name: assign?.role_name || ctx.role_name,
})
const hit = clubOptions.value.find((c) => c.club_id === val)
ElMessage.success(`已切换至:${hit?.name || val}`)
}
clearMenuAccess()
window.location.reload()
}
@@ -523,9 +528,9 @@ provide('permPrefixMap', permPrefixMap)
provide('goeasyAppkey', goeasyAppkey)
provide('hasAnyChatPerm', hasAnyChatPerm)
onMounted(() => {
loadMenuAccess()
loadClubContext()
onMounted(async () => {
await loadClubContext()
await loadMenuAccess()
fetchStats()
fetchKefuPermission()
proxy.$emitter?.on('refresh-stats', fetchStats)