From c7aa5750cfbdd2d4e2d08eb1d80ae6c5c65aae96 Mon Sep 17 00:00:00 2001 From: lx991218 <317035359@qq.com> Date: Mon, 26 Aug 2024 15:59:10 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E6=89=93=E5=8D=B0=E5=8C=B9=E9=85=8D?= =?UTF-8?q?=E5=AF=B9=E5=BA=94=E8=8A=82=E7=82=B9=E8=A1=A8=E5=8D=95=E6=95=B0?= =?UTF-8?q?=E6=8D=AEbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Config/Components/PrintNode/printTemplate/Template1.tsx | 5 ++++- .../Config/Components/PrintNode/printTemplate/drafts.tsx | 4 +++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/components/Common/FlowDesign/Config/Components/PrintNode/printTemplate/Template1.tsx b/src/components/Common/FlowDesign/Config/Components/PrintNode/printTemplate/Template1.tsx index 62611368b..bd8f8e452 100644 --- a/src/components/Common/FlowDesign/Config/Components/PrintNode/printTemplate/Template1.tsx +++ b/src/components/Common/FlowDesign/Config/Components/PrintNode/printTemplate/Template1.tsx @@ -260,7 +260,10 @@ const Template1: FC = ({ printData, current, loading, styleTemplate, pri const type = attrsObj['valueType']; const curData = current.instanceData?.data || []; const attrXfieldId: string = attrsObj['xfield']?.name.split('-')[0]; - const fieldAfter = curData[attrXfieldId] ? curData[attrXfieldId][0]?.after : []; + const fieldAfter = curData[attrXfieldId] + ? curData[attrXfieldId].filter((i) => i.nodeId == current.instanceData?.node.id)[0] + ?.after + : []; const fieldValue = fieldAfter[0]?.[attrsObj['id']]; useEffect(() => { if (type === '用户型') { diff --git a/src/components/Common/FlowDesign/Config/Components/PrintNode/printTemplate/drafts.tsx b/src/components/Common/FlowDesign/Config/Components/PrintNode/printTemplate/drafts.tsx index 8a4b3037a..78775b845 100644 --- a/src/components/Common/FlowDesign/Config/Components/PrintNode/printTemplate/drafts.tsx +++ b/src/components/Common/FlowDesign/Config/Components/PrintNode/printTemplate/drafts.tsx @@ -246,7 +246,9 @@ const Template1: FC = ({ const type = attrsObj['valueType']; const curData = instanceData?.data || []; const attrXfieldId: string = attrsObj['xfield']?.name.split('-')[0]; - const fieldAfter = curData[attrXfieldId] ? curData[attrXfieldId][0]?.after : []; + const fieldAfter = curData[attrXfieldId] + ? curData[attrXfieldId].filter((i) => i.nodeId == instanceData?.node.id)[0]?.after + : []; const fieldValue = fieldAfter[0]?.[attrsObj['id']]; useEffect(() => { -- Gitee