127 lines
3.0 KiB
Python
127 lines
3.0 KiB
Python
from dataclasses import dataclass
|
|
|
|
|
|
@dataclass(frozen=True)
|
|
class MenuSpec:
|
|
code: str
|
|
title: str
|
|
path: str = ""
|
|
icon: str = ""
|
|
parent_code: str = ""
|
|
sort_order: int = 0
|
|
permission_code: str = ""
|
|
is_visible: bool = True
|
|
is_enabled: bool = True
|
|
|
|
|
|
DEFAULT_MENUS: tuple[MenuSpec, ...] = (
|
|
MenuSpec("workbench", "工作台", "#/", "home", sort_order=10),
|
|
MenuSpec(
|
|
"workbench.overview",
|
|
"运营总览",
|
|
"#/",
|
|
"home",
|
|
"workbench",
|
|
10,
|
|
is_visible=False,
|
|
is_enabled=False,
|
|
),
|
|
MenuSpec("business", "工单", icon="ticket", sort_order=20),
|
|
MenuSpec("business.tickets", "工单中心", "#/tickets", "ticket", "business", 10, "ticket.view"),
|
|
MenuSpec(
|
|
"business.ticket_create",
|
|
"创建工单",
|
|
"#/tickets/new",
|
|
"briefcase",
|
|
"business",
|
|
20,
|
|
"ticket.create",
|
|
),
|
|
MenuSpec("knowledge", "知识与方案", icon="book_open", sort_order=30),
|
|
MenuSpec(
|
|
"platform.knowledge",
|
|
"知识库",
|
|
"#/knowledge",
|
|
"database",
|
|
"knowledge",
|
|
10,
|
|
"knowledge.view",
|
|
),
|
|
MenuSpec(
|
|
"knowledge.search",
|
|
"知识检索",
|
|
"#/knowledge/search",
|
|
"search",
|
|
"knowledge",
|
|
20,
|
|
"knowledge.view",
|
|
),
|
|
MenuSpec(
|
|
"business.solutions",
|
|
"解决方案库",
|
|
"#/solutions",
|
|
"library",
|
|
"knowledge",
|
|
30,
|
|
"solution.view",
|
|
),
|
|
MenuSpec("platform", "AI 平台", icon="bot", sort_order=40),
|
|
MenuSpec(
|
|
"platform.agents",
|
|
"Agent 配置",
|
|
"#/agents",
|
|
"bot",
|
|
"platform",
|
|
10,
|
|
"agent.manage",
|
|
),
|
|
MenuSpec(
|
|
"platform.models",
|
|
"模型渠道",
|
|
"#/modelhub/providers",
|
|
"settings",
|
|
"platform",
|
|
20,
|
|
"model.manage",
|
|
),
|
|
MenuSpec(
|
|
"platform.skills",
|
|
"Skill 配置",
|
|
"#/skills",
|
|
"settings",
|
|
"platform",
|
|
30,
|
|
"skill.manage",
|
|
),
|
|
MenuSpec(
|
|
"platform.agent_runs",
|
|
"运行记录",
|
|
"#/agent-runs",
|
|
"audit",
|
|
"platform",
|
|
40,
|
|
"agent.run.view",
|
|
),
|
|
MenuSpec("system", "系统治理", icon="shield", sort_order=50),
|
|
MenuSpec(
|
|
"system.users", "用户管理", "#/system/users", "users", "system", 10, "system.user.view"
|
|
),
|
|
MenuSpec(
|
|
"system.user_groups",
|
|
"用户组管理",
|
|
"#/system/user-groups",
|
|
"user_groups",
|
|
"system",
|
|
20,
|
|
"system.user_group.view",
|
|
),
|
|
MenuSpec(
|
|
"system.roles", "角色权限", "#/system/roles", "roles", "system", 30, "system.role.view"
|
|
),
|
|
MenuSpec(
|
|
"system.menus", "菜单权限", "#/system/menus", "menu", "system", 40, "system.menu.view"
|
|
),
|
|
MenuSpec("system.audit", "操作审计", "#/audit", "audit", "system", 50, "system.audit.view"),
|
|
MenuSpec("system.design", "设计系统", "#/design-system", "settings", "system", 60),
|
|
)
|