From cbe159d1b781c5ccb8fc5142137f12f277673a0a Mon Sep 17 00:00:00 2001 From: "xinxin.wu" Date: Mon, 24 Jun 2024 09:59:01 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=B5=8B=E8=AF=95=E8=AE=A1=E5=88=92):=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=B5=8B=E8=AF=95=E8=AE=A1=E5=88=92=E6=8A=A5?= =?UTF-8?q?=E5=91=8A=E6=98=8E=E7=BB=86tab?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../report/detail/component/planDetail.vue | 75 +++++++++---------- 1 file changed, 34 insertions(+), 41 deletions(-) diff --git a/frontend/src/views/test-plan/report/detail/component/planDetail.vue b/frontend/src/views/test-plan/report/detail/component/planDetail.vue index 2faabaf241..d86d1a4df1 100644 --- a/frontend/src/views/test-plan/report/detail/component/planDetail.vue +++ b/frontend/src/views/test-plan/report/detail/component/planDetail.vue @@ -331,49 +331,42 @@ const apiCaseTotal = computed(() => getSummaryDetail(detail.value.apiCaseCount).caseTotal); const scenarioCaseTotal = computed(() => getSummaryDetail(detail.value.apiScenarioCount).caseTotal); - const getFunctionalTab = computed(() => { - return functionalCaseTotal.value - ? [ - { - value: 'featureCase', - label: t('report.detail.featureCaseDetails'), - }, - ] - : []; - }); - - const getApiTab = computed(() => { - return apiCaseTotal.value - ? [ - { - value: 'apiCase', - label: t('report.detail.apiCaseDetails'), - }, - ] - : []; - }); - - const getScenarioTab = computed(() => { - return scenarioCaseTotal.value - ? [ - { - value: 'scenarioCase', - label: t('report.detail.scenarioCaseDetails'), - }, - ] - : []; - }); + const featureCaseTab = [ + { + value: 'featureCase', + label: t('report.detail.featureCaseDetails'), + }, + ]; + const scenarioCaseTab = [ + { + value: 'scenarioCase', + label: t('report.detail.scenarioCaseDetails'), + }, + ]; + const apiCaseTab = [ + { + value: 'apiCase', + label: t('report.detail.apiCaseDetails'), + }, + ]; const activeTab = ref('bug'); - const contentTabList = ref([ - { - value: 'bug', - label: t('report.detail.bugDetails'), - }, - ...getFunctionalTab.value, - ...getApiTab.value, - ...getScenarioTab.value, - ]); + + const contentTabList = computed(() => { + const featureTab = functionalCaseTotal.value ? featureCaseTab : []; + const apiTab = apiCaseTotal.value ? apiCaseTab : []; + const scenarioTab = scenarioCaseTotal.value ? scenarioCaseTab : []; + + return [ + { + value: 'bug', + label: t('report.detail.bugDetails'), + }, + ...featureTab, + ...apiTab, + ...scenarioTab, + ]; + }); const cardCount = computed(() => { const totalList = [functionalCaseTotal.value, apiCaseTotal.value, scenarioCaseTotal.value];