fix(任务中心): 测试计划执行结果

This commit is contained in:
baiqi 2024-12-16 10:23:10 +08:00 committed by Craftsman
parent 75b3871e1a
commit ada7ddffdd
2 changed files with 11 additions and 13 deletions

View File

@ -180,7 +180,7 @@
}, },
{ {
name: t('report.detail.testPlanCaseTotal'), name: t('report.detail.testPlanCaseTotal'),
value: detail.value.caseTotal, value: detail.value.apiCaseTotal,
unit: t('report.detail.number'), unit: t('report.detail.number'),
icon: 'case_total', icon: 'case_total',
}, },
@ -324,8 +324,8 @@
) { ) {
const plan = testPlanGroups.value.find((item) => item.value === value); const plan = testPlanGroups.value.find((item) => item.value === value);
if (plan) { if (plan) {
activePlanCaseTotal.value = plan.caseTotal; activePlanCaseTotal.value = plan.apiCaseTotal;
activePlanScenarioTotal.value = plan.scenarioTotal; activePlanScenarioTotal.value = plan.apiScenarioTotal;
activeTable.value = activePlanCaseTotal.value > 0 ? 'case' : 'scenario'; activeTable.value = activePlanCaseTotal.value > 0 ? 'case' : 'scenario';
nextTick(() => { nextTick(() => {
searchList(); searchList();
@ -353,21 +353,20 @@
loading.value = true; loading.value = true;
const res = await getTestPlanResult(props.id); const res = await getTestPlanResult(props.id);
detail.value = res; detail.value = res;
activePlanCaseTotal.value = res.caseTotal;
activePlanScenarioTotal.value = res.scenarioTotal;
if (res.children?.length) { if (res.children?.length) {
testPlanGroups.value = res.children.map((item: any) => ({ testPlanGroups.value = res.children.map((item: any) => ({
value: item.id, value: item.id,
label: item.name, label: item.name,
caseTotal: item.caseTotal, apiCaseTotal: item.apiCaseTotal,
scenarioTotal: item.scenarioTotal, apiScenarioTotal: item.apiScenarioTotal,
})); }));
activePlan.value = res.children[0]?.id; activePlan.value = res.children[0]?.id;
activePlanCaseTotal.value = res.children[0]?.apiCaseTotal;
activePlanScenarioTotal.value = res.children[0]?.apiScenarioTotal;
} else { } else {
testPlanGroups.value = []; testPlanGroups.value = [];
activePlanCaseTotal.value = res.children[0]?.caseTotal; activePlanCaseTotal.value = res.apiCaseTotal;
activePlanScenarioTotal.value = res.children[0]?.scenarioTotal; activePlanScenarioTotal.value = res.apiScenarioTotal;
activeTable.value = activePlanCaseTotal.value > 0 ? 'case' : 'scenario';
} }
activeTable.value = activePlanCaseTotal.value > 0 ? 'case' : 'scenario'; activeTable.value = activePlanCaseTotal.value > 0 ? 'case' : 'scenario';
nextTick(() => { nextTick(() => {

View File

@ -356,9 +356,8 @@
activePlanScenarioTotal.value = res.childPlans[0]?.apiScenarioTotal; activePlanScenarioTotal.value = res.childPlans[0]?.apiScenarioTotal;
} else { } else {
testPlanGroups.value = []; testPlanGroups.value = [];
activePlanCaseTotal.value = res.childPlans[0]?.apiCaseTotal; activePlanCaseTotal.value = res.apiCaseTotal;
activePlanScenarioTotal.value = res.childPlans[0]?.apiScenarioTotal; activePlanScenarioTotal.value = res.apiScenarioTotal;
activeTable.value = activePlanCaseTotal.value > 0 ? 'case' : 'scenario';
} }
activeTable.value = activePlanCaseTotal.value > 0 ? 'case' : 'scenario'; activeTable.value = activePlanCaseTotal.value > 0 ? 'case' : 'scenario';
searchList(); searchList();