Browse Source

补充新增字段富文本中的交互

feature/big-screen
Qinghui.Liu 4 years ago
parent
commit
cd9e4832ce
  1. 13
      designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTooltipContentPane.java
  2. 15
      designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartFieldListPane.java

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

@ -15,6 +15,7 @@ import com.fr.design.ui.ModernUIPane;
import com.fr.general.ComparatorUtils;
import com.fr.plugin.chart.base.AttrTooltipContent;
import com.fr.plugin.chart.base.AttrTooltipRichText;
import com.fr.plugin.chart.base.TableFieldCollection;
import com.fr.plugin.chart.base.format.AttrTooltipFormat;
import com.fr.stable.StringUtils;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
@ -449,15 +450,19 @@ public class VanChartTooltipContentPane extends BasicBeanPane<AttrTooltipContent
richTextDialog.addDialogActionListener(new DialogActionAdapter() {
public void doOk() {
// 收集字段格式和汇总方式
updateTooltipFormat(richTextTooltipContent, richTextPane.updateBean());
AttrTooltipContent temporary = richTextPane.updateBean();
VanChartRichEditorModel model = richEditorPane.update();
String content = model.getContent();
// 收集编辑后的富文本内容
updateLocalRichText(content, model.isAuto());
TableFieldCollection fieldCollection = temporary.getFieldCollection();
if (fieldCollection != null) {
fieldCollection.checkFieldDefinition(content);
}
updateTooltipFormat(richTextTooltipContent, temporary);
SwingUtilities.getWindowAncestor(richEditorPane).setVisible(false);
}

15
designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartFieldListPane.java

@ -182,6 +182,10 @@ public class VanChartFieldListPane extends JPanel {
}
public void addSelectedField(String fieldName, String fieldId) {
VanChartRichEditorModel model = richEditorPane.update();
model.setAddition(fieldName);
VanChartRichEditorPane.richEditorAddField(model);
if (tableFieldNameList.contains(fieldName)) {
int index = tableFieldNameList.indexOf(fieldName);
@ -191,10 +195,6 @@ public class VanChartFieldListPane extends JPanel {
tableFieldCollection.addFieldDefinition(fieldName, new TableFieldDefinition(fieldName, fieldFormat, dataFunction));
}
VanChartRichEditorModel model = richEditorPane.update();
model.setAddition(fieldName);
VanChartRichEditorPane.richEditorAddField(model);
}
public void populateFieldFormatPane() {
@ -220,6 +220,13 @@ public class VanChartFieldListPane extends JPanel {
fieldButton.setFormat(fieldAttrPane.updateFormat());
fieldButton.setDataFunction(fieldAttrPane.updateDataFunction());
if (tableFieldNameList.contains(fieldName)) {
Format fieldFormat = fieldButton.getFormat();
DataFunction dataFunction = fieldButton.getDataFunction();
tableFieldCollection.addFieldDefinition(fieldName, new TableFieldDefinition(fieldName, fieldFormat, dataFunction));
}
}
};
}

Loading…
Cancel
Save