From de69e23c956b09d8c84ab05fb064d84cc05f0bb5 Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Wed, 24 Feb 2021 21:16:28 +0800 Subject: [PATCH] =?UTF-8?q?CHART-18057=20=E5=AF=8C=E6=96=87=E6=9C=AC?= =?UTF-8?q?=E9=BB=98=E8=AE=A4=E5=8F=82=E6=95=B0=E5=92=8C=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E9=9B=86=E5=AD=97=E6=AE=B5=E9=87=8D=E5=90=8D=E6=97=B6=EF=BC=8C?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E9=BB=98=E8=AE=A4=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../component/VanChartTooltipContentPane.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTooltipContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTooltipContentPane.java index 3c4cbf70c..86086abdd 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTooltipContentPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTooltipContentPane.java @@ -47,6 +47,7 @@ import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; +import java.util.Arrays; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; @@ -463,9 +464,15 @@ public class VanChartTooltipContentPane extends BasicBeanPane params) { List tableFieldNames = VanChartRichEditorPane.getFieldNames(); + List defaultParams = Arrays.asList(getRichTextFieldNames()); - if (tableFieldNames != null && params != null) { - for (String fieldName : tableFieldNames) { + if (tableFieldNames == null || params == null) { + return; + } + + for (String fieldName : tableFieldNames) { + // 富文本默认参数和数据集字段重名时,显示默认参数 + if (!defaultParams.contains(fieldName)) { params.put(fieldName, "${" + fieldName + "_" + fieldName.hashCode() + "}"); } }