refactor(测试计划): 测试计划详情-缺陷列表和执行历史tab一直显示

This commit is contained in:
teukkk 2024-06-19 14:15:38 +08:00 committed by 刘瑞斌
parent 4e28744647
commit 2e8e11e13a
2 changed files with 2 additions and 8 deletions

View File

@ -283,7 +283,6 @@
name: TestPlanRouteEnum.TEST_PLAN_INDEX_DETAIL, name: TestPlanRouteEnum.TEST_PLAN_INDEX_DETAIL,
query: { query: {
id, id,
isNew: 'true',
}, },
}); });
} }

View File

@ -305,15 +305,10 @@
} }
const activeTab = ref('plan'); const activeTab = ref('plan');
const showBugAndExecTab = ref(route.query.isNew !== 'true'); // [/]tab
watch( watch(
() => detail.value, () => detail.value,
() => { () => {
const { functionalCaseCount, apiCaseCount, apiScenarioCount } = detail.value || {}; const { functionalCaseCount, apiCaseCount, apiScenarioCount } = detail.value || {};
// ,[/],,tab
if (functionalCaseCount || apiCaseCount || apiScenarioCount) {
showBugAndExecTab.value = true;
}
if ( if (
(!functionalCaseCount && activeTab.value === 'featureCase') || (!functionalCaseCount && activeTab.value === 'featureCase') ||
(!apiCaseCount && activeTab.value === 'apiCase') || (!apiCaseCount && activeTab.value === 'apiCase') ||
@ -348,12 +343,12 @@
{ {
value: 'defectList', value: 'defectList',
label: t('caseManagement.featureCase.defectList'), // label: t('caseManagement.featureCase.defectList'), //
show: showBugAndExecTab.value, show: true,
}, },
{ {
value: 'executeHistory', value: 'executeHistory',
label: t('testPlan.featureCase.executionHistory'), // label: t('testPlan.featureCase.executionHistory'), //
show: showBugAndExecTab.value, show: true,
}, },
].filter((tab) => tab.show); // tab ].filter((tab) => tab.show); // tab
}); });