diff --git a/frontend/src/config/workbench.ts b/frontend/src/config/workbench.ts index 9d1039472b..d8ea0f3325 100644 --- a/frontend/src/config/workbench.ts +++ b/frontend/src/config/workbench.ts @@ -243,8 +243,8 @@ export const commonRatePieOptions = { title: { show: true, text: '', - left: 26, - top: '20%', + left: 40, + top: '26%', textStyle: { fontSize: 12, fontWeight: 'normal', @@ -276,16 +276,14 @@ export const commonRatePieOptions = { name: '', type: 'pie', color: [], - padAngle: 2, - radius: ['85%', '100%'], - center: [30, '50%'], + radius: ['65%', '80%'], + center: [44, '50%'], avoidLabelOverlap: false, label: { show: false, position: 'center', }, emphasis: { - scale: false, // 禁用放大效果 label: { show: false, fontSize: 40, diff --git a/frontend/src/views/workbench/homePage/components/apiAndScenarioCase.vue b/frontend/src/views/workbench/homePage/components/apiAndScenarioCase.vue index 74990a090b..ef13db42f5 100644 --- a/frontend/src/views/workbench/homePage/components/apiAndScenarioCase.vue +++ b/frontend/src/views/workbench/homePage/components/apiAndScenarioCase.vue @@ -173,7 +173,7 @@ const coverTitleConfig = computed(() => { return { name: t('workbench.homePage.apiCoverage'), - color: ['#EDEDF1', '#00C261'], + color: ['#D4D4D8', '#00C261'], tooltipText: props.item.key === WorkCardEnum.API_CASE_COUNT ? t('workbench.homePage.apiCaseCountCoverRateTooltip') @@ -185,12 +185,12 @@ return props.item.key === WorkCardEnum.API_CASE_COUNT ? { name: t('workbench.homePage.caseExecutionRate'), - color: ['#EDEDF1', '#00C261'], + color: ['#D4D4D8', '#00C261'], tooltipText: t('workbench.homePage.apiCaseCountExecuteRateTooltip'), } : { name: t('workbench.homePage.sceneExecutionRate'), - color: ['#EDEDF1', '#00C261'], + color: ['#D4D4D8', '#00C261'], tooltipText: t('workbench.homePage.scenarioCaseCountExecuteRateTooltip'), }; }); diff --git a/frontend/src/views/workbench/homePage/components/apiCount.vue b/frontend/src/views/workbench/homePage/components/apiCount.vue index 497e773bfa..39b6c617f0 100644 --- a/frontend/src/views/workbench/homePage/components/apiCount.vue +++ b/frontend/src/views/workbench/homePage/components/apiCount.vue @@ -31,7 +31,6 @@ diff --git a/frontend/src/views/workbench/homePage/components/caseReviewedCount.vue b/frontend/src/views/workbench/homePage/components/caseReviewedCount.vue index ff6f349608..d43b3665fe 100644 --- a/frontend/src/views/workbench/homePage/components/caseReviewedCount.vue +++ b/frontend/src/views/workbench/homePage/components/caseReviewedCount.vue @@ -27,7 +27,6 @@ diff --git a/frontend/src/views/workbench/homePage/components/defectCount.vue b/frontend/src/views/workbench/homePage/components/defectCount.vue index e40641954e..83bedc29a6 100644 --- a/frontend/src/views/workbench/homePage/components/defectCount.vue +++ b/frontend/src/views/workbench/homePage/components/defectCount.vue @@ -28,7 +28,6 @@ :has-permission="hasPermission" :tooltip-text="tooltip" :options="legacyOptions" - :size="60" :value-list="legacyValueList" /> diff --git a/frontend/src/views/workbench/homePage/components/legendPieChart.vue b/frontend/src/views/workbench/homePage/components/legendPieChart.vue index 531d6201a8..ab356be227 100644 --- a/frontend/src/views/workbench/homePage/components/legendPieChart.vue +++ b/frontend/src/views/workbench/homePage/components/legendPieChart.vue @@ -8,7 +8,7 @@
- +
@@ -30,7 +30,6 @@ const props = defineProps<{ options: Record; - size: number; tooltipText?: string; hasPermission: boolean; loading?: boolean; @@ -43,8 +42,9 @@ diff --git a/frontend/src/views/workbench/homePage/components/relatedCaseCount.vue b/frontend/src/views/workbench/homePage/components/relatedCaseCount.vue index 6820713030..f2d79ca506 100644 --- a/frontend/src/views/workbench/homePage/components/relatedCaseCount.vue +++ b/frontend/src/views/workbench/homePage/components/relatedCaseCount.vue @@ -27,7 +27,6 @@ :options="relatedOptions" :has-permission="hasPermission" tooltip-text="workbench.homePage.associateCaseCoverRateTooltip" - :size="60" :value-list="coverRateValueList" />
diff --git a/frontend/src/views/workbench/homePage/components/testPlanCount.vue b/frontend/src/views/workbench/homePage/components/testPlanCount.vue index eda2313173..7594e45456 100644 --- a/frontend/src/views/workbench/homePage/components/testPlanCount.vue +++ b/frontend/src/views/workbench/homePage/components/testPlanCount.vue @@ -24,12 +24,7 @@
- +
diff --git a/frontend/src/views/workbench/homePage/utils.ts b/frontend/src/views/workbench/homePage/utils.ts index e28351a976..9142413cda 100644 --- a/frontend/src/views/workbench/homePage/utils.ts +++ b/frontend/src/views/workbench/homePage/utils.ts @@ -364,15 +364,25 @@ export function handlePieData( ) { const options: Record = getPieCharOptions(key); const lastStatusPercentList = statusPercentList ?? []; - options.series.data = lastStatusPercentList.map((item) => ({ - name: item.status, - value: item.count, - tooltip: { - ...toolTipConfig, - position: 'right', - show: !!hasPermission, - }, - })); + const hasDataLength = lastStatusPercentList.filter((e) => Number(e.count) > 0).length; + const pieBorderWidth = hasDataLength === 1 ? 0 : 2; + + options.series.data = + hasDataLength > 0 + ? lastStatusPercentList.map((item) => ({ + name: item.status, + value: item.count, + tooltip: { + ...toolTipConfig, + position: 'right', + show: !!hasPermission, + }, + itemStyle: { + borderWidth: pieBorderWidth, + borderColor: '#ffffff', + }, + })) + : []; // 计算总数和图例格式 const tempObject: Record = {}; @@ -407,13 +417,20 @@ export function handleUpdateTabPie( const countList = list || []; let lastCountList: { value: number | string; label: string; name: string }[] = []; if (hasPermission) { + const pieBorderWidth = countList.slice(1).filter((e) => Number(e.count) > 0).length === 1 ? 0 : 1; + lastCountList = countList.slice(1).map((item) => { return { value: item.count, label: item.name, name: item.name, + itemStyle: { + borderWidth: pieBorderWidth, + borderColor: '#ffffff', + }, }; }); + options.series.data = lastCountList.every((e) => e.value === 0) ? [] : lastCountList; options.title.text = countList[0].name ?? '';