diff --git a/web/apps/web-ele/src/api/request.ts b/web/apps/web-ele/src/api/request.ts index f9dc50e..7ade3b9 100644 --- a/web/apps/web-ele/src/api/request.ts +++ b/web/apps/web-ele/src/api/request.ts @@ -16,14 +16,13 @@ import { useAccessStore } from '@vben/stores'; import { useAuthStore } from '#/store'; -import { refreshTokenApi } from './core'; +import { refreshTokenApi } from './core/auth'; const { apiURL } = useAppConfig(import.meta.env, import.meta.env.PROD); async function showMessage(type: 'error' | 'warning', message: string) { - const { ElMessage } = await import( - 'element-plus/es/components/message/index' - ); + const { ElMessage } = + await import('element-plus/es/components/message/index'); ElMessage[type](message); } diff --git a/web/apps/web-ele/src/locales/index.ts b/web/apps/web-ele/src/locales/index.ts index 5db1910..ca526aa 100644 --- a/web/apps/web-ele/src/locales/index.ts +++ b/web/apps/web-ele/src/locales/index.ts @@ -32,12 +32,10 @@ const baseModules = import.meta.glob([ const businessModules = import.meta.glob([ './langs/zh-CN/ai-platform.json', './langs/zh-CN/announcement.json', - './langs/zh-CN/dashboard-design.json', './langs/zh-CN/menu.json', './langs/zh-CN/message.json', './langs/zh-CN/permission.json', './langs/zh-CN/role.json', - './langs/zh-CN/system-config.json', './langs/zh-CN/system.json', './langs/zh-CN/user.json', ]); diff --git a/web/apps/web-ele/src/views/_core/page-render/AiAgentHome.vue b/web/apps/web-ele/src/views/_core/page-render/AiAgentHome.vue new file mode 100644 index 0000000..13c5f36 --- /dev/null +++ b/web/apps/web-ele/src/views/_core/page-render/AiAgentHome.vue @@ -0,0 +1,859 @@ + + + + + diff --git a/web/apps/web-ele/src/views/_core/page-render/ai-agent-home-config.ts b/web/apps/web-ele/src/views/_core/page-render/ai-agent-home-config.ts deleted file mode 100644 index edc283c..0000000 --- a/web/apps/web-ele/src/views/_core/page-render/ai-agent-home-config.ts +++ /dev/null @@ -1,246 +0,0 @@ -import type { DashboardConfig } from '#/components/dashboard-design'; - -const AI_AGENT_HOME_CODE = 'main_home'; - -const widgetStyle = { - backgroundColor: '', - borderColor: '', - borderRadius: 8, - borderStyle: 'solid', - borderWidth: 0, - padding: 16, - shadowBlur: 4, - shadowColor: 'rgba(0, 0, 0, 0.1)', - shadowEnabled: true, - shadowOffsetX: 0, - shadowOffsetY: 1, - titleAlign: 'left', - titleColor: '', - titleFontSize: 14, - titleFontWeight: 'normal', - titleShow: true, -} as const; - -const aiAgentAdminHomeConfig: DashboardConfig = { - id: 'ai-agent-admin-main-home', - name: '控制中心', - columns: 12, - rowHeight: 68, - margin: [12, 12], - backgroundColor: '', - widgets: [ - { - id: 'welcome', - i: 'welcome', - x: 0, - y: 0, - w: 9, - h: 2, - minW: 4, - minH: 2, - type: 'welcome-card', - title: '欢迎回来', - props: { - title: '欢迎回来', - subtitle: '聚焦智能体协作、流程编排、知识库和基础权限治理', - showTime: true, - showWeather: false, - }, - style: widgetStyle, - }, - { - id: 'weather', - i: 'weather', - x: 9, - y: 0, - w: 3, - h: 2, - minW: 2, - minH: 2, - type: 'weather', - title: '今日天气', - props: { - title: '今日天气', - cityName: '北京', - latitude: 39.9042, - longitude: 116.4074, - autoLocate: false, - refreshInterval: 30, - }, - style: widgetStyle, - }, - { - id: 'ai-collaboration', - i: 'ai-collaboration', - x: 0, - y: 2, - w: 7, - h: 3, - minW: 6, - minH: 2, - type: 'quick-links', - title: 'AI 协作', - props: { - title: 'AI 协作', - columns: 4, - rows: 2, - menus: [ - { - id: 'ai-agent', - title: '智能体', - icon: 'lucide:square-user', - path: '/ai-platform/agent', - }, - { - id: 'ai-workflow', - title: '流程编排', - icon: 'lucide:workflow', - path: '/ai-platform/workflow', - }, - { - id: 'ai-workflow-runs', - title: '执行历史', - icon: 'lucide:history', - path: '/ai-platform/workflow-runs', - }, - { - id: 'ai-knowledge', - title: '知识库', - icon: 'lucide:library-big', - path: '/ai-platform/knowledge-base', - }, - { - id: 'ai-model', - title: '模型配置', - icon: 'lucide:settings', - path: '/ai-platform/model', - }, - { - id: 'codex-agent', - title: 'Codex 助手', - icon: 'lucide:code-2', - path: '/agent-chat/codex', - }, - ], - }, - style: widgetStyle, - }, - { - id: 'base-admin', - i: 'base-admin', - x: 7, - y: 2, - w: 5, - h: 3, - minW: 4, - minH: 2, - type: 'quick-links', - title: '基础管理', - props: { - title: '基础管理', - columns: 3, - rows: 2, - menus: [ - { - id: 'system-user', - title: '用户管理', - icon: 'lucide:users', - path: '/system/user', - }, - { - id: 'system-role', - title: '角色管理', - icon: 'lucide:shield-check', - path: '/system/role', - }, - { - id: 'system-permission', - title: '权限管理', - icon: 'lucide:key-round', - path: '/system/new-permission', - }, - { - id: 'system-menu', - title: '菜单管理', - icon: 'lucide:menu', - path: '/system/menu', - }, - { - id: 'announcement', - title: '公告管理', - icon: 'lucide:megaphone', - path: '/message/announcement', - }, - { - id: 'message', - title: '消息中心', - icon: 'lucide:bell', - path: '/message/list', - }, - ], - }, - style: widgetStyle, - }, - { - id: 'announcement-list', - i: 'announcement-list', - x: 0, - y: 5, - w: 4, - h: 4, - minW: 3, - minH: 3, - type: 'announcement-list', - title: '最新公告', - props: { - title: '最新公告', - limit: 6, - }, - style: widgetStyle, - }, - { - id: 'notice-list', - i: 'notice-list', - x: 4, - y: 5, - w: 4, - h: 4, - minW: 3, - minH: 3, - type: 'notice-list', - title: '消息通知', - props: { - title: '消息通知', - limit: 6, - }, - style: widgetStyle, - }, - { - id: 'server-monitor', - i: 'server-monitor', - x: 8, - y: 5, - w: 4, - h: 4, - minW: 4, - minH: 3, - type: 'server-monitor', - title: '运行监控', - props: { - title: '运行监控', - refreshInterval: 5000, - }, - style: widgetStyle, - }, - ], -}; - -function isAiAgentAdminHomeCode(code: string) { - return code === AI_AGENT_HOME_CODE; -} - -function createAiAgentAdminHomeConfig() { - return JSON.parse(JSON.stringify(aiAgentAdminHomeConfig)) as DashboardConfig; -} - -export { createAiAgentAdminHomeConfig, isAiAgentAdminHomeCode }; 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 00db233..f3878a1 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 @@ -1,24 +1,18 @@