Browse Source

Pull request #3588: CHART-18255 & CHART-18257 & CHART-18103 富文本默认字段最后一个不需要添加换行、支持组合图的富文本新增、调整富文本字体选择组件宽度字段参数

Merge in DESIGN/design from ~QINGHUI.LIU/design:release/10.0 to release/10.0

* commit '8d8566843cf8ad6c2b11584112ca519d9cfec0c7':
  CHART-18103 调整富文本字体选择组件宽度
  CHART-18257 支持组合图的富文本新增字段参数
  CHART-18255 富文本默认字段最后一个不需要添加换行
feature/big-screen
Qinghui.Liu 4 years ago
parent
commit
9d0e4abba8
  1. 12
      designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTooltipContentPane.java
  2. 12
      designer-chart/src/main/resources/com/fr/design/editor/rich_editor.html

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

@ -384,7 +384,7 @@ public class VanChartTooltipContentPane extends BasicBeanPane<AttrTooltipContent
private void fireRichEditor() { private void fireRichEditor() {
AttrTooltipRichText richText = this.richTextTooltipContent.getRichTextAttr(); AttrTooltipRichText richText = this.richTextTooltipContent.getRichTextAttr();
refreshTableFieldParams(richText.getParams());
ModernUIPane<VanChartRichEditorModel> richEditorPane = VanChartRichEditorPane.createRichEditorPane(richText); ModernUIPane<VanChartRichEditorModel> richEditorPane = VanChartRichEditorPane.createRichEditorPane(richText);
VanChartRichTextPane richTextPane = this.createRichTextPane(richEditorPane); VanChartRichTextPane richTextPane = this.createRichTextPane(richEditorPane);
@ -456,15 +456,19 @@ public class VanChartTooltipContentPane extends BasicBeanPane<AttrTooltipContent
params.put(fieldNames[i], fieldFormats[i].getJs()); params.put(fieldNames[i], fieldFormats[i].getJs());
} }
refreshTableFieldParams(params);
richText.setParams(params);
}
private void refreshTableFieldParams(Map<String, String> params) {
List<String> tableFieldNames = VanChartRichEditorPane.getFieldNames(); List<String> tableFieldNames = VanChartRichEditorPane.getFieldNames();
if (tableFieldNames != null) { if (tableFieldNames != null && params != null) {
for (String fieldName : tableFieldNames) { for (String fieldName : tableFieldNames) {
params.put(fieldName, "${" + fieldName + "_" + fieldName.hashCode() + "}"); params.put(fieldName, "${" + fieldName + "_" + fieldName.hashCode() + "}");
} }
} }
richText.setParams(params);
} }
private JPanel createHtmlPane() { private JPanel createHtmlPane() {

12
designer-chart/src/main/resources/com/fr/design/editor/rich_editor.html

@ -47,8 +47,7 @@
var getInitContent = function (params, initParams, align) { var getInitContent = function (params, initParams, align) {
var editorService = BI.Services.getService("bi.service.design.chart.common.editor"); var editorService = BI.Services.getService("bi.service.design.chart.common.editor");
var paramGroup = params.split("|"); var paramGroup = params.split("|");
var content = "";
content = "";
for (var i = 0, len = paramGroup.length; i < len; i++) { for (var i = 0, len = paramGroup.length; i < len; i++) {
var [key, value] = paramGroup[i].split(":"); var [key, value] = paramGroup[i].split(":");
@ -58,6 +57,10 @@
} }
} }
if (BI.endWith(content, '<br></p>')) {
content = content.slice(0, -8) + '</p>';
}
return content; return content;
} }
@ -83,7 +86,10 @@
toolbar: { toolbar: {
buttons: [ buttons: [
{type: "bi.rich_editor_font_chooser"}, {type: "bi.rich_editor_font_chooser"},
{type: "bi.rich_editor_size_chooser"}, {
type: "bi.rich_editor_size_chooser",
width: 70
},
{type: "bi.rich_editor_bold_button"}, {type: "bi.rich_editor_bold_button"},
{type: "bi.rich_editor_italic_button"}, {type: "bi.rich_editor_italic_button"},
{type: "bi.rich_editor_underline_button"}, {type: "bi.rich_editor_underline_button"},

Loading…
Cancel
Save