From dcfe0864dd8831ff38d54c4387377526db93665b Mon Sep 17 00:00:00 2001 From: wangdan-fit2cloud Date: Sat, 5 Sep 2026 19:12:21 +0800 Subject: [PATCH] feat: ai node --- .../assets/workflow/icon_image-generate.svg | 5 + .../assets/workflow/icon_image-understand.svg | 4 + .../assets/workflow/icon_image_to_video.svg | 5 + ui/src/assets/workflow/icon_question.svg | 3 + .../assets/workflow/icon_speech_to_text.svg | 10 + .../assets/workflow/icon_text_to_speech.svg | 10 + ui/src/assets/workflow/icon_text_to_video.svg | 5 + .../assets/workflow/icon_video-understand.svg | 3 + ui/src/components/COMPONENT_README.md | 4 +- .../markdown-editor/MdEditorMagnify.vue | 28 +- .../global/markdown-editor/md-editor.scss | 2 +- ui/src/styles/tailwind.css | 1 + ui/src/styles/variables.scss | 1 + .../application/ApplicationWorkflowView.vue | 76 +--- ui/src/workflow-canvas/WORKFLOW_README.md | 32 +- ui/src/workflow-canvas/config/node-data.ts | 152 ++++---- ui/src/workflow-canvas/core/NodeCascader.vue | 8 +- .../icons/image-generate-node-icon.vue | 4 +- .../icons/image-to-video-node-icon.vue | 6 + .../icons/image-understand-node-icon.vue | 4 +- .../icons/intent-node-icon.vue | 2 +- .../icons/question-node-icon.vue | 4 +- .../icons/speech-to-text-node-icon.vue | 4 +- .../icons/text-to-speech-node-icon.vue | 4 +- .../icons/text-to-video-node-icon.vue | 4 +- .../icons/video-understand-node-icon.vue | 6 + .../PromptGenerateDialog.vue | 0 .../ReasoningSettingDialog.vue | 2 +- .../component/history-setting/index.vue | 43 --- .../component/prompt-setting/index.vue | 81 ---- .../component/reasoning-setting/index.vue | 40 -- .../component/result-setting/index.vue | 28 -- .../component/vision-setting/index.vue | 83 ---- .../nodes/ai-chat-node/index.vue | 247 ++++++++---- .../base-node/component/file-upload/index.vue | 2 +- .../component/long-term-memory/index.vue | 2 +- .../nodes/image-generate-node/index.vue | 243 +++++++----- .../nodes/image-to-video-node/index.ts | 15 + .../nodes/image-to-video-node/index.vue | 260 +++++++++++++ .../nodes/image-understand-node/index.vue | 362 ++++++++++++------ .../nodes/intent-node/index.vue | 46 +-- .../nodes/question-node/index.vue | 288 ++++++++------ .../nodes/reply-node/index.vue | 23 +- .../nodes/speech-to-text-node/index.vue | 205 ++++++---- .../nodes/text-to-speech-node/index.vue | 194 ++++++---- .../nodes/text-to-video-node/index.vue | 243 +++++++----- .../nodes/tool-custom-node/index.vue | 14 +- .../nodes/tool-lib-node/index.vue | 12 +- .../nodes/video-understand-node/index.ts | 15 + .../nodes/video-understand-node/index.vue | 302 +++++++++++++++ 50 files changed, 2023 insertions(+), 1114 deletions(-) create mode 100644 ui/src/assets/workflow/icon_image-generate.svg create mode 100644 ui/src/assets/workflow/icon_image-understand.svg create mode 100644 ui/src/assets/workflow/icon_image_to_video.svg create mode 100644 ui/src/assets/workflow/icon_question.svg create mode 100644 ui/src/assets/workflow/icon_speech_to_text.svg create mode 100644 ui/src/assets/workflow/icon_text_to_speech.svg create mode 100644 ui/src/assets/workflow/icon_text_to_video.svg create mode 100644 ui/src/assets/workflow/icon_video-understand.svg create mode 100644 ui/src/workflow-canvas/icons/image-to-video-node-icon.vue create mode 100644 ui/src/workflow-canvas/icons/video-understand-node-icon.vue rename ui/src/workflow-canvas/nodes/ai-chat-node/component/{prompt-setting => }/PromptGenerateDialog.vue (100%) rename ui/src/workflow-canvas/nodes/ai-chat-node/component/{reasoning-setting => }/ReasoningSettingDialog.vue (97%) delete mode 100644 ui/src/workflow-canvas/nodes/ai-chat-node/component/history-setting/index.vue delete mode 100644 ui/src/workflow-canvas/nodes/ai-chat-node/component/prompt-setting/index.vue delete mode 100644 ui/src/workflow-canvas/nodes/ai-chat-node/component/reasoning-setting/index.vue delete mode 100644 ui/src/workflow-canvas/nodes/ai-chat-node/component/result-setting/index.vue delete mode 100644 ui/src/workflow-canvas/nodes/ai-chat-node/component/vision-setting/index.vue create mode 100644 ui/src/workflow-canvas/nodes/image-to-video-node/index.ts create mode 100644 ui/src/workflow-canvas/nodes/image-to-video-node/index.vue create mode 100644 ui/src/workflow-canvas/nodes/video-understand-node/index.ts create mode 100644 ui/src/workflow-canvas/nodes/video-understand-node/index.vue diff --git a/ui/src/assets/workflow/icon_image-generate.svg b/ui/src/assets/workflow/icon_image-generate.svg new file mode 100644 index 00000000000..e59aa52c419 --- /dev/null +++ b/ui/src/assets/workflow/icon_image-generate.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/ui/src/assets/workflow/icon_image-understand.svg b/ui/src/assets/workflow/icon_image-understand.svg new file mode 100644 index 00000000000..72126d84092 --- /dev/null +++ b/ui/src/assets/workflow/icon_image-understand.svg @@ -0,0 +1,4 @@ + + + + diff --git a/ui/src/assets/workflow/icon_image_to_video.svg b/ui/src/assets/workflow/icon_image_to_video.svg new file mode 100644 index 00000000000..1cfa2a8c65f --- /dev/null +++ b/ui/src/assets/workflow/icon_image_to_video.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/ui/src/assets/workflow/icon_question.svg b/ui/src/assets/workflow/icon_question.svg new file mode 100644 index 00000000000..afa97360f1e --- /dev/null +++ b/ui/src/assets/workflow/icon_question.svg @@ -0,0 +1,3 @@ + + + diff --git a/ui/src/assets/workflow/icon_speech_to_text.svg b/ui/src/assets/workflow/icon_speech_to_text.svg new file mode 100644 index 00000000000..4bc269ff007 --- /dev/null +++ b/ui/src/assets/workflow/icon_speech_to_text.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/ui/src/assets/workflow/icon_text_to_speech.svg b/ui/src/assets/workflow/icon_text_to_speech.svg new file mode 100644 index 00000000000..05c5bfa15cd --- /dev/null +++ b/ui/src/assets/workflow/icon_text_to_speech.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/ui/src/assets/workflow/icon_text_to_video.svg b/ui/src/assets/workflow/icon_text_to_video.svg new file mode 100644 index 00000000000..2de496fd6c6 --- /dev/null +++ b/ui/src/assets/workflow/icon_text_to_video.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/ui/src/assets/workflow/icon_video-understand.svg b/ui/src/assets/workflow/icon_video-understand.svg new file mode 100644 index 00000000000..14f32ae2b02 --- /dev/null +++ b/ui/src/assets/workflow/icon_video-understand.svg @@ -0,0 +1,3 @@ + + + diff --git a/ui/src/components/COMPONENT_README.md b/ui/src/components/COMPONENT_README.md index b17e56c4fc2..7fab00daeef 100644 --- a/ui/src/components/COMPONENT_README.md +++ b/ui/src/components/COMPONENT_README.md @@ -206,7 +206,9 @@ Element Plus 使用 `ElOnlyChild` 处理浮层触发器。`el-tooltip`、`el-pop 基于 `md-editor-v3` 的全局自动注册组件。三个组件统一使用 User Store 中的当前语言,并为繁体中文 加载 `zh-TW` 语言包;底层组件的 Props 和事件通过 `$attrs` 透传。`MdEditor` 默认关闭 Prettier, 并透传 `defFooters` 插槽;`MdEditorMagnify` 在无工具栏编辑器的页脚提供放大按钮,弹窗中点击确定 -才会写回内容并触发 `submitDialog`,取消或关闭弹窗会丢弃本次弹窗编辑;`MdPreview` 默认关闭代码 +才会写回内容并触发 `submitDialog`,取消或关闭弹窗会丢弃本次弹窗编辑。组件位于配置了字段和规则的 +`el-form-item` 中时,会像 `el-input` 一样按 `change`、`blur` 触发规则校验;未配置字段或规则时跳过, +传入 `:validate-event="false"` 可关闭自动校验。`MdPreview` 默认关闭代码 折叠。Admin 和 Chat 入口统一调用 `configureMarkdownEditor()`,将代码高亮、全屏、KaTeX、图片裁剪、Mermaid、ECharts 和 Prettier 配置为本地实例,避免运行时加载 CDN 资源;`md-editor-v3` v6 的图标已随依赖打包,不再维护或加载 diff --git a/ui/src/components/global/markdown-editor/MdEditorMagnify.vue b/ui/src/components/global/markdown-editor/MdEditorMagnify.vue index 6b8ec2ae68a..cc932bf0402 100644 --- a/ui/src/components/global/markdown-editor/MdEditorMagnify.vue +++ b/ui/src/components/global/markdown-editor/MdEditorMagnify.vue @@ -1,18 +1,28 @@