From 7211563978ad0bdc0ed42b5454f3a48494991adc Mon Sep 17 00:00:00 2001 From: "xinxin.wu" Date: Thu, 19 Dec 2024 14:39:21 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E5=B7=A5=E4=BD=9C=E5=8F=B0):=20=E5=B7=A5?= =?UTF-8?q?=E4=BD=9C=E5=8F=B0=E6=B5=8B=E8=AF=95=E8=AE=A1=E5=88=92=E5=8D=A1?= =?UTF-8?q?=E7=89=87=E6=96=B0=E5=A2=9E=E6=9F=A5=E8=AF=A2=E5=BD=92=E6=A1=A3?= =?UTF-8?q?=E7=8A=B6=E6=80=81=E9=80=9A=E8=BF=87/=E6=9C=AA=E9=80=9A?= =?UTF-8?q?=E8=BF=87=E8=B7=B3=E8=BD=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/config/testPlan.ts | 2 +- frontend/src/config/workbench.ts | 6 +++ frontend/src/enums/workbenchEnum.ts | 2 + .../components/recycle/case/caseTable.vue | 1 - .../homePage/components/passRatePie.vue | 19 +++++--- .../homePage/components/testPlanCount.vue | 47 ++++++++++++++++++- 6 files changed, 67 insertions(+), 10 deletions(-) diff --git a/frontend/src/config/testPlan.ts b/frontend/src/config/testPlan.ts index 1b1402907c..a982b36c75 100644 --- a/frontend/src/config/testPlan.ts +++ b/frontend/src/config/testPlan.ts @@ -157,7 +157,7 @@ export const toolTipConfig: TooltipOption = { appendTo: 'body', formatter(params: any) { const html = ` -
+
-
-
{{ item.label }}
-
- {{ hasPermission ? addCommasToNumber(item.value as number) : '-' }} -
+
+ +
{{ item.label }}
+
+
+ {{ hasPermission ? addCommasToNumber(item.value as number) : '-' }} +
+
+
@@ -44,6 +48,7 @@ value: number | string; status?: string; route?: string; + archivedPassed?: number; }[]; }>(); @@ -67,8 +72,8 @@ @apply flex items-center gap-2; .pass-rate-count { font-size: 20px; - color: rgb(var(--primary-4)); - @apply cursor-pointer font-medium; + gap: 8px; + @apply flex cursor-pointer items-center justify-start font-medium; } } } diff --git a/frontend/src/views/workbench/homePage/components/testPlanCount.vue b/frontend/src/views/workbench/homePage/components/testPlanCount.vue index aa3ed88593..1b027e83bc 100644 --- a/frontend/src/views/workbench/homePage/components/testPlanCount.vue +++ b/frontend/src/views/workbench/homePage/components/testPlanCount.vue @@ -29,7 +29,22 @@ :has-permission="hasPermission" :options="tabItem.options" :value-list="tabItem.valueList" - /> + > + +
@@ -59,7 +74,9 @@ import { workTestPlanRage } from '@/api/modules/workbench'; import getVisualThemeColor from '@/config/chartTheme'; import { useI18n } from '@/hooks/useI18n'; + import useOpenNewPage from '@/hooks/useOpenNewPage'; import useAppStore from '@/store/modules/app'; + import { addCommasToNumber } from '@/utils'; import type { SelectedCardItem, @@ -67,9 +84,12 @@ WorkTestPlanDetail, WorkTestPlanRageDetail, } from '@/models/workbench/homePage'; + import { WorkNavValueEnum } from '@/enums/workbenchEnum'; import { colorMapConfig, handlePieData, handleUpdateTabPie } from '../utils'; + const { openNewPage } = useOpenNewPage(); + const { t } = useI18n(); const appStore = useAppStore(); @@ -155,10 +175,12 @@ { name: t('workbench.homePage.havePassed'), count: passed, + archivedPassed: 0, }, { name: t('workbench.homePage.notPass'), count: notPassed, + archivedPassed: 0, }, ]; @@ -249,6 +271,24 @@ }); } + function goNavigation( + item: { label: string; value: number | string; status?: string; route?: string }, + index: number, + isArchived = false + ) { + let status; + if (isArchived) { + status = index === 0 ? WorkNavValueEnum.TEST_PLAN_PASSED_ARCHIVED : WorkNavValueEnum.TEST_PLAN_NOT_PASS_ARCHIVED; + } else { + status = item.status; + } + + openNewPage(item.route, { + pId: projectId.value, + home: status, + }); + } + onMounted(() => { initTestPlanCount(); }); @@ -296,4 +336,9 @@ :deep(.arco-tabs-tab) { padding: 0 !important; } + .pass-rate-count-archived { + font-size: 20px; + gap: 8px; + @apply grid cursor-pointer grid-cols-2 font-medium; + }