统一菜单隐藏逻辑并隐藏开发菜单和工具市场
This commit is contained in:
parent
fec4459143
commit
617b566250
@ -59,7 +59,7 @@ function getDefaultMenus(): AppMenuItem[] {
|
||||
{ id: 'localJobs', key: 'LocalJobList', label: 'Task Queue', icon: 'iconoir:task-list', type: 'route', routeName: 'LocalJobList', order: 7 },
|
||||
{ id: 'scheduledJobs', key: 'ScheduledJobList', label: 'Scheduled Jobs', icon: 'carbon:event-schedule', type: 'route', routeName: 'ScheduledJobList', order: 8 },
|
||||
{ id: 'tools', key: 'Tools', label: 'Tools', icon: 'tabler:tool', type: 'route', routeName: 'Tools', order: 9 },
|
||||
{ id: 'dev-group', key: 'dev-group', label: 'Development', icon: 'tabler:code', type: 'group', order: 10 },
|
||||
{ id: 'dev-group', key: 'dev-group', label: 'Development', icon: 'tabler:code', type: 'group', order: 10, hidden: true },
|
||||
{ id: 'dev-template', key: 'dev-template', label: 'PageType Template', icon: 'tabler:file-code', type: 'route', routeName: 'CreatePagetypeTemplate', parentId: 'dev-group', order: 1 },
|
||||
{ id: 'dev-app-template', key: 'dev-app-template', label: 'App Template', icon: 'tabler:app-window', type: 'route', routeName: 'CreateAppTemplate', parentId: 'dev-group', order: 1.5 },
|
||||
{ id: 'package', key: 'package', label: 'Package', icon: 'tabler:package', type: 'pagetype', pagetype: 'Package', parentId: 'dev-group', order: 2 },
|
||||
@ -73,7 +73,7 @@ function getDefaultMenus(): AppMenuItem[] {
|
||||
{ id: 'app-marketplace', key: 'AppMarketplace', label: 'App Marketplace', icon: 'tabler:shopping-cart', type: 'route', routeName: 'AppMarketplace', parentId: 'dev-group', order: 7.5 },
|
||||
{ id: 'node-marketplace', key: 'NodeMarketplace', label: 'Node Marketplace', icon: 'carbon:add-child-node', type: 'route', routeName: 'NodeMarketplace', parentId: 'dev-group', order: 8 },
|
||||
{ id: 'agent-marketplace', key: 'AgentMarketplace', label: 'Agent Marketplace', icon: 'hugeicons:robotic', type: 'route', routeName: 'AgentMarketplace', parentId: 'dev-group', order: 8.5 },
|
||||
{ id: 'tool-marketplace', key: 'ToolMarketplace', label: 'Tool Marketplace', icon: 'tabler:tool', type: 'route', routeName: 'ToolMarketplace', parentId: 'dev-group', order: 8.7 }
|
||||
{ id: 'tool-marketplace', key: 'ToolMarketplace', label: 'Tool Marketplace', icon: 'tabler:tool', type: 'route', routeName: 'ToolMarketplace', parentId: 'dev-group', order: 8.7, hidden: true }
|
||||
]
|
||||
}
|
||||
|
||||
@ -180,9 +180,10 @@ export const useMenuStore = defineStore('menu', () => {
|
||||
// 过滤隐藏的菜单项
|
||||
if (m.hidden) return false
|
||||
|
||||
// 隐藏开发菜单及其所有子菜单
|
||||
if (m.id === 'dev-group' || m.parentId === 'dev-group') {
|
||||
return false
|
||||
// 如果父菜单被隐藏,子菜单也应该被隐藏
|
||||
if (m.parentId) {
|
||||
const parent = items.value.find(p => p.id === m.parentId)
|
||||
if (parent?.hidden) return false
|
||||
}
|
||||
|
||||
// 非 System User 的过滤逻辑
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user