fix(测试计划): 执行历史过滤无数据 tab

This commit is contained in:
baiqi 2024-12-12 11:30:03 +08:00 committed by Craftsman
parent 2dd779df42
commit ce6e544309
1 changed files with 6 additions and 4 deletions

View File

@ -280,8 +280,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();
@ -339,8 +339,6 @@
] as Description[], ] as Description[],
...res, ...res,
}; };
activePlanCaseTotal.value = res.apiCaseTotal;
activePlanScenarioTotal.value = res.apiScenarioTotal;
if (res.childPlans.length) { if (res.childPlans.length) {
detail.value.description.push({ detail.value.description.push({
label: t('testPlan.testPlanIndex.testPlan'), label: t('testPlan.testPlanIndex.testPlan'),
@ -350,8 +348,12 @@
testPlanGroups.value = res.childPlans.map((item) => ({ testPlanGroups.value = res.childPlans.map((item) => ({
value: item.id, value: item.id,
label: item.name, label: item.name,
apiCaseTotal: item.apiCaseTotal,
apiScenarioTotal: item.apiScenarioTotal,
})); }));
activePlan.value = res.childPlans[0]?.id; activePlan.value = res.childPlans[0]?.id;
activePlanCaseTotal.value = res.childPlans[0]?.apiCaseTotal;
activePlanScenarioTotal.value = res.childPlans[0]?.apiScenarioTotal;
} else { } else {
testPlanGroups.value = []; testPlanGroups.value = [];
activePlanCaseTotal.value = res.childPlans[0]?.apiCaseTotal; activePlanCaseTotal.value = res.childPlans[0]?.apiCaseTotal;