fix(测试计划): 测试计划详情-执行历史细节修改

This commit is contained in:
teukkk 2024-06-15 10:15:35 +08:00 committed by Craftsman
parent 03737a5cc6
commit b3de5b92b4
1 changed files with 19 additions and 11 deletions

View File

@ -1,17 +1,20 @@
<template>
<div class="p-[16px]">
<ms-base-table v-bind="propsRes" no-disable v-on="propsEvent">
<template #[FilterSlotNameEnum.API_TEST_CASE_API_REPORT_EXECUTE_RESULT]="{ filterContent }">
<template #[FilterSlotNameEnum.TEST_PLAN_STATUS_FILTER]="{ filterContent }">
<ExecutionStatus :module-type="ReportEnum.API_REPORT" :status="filterContent.value" />
</template>
<template #triggerMode="{ record }">
<span>{{ t(TriggerModeLabel[record.triggerMode as keyof typeof TriggerModeLabel]) }}</span>
</template>
<template #lastExecResult="{ record }">
<ExecutionStatus :status="record.execStatus" :module-type="ReportEnum.API_REPORT" />
<ExecutionStatus v-if="record.execStatus" :status="record.execStatus" :module-type="ReportEnum.API_REPORT" />
</template>
<template #executionStartAndEndTime="{ record }">
<div> {{ record.startTime }} {{ record.endTime ?? '-' }} </div>
<div>
{{ dayjs(record.startTime).format('YYYY-MM-DD HH:mm:ss') }}
{{ record.endTime ? dayjs(record.endTime).format('YYYY-MM-DD HH:mm:ss') : '-' }}
</div>
</template>
<template #operation="{ record }">
<a-tooltip :content="t('project.executionHistory.cleared')" :disabled="!record.deleted">
@ -44,13 +47,11 @@
import { hasAnyPermission } from '@/utils/permission';
import type { PlanDetailExecuteHistoryItem } from '@/models/testPlan/testPlan';
import { LastExecuteResults } from '@/enums/caseEnum';
import { ReportEnum, TriggerModeLabel } from '@/enums/reportEnum';
import { PlanReportStatus, ReportEnum, TriggerModeLabel } from '@/enums/reportEnum';
import { TestPlanRouteEnum } from '@/enums/routeEnum';
import { FilterSlotNameEnum } from '@/enums/tableFilterEnum';
import { triggerModeOptions } from '@/views/api-test/report/utils';
import { executionResultMap } from '@/views/case-management/caseManagementFeature/components/utils';
const { t } = useI18n();
const route = useRoute();
@ -58,6 +59,15 @@
const planId = ref(route.query.id as string);
const statusResultOptions = computed(() => {
return Object.keys(PlanReportStatus).map((key) => {
return {
value: key,
label: PlanReportStatus[key].statusText,
};
});
});
const columns: MsTableColumn = [
{
title: 'apiTestManagement.order',
@ -80,10 +90,8 @@
dataIndex: 'execStatus',
slotName: 'lastExecResult',
filterConfig: {
valueKey: 'key',
labelKey: 'statusText',
options: Object.values(executionResultMap),
filterSlotName: FilterSlotNameEnum.CASE_MANAGEMENT_EXECUTE_RESULT,
options: statusResultOptions.value,
filterSlotName: FilterSlotNameEnum.TEST_PLAN_STATUS_FILTER,
},
width: 150,
},
@ -97,7 +105,7 @@
title: 'testPlan.executeHistory.executionStartAndEndTime',
dataIndex: 'startTime',
slotName: 'executionStartAndEndTime',
width: 200,
width: 300,
},
{
title: 'common.operation',