From 7c86c9abfd98ce74235e859a7fdb0dc26a597782 Mon Sep 17 00:00:00 2001 From: huanghao1412 Date: Thu, 18 Jan 2024 15:50:48 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E6=A8=A1=E5=9D=97id=E5=8A=A0=E9=94=99=E4=BD=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/hooks/useChartCommonData.hook.ts | 3 +- .../components/ChartDataPointHistory.vue | 88 +++++++------------ 2 files changed, 32 insertions(+), 59 deletions(-) diff --git a/src/hooks/useChartCommonData.hook.ts b/src/hooks/useChartCommonData.hook.ts index 4b6df83c..d0e75d09 100644 --- a/src/hooks/useChartCommonData.hook.ts +++ b/src/hooks/useChartCommonData.hook.ts @@ -35,6 +35,7 @@ export const useChartCommonData = ( // if (vChartRef.value) { // setOption(vChartRef.value, { dataset: dataset }) // } + if(!dataset.dimensions) return if(targetComponent.option){ let seriesItem = cloneDeep(targetComponent.option.series[0]) let series = [] @@ -105,7 +106,7 @@ export const useChartCommonData = ( if (res) { try { const { data } = res - echartsUpdateHandle(data.length ? data[0] : { dimensions: [], source: [] }) + if(data.length) echartsUpdateHandle(data[0]) } catch (error) { console.error(error) } diff --git a/src/views/chart/ContentConfigurations/components/ChartDataV2/components/ChartDataPointHistory.vue b/src/views/chart/ContentConfigurations/components/ChartDataV2/components/ChartDataPointHistory.vue index 422476ae..6d0a1991 100644 --- a/src/views/chart/ContentConfigurations/components/ChartDataV2/components/ChartDataPointHistory.vue +++ b/src/views/chart/ContentConfigurations/components/ChartDataV2/components/ChartDataPointHistory.vue @@ -3,14 +3,14 @@ - + - + - + @@ -28,7 +28,14 @@ - + + + + + + @@ -49,7 +56,7 @@