Trim non-core workflow nodes

This commit is contained in:
2026-06-10 08:03:14 +08:00
parent 8b59efdf2c
commit 9d00248e6e
4 changed files with 28 additions and 324 deletions
@@ -11,7 +11,7 @@ import type {
SystemSummaryData,
} from '#/components/form-editor';
import { computed, onUnmounted, ref, watch } from 'vue';
import { computed, defineAsyncComponent, onUnmounted, ref, watch } from 'vue';
import { Settings2, X } from '@vben/icons';
import { $t } from '@vben/locales';
@@ -30,15 +30,33 @@ import {
runWorkflowStreamApi,
} from '#/api/ai-platform/ai-platform';
import { ChatBox } from '#/components/ChatBox/index';
import {
AppDesignPanel,
AppSettingsPanel,
DashboardBasicInfoConfirmPanel,
DashboardDesignConfirmPanel,
DashboardPublishConfirmPanel,
DesignEditorPanel,
SystemSummaryConfirmPanel,
} from '#/components/form-editor';
const DesignEditorPanel = defineAsyncComponent(() =>
import('#/components/form-editor').then((mod) => mod.DesignEditorPanel),
);
const AppDesignPanel = defineAsyncComponent(() =>
import('#/components/form-editor').then((mod) => mod.AppDesignPanel),
);
const AppSettingsPanel = defineAsyncComponent(() =>
import('#/components/form-editor').then((mod) => mod.AppSettingsPanel),
);
const DashboardBasicInfoConfirmPanel = defineAsyncComponent(() =>
import('#/components/form-editor').then(
(mod) => mod.DashboardBasicInfoConfirmPanel,
),
);
const DashboardDesignConfirmPanel = defineAsyncComponent(() =>
import('#/components/form-editor').then(
(mod) => mod.DashboardDesignConfirmPanel,
),
);
const DashboardPublishConfirmPanel = defineAsyncComponent(() =>
import('#/components/form-editor').then(
(mod) => mod.DashboardPublishConfirmPanel,
),
);
const SystemSummaryConfirmPanel = defineAsyncComponent(() =>
import('#/components/form-editor').then((mod) => mod.SystemSummaryConfirmPanel),
);
const props = defineProps<{
nodes: any[];
@@ -55,78 +55,12 @@ const components: Record<string, any> = {
// 循环节点
loop: defineAsyncComponent(() => import('../panels/LoopPanel.vue')),
// 表单节点
form_basic_info: defineAsyncComponent(
() => import('../panels/FormBasicInfoPanel.vue'),
),
form_database_design: defineAsyncComponent(
() => import('../panels/FormDatabaseDesignPanel.vue'),
),
form_database_create: defineAsyncComponent(
() => import('../panels/FormDatabaseCreatePanel.vue'),
),
form_ui_design: defineAsyncComponent(
() => import('../panels/FormUIDesignPanel.vue'),
),
form_list_design: defineAsyncComponent(
() => import('../panels/FormListDesignPanel.vue'),
),
form_create: defineAsyncComponent(
() => import('../panels/FormCreatePanel.vue'),
),
form_publish: defineAsyncComponent(
() => import('../panels/FormPublishPanel.vue'),
),
// 应用节点
app_create: defineAsyncComponent(
() => import('../panels/AppCreatePanel.vue'),
),
app_design: defineAsyncComponent(
() => import('../panels/AppDesignPanel.vue'),
),
app_settings: defineAsyncComponent(
() => import('../panels/AppSettingsPanel.vue'),
),
app_update: defineAsyncComponent(
() => import('../panels/AppUpdatePanel.vue'),
),
// 仪表盘节点
dashboard_basic_info: defineAsyncComponent(
() => import('../panels/DashboardBasicInfoPanel.vue'),
),
dashboard_design: defineAsyncComponent(
() => import('../panels/DashboardDesignPanel.vue'),
),
dashboard_create: defineAsyncComponent(
() => import('../panels/DashboardCreatePanel.vue'),
),
dashboard_publish: defineAsyncComponent(
() => import('../panels/DashboardPublishPanel.vue'),
),
// 系统总结节点
system_summary: defineAsyncComponent(
() => import('../panels/SystemSummaryPanel.vue'),
),
// 子流程节点
subflow: defineAsyncComponent(() => import('../panels/SubflowPanel.vue')),
// 表单数据节点
form_data_create: defineAsyncComponent(
() => import('../panels/FormDataPanel.vue'),
),
form_data_read: defineAsyncComponent(
() => import('../panels/FormDataPanel.vue'),
),
form_data_update: defineAsyncComponent(
() => import('../panels/FormDataPanel.vue'),
),
form_data_delete: defineAsyncComponent(
() => import('../panels/FormDataPanel.vue'),
),
form_data_list: defineAsyncComponent(
() => import('../panels/FormDataPanel.vue'),
),
form_schema_to_llm: defineAsyncComponent(
() => import('../panels/FormDataPanel.vue'),
),
// Text-to-SQL 节点
text_to_sql: defineAsyncComponent(
() => import('../panels/TextToSqlPanel.vue'),
@@ -20,7 +20,6 @@ import {
Bot,
Brain,
CircleHelp,
ClipboardCheck,
Clock,
Code,
Combine,
@@ -28,14 +27,11 @@ import {
Database,
DatabaseBackup,
DatabaseZap,
FilePlus,
FileText,
Fullscreen,
GitBranch,
GitFork,
Globe,
HelpCircle,
LayoutDashboard,
LayoutTemplate,
ListChecks,
Map,
@@ -46,16 +42,12 @@ import {
Plus,
Redo2,
RefreshCw,
Save,
Search,
Send,
Settings,
Snowflake,
Square,
TableProperties,
Trash2,
Undo2,
Upload,
Workflow,
} from '@vben/icons';
import { $t } from '@vben/locales';
@@ -93,32 +85,16 @@ import '@vue-flow/controls/dist/style.css';
const AiChatPanel = defineAsyncComponent(() =>
import('#/components/ai-chat-panel/AiChatPanel.vue'),
);
const AppCreateNode = defineAsyncComponent(() => import('./nodes/AppCreateNode.vue'));
const AppDesignNode = defineAsyncComponent(() => import('./nodes/AppDesignNode.vue'));
const AppSettingsNode = defineAsyncComponent(() => import('./nodes/AppSettingsNode.vue'));
const AppUpdateNode = defineAsyncComponent(() => import('./nodes/AppUpdateNode.vue'));
const ChoiceNode = defineAsyncComponent(() => import('./nodes/ChoiceNode.vue'));
const CodeNode = defineAsyncComponent(() => import('./nodes/CodeNode.vue'));
const ConditionNode = defineAsyncComponent(() => import('./nodes/ConditionNode.vue'));
const ConfirmNode = defineAsyncComponent(() => import('./nodes/ConfirmNode.vue'));
const DashboardBasicInfoNode = defineAsyncComponent(() => import('./nodes/DashboardBasicInfoNode.vue'));
const DashboardCreateNode = defineAsyncComponent(() => import('./nodes/DashboardCreateNode.vue'));
const DashboardDesignNode = defineAsyncComponent(() => import('./nodes/DashboardDesignNode.vue'));
const DashboardPublishNode = defineAsyncComponent(() => import('./nodes/DashboardPublishNode.vue'));
const DbDeleteNode = defineAsyncComponent(() => import('./nodes/DbDeleteNode.vue'));
const DbInsertNode = defineAsyncComponent(() => import('./nodes/DbInsertNode.vue'));
const DbQueryNode = defineAsyncComponent(() => import('./nodes/DbQueryNode.vue'));
const DbSqlNode = defineAsyncComponent(() => import('./nodes/DbSqlNode.vue'));
const DbUpdateNode = defineAsyncComponent(() => import('./nodes/DbUpdateNode.vue'));
const EndNode = defineAsyncComponent(() => import('./nodes/EndNode.vue'));
const FormBasicInfoNode = defineAsyncComponent(() => import('./nodes/FormBasicInfoNode.vue'));
const FormCreateNode = defineAsyncComponent(() => import('./nodes/FormCreateNode.vue'));
const FormDatabaseCreateNode = defineAsyncComponent(() => import('./nodes/FormDatabaseCreateNode.vue'));
const FormDatabaseDesignNode = defineAsyncComponent(() => import('./nodes/FormDatabaseDesignNode.vue'));
const FormDataNode = defineAsyncComponent(() => import('./nodes/FormDataNode.vue'));
const FormListDesignNode = defineAsyncComponent(() => import('./nodes/FormListDesignNode.vue'));
const FormPublishNode = defineAsyncComponent(() => import('./nodes/FormPublishNode.vue'));
const FormUIDesignNode = defineAsyncComponent(() => import('./nodes/FormUIDesignNode.vue'));
const HttpNode = defineAsyncComponent(() => import('./nodes/HttpNode.vue'));
const IntentNode = defineAsyncComponent(() => import('./nodes/IntentNode.vue'));
const KnowledgeRetrievalNode = defineAsyncComponent(() => import('./nodes/KnowledgeRetrievalNode.vue'));
@@ -132,7 +108,6 @@ const SnowflakeCortexAnalystNode = defineAsyncComponent(() => import('./nodes/Sn
const SnowflakeCortexLLMNode = defineAsyncComponent(() => import('./nodes/SnowflakeCortexLLMNode.vue'));
const StartNode = defineAsyncComponent(() => import('./nodes/StartNode.vue'));
const SubflowNode = defineAsyncComponent(() => import('./nodes/SubflowNode.vue'));
const SystemSummaryNode = defineAsyncComponent(() => import('./nodes/SystemSummaryNode.vue'));
const TemplateNode = defineAsyncComponent(() => import('./nodes/TemplateNode.vue'));
const TextToSqlNode = defineAsyncComponent(() => import('./nodes/TextToSqlNode.vue'));
@@ -189,34 +164,12 @@ const nodeTypes = {
// 循环节点
loop: markRaw(LoopNode),
// 表单节点
form_basic_info: markRaw(FormBasicInfoNode),
form_database_design: markRaw(FormDatabaseDesignNode),
form_database_create: markRaw(FormDatabaseCreateNode),
form_ui_design: markRaw(FormUIDesignNode),
form_list_design: markRaw(FormListDesignNode),
form_create: markRaw(FormCreateNode),
form_publish: markRaw(FormPublishNode),
// 应用管理节点
app_create: markRaw(AppCreateNode),
app_design: markRaw(AppDesignNode),
app_settings: markRaw(AppSettingsNode),
app_update: markRaw(AppUpdateNode),
// 仪表盘节点
dashboard_basic_info: markRaw(DashboardBasicInfoNode),
dashboard_design: markRaw(DashboardDesignNode),
dashboard_create: markRaw(DashboardCreateNode),
dashboard_publish: markRaw(DashboardPublishNode),
// 系统总结节点
system_summary: markRaw(SystemSummaryNode),
// 子流程节点
subflow: markRaw(SubflowNode),
// 表单数据节点
form_data_create: markRaw(FormDataNode),
form_data_read: markRaw(FormDataNode),
form_data_update: markRaw(FormDataNode),
form_data_delete: markRaw(FormDataNode),
form_data_list: markRaw(FormDataNode),
form_schema_to_llm: markRaw(FormDataNode),
// Text-to-SQL 节点
text_to_sql: markRaw(TextToSqlNode),
// 知识库节点
@@ -394,94 +347,6 @@ const nodeCategories = computed(() => [
},
],
},
{
name: $t('ai-platform.workflow.editor.categories.formDesign'),
nodes: [
{
type: 'form_basic_info',
label: getNodeLabel('form_basic_info'),
icon: 'FileText',
color: 'purple',
},
{
type: 'form_database_design',
label: getNodeLabel('form_database_design'),
icon: 'Database',
color: 'purple',
},
{
type: 'form_database_create',
label: getNodeLabel('form_database_create'),
icon: 'DatabaseZap',
color: 'purple',
},
{
type: 'form_ui_design',
label: getNodeLabel('form_ui_design'),
icon: 'LayoutTemplate',
color: 'purple',
},
{
type: 'form_list_design',
label: getNodeLabel('form_list_design'),
icon: 'TableProperties',
color: 'purple',
},
{
type: 'form_create',
label: getNodeLabel('form_create'),
icon: 'FilePlus',
color: 'purple',
},
{
type: 'form_publish',
label: getNodeLabel('form_publish'),
icon: 'Send',
color: 'purple',
},
],
},
{
name: $t('ai-platform.workflow.editor.categories.formData'),
nodes: [
{
type: 'form_data_create',
label: getNodeLabel('form_data_create'),
icon: 'FilePlus',
color: 'green',
},
{
type: 'form_data_read',
label: getNodeLabel('form_data_read'),
icon: 'FileText',
color: 'blue',
},
{
type: 'form_data_update',
label: getNodeLabel('form_data_update'),
icon: 'FileText',
color: 'orange',
},
{
type: 'form_data_delete',
label: getNodeLabel('form_data_delete'),
icon: 'Trash2',
color: 'red',
},
{
type: 'form_data_list',
label: getNodeLabel('form_data_list'),
icon: 'Search',
color: 'blue',
},
{
type: 'form_schema_to_llm',
label: getNodeLabel('form_schema_to_llm'),
icon: 'Code',
color: 'purple',
},
],
},
{
name: $t('ai-platform.workflow.editor.categories.dialog'),
nodes: [
@@ -616,72 +481,6 @@ const nodeCategories = computed(() => [
},
],
},
{
name: $t('ai-platform.workflow.editor.categories.appManage'),
nodes: [
{
type: 'app_create',
label: getNodeLabel('app_create'),
icon: 'LayoutTemplate',
color: 'indigo',
},
{
type: 'app_design',
label: getNodeLabel('app_design'),
icon: 'LayoutDashboard',
color: 'indigo',
},
{
type: 'app_settings',
label: getNodeLabel('app_settings'),
icon: 'Settings',
color: 'indigo',
},
{
type: 'app_update',
label: getNodeLabel('app_update'),
icon: 'Save',
color: 'indigo',
},
],
},
{
name: $t('ai-platform.workflow.editor.categories.dashboard'),
icon: 'LayoutDashboard',
color: 'cyan',
nodes: [
{
type: 'dashboard_basic_info',
label: getNodeLabel('dashboard_basic_info'),
icon: 'FileText',
color: 'cyan',
},
{
type: 'dashboard_design',
label: getNodeLabel('dashboard_design'),
icon: 'LayoutDashboard',
color: 'cyan',
},
{
type: 'dashboard_create',
label: getNodeLabel('dashboard_create'),
icon: 'FilePlus',
color: 'cyan',
},
{
type: 'dashboard_publish',
label: getNodeLabel('dashboard_publish'),
icon: 'Upload',
color: 'cyan',
},
{
type: 'system_summary',
label: getNodeLabel('system_summary'),
icon: 'ClipboardCheck',
color: 'cyan',
},
],
},
{
name: $t('ai-platform.workflow.editor.categories.knowledge'),
nodes: [
@@ -725,18 +524,10 @@ const iconComponents: Record<string, any> = {
RefreshCw,
CornerDownLeft,
// 表单节点图标
FileText,
TableProperties,
Send,
// 应用节点图标
LayoutDashboard,
Settings,
Save,
// 仪表盘节点图标
FilePlus,
Upload,
// 系统总结节点图标
ClipboardCheck,
// 子流程节点图标
Workflow,
// 知识库节点图标
@@ -2,32 +2,16 @@ import { defineAsyncComponent, markRaw } from 'vue';
import AddButtonEdge from '../editor/edges/AddButtonEdge.vue';
const AppCreateNode = defineAsyncComponent(() => import('../editor/nodes/AppCreateNode.vue'));
const AppDesignNode = defineAsyncComponent(() => import('../editor/nodes/AppDesignNode.vue'));
const AppSettingsNode = defineAsyncComponent(() => import('../editor/nodes/AppSettingsNode.vue'));
const AppUpdateNode = defineAsyncComponent(() => import('../editor/nodes/AppUpdateNode.vue'));
const ChoiceNode = defineAsyncComponent(() => import('../editor/nodes/ChoiceNode.vue'));
const CodeNode = defineAsyncComponent(() => import('../editor/nodes/CodeNode.vue'));
const ConditionNode = defineAsyncComponent(() => import('../editor/nodes/ConditionNode.vue'));
const ConfirmNode = defineAsyncComponent(() => import('../editor/nodes/ConfirmNode.vue'));
const DashboardBasicInfoNode = defineAsyncComponent(() => import('../editor/nodes/DashboardBasicInfoNode.vue'));
const DashboardCreateNode = defineAsyncComponent(() => import('../editor/nodes/DashboardCreateNode.vue'));
const DashboardDesignNode = defineAsyncComponent(() => import('../editor/nodes/DashboardDesignNode.vue'));
const DashboardPublishNode = defineAsyncComponent(() => import('../editor/nodes/DashboardPublishNode.vue'));
const DbDeleteNode = defineAsyncComponent(() => import('../editor/nodes/DbDeleteNode.vue'));
const DbInsertNode = defineAsyncComponent(() => import('../editor/nodes/DbInsertNode.vue'));
const DbQueryNode = defineAsyncComponent(() => import('../editor/nodes/DbQueryNode.vue'));
const DbSqlNode = defineAsyncComponent(() => import('../editor/nodes/DbSqlNode.vue'));
const DbUpdateNode = defineAsyncComponent(() => import('../editor/nodes/DbUpdateNode.vue'));
const EndNode = defineAsyncComponent(() => import('../editor/nodes/EndNode.vue'));
const FormBasicInfoNode = defineAsyncComponent(() => import('../editor/nodes/FormBasicInfoNode.vue'));
const FormCreateNode = defineAsyncComponent(() => import('../editor/nodes/FormCreateNode.vue'));
const FormDatabaseCreateNode = defineAsyncComponent(() => import('../editor/nodes/FormDatabaseCreateNode.vue'));
const FormDatabaseDesignNode = defineAsyncComponent(() => import('../editor/nodes/FormDatabaseDesignNode.vue'));
const FormDataNode = defineAsyncComponent(() => import('../editor/nodes/FormDataNode.vue'));
const FormListDesignNode = defineAsyncComponent(() => import('../editor/nodes/FormListDesignNode.vue'));
const FormPublishNode = defineAsyncComponent(() => import('../editor/nodes/FormPublishNode.vue'));
const FormUIDesignNode = defineAsyncComponent(() => import('../editor/nodes/FormUIDesignNode.vue'));
const HttpNode = defineAsyncComponent(() => import('../editor/nodes/HttpNode.vue'));
const IntentNode = defineAsyncComponent(() => import('../editor/nodes/IntentNode.vue'));
const KnowledgeRetrievalNode = defineAsyncComponent(() => import('../editor/nodes/KnowledgeRetrievalNode.vue'));
@@ -41,7 +25,6 @@ const SnowflakeCortexAnalystNode = defineAsyncComponent(() => import('../editor/
const SnowflakeCortexLLMNode = defineAsyncComponent(() => import('../editor/nodes/SnowflakeCortexLLMNode.vue'));
const StartNode = defineAsyncComponent(() => import('../editor/nodes/StartNode.vue'));
const SubflowNode = defineAsyncComponent(() => import('../editor/nodes/SubflowNode.vue'));
const SystemSummaryNode = defineAsyncComponent(() => import('../editor/nodes/SystemSummaryNode.vue'));
const TemplateNode = defineAsyncComponent(() => import('../editor/nodes/TemplateNode.vue'));
const TextToSqlNode = defineAsyncComponent(() => import('../editor/nodes/TextToSqlNode.vue'));
@@ -68,29 +51,7 @@ export const workflowNodeTypes = {
snowflake_cortex_llm: markRaw(SnowflakeCortexLLMNode),
snowflake_cortex_analyst: markRaw(SnowflakeCortexAnalystNode),
loop: markRaw(LoopNode),
form_basic_info: markRaw(FormBasicInfoNode),
form_database_design: markRaw(FormDatabaseDesignNode),
form_database_create: markRaw(FormDatabaseCreateNode),
form_ui_design: markRaw(FormUIDesignNode),
form_list_design: markRaw(FormListDesignNode),
form_create: markRaw(FormCreateNode),
form_publish: markRaw(FormPublishNode),
app_create: markRaw(AppCreateNode),
app_design: markRaw(AppDesignNode),
app_settings: markRaw(AppSettingsNode),
app_update: markRaw(AppUpdateNode),
dashboard_basic_info: markRaw(DashboardBasicInfoNode),
dashboard_design: markRaw(DashboardDesignNode),
dashboard_create: markRaw(DashboardCreateNode),
dashboard_publish: markRaw(DashboardPublishNode),
system_summary: markRaw(SystemSummaryNode),
subflow: markRaw(SubflowNode),
form_data_create: markRaw(FormDataNode),
form_data_read: markRaw(FormDataNode),
form_data_update: markRaw(FormDataNode),
form_data_delete: markRaw(FormDataNode),
form_data_list: markRaw(FormDataNode),
form_schema_to_llm: markRaw(FormDataNode),
text_to_sql: markRaw(TextToSqlNode),
knowledge_retrieval: markRaw(KnowledgeRetrievalNode),
};