From f6960a1ce62d88bb4128a094b587428e06f30581 Mon Sep 17 00:00:00 2001 From: JY <1140938202@qq.com> Date: Fri, 18 Jul 2025 10:14:16 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E4=BF=AE=E6=94=B9=E5=AD=90=E8=A1=A8?= =?UTF-8?q?=E8=B5=8B=E5=80=BC=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../FlowDesign/Config/Components/FormBinding/index.tsx | 1 + src/ts/base/model.ts | 4 ++++ src/ts/core/work/index.ts | 7 +++++-- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/components/Common/FlowDesign/Config/Components/FormBinding/index.tsx b/src/components/Common/FlowDesign/Config/Components/FormBinding/index.tsx index d09cdb0c0..c965bf7dc 100644 --- a/src/components/Common/FlowDesign/Config/Components/FormBinding/index.tsx +++ b/src/components/Common/FlowDesign/Config/Components/FormBinding/index.tsx @@ -107,6 +107,7 @@ const FormBinding: React.FC = (props) => { ...forms.map((item) => { return { id: item.id, + primaryId: item.primaryId, typeName: props.formType, allowAdd: false, allowEdit: false, diff --git a/src/ts/base/model.ts b/src/ts/base/model.ts index 93ad351e5..0bd3b0fcf 100644 --- a/src/ts/base/model.ts +++ b/src/ts/base/model.ts @@ -826,6 +826,8 @@ export type InstanceDataModel = { export type InstanceFormInfo = { // 表单Id id: string; + // 表单主Id + primaryId:string; // 表单编号 code: string; // 表单类型: 表单、表格 @@ -1191,6 +1193,8 @@ export interface WorkDocumentConfig { export type FormInfo = { // 表单Id id: string; + // 主Id + primaryId: string; // 类型 typeName: string; // 允许新增 diff --git a/src/ts/core/work/index.ts b/src/ts/core/work/index.ts index 13bec984a..e0355367c 100644 --- a/src/ts/core/work/index.ts +++ b/src/ts/core/work/index.ts @@ -486,14 +486,17 @@ export class Work extends Version implements IWork { if (form.attributes.find((a) => a.options && a.options.isNative) != undefined) { data.isNew = false; } - if (pdata && pdata.data[form.id]) { - const after = pdata.data[form.id]?.at(-1); + const matchedForm = pdata?.forms?.find(f => f.primaryId === form.metadata?.primaryId); + const formId = matchedForm?.id || form.id; + if (pdata && pdata.data[formId]) { + const after = pdata.data[formId]?.at(-1); if (after) { data.data[form.id] = [{ ...after, nodeId: this.node!.id }]; } } data.forms.push({ id: form.id, + primaryId: form.metadata.primaryId, code: form.code, typeName: form.typeName, dataCollName: form.metadata.collName ?? '_system-things', -- Gitee