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 47edcac..7971104 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 @@ -32,6 +32,11 @@ import { import { AiWorkingAnimation } from '#/components/ai-loading'; import { ChatBox } from '#/components/ChatBox'; import { + AppDesignPanel, + AppSettingsPanel, + DashboardBasicInfoConfirmPanel, + DashboardDesignConfirmPanel, + DashboardPublishConfirmPanel, DesignEditorPanel, SystemSummaryConfirmPanel, } from '#/components/form-editor'; @@ -192,6 +197,21 @@ const pendingMessage = ref(''); const showDesignPanel = ref(false); const currentDesign = ref(undefined); +const showAppDesignPanel = ref(false); +const currentAppDesign = ref(undefined); + +const showAppSettingsPanel = ref(false); +const currentAppSettings = ref(undefined); + +const showDashboardBasicInfoPanel = ref(false); +const currentDashboardBasicInfo = ref(undefined); + +const showDashboardDesignPanel = ref(false); +const currentDashboardDesign = ref(undefined); + +const showDashboardPublishPanel = ref(false); +const currentDashboardPublish = ref(undefined); + const showSystemSummaryPanel = ref(false); const currentSystemSummary = ref(undefined); @@ -203,6 +223,11 @@ const loadingAnimationTitle = ref('AI 正在开发...'); const hasAnyDesignPanelOpen = computed( () => showDesignPanel.value || + showAppDesignPanel.value || + showAppSettingsPanel.value || + showDashboardBasicInfoPanel.value || + showDashboardDesignPanel.value || + showDashboardPublishPanel.value || showSystemSummaryPanel.value || showLoadingAnimation.value, ); @@ -253,6 +278,31 @@ const handleDesignPreview = (data: DesignPreviewData) => { showLoadingAnimation.value = false; switch (data.type) { + case 'app_design': { + currentAppDesign.value = data; + showAppDesignPanel.value = true; + break; + } + case 'app_settings': { + currentAppSettings.value = data; + showAppSettingsPanel.value = true; + break; + } + case 'dashboard_basic_info': { + currentDashboardBasicInfo.value = data; + showDashboardBasicInfoPanel.value = true; + break; + } + case 'dashboard_design': { + currentDashboardDesign.value = data; + showDashboardDesignPanel.value = true; + break; + } + case 'dashboard_publish': { + currentDashboardPublish.value = data; + showDashboardPublishPanel.value = true; + break; + } case 'system_summary': { currentSystemSummary.value = data; showSystemSummaryPanel.value = true; @@ -757,6 +807,68 @@ const handleDesignClose = createDesignCloseHandler( currentDesign, ); +const handleAppDesignConfirm = createDesignConfirmHandler( + showAppDesignPanel, + currentAppDesign, + '确认应用设计', +); +const handleAppDesignClose = createDesignCloseHandler( + showAppDesignPanel, + currentAppDesign, +); + +const handleAppSettingsConfirm = createDesignConfirmHandler( + showAppSettingsPanel, + currentAppSettings, + '确认应用设置', +); +const handleAppSettingsClose = createDesignCloseHandler( + showAppSettingsPanel, + currentAppSettings, +); + +const handleDashboardBasicInfoConfirm = createDesignConfirmHandler( + showDashboardBasicInfoPanel, + currentDashboardBasicInfo, + '确认仪表盘基础信息', +); +const handleDashboardBasicInfoClose = createDesignCloseHandler( + showDashboardBasicInfoPanel, + currentDashboardBasicInfo, +); + +const handleDashboardDesignConfirm = createDesignConfirmHandler( + showDashboardDesignPanel, + currentDashboardDesign, + '确认仪表盘设计', +); +const handleDashboardDesignClose = createDesignCloseHandler( + showDashboardDesignPanel, + currentDashboardDesign, +); + +const handleDashboardPublishConfirm = (data: Record) => { + showDashboardPublishPanel.value = false; + currentDashboardPublish.value = undefined; + + const userMsg: ChatMessage = { + id: generateId(), + role: 'user', + content: `发布到菜单:${data.menu_name || data.name || ''}`, + timestamp: new Date(), + }; + messages.value.push(userMsg); + + waitingForInput.value = false; + waitingConfig.value = null; + + resumeExecution(JSON.stringify(data)); +}; +const handleDashboardPublishClose = createDesignCloseHandler( + showDashboardPublishPanel, + currentDashboardPublish, +); + const handleSystemSummaryConfirm = createDesignConfirmHandler( showSystemSummaryPanel, currentSystemSummary, @@ -902,6 +1014,51 @@ onUnmounted(() => { @close="handleDesignClose" /> + + + + + + + + + + { @close="handleDesignClose" /> + + + + + + + + + + ; nodeId: string; data_sources?: any[]; + form_fields?: any[]; schema_fields?: any[]; + table_configs?: any[]; layoutOptions?: any[]; themeOptions?: any[]; } diff --git a/web/apps/web-ele/src/components/form-editor/index.ts b/web/apps/web-ele/src/components/form-editor/index.ts index d746efc..8cf9a69 100644 --- a/web/apps/web-ele/src/components/form-editor/index.ts +++ b/web/apps/web-ele/src/components/form-editor/index.ts @@ -20,5 +20,10 @@ export type PageEditorData = PreviewData; export type PagePublishInfo = PreviewData; export type SystemSummaryData = PreviewData; +export const AppDesignPanel = DesignPreviewDialog; +export const AppSettingsPanel = DesignPreviewDialog; +export const DashboardBasicInfoConfirmPanel = DesignPreviewDialog; +export const DashboardDesignConfirmPanel = DesignPreviewDialog; +export const DashboardPublishConfirmPanel = DesignPreviewDialog; export const DesignEditorPanel = DesignPreviewDialog; export const SystemSummaryConfirmPanel = DesignPreviewDialog;