From 4d74dd2d63d97e027f29f666521634661f89847d Mon Sep 17 00:00:00 2001 From: 2910410219 <2910410219@qq.com> Date: Thu, 20 Aug 2026 17:54:33 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=A6=96=E9=A1=B5=E5=AF=B9?= =?UTF-8?q?=E8=AF=9D=E5=9B=9E=E6=98=BE=E4=B8=AD=E8=B4=B4=E7=89=87=E6=A8=A1?= =?UTF-8?q?=E6=9D=BF=E6=9C=AA=E6=81=A2=E5=A4=8D=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 贴片模板提交时写入 patchLayout 节点的内部 templates 字段并删除顶层, 回显恢复逻辑仅从顶层读取导致模板丢失;现优先从 nodeInputParams 中 patchLayout 节点的 templates 恢复,顶层旧位置作为兼容兜底。 Co-Authored-By: Claude --- src/views/home/components/WorkflowFormCard.vue | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/views/home/components/WorkflowFormCard.vue b/src/views/home/components/WorkflowFormCard.vue index 0194e2c..e70ded8 100644 --- a/src/views/home/components/WorkflowFormCard.vue +++ b/src/views/home/components/WorkflowFormCard.vue @@ -400,8 +400,15 @@ watch( Object.keys(formFileNames).forEach((key) => delete formFileNames[key]); Object.keys(uploadingFields).forEach((key) => delete uploadingFields[key]); // 尝试从执行详情恢复贴片模板 + // 提交路径:templates 写入开启贴片布局的节点内部(patchLayout === true 的 node.templates),顶层已删除; + // 回显时 detail.nodeInputParams 即提交时的 nodes,从该处优先恢复;兼容旧数据(extension / detail / flowContent 顶层) + const patchNodes = Array.isArray(detail?.nodeInputParams) + ? (detail.nodeInputParams as any[]).filter((n: any) => n.patchLayout === true && Array.isArray(n.templates)) + : []; + const nodeTemplates = patchNodes[0]?.templates; const ext = (detail as any)?.extension; - const restoredTemplates = ext?.templates || (detail as any)?.templates || detail?.flowContent?.templates || []; + const restoredTemplates = + nodeTemplates || ext?.templates || (detail as any)?.templates || detail?.flowContent?.templates || []; templates.value = Array.isArray(restoredTemplates) ? restoredTemplates : []; if (!detail?.nodeInputParams) return;