feat: 优化工作流字段化参数配置

- 开始节点固定 user_input 并区分系统入口与自定义参数

- LLM 与知识库节点切换为字段值加上游引用配置

- 单节点调试改为字段预览与上游引用输入模式
This commit is contained in:
2026-04-12 20:31:02 +08:00
parent 47655a728b
commit 8cfe5400fe
24 changed files with 2785 additions and 792 deletions

View File

@@ -4,6 +4,7 @@ import { useRoute } from 'vue-router';
import { usePreferences } from '@easyflow/preferences';
import { getOptions, sortNodes } from '@easyflow/utils';
import { Tinyflow } from '@tinyflow-ai/vue';
import {
ArrowLeft,
@@ -11,7 +12,6 @@ import {
Close,
Promotion,
} from '@element-plus/icons-vue';
import { Tinyflow } from '@tinyflow-ai/vue';
import {
ElButton,
ElDrawer,
@@ -37,6 +37,11 @@ import WorkflowSteps from '#/views/ai/workflow/components/WorkflowSteps.vue';
import { getCustomNode } from './customNode/index';
import nodeNames from './customNode/nodeNames';
import {
createInitialWorkflowData,
isWorkflowDataEmpty,
normalizeWorkflowStartNodes,
} from '../../../../../packages/tinyflow-ui/src/utils/workflowNodeFields';
import '@tinyflow-ai/vue/dist/index.css';
@@ -348,9 +353,10 @@ async function handleSave(showMsg: boolean = false): Promise<boolean> {
}
saveLoading.value = true;
try {
const content = normalizeWorkflowStartNodes(tinyflowRef.value?.getData());
const res = await api.post('/api/v1/workflow/update', {
id: workflowId.value,
content: tinyflowRef.value?.getData(),
content,
});
if (res.errorCode === 0 && showMsg) {
ElMessage.success(res.message);
@@ -365,9 +371,12 @@ async function handleSave(showMsg: boolean = false): Promise<boolean> {
async function getWorkflowInfo(workflowId: any) {
return api.get(`/api/v1/workflow/detail?id=${workflowId}`).then((res) => {
workflowInfo.value = res.data;
tinyFlowData.value = workflowInfo.value.content
const parsedContent = workflowInfo.value.content
? JSON.parse(workflowInfo.value.content)
: {};
tinyFlowData.value = isWorkflowDataEmpty(parsedContent)
? createInitialWorkflowData()
: parsedContent;
syncNavTitle(workflowInfo.value?.title || '');
});
}
@@ -406,7 +415,7 @@ async function runCheck(
stage: WorkflowCheckStage,
silentPass: boolean = false,
) {
const content = tinyflowRef.value?.getData();
const content = normalizeWorkflowStartNodes(tinyflowRef.value?.getData());
if (!content) {
ElMessage.error($t('aiWorkflow.checkContentEmpty'));
return false;