From fdf43683207051b2c93ca567ff2aa5384ca6cdb6 Mon Sep 17 00:00:00 2001 From: "xinxin.wu" Date: Thu, 5 Dec 2024 19:27:59 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E5=B7=A5=E4=BD=9C=E5=8F=B0):=20=E5=B7=A5?= =?UTF-8?q?=E4=BD=9C=E5=8F=B0=E6=B5=8B=E8=AF=95=E8=AE=A1=E5=88=92=E6=A6=82?= =?UTF-8?q?=E8=A7=88=E8=81=94=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../homePage/components/overview.vue | 16 ++- .../homePage/components/overviewMember.vue | 14 +- .../homePage/components/testPlanOverview.vue | 123 ++++++++++-------- .../homePage/components/thresholdProgress.vue | 2 +- .../src/views/workbench/homePage/utils.ts | 43 +++++- 5 files changed, 135 insertions(+), 63 deletions(-) diff --git a/frontend/src/views/workbench/homePage/components/overview.vue b/frontend/src/views/workbench/homePage/components/overview.vue index ee61af2e21..6948e6fc07 100644 --- a/frontend/src/views/workbench/homePage/components/overview.vue +++ b/frontend/src/views/workbench/homePage/components/overview.vue @@ -37,7 +37,7 @@
- +
@@ -67,7 +67,7 @@ } from '@/models/workbench/homePage'; import { WorkCardEnum } from '@/enums/workbenchEnum'; - import { getColorScheme, getSeriesData } from '../utils'; + import { createCustomTooltip, getColorScheme, getSeriesData } from '../utils'; const { t } = useI18n(); @@ -176,6 +176,7 @@ }); } } + const chartRef = ref>(); async function handleRefreshKeyChange() { await nextTick(() => { @@ -187,8 +188,15 @@ }, 0); } - onMounted(() => { - initOverViewDetail(); + onMounted(async () => { + await initOverViewDetail(); + + setTimeout(() => { + const chartDom = chartRef.value?.chartRef; + if (chartDom && chartDom.chart) { + createCustomTooltip(chartDom); + } + }, 0); }); watch( diff --git a/frontend/src/views/workbench/homePage/components/overviewMember.vue b/frontend/src/views/workbench/homePage/components/overviewMember.vue index d4e3c98e6c..2695c634b8 100644 --- a/frontend/src/views/workbench/homePage/components/overviewMember.vue +++ b/frontend/src/views/workbench/homePage/components/overviewMember.vue @@ -37,7 +37,7 @@
- +
@@ -60,7 +60,7 @@ import type { SelectedCardItem, TimeFormParams } from '@/models/workbench/homePage'; - import { getColorScheme, getSeriesData } from '../utils'; + import { createCustomTooltip, getColorScheme, getSeriesData } from '../utils'; const { t } = useI18n(); const appStore = useAppStore(); @@ -132,6 +132,7 @@ value: e.id, })); } + const chartRef = ref>(); async function handleProjectChange(isRefreshKey: boolean = false, setAll = false) { await nextTick(); @@ -146,7 +147,14 @@ } } await nextTick(); - initOverViewMemberDetail(); + await initOverViewMemberDetail(); + + setTimeout(() => { + const chartDom = chartRef.value?.chartRef; + if (chartDom && chartDom.chart) { + createCustomTooltip(chartDom); + } + }, 0); } async function changeProject() { diff --git a/frontend/src/views/workbench/homePage/components/testPlanOverview.vue b/frontend/src/views/workbench/homePage/components/testPlanOverview.vue index eee48e42e0..934205c57f 100644 --- a/frontend/src/views/workbench/homePage/components/testPlanOverview.vue +++ b/frontend/src/views/workbench/homePage/components/testPlanOverview.vue @@ -6,36 +6,41 @@
{{ t(props.item.label) }}
-
- +
-