fix(bug): 任务中心&接口测试 bug 修复

This commit is contained in:
baiqi 2024-11-20 11:44:27 +08:00 committed by 刘瑞斌
parent 6c33f1b9f7
commit eb974c121a
6 changed files with 24 additions and 17 deletions

View File

@ -5,6 +5,8 @@ import { addCommasToNumber } from '@/utils';
import type { PassRateCountDetail, planStatusType, TestPlanDetail } from '@/models/testPlan/testPlan';
import type { countDetail, PlanReportDetail, StatusListType } from '@/models/testPlan/testPlanReport';
import { LastExecuteResults } from '@/enums/caseEnum';
import type { TooltipOption } from 'echarts/types/dist/shared';
// TODO: 对照后端字段
// 测试计划详情
export const testPlanDefaultDetail: TestPlanDetail = {
@ -142,16 +144,17 @@ export const statusConfig: StatusListType[] = [
},
];
export const toolTipConfig = {
export const toolTipConfig: TooltipOption = {
show: true,
trigger: 'item',
label: {
textStyle: {
color: '#959598',
},
position: 'top',
backgroundColor: '#fff',
padding: 16,
borderWidth: 0,
appendTo: 'body',
formatter(params: any) {
const html = `
<div class="w-[144px] flex items-center justify-between">

View File

@ -654,8 +654,10 @@
watch(
() => propsRes.value.data,
() => {
initStatistics();
(arr) => {
if (arr.length > 0) {
initStatistics();
}
}
);

View File

@ -977,8 +977,10 @@
watch(
() => propsRes.value.data,
() => {
initStatistics();
(arr) => {
if (arr.length > 0) {
initStatistics();
}
}
);

View File

@ -27,6 +27,7 @@
detail: PlanReportDetail;
hideTitle?: boolean;
animation?: boolean; //
noBlock?: boolean;
}>();
const legendData = ref<LegendData[]>([]);
@ -80,6 +81,10 @@
},
});
if (props.noBlock) {
executeCharOptions.value.series.data.pop();
}
function initExecuteOptions() {
const pieBorderWidth =
statusConfig.filter((e) => Number(props.detail.executeCount[e.value]) > 0).length === 1 ? 0 : 2;

View File

@ -111,7 +111,6 @@
},
fixed: 'left',
width: 100,
columnSelectorDisabled: true,
},
{
title: 'case.caseName',
@ -123,7 +122,6 @@
},
fixed: 'left',
width: 180,
columnSelectorDisabled: true,
},
{
title: 'case.caseLevel',
@ -134,7 +132,6 @@
filterSlotName: FilterSlotNameEnum.CASE_MANAGEMENT_CASE_LEVEL,
},
width: 100,
showDrag: true,
},
{
title: 'apiTestManagement.apiStatus',
@ -147,9 +144,9 @@
filterConfig: {
options: caseStatusOptions,
filterSlotName: FilterSlotNameEnum.API_TEST_CASE_API_STATUS,
disabledTooltip: true,
},
width: 100,
showDrag: true,
},
{
title: 'case.lastReportStatus',
@ -159,7 +156,6 @@
options: lastReportStatusListOptions.value,
filterSlotName: FilterSlotNameEnum.API_TEST_CASE_API_LAST_EXECUTE_STATUS,
},
showInTable: false,
width: 100,
showDrag: true,
},
@ -167,22 +163,22 @@
title: 'case.caseEnvironment',
dataIndex: 'environmentName',
showTooltip: true,
showInTable: false,
width: 150,
showDrag: true,
},
{
title: 'case.tableColumnCreateUser',
slotName: 'createName',
dataIndex: 'createUser',
showInTable: true,
showTooltip: true,
width: 150,
},
{
title: 'case.tableColumnCreateTime',
dataIndex: 'createTime',
showInTable: false,
sortable: {
sortDirections: ['ascend', 'descend'],
sorter: true,
},
width: 180,
},
];

View File

@ -33,7 +33,7 @@
<apiStatus :status="record.status" />
</template>
<template #createUserName="{ record }">
<a-tooltip :content="`${record.createName}`" position="tl">
<a-tooltip :content="`${record.createUserName}`" position="tl">
<div class="one-line-text">{{ characterLimit(record.createUserName) }}</div>
</a-tooltip>
</template>
@ -200,7 +200,6 @@
dataIndex: 'createUser',
slotName: 'createUserName',
showInTable: false,
showTooltip: true,
width: 150,
},
{