diff --git a/frontend/src/views/case-management/caseManagementFeature/components/tabContent/tabTestPlan.vue b/frontend/src/views/case-management/caseManagementFeature/components/tabContent/tabTestPlan.vue
index a07a9dd9ff..1b3e7e6b6c 100644
--- a/frontend/src/views/case-management/caseManagementFeature/components/tabContent/tabTestPlan.vue
+++ b/frontend/src/views/case-management/caseManagementFeature/components/tabContent/tabTestPlan.vue
@@ -17,7 +17,8 @@
{{ record.testPlanNum }}
-
+
+ -
@@ -45,9 +46,10 @@
import MsStatusTag from '@/components/business/ms-status-tag/index.vue';
import { getLinkedCaseTestPlanList } from '@/api/modules/case-management/featureCase';
+ import { getPlanPassRate } from '@/api/modules/test-plan/testPlan';
import { useI18n } from '@/hooks/useI18n';
- import { AssociateFunctionalCaseItem, planStatusType } from '@/models/testPlan/testPlan';
+ import { AssociateFunctionalCaseItem, PassRateCountDetail, planStatusType } from '@/models/testPlan/testPlan';
import { TestPlanRouteEnum } from '@/enums/routeEnum';
import { TableKeyEnum } from '@/enums/tableEnum';
import { FilterSlotNameEnum } from '@/enums/tableFilterEnum';
@@ -107,10 +109,11 @@
title: 'caseManagement.featureCase.planStatus',
slotName: 'planStatus',
dataIndex: 'planStatus',
- filterConfig: {
- options: planStatusOptions.value,
- filterSlotName: FilterSlotNameEnum.TEST_PLAN_STATUS_FILTER,
- },
+ // TODO : 这个版本先不上过滤后台没有做
+ // filterConfig: {
+ // options: planStatusOptions.value,
+ // filterSlotName: FilterSlotNameEnum.TEST_PLAN_STATUS_FILTER,
+ // },
width: 200,
},
{
@@ -188,6 +191,38 @@
}
);
+ const defaultCountDetailMap = ref>({});
+
+ function getStatus(id: string) {
+ return defaultCountDetailMap.value[id]?.status;
+ }
+
+ // 获取状态统计
+ async function getStatistics(selectedPlanIds: (string | undefined)[]) {
+ try {
+ const result = await getPlanPassRate(selectedPlanIds);
+ result.forEach((item: PassRateCountDetail) => {
+ defaultCountDetailMap.value[item.id] = item;
+ });
+ } catch (error) {
+ // eslint-disable-next-line no-console
+ console.log(error);
+ }
+ }
+
+ watch(
+ () => propsRes.value.data,
+ (val) => {
+ if (val) {
+ const selectedPlanIds: (string | undefined)[] = propsRes.value.data.map((e) => e.testPlanId) || [];
+ getStatistics(selectedPlanIds);
+ }
+ },
+ {
+ deep: true,
+ }
+ );
+
onMounted(() => {
initData();
});