diff --git a/ui/src/workflow-canvas/component/NodeMenu.vue b/ui/src/workflow-canvas/component/NodeMenu.vue index 429acbb1d82..4be12bcbb38 100644 --- a/ui/src/workflow-canvas/component/NodeMenu.vue +++ b/ui/src/workflow-canvas/component/NodeMenu.vue @@ -7,7 +7,9 @@ import { WorkflowNodeType } from '@/workflow-canvas/types' defineOptions({ name: 'NodeMenu' }) -const emit = defineEmits<{ select: [nodeType: WorkflowNodeType] }>() +const emit = defineEmits<{ + select: [nodeType: WorkflowNodeType] +}>() type WorkflowComponentTab = 'basic' | 'tool' | 'application' @@ -21,9 +23,60 @@ const workflowComponentTabs: Array<{ label: string; value: WorkflowComponentTab ] const workflowComponentOptions = [ - { icon: aiChatIcon, iconClass: 'bg-primary-gradient', label: 'AI 对话', value: WorkflowNodeType.AiChat }, - { icon: replyIcon, iconClass: 'bg-warning', label: '指定回复', value: WorkflowNodeType.Reply }, -] satisfies Array<{ icon: string; iconClass: string; label: string; value: WorkflowNodeType }> + { + icon: aiChatIcon, + iconClass: 'bg-primary-gradient', + label: 'AI 对话', + value: WorkflowNodeType.AiChat, + }, + { + icon: aiChatIcon, + iconClass: 'bg-primary-gradient', + label: '意图识别', + value: WorkflowNodeType.IntentNode, + }, + // { + // icon: aiChatIcon, + // iconClass: 'bg-primary-gradient', + // label: '文本转语音', + // value: WorkflowNodeType.TextToSpeechNode, + // }, + // { + // icon: aiChatIcon, + // iconClass: 'bg-primary-gradient', + // label: '语音转文本', + // value: WorkflowNodeType.SpeechToTextNode, + // }, + // { + // icon: aiChatIcon, + // iconClass: 'bg-primary-gradient', + // label: '图片生成', + // value: WorkflowNodeType.ImageGenerateNode, + // }, + // { + // icon: aiChatIcon, + // iconClass: 'bg-primary-gradient', + // label: '图片理解', + // value: WorkflowNodeType.ImageUnderstandNode, + // }, + // { + // icon: aiChatIcon, + // iconClass: 'bg-primary-gradient', + // label: '问题优化', + // value: WorkflowNodeType.Question, + // }, + { + icon: replyIcon, + iconClass: 'bg-warning', + label: '指定回复', + value: WorkflowNodeType.Reply, + }, +] satisfies Array<{ + icon: string + iconClass: string + label: string + value: WorkflowNodeType +}> const filteredComponentOptions = computed(() => { if (activeTab.value !== 'basic') return [] @@ -31,12 +84,19 @@ const filteredComponentOptions = computed(() => { const keyword = searchKeyword.value.trim().toLocaleLowerCase() if (!keyword) return workflowComponentOptions - return workflowComponentOptions.filter((componentOption) => componentOption.label.toLocaleLowerCase().includes(keyword)) + return workflowComponentOptions.filter((componentOption) => + componentOption.label.toLocaleLowerCase().includes(keyword), + ) })