refactor(测试计划): 测试计划详情-缺陷列表和执行历史tab一直显示
This commit is contained in:
parent
4e28744647
commit
2e8e11e13a
|
@ -283,7 +283,6 @@
|
||||||
name: TestPlanRouteEnum.TEST_PLAN_INDEX_DETAIL,
|
name: TestPlanRouteEnum.TEST_PLAN_INDEX_DETAIL,
|
||||||
query: {
|
query: {
|
||||||
id,
|
id,
|
||||||
isNew: 'true',
|
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -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
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue