1.将部门修改为渠道,并且所有dice_表关联渠道表
2.将所有配置表,记录表设置关联渠道 3.优化后台页面设置
This commit is contained in:
48
saiadmin-artd/src/utils/channelLayout.ts
Normal file
48
saiadmin-artd/src/utils/channelLayout.ts
Normal file
@@ -0,0 +1,48 @@
|
||||
import type { RouteLocationNormalized } from 'vue-router'
|
||||
import { useUserStore } from '@/store/modules/user'
|
||||
|
||||
/** 页面自带左侧渠道栏,不再包一层全局渠道壳 */
|
||||
const BUILTIN_CHANNEL_LAYOUT_PATHS = [
|
||||
'/system/user',
|
||||
'/system/dept'
|
||||
]
|
||||
|
||||
export function isSuperAdminUser(): boolean {
|
||||
const userStore = useUserStore()
|
||||
return Number(userStore.info?.id ?? 0) === 1
|
||||
}
|
||||
|
||||
/** 游戏配置类页面:显示「默认配置模板」 */
|
||||
export function isConfigChannelRoute(route: Pick<RouteLocationNormalized, 'path' | 'meta'>): boolean {
|
||||
if (route.meta?.channelScope === 'config') {
|
||||
return true
|
||||
}
|
||||
return /\/(config|ante_config|lottery_pool_config|reward_config|game)(\/|$)/.test(route.path)
|
||||
}
|
||||
|
||||
/** 角色管理:左侧渠道树含默认模板(dept_id=0)与各渠道角色 */
|
||||
export function isRoleChannelRoute(route: Pick<RouteLocationNormalized, 'path' | 'meta'>): boolean {
|
||||
if (route.meta?.channelScope === 'role') {
|
||||
return true
|
||||
}
|
||||
return route.path.startsWith('/system/role')
|
||||
}
|
||||
|
||||
export function shouldWrapSuperAdminChannelLayout(route: RouteLocationNormalized): boolean {
|
||||
if (!isSuperAdminUser()) {
|
||||
return false
|
||||
}
|
||||
if (route.meta?.isFullPage) {
|
||||
return false
|
||||
}
|
||||
if (route.meta?.noChannelLayout === true) {
|
||||
return false
|
||||
}
|
||||
const path = route.path
|
||||
for (let i = 0; i < BUILTIN_CHANNEL_LAYOUT_PATHS.length; i++) {
|
||||
if (path.startsWith(BUILTIN_CHANNEL_LAYOUT_PATHS[i])) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
return true
|
||||
}
|
||||
Reference in New Issue
Block a user