From 5bc0ca72ea22fd167b2bc8de75de963eda02b296 Mon Sep 17 00:00:00 2001 From: teukkk Date: Thu, 1 Aug 2024 15:10:42 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=B5=8B=E8=AF=95=E8=AE=A1=E5=88=92):=20?= =?UTF-8?q?=E8=84=91=E5=9B=BE=E6=89=A7=E8=A1=8C=E7=94=A8=E4=BE=8B-?= =?UTF-8?q?=E8=B0=83=E6=95=B4=E6=AD=A5=E9=AA=A4=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../testPlanFeatureCaseMinder/index.vue | 23 +++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/frontend/src/components/business/ms-minders/testPlanFeatureCaseMinder/index.vue b/frontend/src/components/business/ms-minders/testPlanFeatureCaseMinder/index.vue index 9e15a46d24..d3d848671b 100644 --- a/frontend/src/components/business/ms-minders/testPlanFeatureCaseMinder/index.vue +++ b/frontend/src/components/business/ms-minders/testPlanFeatureCaseMinder/index.vue @@ -628,6 +628,11 @@ function cancelStepExecute() { executeForm.value = { ...defaultExecuteForm }; } + /** + * 步骤/用例执行后 更新脑图数据 + * @param status 用例执行状态 + * @param content 用例实际结果内容 + */ function submitStepExecuteDone(status: string, content: string) { // 用例更新标签 caseNodeAboveSelectStep.value.setData('resource', [executionResultMap[status].statusText, caseTag]).render(); @@ -645,6 +650,9 @@ }); caseNodeAboveSelectStep.value.layout(); } + /** + * 步骤/用例执行 + */ async function submitStepExecute() { try { submitStepExecuteLoading.value = true; @@ -655,7 +663,18 @@ id: caseNodeAboveSelectStep.value.data.id, ...executeForm.value, notifier: executeForm.value?.commentIds?.join(';'), - stepsExecResult: JSON.stringify(stepData.value), + stepsExecResult: JSON.stringify( + stepData.value.map((item, index) => { + return { + id: item.id, + num: index, + desc: item.step, + result: item.expected, + actualResult: item.actualResult, + executeResult: item.executeResult, + }; + }) + ), }; await runFeatureCase(params); stepExecuteModelVisible.value = false; @@ -748,7 +767,7 @@ // 点步骤描述下的【步骤描述/预期结果/实际结果】标签 if ([actualResultTag, stepTag, stepExpectTag].some((item) => node.data?.resource?.includes(item))) { caseNodeAboveSelectStep.value = getCaseNodeWithResource(node, stepTag); - if (caseNodeAboveSelectStep.value.data.id) { + if (caseNodeAboveSelectStep.value?.data?.id) { getStepData(caseNodeAboveSelectStep.value.data.id); stepExecuteModelVisible.value = true; }