From eb974c121a1551b44db89985fc2b67c0f20ffd82 Mon Sep 17 00:00:00 2001 From: baiqi Date: Wed, 20 Nov 2024 11:44:27 +0800 Subject: [PATCH] =?UTF-8?q?fix(bug):=20=E4=BB=BB=E5=8A=A1=E4=B8=AD?= =?UTF-8?q?=E5=BF=83&=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95=20bug=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/config/testPlan.ts | 7 +++++-- .../components/management/case/caseTable.vue | 6 ++++-- .../api-test/scenario/components/scenarioTable.vue | 6 ++++-- .../component/system-card/executeAnalysis.vue | 5 +++++ .../views/workbench/components/apiCaseTable.vue | 14 +++++--------- .../workbench/components/scenarioCaseTable.vue | 3 +-- 6 files changed, 24 insertions(+), 17 deletions(-) diff --git a/frontend/src/config/testPlan.ts b/frontend/src/config/testPlan.ts index d0896c7319..741d47f3de 100644 --- a/frontend/src/config/testPlan.ts +++ b/frontend/src/config/testPlan.ts @@ -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 = `
diff --git a/frontend/src/views/api-test/management/components/management/case/caseTable.vue b/frontend/src/views/api-test/management/components/management/case/caseTable.vue index 21dd51cda9..8a7d4a0bd5 100644 --- a/frontend/src/views/api-test/management/components/management/case/caseTable.vue +++ b/frontend/src/views/api-test/management/components/management/case/caseTable.vue @@ -654,8 +654,10 @@ watch( () => propsRes.value.data, - () => { - initStatistics(); + (arr) => { + if (arr.length > 0) { + initStatistics(); + } } ); diff --git a/frontend/src/views/api-test/scenario/components/scenarioTable.vue b/frontend/src/views/api-test/scenario/components/scenarioTable.vue index f189d949d0..2b1788987b 100644 --- a/frontend/src/views/api-test/scenario/components/scenarioTable.vue +++ b/frontend/src/views/api-test/scenario/components/scenarioTable.vue @@ -977,8 +977,10 @@ watch( () => propsRes.value.data, - () => { - initStatistics(); + (arr) => { + if (arr.length > 0) { + initStatistics(); + } } ); diff --git a/frontend/src/views/test-plan/report/detail/component/system-card/executeAnalysis.vue b/frontend/src/views/test-plan/report/detail/component/system-card/executeAnalysis.vue index 92832d075f..c9ad43eb24 100644 --- a/frontend/src/views/test-plan/report/detail/component/system-card/executeAnalysis.vue +++ b/frontend/src/views/test-plan/report/detail/component/system-card/executeAnalysis.vue @@ -27,6 +27,7 @@ detail: PlanReportDetail; hideTitle?: boolean; animation?: boolean; // 是否开启动画 + noBlock?: boolean; }>(); const legendData = ref([]); @@ -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; diff --git a/frontend/src/views/workbench/components/apiCaseTable.vue b/frontend/src/views/workbench/components/apiCaseTable.vue index 3d0259e501..ff8090a752 100644 --- a/frontend/src/views/workbench/components/apiCaseTable.vue +++ b/frontend/src/views/workbench/components/apiCaseTable.vue @@ -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, }, ]; diff --git a/frontend/src/views/workbench/components/scenarioCaseTable.vue b/frontend/src/views/workbench/components/scenarioCaseTable.vue index 94806b4b46..466da694dd 100644 --- a/frontend/src/views/workbench/components/scenarioCaseTable.vue +++ b/frontend/src/views/workbench/components/scenarioCaseTable.vue @@ -33,7 +33,7 @@ @@ -200,7 +200,6 @@ dataIndex: 'createUser', slotName: 'createUserName', showInTable: false, - showTooltip: true, width: 150, }, {