From ee5120c6edcf1de0e5a996d552da890bd89c5cbe Mon Sep 17 00:00:00 2001 From: 2910410219 <2910410219@qq.com> Date: Thu, 20 Aug 2026 14:48:28 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A6=96=E9=A1=B5=E6=89=A7=E8=A1=8C=E5=B7=A5?= =?UTF-8?q?=E4=BD=9C=E6=B5=81=EF=BC=9A=E8=B4=B4=E7=89=87=E6=A8=A1=E6=9D=BF?= =?UTF-8?q?=E5=86=99=E5=85=A5=E5=BC=80=E5=90=AF=E8=B4=B4=E7=89=87=E5=B8=83?= =?UTF-8?q?=E5=B1=80=E7=9A=84=E8=8A=82=E7=82=B9=E5=86=85=E9=83=A8=EF=BC=88?= =?UTF-8?q?=E4=B8=8E=20modelConfig=20=E5=B9=B3=E7=BA=A7=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - templates 不再放 flowContent 最外层,改为写入 patchLayout===true 的节点内部(数组),后端执行从节点读取 - 删除 detail.flowContent 可能遗留的顶层 templates,统一走节点 Co-Authored-By: Claude --- src/views/home/index.vue | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/src/views/home/index.vue b/src/views/home/index.vue index 3c03e62..7acdf36 100644 --- a/src/views/home/index.vue +++ b/src/views/home/index.vue @@ -1025,13 +1025,17 @@ const runWorkflow = async ( const nodeInputParams = JSON.parse(JSON.stringify(detail.nodeInputParams || [])); applyHomeFormValues(nodeInputParams, opts.formValues, opts.formFileNames); - // 2. 构建 flowContent - const updatedFlowContent = { - ...detail.flowContent, - nodes: nodeInputParams, - // 贴片模板:表单卡片编辑后随提交回传(后端从 flowContent.templates 读取,空数组也如实提交表示清空) - ...(Array.isArray(opts.templates) ? { templates: opts.templates } : {}), - }; + // 贴片模板写入开启贴片布局的节点内部(与 modelConfig 平级,数组),后端执行从节点读取; + // 空数组也如实写入表示清空;无贴片节点的模板不写 + if (Array.isArray(opts.templates)) { + nodeInputParams.forEach((n: any) => { + if (n.patchLayout === true) n.templates = opts.templates; + }); + } + + // 构建 flowContent:templates 不再放最外层(删除 detail.flowContent 可能遗留的顶层 templates,统一走节点) + const updatedFlowContent: any = { ...detail.flowContent, nodes: nodeInputParams }; + delete updatedFlowContent.templates; // 3. 工作流模型由后端按 flow 配置决定,无需前端取模型 id(普通对话取模型见 runChat)