diff --git a/.gitignore b/.gitignore index 2cfafb5..e88173d 100644 --- a/.gitignore +++ b/.gitignore @@ -195,6 +195,10 @@ web/apps/web-ele/src/views/online-dev/* !web/apps/web-ele/src/views/online-dev/page-render/ !web/apps/web-ele/src/views/online-dev/page-render/** web/apps/web-ele/src/views/dashboard/ +!web/apps/web-ele/src/views/dashboard/ +web/apps/web-ele/src/views/dashboard/* +!web/apps/web-ele/src/views/dashboard/workspace/ +!web/apps/web-ele/src/views/dashboard/workspace/** web/apps/web-ele/src/views/demos/ web/apps/web-ele/src/views/zq-smart-table/ web/apps/web-ele/src/api/online-dev/ diff --git a/backend-fastapi/core/menu/service.py b/backend-fastapi/core/menu/service.py index 66721ef..c008a4e 100644 --- a/backend-fastapi/core/menu/service.py +++ b/backend-fastapi/core/menu/service.py @@ -17,7 +17,7 @@ from core.menu.schema import MenuCreate, MenuUpdate menu_cache = CacheManager(prefix="menu:") # 缓存key -AI_AGENT_ADMIN_MENU_CACHE_VERSION = "v11" +AI_AGENT_ADMIN_MENU_CACHE_VERSION = "v12" MENU_TREE_CACHE_KEY = f"tree:ai_agent_admin:{AI_AGENT_ADMIN_MENU_CACHE_VERSION}" USER_ROUTE_CACHE_PREFIX = f"user_route:ai_agent_admin:{AI_AGENT_ADMIN_MENU_CACHE_VERSION}:" @@ -51,8 +51,8 @@ def _filter_ai_agent_admin_menus(menus: List[Menu]) -> List[Menu]: def _normalize_ai_agent_admin_menu(menu: Menu) -> None: """Keep the retained control center on the lightweight admin dashboard.""" if menu.name == "ControlCenter": - menu.path = "/page-render/main_home" - menu.component = "_core/page-render/index" + menu.path = "/dashboard/workspace" + menu.component = "/dashboard/workspace/index" menu.query = None diff --git a/backend-fastapi/db_init.json b/backend-fastapi/db_init.json index 0460f6b..88de436 100644 --- a/backend-fastapi/db_init.json +++ b/backend-fastapi/db_init.json @@ -7038,9 +7038,9 @@ "name": "ControlCenter", "title": "menu-title.controlCenter", "authCode": null, - "path": "/ai-platform/agent", + "path": "/dashboard/workspace", "type": "menu", - "component": "/ai-platform/agent/index", + "component": "/dashboard/workspace/index", "redirect": null, "activePath": null, "query": null, @@ -9386,7 +9386,7 @@ "fields": { "application_id": "23CFVEUHdZcOQyku1mbIO", "config_key": "frontend_preferences", - "config_value": "{\"app\":{\"defaultHomePath\":\"/ai-platform/agent\"}}", + "config_value": "{\"app\":{\"defaultHomePath\":\"/dashboard/workspace\"}}", "config_type": "preferences", "description": "子应用UI偏好配置", "status": true, @@ -9406,7 +9406,7 @@ "fields": { "application_id": "uRFPsrZ0BSJodp-qesFq6", "config_key": "frontend_preferences", - "config_value": "{\"app\":{\"defaultHomePath\":\"/ai-platform/agent\"}}", + "config_value": "{\"app\":{\"defaultHomePath\":\"/dashboard/workspace\"}}", "config_type": "preferences", "description": "子应用UI偏好配置", "status": true, @@ -12988,7 +12988,7 @@ "cover": "", "app_type": "ai", "status": "published", - "home_path": "/ai-platform/agent", + "home_path": "/dashboard/workspace", "version": 1, "config": {}, "owner_id": null, diff --git a/web/apps/web-ele/src/locales/langs/zh-CN/menu-title.json b/web/apps/web-ele/src/locales/langs/zh-CN/menu-title.json index 87a34f5..752cb41 100644 --- a/web/apps/web-ele/src/locales/langs/zh-CN/menu-title.json +++ b/web/apps/web-ele/src/locales/langs/zh-CN/menu-title.json @@ -1,6 +1,7 @@ { "home": "首页", "controlCenter": "控制中心", + "workspace": "工作台", "aiPlatform": "AI 平台", "aiAgent": "智能体", "workflowOrchestration": "流程编排", diff --git a/web/apps/web-ele/src/preferences.ts b/web/apps/web-ele/src/preferences.ts index 7b8c426..37d8592 100644 --- a/web/apps/web-ele/src/preferences.ts +++ b/web/apps/web-ele/src/preferences.ts @@ -16,7 +16,7 @@ export const overridesPreferences = defineOverridesPreferences({ enablePreferences: false, accessMode: 'mixed', authPageLayout: 'panel-center', - defaultHomePath: '/ai-platform/agent', + defaultHomePath: '/dashboard/workspace', layout: 'header-sidebar-nav', preferencesButtonPosition: 'header', }, diff --git a/web/apps/web-ele/src/router/access.ts b/web/apps/web-ele/src/router/access.ts index 7b67b91..13be7aa 100644 --- a/web/apps/web-ele/src/router/access.ts +++ b/web/apps/web-ele/src/router/access.ts @@ -179,9 +179,12 @@ async function generateAccess(options: GenerateMenuAndRoutesOptions) { '../views/_core/fallback/**/*.vue', '../views/_core/file-preview/index.vue', '../views/_core/menu/index.vue', + '../views/_core/message/index.vue', '../views/_core/page-render/index.vue', '../views/_core/permission/index.vue', '../views/_core/role/index.vue', + '../views/_core/system-config/index.vue', + '../views/_core/ui-config/index.vue', '../views/_core/user/index.vue', '../views/ai-platform/agent/editor/index.vue', '../views/ai-platform/agent/index.vue', @@ -191,6 +194,7 @@ async function generateAccess(options: GenerateMenuAndRoutesOptions) { '../views/ai-platform/workflow/editor/index.vue', '../views/ai-platform/workflow/index.vue', '../views/ai-platform/workflow-runs/index.vue', + '../views/dashboard/workspace/index.vue', ]); const layoutMap: ComponentRecordType = { diff --git a/web/apps/web-ele/src/router/guard.ts b/web/apps/web-ele/src/router/guard.ts index 285009e..1426730 100644 --- a/web/apps/web-ele/src/router/guard.ts +++ b/web/apps/web-ele/src/router/guard.ts @@ -206,7 +206,7 @@ function setupAccessGuard(router: Router) { if (to.path === subAppRootPath) { const defaultHome = - preferences.app.defaultHomePath || '/ai-platform/agent'; + preferences.app.defaultHomePath || '/dashboard/workspace'; // 确保路径包含子应用前缀 const subAppTargetPath = defaultHome.startsWith(subAppRootPath) ? defaultHome @@ -222,7 +222,7 @@ function setupAccessGuard(router: Router) { const redirectPath = normalizeHomePath( (from.query.redirect ?? (to.path === preferences.app.defaultHomePath - ? userInfo.homePath + ? preferences.app.defaultHomePath : to.fullPath)) as string, ); diff --git a/web/apps/web-ele/src/router/light-menu.ts b/web/apps/web-ele/src/router/light-menu.ts index 0b811ec..f729798 100644 --- a/web/apps/web-ele/src/router/light-menu.ts +++ b/web/apps/web-ele/src/router/light-menu.ts @@ -1,4 +1,7 @@ export const LIGHT_MENU_NAMES = new Set([ + 'ControlCenter', + 'Dashboard', + 'DashboardWorkspace', 'AIAgent', 'AIKnowledgeDetail', 'AIModelConfig', @@ -8,15 +11,21 @@ export const LIGHT_MENU_NAMES = new Set([ 'AnnouncementList', 'AnnouncementManage', 'CodexAgentChat', + 'MessageCenter', + 'MessageList', 'KnowledgeBase', 'SystemManagement', + 'SystemConfig', 'SystemMenu', 'SystemPermission', 'SystemRole', + 'UIConfig', 'UserManagement', ]); const LIGHT_ROUTE_PATH_PREFIXES = [ + '/control-center', + '/dashboard', '/ai-platform/agent', '/ai-platform/knowledge', '/ai-platform/knowledge-base', @@ -24,10 +33,15 @@ const LIGHT_ROUTE_PATH_PREFIXES = [ '/ai-platform/workflow', '/ai-platform/workflow-runs', '/agent-chat', + '/message/list', '/message/announcement', + '/message/announcement-list', + '/page-render/main_home', + '/system/config', '/system/menu', '/system/new-permission', '/system/role', + '/system/ui-config', '/system/user', ]; diff --git a/web/apps/web-ele/src/router/routes/index.ts b/web/apps/web-ele/src/router/routes/index.ts index 880a361..1a20f1e 100644 --- a/web/apps/web-ele/src/router/routes/index.ts +++ b/web/apps/web-ele/src/router/routes/index.ts @@ -4,6 +4,7 @@ import { mergeRouteModules, traverseTreeValues } from '@vben/utils'; import { coreRoutes, fallbackNotFoundRoute } from './core'; import aiPlatformRoutes from './modules/ai-platform'; +import dashboardRoutes from './modules/dashboard'; // 有需要可以自行打开注释,并创建文件夹 // const externalRouteFiles = import.meta.glob('./external/**/*.ts', { eager: true }); @@ -12,6 +13,7 @@ import aiPlatformRoutes from './modules/ai-platform'; /** 动态路由 */ const dynamicRoutes: RouteRecordRaw[] = mergeRouteModules({ './modules/ai-platform.ts': { default: aiPlatformRoutes }, + './modules/dashboard.ts': { default: dashboardRoutes }, }); /** 外部路由列表,访问这些页面可以不需要Layout,可能用于内嵌在别的系统(不会显示在菜单中) */ diff --git a/web/apps/web-ele/src/router/routes/modules/ai-platform.ts b/web/apps/web-ele/src/router/routes/modules/ai-platform.ts index 74ec41f..04fe57f 100644 --- a/web/apps/web-ele/src/router/routes/modules/ai-platform.ts +++ b/web/apps/web-ele/src/router/routes/modules/ai-platform.ts @@ -5,7 +5,7 @@ const routes: RouteRecordRaw[] = [ meta: { hideInMenu: true }, name: 'ControlCenterLegacyRedirect', path: '/control-center', - redirect: '/ai-platform/agent', + redirect: '/dashboard/workspace', }, { meta: { @@ -14,7 +14,7 @@ const routes: RouteRecordRaw[] = [ }, name: 'PageRenderMainHome', path: '/page-render/main_home', - redirect: '/ai-platform/agent', + redirect: '/dashboard/workspace', }, { meta: { hideInMenu: true }, diff --git a/web/apps/web-ele/src/router/routes/modules/dashboard.ts b/web/apps/web-ele/src/router/routes/modules/dashboard.ts new file mode 100644 index 0000000..df1b0f2 --- /dev/null +++ b/web/apps/web-ele/src/router/routes/modules/dashboard.ts @@ -0,0 +1,28 @@ +import type { RouteRecordRaw } from 'vue-router'; + +const routes: RouteRecordRaw[] = [ + { + meta: { + hideInMenu: true, + icon: 'lucide:layout-dashboard', + order: 0, + title: 'menu-title.controlCenter', + }, + name: 'Dashboard', + path: '/dashboard', + redirect: '/dashboard/workspace', + children: [ + { + component: () => import('#/views/dashboard/workspace/index.vue'), + meta: { + hideInMenu: true, + title: 'menu-title.workspace', + }, + name: 'DashboardWorkspace', + path: '/dashboard/workspace', + }, + ], + }, +]; + +export default routes; diff --git a/web/apps/web-ele/src/views/_core/ui-config/modules/app-settings-form.vue b/web/apps/web-ele/src/views/_core/ui-config/modules/app-settings-form.vue index 1c51639..90b859e 100644 --- a/web/apps/web-ele/src/views/_core/ui-config/modules/app-settings-form.vue +++ b/web/apps/web-ele/src/views/_core/ui-config/modules/app-settings-form.vue @@ -53,7 +53,7 @@ const appDynamicTitle = ref(true); const appWatermark = ref(false); const appWatermarkContent = ref(''); const appEnableCheckUpdates = ref(true); -const appDefaultHomePath = ref('/ai-platform/agent'); +const appDefaultHomePath = ref('/dashboard/workspace'); const appEnablePreferences = ref(true); const footerEnable = ref(true); @@ -106,7 +106,7 @@ function getDefaultConfig() { defaultHomePath: overrides.app?.defaultHomePath || preferences.app.defaultHomePath || - '/ai-platform/agent', + '/dashboard/workspace', enablePreferences: overrides.app?.enablePreferences ?? true, }, footer: { @@ -229,7 +229,7 @@ async function loadConfig() { // 获取带子应用前缀的首页路径 function getDefaultHomePathWithPrefix(): string { - const path = appDefaultHomePath.value || '/ai-platform/agent'; + const path = appDefaultHomePath.value || '/dashboard/workspace'; const appCode = appContextStore.appCode; // 如果是子应用模式且路径不包含子应用前缀,自动添加 if (appCode && !path.startsWith(`/app/${appCode}`)) { diff --git a/web/apps/web-ele/src/views/dashboard/workspace/index.vue b/web/apps/web-ele/src/views/dashboard/workspace/index.vue new file mode 100644 index 0000000..b64fdf9 --- /dev/null +++ b/web/apps/web-ele/src/views/dashboard/workspace/index.vue @@ -0,0 +1,534 @@ + + + + +