From 53e924379a503e4d99006be7ad0e21e5d3978b5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?cls=5F=E5=AE=81=E6=B3=A2=E6=9C=AC=E6=9C=BA?= <908705107@qq.com> Date: Wed, 10 Jun 2026 13:06:57 +0800 Subject: [PATCH] Use dashboard render page as home --- backend-fastapi/db_init.json | 330 +++++++++++++++++- web/apps/web-ele/src/preferences.ts | 2 +- web/apps/web-ele/src/router/guard.ts | 2 +- .../ui-config/modules/app-settings-form.vue | 2 +- web/packages/@core/preferences/src/config.ts | 2 +- 5 files changed, 328 insertions(+), 10 deletions(-) diff --git a/backend-fastapi/db_init.json b/backend-fastapi/db_init.json index 4bf2ed0..38eeb61 100644 --- a/backend-fastapi/db_init.json +++ b/backend-fastapi/db_init.json @@ -7038,12 +7038,14 @@ "name": "ControlCenter", "title": "menu-title.controlCenter", "authCode": null, - "path": "/control-center", - "type": "menu", - "component": "_core/control-center/index", + "path": "/page-render/main_home", + "type": "online_page", + "component": "online-dev/page-render/index", "redirect": null, "activePath": null, - "query": null, + "query": { + "pageCode": "main_home" + }, "noBasicLayout": false, "icon": "lucide:layout-dashboard", "activeIcon": null, @@ -9341,7 +9343,7 @@ "fields": { "application_id": "23CFVEUHdZcOQyku1mbIO", "config_key": "frontend_preferences", - "config_value": "{\"app\": {\"defaultHomePath\": \"/control-center\"}}", + "config_value": "{\"app\":{\"defaultHomePath\":\"/page-render/main_home\"}}", "config_type": "preferences", "description": "子应用UI偏好配置", "status": true, @@ -9361,7 +9363,7 @@ "fields": { "application_id": "uRFPsrZ0BSJodp-qesFq6", "config_key": "frontend_preferences", - "config_value": "{\"app\": {\"defaultHomePath\": \"/control-center\"}}", + "config_value": "{\"app\":{\"defaultHomePath\":\"/page-render/main_home\"}}", "config_type": "preferences", "description": "子应用UI偏好配置", "status": true, @@ -13838,5 +13840,321 @@ "sys_modifier_id": null, "sys_dept_id": null } + }, + { + "model": "online_dev.page_manager.model.PageMeta", + "pk": "Ou-NinwIGlk2aTldCWoha", + "fields": { + "application_id": null, + "name": "控制中心", + "code": "main_home", + "category": "portal", + "description": "主应用入口", + "status": "published", + "version": 2, + "page_config": { + "id": "7a337940-4590-495e-acee-1b2dd3a04370", + "name": "我的仪表盘", + "margin": [ + 12, + 12 + ], + "columns": 12, + "widgets": [ + { + "h": 2, + "i": "8de42fc4-45fc-4bd0-916f-1e85c45176a5", + "w": 9, + "x": 0, + "y": 0, + "id": "8de42fc4-45fc-4bd0-916f-1e85c45176a5", + "minH": 2, + "minW": 4, + "type": "welcome-card", + "props": { + "title": "欢迎回来罗", + "showTime": true, + "subtitle": "今天是个好日子", + "showWeather": false + }, + "style": { + "backgroundColor": "", + "borderWidth": 0, + "borderColor": "", + "borderStyle": "solid", + "borderRadius": 8, + "shadowEnabled": true, + "shadowColor": "rgba(0, 0, 0, 0.1)", + "shadowBlur": 4, + "shadowOffsetX": 0, + "shadowOffsetY": 1, + "padding": 16, + "titleShow": true, + "titleFontSize": 14, + "titleColor": "", + "titleAlign": "left", + "titleFontWeight": "normal" + }, + "title": "欢迎回来罗" + }, + { + "h": 2, + "i": "62da9e43-927d-4e60-8d55-86fff731ce6f", + "w": 3, + "x": 9, + "y": 0, + "id": "62da9e43-927d-4e60-8d55-86fff731ce6f", + "minH": 2, + "minW": 2, + "type": "weather", + "props": { + "city": "北京", + "icon": "sunny", + "wind": "东北风 3级", + "title": "今日天气", + "weather": "晴", + "humidity": 45, + "autoLocate": true, + "temperature": 25, + "refreshInterval": 10 + }, + "style": { + "backgroundColor": "", + "borderWidth": 0, + "borderColor": "", + "borderStyle": "solid", + "borderRadius": 8, + "shadowEnabled": true, + "shadowColor": "rgba(0, 0, 0, 0.1)", + "shadowBlur": 4, + "shadowOffsetX": 0, + "shadowOffsetY": 1, + "padding": 16, + "titleShow": true, + "titleFontSize": 14, + "titleColor": "", + "titleAlign": "left", + "titleFontWeight": "normal" + }, + "title": "天气" + }, + { + "h": 3, + "i": "725fb629-8f27-4738-a335-42159dc2b9bb", + "w": 6, + "x": 0, + "y": 2, + "id": "725fb629-8f27-4738-a335-42159dc2b9bb", + "minH": 2, + "minW": 6, + "type": "approval-center", + "props": { + "title": "审批中心", + "showMore": true, + "routePrefix": "/app/workflow_center" + }, + "style": { + "backgroundColor": "", + "borderWidth": 0, + "borderColor": "", + "borderStyle": "solid", + "borderRadius": 8, + "shadowEnabled": true, + "shadowColor": "rgba(0, 0, 0, 0.1)", + "shadowBlur": 4, + "shadowOffsetX": 0, + "shadowOffsetY": 1, + "padding": 16, + "titleShow": true, + "titleFontSize": 14, + "titleColor": "", + "titleAlign": "left", + "titleFontWeight": "normal" + }, + "title": "审批中心" + }, + { + "h": 3, + "i": "2b385f41-7f9a-460c-8526-8b14c124ac9d", + "w": 6, + "x": 0, + "y": 5, + "id": "2b385f41-7f9a-460c-8526-8b14c124ac9d", + "minH": 2, + "minW": 6, + "type": "my-apps", + "props": { + "title": "我的应用", + "maxCount": 8, + "showMore": false + }, + "style": { + "backgroundColor": "", + "borderWidth": 0, + "borderColor": "", + "borderStyle": "solid", + "borderRadius": 8, + "shadowEnabled": true, + "shadowColor": "rgba(0, 0, 0, 0.1)", + "shadowBlur": 4, + "shadowOffsetX": 0, + "shadowOffsetY": 1, + "padding": 16, + "titleShow": true, + "titleFontSize": 14, + "titleColor": "", + "titleAlign": "left", + "titleFontWeight": "normal" + }, + "title": "我的应用" + }, + { + "h": 6, + "i": "c494c8bc-12be-48a7-837d-8313544c1359", + "w": 3, + "x": 6, + "y": 2, + "id": "c494c8bc-12be-48a7-837d-8313544c1359", + "minH": 3, + "minW": 3, + "type": "announcement-list", + "props": { + "limit": 5, + "title": "最新公告" + }, + "style": { + "backgroundColor": "", + "borderWidth": 0, + "borderColor": "", + "borderStyle": "solid", + "borderRadius": 8, + "shadowEnabled": true, + "shadowColor": "rgba(0, 0, 0, 0.1)", + "shadowBlur": 4, + "shadowOffsetX": 0, + "shadowOffsetY": 1, + "padding": 16, + "titleShow": true, + "titleFontSize": 14, + "titleColor": "", + "titleAlign": "left", + "titleFontWeight": "normal" + }, + "title": "公告列表" + }, + { + "h": 4, + "i": "4dc70a35-21f7-4f6f-a482-b0588e5c7f5c", + "w": 12, + "x": 0, + "y": 8, + "id": "4dc70a35-21f7-4f6f-a482-b0588e5c7f5c", + "minH": 2, + "minW": 6, + "type": "server-monitor", + "props": { + "title": "服务器信息", + "refreshInterval": 5000 + }, + "title": "服务器信息", + "style": { + "backgroundColor": "", + "borderWidth": 0, + "borderColor": "", + "borderStyle": "solid", + "borderRadius": 8, + "shadowEnabled": true, + "shadowColor": "rgba(0, 0, 0, 0.1)", + "shadowBlur": 4, + "shadowOffsetX": 0, + "shadowOffsetY": 1, + "padding": 16, + "titleShow": true, + "titleFontSize": 14, + "titleColor": "", + "titleAlign": "left", + "titleFontWeight": "normal" + } + }, + { + "h": 6, + "i": "f6d27478-321e-4e49-af40-66bdd43bee09", + "w": 3, + "x": 9, + "y": 2, + "id": "f6d27478-321e-4e49-af40-66bdd43bee09", + "minH": 3, + "minW": 3, + "type": "notice-list", + "props": { + "limit": 5, + "title": "消息通知" + }, + "title": "消息通知", + "style": { + "backgroundColor": "", + "borderWidth": 0, + "borderColor": "", + "borderStyle": "solid", + "borderRadius": 8, + "shadowEnabled": true, + "shadowColor": "rgba(0, 0, 0, 0.1)", + "shadowBlur": 4, + "shadowOffsetX": 0, + "shadowOffsetY": 1, + "padding": 16, + "titleShow": true, + "titleFontSize": 14, + "titleColor": "", + "titleAlign": "left", + "titleFontWeight": "normal" + } + }, + { + "id": "0a178e51-c480-4cb9-858c-dc0cbbbe6196", + "i": "0a178e51-c480-4cb9-858c-dc0cbbbe6196", + "type": "quick-links", + "x": 0, + "y": 12, + "w": 4, + "h": 3, + "minW": 2, + "minH": 2, + "title": "快捷入口", + "props": { + "title": "快捷入口", + "columns": 4, + "rows": 2, + "menus": [ + { + "id": "mWJtvLYnAMa_3fR_jjtBc", + "title": "应用管理", + "icon": "lucide:app-window", + "path": "/application", + "bgColor": "" + }, + null, + null, + null, + null, + null, + null, + null + ] + } + } + ], + "rowHeight": 55, + "showOuterMargin": false + }, + "id": "Ou-NinwIGlk2aTldCWoha", + "sort": 0, + "is_deleted": false, + "sys_create_datetime": "2026-02-09T06:36:11.612236", + "sys_update_datetime": "2026-05-01T02:34:26.633176", + "sys_creator_id": "Rl5LfJAlZZRG1j460QGmD", + "sys_modifier_id": "88_cF6A9Ig5DMTcSUgJBs", + "sys_dept_id": null + } } ] diff --git a/web/apps/web-ele/src/preferences.ts b/web/apps/web-ele/src/preferences.ts index a8854d6..9f9b571 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: '/control-center', + defaultHomePath: '/page-render/main_home', layout: 'header-sidebar-nav', }, shortcutKeys: { diff --git a/web/apps/web-ele/src/router/guard.ts b/web/apps/web-ele/src/router/guard.ts index 16e3686..a23867e 100644 --- a/web/apps/web-ele/src/router/guard.ts +++ b/web/apps/web-ele/src/router/guard.ts @@ -188,7 +188,7 @@ function setupAccessGuard(router: Router) { if (to.path === subAppRootPath) { const defaultHome = - preferences.app.defaultHomePath || '/control-center'; + preferences.app.defaultHomePath || '/page-render/main_home'; // 确保路径包含子应用前缀 const subAppTargetPath = defaultHome.startsWith(subAppRootPath) ? defaultHome 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 3870d66..beee0df 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 @@ -106,7 +106,7 @@ function getDefaultConfig() { defaultHomePath: overrides.app?.defaultHomePath || preferences.app.defaultHomePath || - '/control-center', + '/page-render/main_home', enablePreferences: overrides.app?.enablePreferences ?? true, }, footer: { diff --git a/web/packages/@core/preferences/src/config.ts b/web/packages/@core/preferences/src/config.ts index 801059f..6108aeb 100644 --- a/web/packages/@core/preferences/src/config.ts +++ b/web/packages/@core/preferences/src/config.ts @@ -17,7 +17,7 @@ const defaultPreferences: Preferences = { contentPaddingTop: 0, defaultAvatar: 'https://unpkg.com/@vbenjs/static-source@0.1.7/source/avatar-v1.webp', - defaultHomePath: '/control-center', + defaultHomePath: '/page-render/main_home', dynamicTitle: true, enableCheckUpdates: true, enablePreferences: true,