Revert "Replace heavy design panels with preview drawer"

This reverts commit 0398d5956c.
This commit is contained in:
2026-06-10 11:25:49 +08:00
parent 0398d5956c
commit eab0a8f5cb
4 changed files with 245 additions and 165 deletions
@@ -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,10 +31,31 @@ import {
import { AiWorkingAnimation } from '#/components/ai-loading';
import { ChatBox } from '#/components/ChatBox';
import DesignPreviewPanel from './DesignPreviewPanel.vue';
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<AiChatPanelProps>(), {
mode: 'workflow',
@@ -996,59 +1017,66 @@ onUnmounted(() => {
/>
<!-- 设计编辑面板 -->
<DesignPreviewPanel
<DesignEditorPanel
v-if="showDesignPanel"
v-model:visible="showDesignPanel"
:preview="currentDesign as any"
:visible="showDesignPanel"
:design="currentDesign as any"
@update:visible="showDesignPanel = $event"
@confirm="handleDesignConfirm"
@close="handleDesignClose"
/>
<DesignPreviewPanel
<AppDesignPanel
v-if="showAppDesignPanel"
v-model:visible="showAppDesignPanel"
:preview="currentAppDesign as any"
:visible="showAppDesignPanel"
:design="currentAppDesign as any"
@update:visible="showAppDesignPanel = $event"
@confirm="handleAppDesignConfirm"
@close="handleAppDesignClose"
/>
<DesignPreviewPanel
<AppSettingsPanel
v-if="showAppSettingsPanel"
v-model:visible="showAppSettingsPanel"
:preview="currentAppSettings as any"
:visible="showAppSettingsPanel"
:settings="currentAppSettings as any"
@update:visible="showAppSettingsPanel = $event"
@confirm="handleAppSettingsConfirm"
@close="handleAppSettingsClose"
/>
<DesignPreviewPanel
<DashboardBasicInfoConfirmPanel
v-if="showDashboardBasicInfoPanel"
v-model:visible="showDashboardBasicInfoPanel"
:preview="currentDashboardBasicInfo as any"
:visible="showDashboardBasicInfoPanel"
:basic-info="currentDashboardBasicInfo as any"
@update:visible="showDashboardBasicInfoPanel = $event"
@confirm="handleDashboardBasicInfoConfirm"
@close="handleDashboardBasicInfoClose"
/>
<DesignPreviewPanel
<DashboardDesignConfirmPanel
v-if="showDashboardDesignPanel"
v-model:visible="showDashboardDesignPanel"
:preview="currentDashboardDesign as any"
:visible="showDashboardDesignPanel"
:design="currentDashboardDesign as any"
@update:visible="showDashboardDesignPanel = $event"
@confirm="handleDashboardDesignConfirm"
@close="handleDashboardDesignClose"
/>
<DesignPreviewPanel
<DashboardPublishConfirmPanel
v-if="showDashboardPublishPanel"
v-model:visible="showDashboardPublishPanel"
:preview="currentDashboardPublish as any"
:visible="showDashboardPublishPanel"
:publish-data="currentDashboardPublish as any"
@update:visible="showDashboardPublishPanel = $event"
@confirm="handleDashboardPublishConfirm"
@close="handleDashboardPublishClose"
/>
<!-- 系统总结面板 -->
<DesignPreviewPanel
<SystemSummaryConfirmPanel
v-if="showSystemSummaryPanel"
v-model:visible="showSystemSummaryPanel"
:preview="currentSystemSummary as any"
:visible="showSystemSummaryPanel"
:data="currentSystemSummary as any"
@update:visible="showSystemSummaryPanel = $event"
@confirm="handleSystemSummaryConfirm"
@close="handleSystemSummaryClose"
/>
@@ -1056,51 +1084,58 @@ onUnmounted(() => {
<!-- 侧边栏布局时的设计面板(保持原有行为) -->
<template v-if="layout === 'sidebar'">
<DesignPreviewPanel
v-model:visible="showDesignPanel"
:preview="currentDesign as any"
<DesignEditorPanel
:visible="showDesignPanel"
:design="currentDesign as any"
@update:visible="showDesignPanel = $event"
@confirm="handleDesignConfirm"
@close="handleDesignClose"
/>
<DesignPreviewPanel
v-model:visible="showAppDesignPanel"
:preview="currentAppDesign as any"
<AppDesignPanel
:visible="showAppDesignPanel"
:design="currentAppDesign as any"
@update:visible="showAppDesignPanel = $event"
@confirm="handleAppDesignConfirm"
@close="handleAppDesignClose"
/>
<DesignPreviewPanel
v-model:visible="showAppSettingsPanel"
:preview="currentAppSettings as any"
<AppSettingsPanel
:visible="showAppSettingsPanel"
:settings="currentAppSettings as any"
@update:visible="showAppSettingsPanel = $event"
@confirm="handleAppSettingsConfirm"
@close="handleAppSettingsClose"
/>
<DesignPreviewPanel
v-model:visible="showDashboardBasicInfoPanel"
:preview="currentDashboardBasicInfo as any"
<DashboardBasicInfoConfirmPanel
:visible="showDashboardBasicInfoPanel"
:basic-info="currentDashboardBasicInfo as any"
@update:visible="showDashboardBasicInfoPanel = $event"
@confirm="handleDashboardBasicInfoConfirm"
@close="handleDashboardBasicInfoClose"
/>
<DesignPreviewPanel
v-model:visible="showDashboardDesignPanel"
:preview="currentDashboardDesign as any"
<DashboardDesignConfirmPanel
:visible="showDashboardDesignPanel"
:design="currentDashboardDesign as any"
@update:visible="showDashboardDesignPanel = $event"
@confirm="handleDashboardDesignConfirm"
@close="handleDashboardDesignClose"
/>
<DesignPreviewPanel
v-model:visible="showDashboardPublishPanel"
:preview="currentDashboardPublish as any"
<DashboardPublishConfirmPanel
:visible="showDashboardPublishPanel"
:publish-data="currentDashboardPublish as any"
@update:visible="showDashboardPublishPanel = $event"
@confirm="handleDashboardPublishConfirm"
@close="handleDashboardPublishClose"
/>
<DesignPreviewPanel
v-model:visible="showSystemSummaryPanel"
:preview="currentSystemSummary as any"
<SystemSummaryConfirmPanel
:visible="showSystemSummaryPanel"
:data="currentSystemSummary as any"
@update:visible="showSystemSummaryPanel = $event"
@confirm="handleSystemSummaryConfirm"
@close="handleSystemSummaryClose"
/>