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;