From aee3732db6774f6b038a557a029eac0025c39262 Mon Sep 17 00:00:00 2001 From: "xinxin.wu" Date: Wed, 18 Dec 2024 17:40:05 +0800 Subject: [PATCH] =?UTF-8?q?style(=E5=B7=A5=E4=BD=9C=E5=8F=B0):=20=E8=B0=83?= =?UTF-8?q?=E6=95=B4=E5=B7=A5=E4=BD=9C=E5=8F=B0=E5=9B=BE=E8=A1=A8tooltip?= =?UTF-8?q?=E6=9A=97=E9=BB=91=E6=A8=A1=E5=BC=8FStyle?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/config/testPlan.ts | 19 ++++++++++--------- .../src/views/workbench/homePage/utils.ts | 14 +++++++++++--- 2 files changed, 21 insertions(+), 12 deletions(-) diff --git a/frontend/src/config/testPlan.ts b/frontend/src/config/testPlan.ts index 76fd3565c8..1b1402907c 100644 --- a/frontend/src/config/testPlan.ts +++ b/frontend/src/config/testPlan.ts @@ -151,20 +151,21 @@ export const toolTipConfig: TooltipOption = { color: '#959598', }, position: 'top', - backgroundColor: '#fff', - padding: 16, + backgroundColor: 'transparent', + padding: 0, borderWidth: 0, appendTo: 'body', formatter(params: any) { const html = ` -
-
-
+
+
-
${params.name}
-
-
${addCommasToNumber(params.value)}
+ }"> +
+
${params.name}
+
+
${addCommasToNumber(params.value)}
`; return html; diff --git a/frontend/src/views/workbench/homePage/utils.ts b/frontend/src/views/workbench/homePage/utils.ts index 857fae4e6d..4e6a4088f2 100644 --- a/frontend/src/views/workbench/homePage/utils.ts +++ b/frontend/src/views/workbench/homePage/utils.ts @@ -107,6 +107,7 @@ export function getCommonBarOptions( type: 'shadow', axis: 'auto', }, + backgroundColor: 'transparent', formatter(params: any) { let testPlanHtml = ''; // 如果是测试计划未分配 @@ -130,7 +131,7 @@ export function getCommonBarOptions( paramsList = params; } const html = ` -
+
${params[0].axisValueLabel}
@@ -270,10 +271,16 @@ export function getCommonBarOptions( }, tooltip: { show: true, - padding: 16, + padding: 0, position(point: any) { return [point[0], '10%']; }, + backgroundColor: 'transparent', + formatter(params: any) { + return ` +
${params.name}
+ `; + }, extraCssText: 'max-width: 300px; white-space: normal; word-wrap: break-word; word-break: break-all;', textStyle: { width: 300, @@ -750,9 +757,10 @@ export function getSeriesData( show: true, trigger: 'item', enterable: true, + backgroundColor: 'transparent', formatter(params: any) { const html = ` -
+