fix(测试计划): 修复测试计划报告明细展示测试计划名称和用例需跳转详情

This commit is contained in:
xinxin.wu 2024-07-18 17:33:38 +08:00 committed by 刘瑞斌
parent cd6083ee7e
commit 889fecd1ee
5 changed files with 38 additions and 3 deletions

View File

@ -17,6 +17,7 @@ export interface FeatureCaseItem {
executeUserName: string; executeUserName: string;
bugCount: number; bugCount: number;
reportId: string; reportId: string;
projectId: string;
} }
export interface UpdateReportDetailParams { export interface UpdateReportDetailParams {

View File

@ -135,6 +135,7 @@ const functionalList: FeatureCaseItem = {
executeUserName: '', executeUserName: '',
bugCount: 0, bugCount: 0,
reportId: '', reportId: '',
projectId: '',
}; };
// 缺陷明细 // 缺陷明细
const bugList: ReportBugItem = { const bugList: ReportBugItem = {

View File

@ -72,9 +72,10 @@
shareId?: string; shareId?: string;
activeType: ReportCardTypeEnum; activeType: ReportCardTypeEnum;
isPreview?: boolean; isPreview?: boolean;
isGroup?: boolean;
}>(); }>();
const columns: MsTableColumn = [ const staticColumns: MsTableColumn = [
{ {
title: 'ID', title: 'ID',
dataIndex: 'num', dataIndex: 'num',
@ -112,6 +113,16 @@
width: 150, width: 150,
showDrag: true, showDrag: true,
}, },
];
const testPlanNameColumns: MsTableColumn = [
{
title: 'report.plan.name',
dataIndex: 'planName',
showTooltip: true,
width: 200,
},
];
const lastStaticColumns: MsTableColumn = [
{ {
title: 'common.belongModule', title: 'common.belongModule',
dataIndex: 'moduleName', dataIndex: 'moduleName',
@ -135,15 +146,22 @@
}, },
]; ];
const columns = computed(() => {
if (props.isGroup) {
return [...staticColumns, ...testPlanNameColumns, ...lastStaticColumns];
}
return [...staticColumns, ...lastStaticColumns];
});
const useApiTable = useTable(getApiPage, { const useApiTable = useTable(getApiPage, {
scroll: { x: '100%' }, scroll: { x: '100%' },
columns, columns: columns.value,
showSelectorAll: false, showSelectorAll: false,
showSetting: false, showSetting: false,
}); });
const useScenarioTable = useTable(getScenarioPage, { const useScenarioTable = useTable(getScenarioPage, {
scroll: { x: '100%' }, scroll: { x: '100%' },
columns, columns: columns.value,
showSelectorAll: false, showSelectorAll: false,
showSetting: false, showSetting: false,
}); });

View File

@ -1,5 +1,8 @@
<template> <template>
<MsBaseTable v-bind="propsRes" v-on="propsEvent"> <MsBaseTable v-bind="propsRes" v-on="propsEvent">
<template #num="{ record }">
<MsButton :disabled="!props.isPreview" type="text" @click="toDetail(record)">{{ record.num }}</MsButton>
</template>
<template #caseLevel="{ record }"> <template #caseLevel="{ record }">
<CaseLevel :case-level="record.priority" /> <CaseLevel :case-level="record.priority" />
</template> </template>
@ -46,15 +49,19 @@
getReportShareFeatureCaseList, getReportShareFeatureCaseList,
} from '@/api/modules/test-plan/report'; } from '@/api/modules/test-plan/report';
import { useI18n } from '@/hooks/useI18n'; import { useI18n } from '@/hooks/useI18n';
import useOpenNewPage from '@/hooks/useOpenNewPage';
import { FeatureCaseItem } from '@/models/testPlan/report'; import { FeatureCaseItem } from '@/models/testPlan/report';
import type { ExecuteHistoryItem } from '@/models/testPlan/testPlan'; import type { ExecuteHistoryItem } from '@/models/testPlan/testPlan';
import { CaseManagementRouteEnum } from '@/enums/routeEnum';
import { FilterSlotNameEnum } from '@/enums/tableFilterEnum'; import { FilterSlotNameEnum } from '@/enums/tableFilterEnum';
import { ReportCardTypeEnum } from '@/enums/testPlanReportEnum'; import { ReportCardTypeEnum } from '@/enums/testPlanReportEnum';
import { executionResultMap } from '@/views/case-management/caseManagementFeature/components/utils'; import { executionResultMap } from '@/views/case-management/caseManagementFeature/components/utils';
import { detailTableExample } from '@/views/test-plan/report/detail/component/reportConfig'; import { detailTableExample } from '@/views/test-plan/report/detail/component/reportConfig';
const { openNewPage } = useOpenNewPage();
const props = defineProps<{ const props = defineProps<{
reportId: string; reportId: string;
shareId?: string; shareId?: string;
@ -162,6 +169,13 @@
setLoadListParams({ reportId: props.reportId, shareId: props.shareId ?? undefined }); setLoadListParams({ reportId: props.reportId, shareId: props.shareId ?? undefined });
loadList(); loadList();
} }
//
function toDetail(record: FeatureCaseItem) {
openNewPage(CaseManagementRouteEnum.CASE_MANAGEMENT_CASE, {
id: record.id,
pId: record.projectId,
});
}
watch( watch(
[() => props.reportId, () => props.isPreview], [() => props.reportId, () => props.isPreview],

View File

@ -209,6 +209,7 @@
:share-id="shareId" :share-id="shareId"
:active-type="item.value" :active-type="item.value"
:is-preview="props.isPreview" :is-preview="props.isPreview"
:is-group="props.isGroup"
/> />
<CustomRichText <CustomRichText
v-else-if="item.value === ReportCardTypeEnum.CUSTOM_CARD" v-else-if="item.value === ReportCardTypeEnum.CUSTOM_CARD"