From 0f61ee728b2a2c09a055ded33e036b373714f225 Mon Sep 17 00:00:00 2001 From: headmasterZhao <635733318@qq.com> Date: Tue, 4 Apr 2023 08:41:26 +0800 Subject: [PATCH 1/4] =?UTF-8?q?fix:=20=E6=9F=B1=E7=8A=B6=E5=9B=BE=E4=BC=A0?= =?UTF-8?q?=E5=85=A5=E9=94=99=E8=AF=AF=E6=95=B0=E6=8D=AE=E5=90=8E=E5=B1=95?= =?UTF-8?q?=E7=A4=BA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/packages/components/Charts/Bars/BarCommon/index.vue | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/packages/components/Charts/Bars/BarCommon/index.vue b/src/packages/components/Charts/Bars/BarCommon/index.vue index f10a5d14..7f86ca6b 100644 --- a/src/packages/components/Charts/Bars/BarCommon/index.vue +++ b/src/packages/components/Charts/Bars/BarCommon/index.vue @@ -63,6 +63,9 @@ watch( if (dimensionsGap < 0) { props.chartConfig.option.series.splice(newDimensions - 1) } else if (dimensionsGap > 0) { + if(!oldData || !oldData?.dimensions || !Array.isArray(oldData?.dimensions)) { + props.chartConfig.option.series=[] + } for (let i = 0; i < dimensionsGap; i++) { seriesArr.push(cloneDeep(seriesItem)) } From 93f398d5a7ce36c18ca2e969b538c139a19950d3 Mon Sep 17 00:00:00 2001 From: headmasterZhao <635733318@qq.com> Date: Tue, 4 Apr 2023 08:46:56 +0800 Subject: [PATCH 2/4] =?UTF-8?q?fix:=20=E6=9F=B1=E7=8A=B6=E5=9B=BE=E4=BC=A0?= =?UTF-8?q?=E5=85=A5=E9=94=99=E8=AF=AF=E6=95=B0=E6=8D=AE=E5=90=8E=E5=B1=95?= =?UTF-8?q?=E7=A4=BA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/packages/components/Charts/Bars/BarCommon/index.vue | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/packages/components/Charts/Bars/BarCommon/index.vue b/src/packages/components/Charts/Bars/BarCommon/index.vue index 7f86ca6b..c2918b48 100644 --- a/src/packages/components/Charts/Bars/BarCommon/index.vue +++ b/src/packages/components/Charts/Bars/BarCommon/index.vue @@ -52,6 +52,7 @@ watch( () => props.chartConfig.option.dataset, (newData: { dimensions: any }, oldData) => { try { + debugger if (!isObject(newData) || !('dimensions' in newData)) return if (Array.isArray(newData?.dimensions)) { const seriesArr = [] @@ -69,7 +70,7 @@ watch( for (let i = 0; i < dimensionsGap; i++) { seriesArr.push(cloneDeep(seriesItem)) } - props.chartConfig.option.series = [...seriesArr] + props.chartConfig.option.series.push(...seriesArr) } replaceMergeArr.value = ['series'] nextTick(() => { From 8e1731354cee71e0890d1ff1ff70d588dbc010bf Mon Sep 17 00:00:00 2001 From: headmasterZhao <635733318@qq.com> Date: Tue, 4 Apr 2023 09:34:47 +0800 Subject: [PATCH 3/4] =?UTF-8?q?fix:=20=E6=9F=B1=E7=8A=B6=E5=9B=BE=E4=BC=A0?= =?UTF-8?q?=E5=85=A5=E9=94=99=E8=AF=AF=E6=95=B0=E6=8D=AE=E5=90=8E=E5=B1=95?= =?UTF-8?q?=E7=A4=BA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/packages/components/Charts/Bars/BarCommon/index.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/packages/components/Charts/Bars/BarCommon/index.vue b/src/packages/components/Charts/Bars/BarCommon/index.vue index c2918b48..c6da8e01 100644 --- a/src/packages/components/Charts/Bars/BarCommon/index.vue +++ b/src/packages/components/Charts/Bars/BarCommon/index.vue @@ -64,7 +64,7 @@ watch( if (dimensionsGap < 0) { props.chartConfig.option.series.splice(newDimensions - 1) } else if (dimensionsGap > 0) { - if(!oldData || !oldData?.dimensions || !Array.isArray(oldData?.dimensions)) { + if(!oldData || !oldData?.dimensions || !Array.isArray(oldData?.dimensions) || !oldData?.dimensions.length ) { props.chartConfig.option.series=[] } for (let i = 0; i < dimensionsGap; i++) { From c930e3433f0ad78f4a0af118044eb3d40b1e54d3 Mon Sep 17 00:00:00 2001 From: headmasterZhao <635733318@qq.com> Date: Tue, 4 Apr 2023 09:35:28 +0800 Subject: [PATCH 4/4] =?UTF-8?q?fix:=20=E6=9F=B1=E7=8A=B6=E5=9B=BE=E4=BC=A0?= =?UTF-8?q?=E5=85=A5=E9=94=99=E8=AF=AF=E6=95=B0=E6=8D=AE=E5=90=8E=E5=B1=95?= =?UTF-8?q?=E7=A4=BA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/packages/components/Charts/Bars/BarCommon/index.vue | 1 - 1 file changed, 1 deletion(-) diff --git a/src/packages/components/Charts/Bars/BarCommon/index.vue b/src/packages/components/Charts/Bars/BarCommon/index.vue index c6da8e01..d4daecbc 100644 --- a/src/packages/components/Charts/Bars/BarCommon/index.vue +++ b/src/packages/components/Charts/Bars/BarCommon/index.vue @@ -52,7 +52,6 @@ watch( () => props.chartConfig.option.dataset, (newData: { dimensions: any }, oldData) => { try { - debugger if (!isObject(newData) || !('dimensions' in newData)) return if (Array.isArray(newData?.dimensions)) { const seriesArr = []