diff --git a/web/apps/web-ele/src/components/ai-chat-panel/AiChatPanel.vue b/web/apps/web-ele/src/components/ai-chat-panel/AiChatPanel.vue index 7971104..f37e098 100644 --- a/web/apps/web-ele/src/components/ai-chat-panel/AiChatPanel.vue +++ b/web/apps/web-ele/src/components/ai-chat-panel/AiChatPanel.vue @@ -16,7 +16,7 @@ import type { * - agent-debug: 智能体编辑器调试模式 * - agent-chat: 智能体正式对话模式(支持历史、反馈) */ -import { computed, onUnmounted, ref, watch } from 'vue'; +import { computed, defineAsyncComponent, onUnmounted, ref, watch } from 'vue'; import { Close, Setting } from '@element-plus/icons-vue'; @@ -31,19 +31,31 @@ import { import { AiWorkingAnimation } from '#/components/ai-loading'; import { ChatBox } from '#/components/ChatBox'; -import { - AppDesignPanel, - AppSettingsPanel, - DashboardBasicInfoConfirmPanel, - DashboardDesignConfirmPanel, - DashboardPublishConfirmPanel, - DesignEditorPanel, - SystemSummaryConfirmPanel, -} from '#/components/form-editor'; - import { useChatApi } from './composables/useChatApi'; import { useEventHandler } from './composables/useEventHandler'; +const DesignEditorPanel = defineAsyncComponent( + () => import('#/components/form-editor/DesignEditorPanel.vue'), +); +const AppDesignPanel = defineAsyncComponent( + () => import('#/components/form-editor/AppDesignPanel.vue'), +); +const AppSettingsPanel = defineAsyncComponent( + () => import('#/components/form-editor/AppSettingsPanel.vue'), +); +const DashboardBasicInfoConfirmPanel = defineAsyncComponent( + () => import('#/components/form-editor/DashboardBasicInfoConfirmPanel.vue'), +); +const DashboardDesignConfirmPanel = defineAsyncComponent( + () => import('#/components/form-editor/DashboardDesignConfirmPanel.vue'), +); +const DashboardPublishConfirmPanel = defineAsyncComponent( + () => import('#/components/form-editor/DashboardPublishConfirmPanel.vue'), +); +const SystemSummaryConfirmPanel = defineAsyncComponent( + () => import('#/components/form-editor/SystemSummaryConfirmPanel.vue'), +); + // ==================== Props ==================== const props = withDefaults(defineProps(), { mode: 'workflow', diff --git a/web/apps/web-ele/src/views/ai-platform/agent/components/AgentChatPanel.vue b/web/apps/web-ele/src/views/ai-platform/agent/components/AgentChatPanel.vue index 91fc316..09923e7 100644 --- a/web/apps/web-ele/src/views/ai-platform/agent/components/AgentChatPanel.vue +++ b/web/apps/web-ele/src/views/ai-platform/agent/components/AgentChatPanel.vue @@ -11,7 +11,14 @@ import type { ChatMessage } from '#/components/ChatBox/index'; * Agent 对话面板组件 * 可复用于 Agent 编辑页面和 Agent 对话页面 */ -import { computed, nextTick, onUnmounted, ref, watch } from 'vue'; +import { + computed, + defineAsyncComponent, + nextTick, + onUnmounted, + ref, + watch, +} from 'vue'; import { $t } from '@vben/locales'; @@ -23,10 +30,16 @@ import { sendAgentMessageStream, } from '#/api/ai-platform/ai-platform'; import { ChatBox } from '#/components/ChatBox/index'; -import { AppDesignPanel, DesignEditorPanel } from '#/components/form-editor'; import AiWorkingAnimation from '../../../../components/ai-loading/AiWorkingAnimation.vue'; +const DesignEditorPanel = defineAsyncComponent( + () => import('#/components/form-editor/DesignEditorPanel.vue'), +); +const AppDesignPanel = defineAsyncComponent( + () => import('#/components/form-editor/AppDesignPanel.vue'), +); + const props = defineProps<{ /** Agent 详情(可选,用于显示名称和欢迎配置) */ agent?: Agent | null; diff --git a/web/apps/web-ele/src/views/ai-platform/workflow/editor/components/ChatPanel.vue b/web/apps/web-ele/src/views/ai-platform/workflow/editor/components/ChatPanel.vue index fbcc835..2467403 100644 --- a/web/apps/web-ele/src/views/ai-platform/workflow/editor/components/ChatPanel.vue +++ b/web/apps/web-ele/src/views/ai-platform/workflow/editor/components/ChatPanel.vue @@ -1,15 +1,13 @@