Browse Source

修改参数

feature/big-screen
Qinghui.Liu 4 years ago
parent
commit
49d74a8b15
  1. 3
      designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartRichEditorPane.java
  2. 27
      designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTooltipContentPane.java

3
designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartRichEditorPane.java

@ -8,6 +8,7 @@ import com.teamdev.jxbrowser.chromium.JSValue;
import com.teamdev.jxbrowser.chromium.events.ScriptContextAdapter; import com.teamdev.jxbrowser.chromium.events.ScriptContextAdapter;
import com.teamdev.jxbrowser.chromium.events.ScriptContextEvent; import com.teamdev.jxbrowser.chromium.events.ScriptContextEvent;
import java.net.URLEncoder;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -83,7 +84,7 @@ public class VanChartRichEditorPane {
for (Map.Entry<String, String> entry : paramsMap.entrySet()) { for (Map.Entry<String, String> entry : paramsMap.entrySet()) {
String param = entry.getValue(); String param = entry.getValue();
if (content.contains(param)) { if (content.contains(URLEncoder.encode(param))) {
result.add(param); result.add(param);
} }
} }

27
designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTooltipContentPane.java

@ -11,7 +11,6 @@ import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.ui.ModernUIPane; import com.fr.design.ui.ModernUIPane;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.log.FineLoggerFactory;
import com.fr.plugin.chart.base.AttrTooltipContent; import com.fr.plugin.chart.base.AttrTooltipContent;
import com.fr.plugin.chart.base.AttrTooltipRichText; import com.fr.plugin.chart.base.AttrTooltipRichText;
import com.fr.plugin.chart.base.format.AttrTooltipFormat; import com.fr.plugin.chart.base.format.AttrTooltipFormat;
@ -311,12 +310,12 @@ public class VanChartTooltipContentPane extends BasicBeanPane<AttrTooltipContent
// 在BI的富文本组件中,先清空content,然后addParam,最后读取最新的content, // 在BI的富文本组件中,先清空content,然后addParam,最后读取最新的content,
// 但是当前接口还没开出来,暂时先在本地写死,模拟类似的效果 // 但是当前接口还没开出来,暂时先在本地写死,模拟类似的效果
String[] richTextGroup = new String[]{ String[] richTextGroup = new String[]{
"<img alt=\"categoryFormat\" class=\"rich-editor-param\" style=\"background-color: rgba(54, 133, 242, 0.1);vertical-align: middle; margin: 0 1px; width:88.17578125px;height: 16px; max-width:88.17578125px;max-height: 16px; min-width:88.17578125px;min-height: 16px\" name=\"categoryFormat\"/>", "<img alt=\"%24%7BCATEGORY%7D\" class=\"rich-editor-param\" style=\"background-color: rgba(54, 133, 242, 0.1);vertical-align: middle; margin: 0 1px; width:86.095703125px;height: 16px; max-width:86.095703125px;max-height: 16px; min-width:86.095703125px;min-height: 16px\" name=\"%24%7BCATEGORY%7D\" />",
"<img alt=\"seriesFormat\" class=\"rich-editor-param\" style=\"background-color: rgba(54, 133, 242, 0.1);vertical-align: middle; margin: 0 1px; width:73.73828125px;height: 16px; max-width:73.73828125px;max-height: 16px; min-width:73.73828125px;min-height: 16px\" name=\"seriesFormat\"/>", "<img alt=\"%24%7BSERIES%7D\" class=\"rich-editor-param\" style=\"background-color: rgba(54, 133, 242, 0.1);vertical-align: middle; margin: 0 1px; width:63.8828125px;height: 16px; max-width:63.8828125px;max-height: 16px; min-width:63.8828125px;min-height: 16px\" name=\"%24%7BSERIES%7D\" />",
"<img alt=\"valueFormat\" class=\"rich-editor-param\" style=\"background-color: rgba(54, 133, 242, 0.1);vertical-align: middle; margin: 0 1px; width:71.4765625px;height: 16px; max-width:71.4765625px;max-height: 16px; min-width:71.4765625px;min-height: 16px\" name=\"valueFormat\"/>", "<img alt=\"%24%7BVALUE%7D\" class=\"rich-editor-param\" style=\"background-color: rgba(54, 133, 242, 0.1);vertical-align: middle; margin: 0 1px; width:61.849609375px;height: 16px; max-width:61.849609375px;max-height: 16px; min-width:61.849609375px;min-height: 16px\" name=\"%24%7BVALUE%7D\" />",
"<img alt=\"percentFormat\" class=\"rich-editor-param\" style=\"background-color: rgba(54, 133, 242, 0.1);vertical-align: middle; margin: 0 1px; width:83.388671875px;height: 16px; max-width:83.388671875px;max-height: 16px; min-width:83.388671875px;min-height: 16px\" name=\"percentFormat\"/>", "<img alt=\"%24%7BPERCENT%7D\" class=\"rich-editor-param\" style=\"background-color: rgba(54, 133, 242, 0.1);vertical-align: middle; margin: 0 1px; width:77.39453125px;height: 16px; max-width:77.39453125px;max-height: 16px; min-width:77.39453125px;min-height: 16px\" name=\"%24%7BPERCENT%7D\" />",
"<img alt=\"changedValueFormat\" class=\"rich-editor-param\" style=\"background-color: rgba(54, 133, 242, 0.1);vertical-align: middle; margin: 0 1px; width:117.888671875px;height: 16px; max-width:117.888671875px;max-height: 16px; min-width:117.888671875px;min-height: 16px\" name=\"changedValueFormat\"/>", "<img alt=\"%24%7BCHANGEDVALUE%7D\" class=\"rich-editor-param\" style=\"background-color: rgba(54, 133, 242, 0.1);vertical-align: middle; margin: 0 1px; width:122.119140625px;height: 16px; max-width:122.119140625px;max-height: 16px; min-width:122.119140625px;min-height: 16px\" name=\"%24%7BCHANGEDVALUE%7D\" />",
"<img alt=\"changedPercentFormat\" class=\"rich-editor-param\" style=\"background-color: rgba(54, 133, 242, 0.1);vertical-align: middle; margin: 0 1px; width:128.224609375px;height: 16px; max-width:128.224609375px;max-height: 16px; min-width:128.224609375px;min-height: 16px\" name=\"changedPercentFormat\"/>" "<img alt=\"%24%7BCHANGEDPERCENT%7D\" class=\"rich-editor-param\" style=\"background-color: rgba(54, 133, 242, 0.1);vertical-align: middle; margin: 0 1px; width:137.6640625px;height: 16px; max-width:137.6640625px;max-height: 16px; min-width:137.6640625px;min-height: 16px\" name=\"%24%7BCHANGEDPERCENT%7D\" />"
}; };
StringBuilder result = new StringBuilder("<p>"); StringBuilder result = new StringBuilder("<p>");
@ -378,7 +377,7 @@ public class VanChartTooltipContentPane extends BasicBeanPane<AttrTooltipContent
formatPane.populate(format); formatPane.populate(format);
// 填充面板时,更新富文本编辑器参数 // 填充面板时,更新富文本编辑器参数
formatPane.updateFormatParams(richText.getParams(), format.getFormatJSONKey()); formatPane.updateFormatParams(richText.getParams(), format.getJs());
} }
} }
@ -456,14 +455,10 @@ public class VanChartTooltipContentPane extends BasicBeanPane<AttrTooltipContent
} }
private void updateTooltipRichText(AttrTooltipContent attrTooltipContent) { private void updateTooltipRichText(AttrTooltipContent attrTooltipContent) {
try { if (attrTooltipContent != null) {
if (attrTooltipContent != null) { AttrTooltipRichText tooltipRichText = attrTooltipContent.getRichText();
AttrTooltipRichText tooltipRichText = attrTooltipContent.getRichText(); tooltipRichText.setContent(richText.getContent());
tooltipRichText.setContent(richText.getContent()); tooltipRichText.setAuto(richText.isAuto());
tooltipRichText.setAuto(richText.isAuto());
}
} catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
} }
} }

Loading…
Cancel
Save