{{ widget.props.title }}
diff --git a/web/apps/web-ele/src/views/_core/page-render/index.vue b/web/apps/web-ele/src/views/_core/page-render/index.vue
index 04f0ec2..4714ed3 100644
--- a/web/apps/web-ele/src/views/_core/page-render/index.vue
+++ b/web/apps/web-ele/src/views/_core/page-render/index.vue
@@ -12,43 +12,48 @@ const route = useRoute();
const DashboardRenderer = defineAsyncComponent(
() => import('#/components/dashboard-design/DashboardRenderer.vue'),
);
+
const loading = ref(false);
-const pageConfig = ref('');
-const pageName = ref('');
-const pageCode = ref('');
+const pageConfig = ref('');
const aiHomeMenus = [
{
+ color: 'rgba(59, 130, 246, 0.85)',
icon: 'lucide:bot',
id: 'ai-agent',
path: '/ai-platform/agent',
title: '智能体',
},
{
+ color: 'rgba(22, 163, 74, 0.85)',
icon: 'lucide:git-branch',
id: 'ai-workflow',
path: '/ai-platform/workflow',
title: '流程编排',
},
{
+ color: 'rgba(124, 58, 237, 0.85)',
icon: 'lucide:history',
id: 'ai-workflow-runs',
path: '/ai-platform/workflow-runs',
title: '执行历史',
},
{
+ color: 'rgba(249, 115, 22, 0.85)',
icon: 'lucide:message-square-code',
id: 'codex-chat',
path: '/agent-chat/codex',
title: 'Codex',
},
{
+ color: 'rgba(15, 118, 110, 0.85)',
icon: 'lucide:database',
id: 'knowledge-base',
path: '/ai-platform/knowledge-base',
title: '知识库',
},
{
+ color: 'rgba(71, 85, 105, 0.85)',
icon: 'lucide:settings',
id: 'model-config',
path: '/ai-platform/model',
@@ -58,36 +63,42 @@ const aiHomeMenus = [
const adminHomeMenus = [
{
+ bgColor: 'linear-gradient(135deg, #60a5fa, #2563eb)',
icon: 'lucide:users',
id: 'system-user',
path: '/system/user',
title: '用户管理',
},
{
+ bgColor: 'linear-gradient(135deg, #a78bfa, #7c3aed)',
icon: 'lucide:shield-check',
id: 'system-role',
path: '/system/role',
title: '角色权限',
},
{
+ bgColor: 'linear-gradient(135deg, #fb923c, #f97316)',
icon: 'lucide:menu',
id: 'system-menu',
path: '/system/menu',
title: '菜单管理',
},
{
+ bgColor: 'linear-gradient(135deg, #2dd4bf, #0f766e)',
icon: 'lucide:key-round',
id: 'system-permission',
path: '/system/new-permission',
title: 'API 权限',
},
{
+ bgColor: 'linear-gradient(135deg, #4ade80, #16a34a)',
icon: 'lucide:megaphone',
id: 'announcement',
path: '/message/announcement',
title: '公告管理',
},
{
+ bgColor: 'linear-gradient(135deg, #94a3b8, #475569)',
icon: 'lucide:inbox',
id: 'message-list',
path: '/message/list',
@@ -137,6 +148,35 @@ function toQuickLinksWidget(widget: any, title: string, menus: any[]) {
};
}
+function toApprovalCenterWidget(widget: any, title: string, menus: any[]) {
+ return {
+ ...widget,
+ props: {
+ ...widget.props,
+ menus,
+ showMore: false,
+ title,
+ },
+ title,
+ type: 'approval-center',
+ };
+}
+
+function toStaticAppsWidget(widget: any, title: string, menus: any[]) {
+ return {
+ ...widget,
+ props: {
+ ...widget.props,
+ maxCount: menus.length,
+ menus,
+ showMore: false,
+ title,
+ },
+ title,
+ type: 'my-apps',
+ };
+}
+
function getLightMainHomeConfig(config: Record) {
const next = JSON.parse(JSON.stringify(config));
if (!Array.isArray(next.widgets)) return next;
@@ -154,11 +194,11 @@ function getLightMainHomeConfig(config: Record) {
}
if (widget.type === 'approval-center') {
- return toQuickLinksWidget(widget, 'AI 协作中心', aiHomeMenus);
+ return toApprovalCenterWidget(widget, 'AI 协作中心', aiHomeMenus);
}
if (widget.type === 'my-apps') {
- return toQuickLinksWidget(widget, '基础管理', adminHomeMenus);
+ return toStaticAppsWidget(widget, '基础管理', adminHomeMenus);
}
if (widget.type === 'quick-links') {
@@ -171,19 +211,10 @@ function getLightMainHomeConfig(config: Record) {
return next;
}
-// 获取页面编码
function getPageCode(): string {
- // 优先从 query 获取
- if (route.query.pageCode) {
- return route.query.pageCode as string;
- }
+ if (route.query.pageCode) return route.query.pageCode as string;
+ if (route.params.code) return route.params.code as string;
- // 其次从 params 获取
- if (route.params.code) {
- return route.params.code as string;
- }
-
- // 最后从路径中提取(路径格式:/page-render/xxx)
const pathParts = route.path.split('/').filter(Boolean);
const length = pathParts.length;
if (length >= 2 && pathParts[length - 2] === 'page-render') {
@@ -193,7 +224,6 @@ function getPageCode(): string {
return '';
}
-// 加载页面数据
async function loadPageData() {
const code = getPageCode();
if (!code) {
@@ -201,12 +231,9 @@ async function loadPageData() {
return;
}
- pageCode.value = code;
loading.value = true;
-
try {
const page = await getPageByCodeApi(code);
- pageName.value = page.name;
const config =
page.page_config && Object.keys(page.page_config).length > 0
? code === 'main_home'
@@ -225,7 +252,6 @@ onMounted(() => {
loadPageData();
});
-// 监听路由变化
watch(
() => route.fullPath,
() => {