From 97e38804a867ffbabbea739b1d8971bc24d20ea9 Mon Sep 17 00:00:00 2001 From: teukkk Date: Fri, 9 Aug 2024 15:32:15 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=B5=8B=E8=AF=95=E8=AE=A1=E5=88=92):=20?= =?UTF-8?q?=E6=89=A7=E8=A1=8C=E8=84=91=E5=9B=BE-=E7=94=A8=E4=BE=8B?= =?UTF-8?q?=E7=9A=84=E5=AE=9E=E9=99=85=E7=BB=93=E6=9E=9C=E5=8F=AA=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E4=B8=8D=E6=96=B0=E5=A2=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../testPlanFeatureCaseMinder/index.vue | 22 ++++++------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/frontend/src/components/business/ms-minders/testPlanFeatureCaseMinder/index.vue b/frontend/src/components/business/ms-minders/testPlanFeatureCaseMinder/index.vue index 1f77bd825c..85b7c4cab1 100644 --- a/frontend/src/components/business/ms-minders/testPlanFeatureCaseMinder/index.vue +++ b/frontend/src/components/business/ms-minders/testPlanFeatureCaseMinder/index.vue @@ -543,21 +543,13 @@ // 执行 const executeVisible = ref(false); - // 新增或更新用例的实际结果节点 + // 更新用例的实际结果节点 function updateCaseActualResultNode(node: MinderJsonNode, content: string) { - let actualResultNode; - actualResultNode = node.children?.find((item: MinderJsonNode) => item.data?.id === `actualResult-${node.data?.id}`); + const actualResultNode = node.children?.find((item: MinderJsonNode) => + item.data?.resource?.includes(actualResultTag) + ); if (actualResultNode) { - actualResultNode - .setData('resource', [actualResultTag]) - .setData('text', content ?? '') - .render(); - } else { - actualResultNode = createNode( - { resource: [actualResultTag], text: content ?? '', id: `actualResult-${node.data?.id}` }, - node - ); - handleRenderNode(node, [actualResultNode]); + actualResultNode.setData('text', content ?? '').render(); } } // 点击模块/用例执行 @@ -567,7 +559,7 @@ if (resource?.includes(caseTag)) { // 用例添加标签 window.minder.execCommand('resource', [executionResultMap[status].statusText, caseTag]); - // 新增或更新用例的实际结果节点 + // 更新用例的实际结果节点 updateCaseActualResultNode(selectNode.value, content); // 更新执行历史 if (extraVisible.value && activeExtraKey.value === 'history') { @@ -638,7 +630,7 @@ function submitStepExecuteDone(status: string, content: string) { // 用例更新标签 caseNodeAboveSelectStep.value.setData('resource', [executionResultMap[status].statusText, caseTag]).render(); - // 新增或更新用例的实际结果节点 + // 更新用例的实际结果节点 updateCaseActualResultNode(caseNodeAboveSelectStep.value, content); // 更新步骤数据:标签和实际结果 caseNodeAboveSelectStep.value.children.forEach((child: MinderJsonNode) => {