From c21154e1fc548994735bfaa7e26af3349730f82c Mon Sep 17 00:00:00 2001 From: kuangshuai Date: Tue, 1 Jun 2021 18:18:32 +0800 Subject: [PATCH 1/3] =?UTF-8?q?REPORT-52928=20=E5=9F=8B=E7=82=B9=E5=8F=AA?= =?UTF-8?q?=E7=BB=9F=E8=AE=A1=E6=9C=89=E7=89=B9=E6=AE=8A=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E7=9A=84=E7=BB=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/mainframe/JForm.java | 14 ------ .../fr/design/share/SharableInitManager.java | 16 ------ .../com/fr/design/share/SharableManager.java | 49 +++++++++++++++++++ .../design/share/utils/EffectItemUtils.java | 5 ++ .../main/java/com/fr/start/MainDesigner.java | 2 + .../fr/start/module/DesignerActivator.java | 4 +- 6 files changed, 58 insertions(+), 32 deletions(-) delete mode 100644 designer-realize/src/main/java/com/fr/design/share/SharableInitManager.java create mode 100644 designer-realize/src/main/java/com/fr/design/share/SharableManager.java diff --git a/designer-form/src/main/java/com/fr/design/mainframe/JForm.java b/designer-form/src/main/java/com/fr/design/mainframe/JForm.java index c67280caa..3ddc16c9c 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/JForm.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/JForm.java @@ -346,20 +346,6 @@ public class JForm extends JTemplate implements BaseJForm xCreators = ShareComponentUtils.getHelpConfigXCreatorList(root); - JSONArray helpConfigUseInfo = ComponentCollector.getInstance().getHelpConfigUseInfoWithTemplate(jt.getTarget().getTemplateID()); - for (XCreator xCreator : xCreators) { - if (helpConfigUseInfo.contains(ShareComponentUtils.getWidgetId(xCreator.toData()))) { - useCount++; - } - } - ComponentCollector.getInstance().collectHelpConfigInfo(jt.getTarget().getTemplateID(), xCreators.size(), useCount); - } - } }); diff --git a/designer-realize/src/main/java/com/fr/design/share/SharableInitManager.java b/designer-realize/src/main/java/com/fr/design/share/SharableInitManager.java deleted file mode 100644 index a01068421..000000000 --- a/designer-realize/src/main/java/com/fr/design/share/SharableInitManager.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.fr.design.share; - -import com.fr.design.base.clipboard.ClipboardFilter; -import com.fr.design.mainframe.share.collect.SharableCollectorManager; -import com.fr.design.mainframe.share.encrypt.clipboard.impl.EncryptSelectionClipboardHandler; -import com.fr.design.mainframe.share.encrypt.clipboard.impl.EncryptTransferableClipboardHandler; -import com.fr.design.mainframe.share.util.SharableXMLUtils; - -public class SharableInitManager { - public static void start() { - SharableXMLUtils.registerSharableReadHelper(); - SharableCollectorManager.getInstance().execute(); - ClipboardFilter.registerClipboardHandler(EncryptSelectionClipboardHandler.getInstance()); - ClipboardFilter.registerClipboardHandler(EncryptTransferableClipboardHandler.getInstance()); - } -} diff --git a/designer-realize/src/main/java/com/fr/design/share/SharableManager.java b/designer-realize/src/main/java/com/fr/design/share/SharableManager.java new file mode 100644 index 000000000..ba3b83064 --- /dev/null +++ b/designer-realize/src/main/java/com/fr/design/share/SharableManager.java @@ -0,0 +1,49 @@ +package com.fr.design.share; + +import com.fr.design.base.clipboard.ClipboardFilter; +import com.fr.design.designer.creator.XCreator; +import com.fr.design.designer.creator.XLayoutContainer; +import com.fr.design.mainframe.JForm; +import com.fr.design.mainframe.JTemplate; +import com.fr.design.mainframe.share.collect.ComponentCollector; +import com.fr.design.mainframe.share.collect.SharableCollectorManager; +import com.fr.design.mainframe.share.encrypt.clipboard.impl.EncryptSelectionClipboardHandler; +import com.fr.design.mainframe.share.encrypt.clipboard.impl.EncryptTransferableClipboardHandler; +import com.fr.design.mainframe.share.util.SharableXMLUtils; +import com.fr.design.mainframe.share.util.ShareComponentUtils; +import com.fr.design.share.utils.EffectItemUtils; +import com.fr.json.JSONArray; + +import java.util.List; + +public class SharableManager { + public static void start() { + SharableXMLUtils.registerSharableReadHelper(); + SharableCollectorManager.getInstance().execute(); + ClipboardFilter.registerClipboardHandler(EncryptSelectionClipboardHandler.getInstance()); + ClipboardFilter.registerClipboardHandler(EncryptTransferableClipboardHandler.getInstance()); + } + + public static void saveTemplate(JTemplate jt) { + if (jt instanceof JForm) { + int showCount = 0; + int useCount = 0; + if (!jt.getProcessInfo().isTestTemplate()) { + JForm jForm = (JForm) jt; + XLayoutContainer root = jForm.getFormDesign().getRootComponent(); + List xCreators = ShareComponentUtils.getHelpConfigXCreatorList(root); + JSONArray helpConfigUseInfo = ComponentCollector.getInstance().getHelpConfigUseInfoWithTemplate(jForm.getTarget().getTemplateID()); + for (XCreator xCreator : xCreators) { + if (EffectItemUtils.hasEffectItem(xCreator.toData())) { + showCount ++; + if (helpConfigUseInfo.contains(ShareComponentUtils.getWidgetId(xCreator.toData()))) { + useCount++; + } + } + } + + ComponentCollector.getInstance().collectHelpConfigInfo(jForm.getTarget().getTemplateID(), showCount, useCount); + } + } + } +} diff --git a/designer-realize/src/main/java/com/fr/design/share/utils/EffectItemUtils.java b/designer-realize/src/main/java/com/fr/design/share/utils/EffectItemUtils.java index 010828cf1..99391d8c9 100644 --- a/designer-realize/src/main/java/com/fr/design/share/utils/EffectItemUtils.java +++ b/designer-realize/src/main/java/com/fr/design/share/utils/EffectItemUtils.java @@ -19,4 +19,9 @@ public class EffectItemUtils { } return effectItemGroupList; } + + public static boolean hasEffectItem(Widget widget) { + EffectItemGroup effectItemGroup = new EffectItemGroup(widget); + return effectItemGroup.getEffectItems().size() > 0; + } } diff --git a/designer-realize/src/main/java/com/fr/start/MainDesigner.java b/designer-realize/src/main/java/com/fr/start/MainDesigner.java index 5d3964771..389538b2b 100644 --- a/designer-realize/src/main/java/com/fr/start/MainDesigner.java +++ b/designer-realize/src/main/java/com/fr/start/MainDesigner.java @@ -38,6 +38,7 @@ import com.fr.design.module.ChartEmptyDataStyleAction; import com.fr.design.module.ChartPreStyleAction; import com.fr.design.module.DesignModuleFactory; import com.fr.design.monitor.DesignerLifecycleMonitorContext; +import com.fr.design.share.SharableManager; import com.fr.design.utils.concurrent.ThreadFactoryBuilder; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.event.Event; @@ -235,6 +236,7 @@ public class MainDesigner extends BaseDesigner { jt.stopEditing(); jt.saveDirectly(); jt.requestFocus(); + SharableManager.saveTemplate(jt); } }); } diff --git a/designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java b/designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java index e73e9387f..ef3baffd4 100644 --- a/designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java +++ b/designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java @@ -61,7 +61,7 @@ import com.fr.design.os.impl.SupportOSImpl; import com.fr.design.parameter.FormParameterReader; import com.fr.design.parameter.ParameterPropertyPane; import com.fr.design.parameter.WorkBookParameterReader; -import com.fr.design.share.SharableInitManager; +import com.fr.design.share.SharableManager; import com.fr.design.share.ui.config.ShareConfigPane; import com.fr.design.share.ui.generate.ShareGeneratePane; import com.fr.design.update.actions.RecoverForDesigner; @@ -207,7 +207,7 @@ public class DesignerActivator extends Activator { designerRegister(); InformationCollector.getInstance().collectStartTime(); - SharableInitManager.start(); + SharableManager.start(); } private void createPluginListener() { From e1ba505b503bfabcec5e47eb1ebb3078f0531cde Mon Sep 17 00:00:00 2001 From: hades Date: Wed, 2 Jun 2021 10:37:05 +0800 Subject: [PATCH 2/3] =?UTF-8?q?REPORT-53156=20=E3=80=90=E6=99=BA=E8=83=BD?= =?UTF-8?q?=E8=81=94=E5=8A=A8=E3=80=91=E7=BB=84=E4=BB=B6=E6=8B=96=E5=85=A5?= =?UTF-8?q?=E6=97=B6=EF=BC=8C=E6=8E=A7=E4=BB=B6=E5=BC=95=E7=94=A8=E6=A8=A1?= =?UTF-8?q?=E6=9D=BF=E6=95=B0=E6=8D=AE=E9=9B=86=E7=9A=84=E5=9C=B0=E6=96=B9?= =?UTF-8?q?=E6=B2=A1=E6=9C=89=E5=8F=91=E7=94=9F=E6=9B=BF=E6=8D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/mod/ContentObjectManager.java | 3 +- .../fr/design/mod/ContentReplacerCenter.java | 2 ++ .../change/NameTableDataContentChange.java | 34 +++++++++++++++++++ .../repalce/NameTableDataContentReplacer.java | 17 ++++++++++ 4 files changed, 55 insertions(+), 1 deletion(-) create mode 100644 designer-base/src/main/java/com/fr/design/mod/impl/change/NameTableDataContentChange.java create mode 100644 designer-base/src/main/java/com/fr/design/mod/impl/repalce/NameTableDataContentReplacer.java diff --git a/designer-base/src/main/java/com/fr/design/mod/ContentObjectManager.java b/designer-base/src/main/java/com/fr/design/mod/ContentObjectManager.java index 72ea9bb63..4d8f0cec1 100644 --- a/designer-base/src/main/java/com/fr/design/mod/ContentObjectManager.java +++ b/designer-base/src/main/java/com/fr/design/mod/ContentObjectManager.java @@ -3,7 +3,7 @@ package com.fr.design.mod; import com.fr.base.Formula; import com.fr.chart.web.ChartHyperRelateCellLink; import com.fr.chart.web.ChartHyperRelateFloatLink; -import com.fr.design.file.filter.ClassFilter; +import com.fr.data.impl.NameTableData; import com.fr.invoke.ClassHelper; import com.fr.js.JavaScriptImpl; import com.fr.plugin.chart.base.VanChartHtmlLabel; @@ -41,6 +41,7 @@ public class ContentObjectManager { set.add(ChartHyperRelateCellLink.class.getName()); set.add(ChartHyperRelateFloatLink.class.getName()); set.add(VanChartHtmlLabel.class.getName()); + set.add(NameTableData.class.getName()); } public void searchObject(Object ob) { diff --git a/designer-base/src/main/java/com/fr/design/mod/ContentReplacerCenter.java b/designer-base/src/main/java/com/fr/design/mod/ContentReplacerCenter.java index 3a18a6ea2..de690e623 100644 --- a/designer-base/src/main/java/com/fr/design/mod/ContentReplacerCenter.java +++ b/designer-base/src/main/java/com/fr/design/mod/ContentReplacerCenter.java @@ -8,6 +8,7 @@ import com.fr.design.mod.impl.change.ChartHyperRelateCellLinkContentChange; import com.fr.design.mod.impl.change.ChartHyperRelateFloatLinkContentChange; import com.fr.design.mod.impl.change.FormulaContentChange; import com.fr.design.mod.impl.change.JavaScriptContentChange; +import com.fr.design.mod.impl.change.NameTableDataContentChange; import com.fr.design.mod.impl.change.VanChartHtmlLabelContentChange; import com.fr.event.Event; import com.fr.event.EventDispatcher; @@ -73,6 +74,7 @@ public class ContentReplacerCenter { contentChangeList.add(new FormulaContentChange()); contentChangeList.add(new JavaScriptContentChange()); contentChangeList.add(new VanChartHtmlLabelContentChange()); + contentChangeList.add(new NameTableDataContentChange()); } private void onRename(List contentChangeItemList, List contentChangeList) { diff --git a/designer-base/src/main/java/com/fr/design/mod/impl/change/NameTableDataContentChange.java b/designer-base/src/main/java/com/fr/design/mod/impl/change/NameTableDataContentChange.java new file mode 100644 index 000000000..a0a036cdf --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/mod/impl/change/NameTableDataContentChange.java @@ -0,0 +1,34 @@ +package com.fr.design.mod.impl.change; + +import com.fr.data.impl.NameTableData; +import com.fr.design.mod.ContentChange; +import com.fr.design.mod.ContentReplacer; +import com.fr.design.mod.bean.ChangeItem; +import com.fr.design.mod.impl.repalce.NameTableDataContentReplacer; +import java.util.HashMap; +import java.util.Map; + +/** + * @author hades + * @version 10.0 + * Created by hades on 2021/6/2 + */ +public class NameTableDataContentChange implements ContentChange { + + private final Map> map; + + public NameTableDataContentChange() { + map = new HashMap<>(); + map.put(ChangeItem.TABLE_DATA_NAME, new NameTableDataContentReplacer()); + } + + @Override + public String type() { + return NameTableData.class.getName(); + } + + @Override + public Map> changeInfo() { + return map; + } +} diff --git a/designer-base/src/main/java/com/fr/design/mod/impl/repalce/NameTableDataContentReplacer.java b/designer-base/src/main/java/com/fr/design/mod/impl/repalce/NameTableDataContentReplacer.java new file mode 100644 index 000000000..eae4344d7 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/mod/impl/repalce/NameTableDataContentReplacer.java @@ -0,0 +1,17 @@ +package com.fr.design.mod.impl.repalce; + +import com.fr.data.impl.NameTableData; +import com.fr.design.mod.ContentReplacer; + +/** + * @author hades + * @version 10.0 + * Created by hades on 2021/6/2 + */ +public class NameTableDataContentReplacer implements ContentReplacer { + + @Override + public void replace(NameTableData nameTableData, String oldName, String newName) { + nameTableData.rename(oldName, newName); + } +} From a83d2616adcabee00396391e1003d4cbb25644e8 Mon Sep 17 00:00:00 2001 From: hades Date: Wed, 2 Jun 2021 10:39:35 +0800 Subject: [PATCH 3/3] =?UTF-8?q?REPORT-53157=20=E3=80=90=E6=99=BA=E8=83=BD?= =?UTF-8?q?=E8=81=94=E5=8A=A8=E3=80=91=E7=BB=84=E4=BB=B6=E6=8B=96=E5=85=A5?= =?UTF-8?q?=E6=97=B6=EF=BC=8C=E5=8D=95=E5=85=83=E6=A0=BC=E4=BD=8D=E7=BD=AE?= =?UTF-8?q?=E5=BC=95=E7=94=A8=E6=95=B0=E6=8D=AE=E9=9B=86=E7=9A=84=E5=9C=B0?= =?UTF-8?q?=E6=96=B9=E6=9C=AA=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/mod/ContentObjectManager.java | 4 +++ .../fr/design/mod/ContentReplacerCenter.java | 4 +++ .../impl/change/DSColumnContentChange.java | 34 +++++++++++++++++++ .../change/SimpleDSColumnContentChange.java | 34 +++++++++++++++++++ .../impl/repalce/DSColumnContentReplacer.java | 20 +++++++++++ .../SimpleDSColumnContentReplacer.java | 20 +++++++++++ .../mainframe/FormCreatorDropTarget.java | 7 ++++ 7 files changed, 123 insertions(+) create mode 100644 designer-base/src/main/java/com/fr/design/mod/impl/change/DSColumnContentChange.java create mode 100644 designer-base/src/main/java/com/fr/design/mod/impl/change/SimpleDSColumnContentChange.java create mode 100644 designer-base/src/main/java/com/fr/design/mod/impl/repalce/DSColumnContentReplacer.java create mode 100644 designer-base/src/main/java/com/fr/design/mod/impl/repalce/SimpleDSColumnContentReplacer.java diff --git a/designer-base/src/main/java/com/fr/design/mod/ContentObjectManager.java b/designer-base/src/main/java/com/fr/design/mod/ContentObjectManager.java index 4d8f0cec1..bde02bfc2 100644 --- a/designer-base/src/main/java/com/fr/design/mod/ContentObjectManager.java +++ b/designer-base/src/main/java/com/fr/design/mod/ContentObjectManager.java @@ -3,10 +3,12 @@ package com.fr.design.mod; import com.fr.base.Formula; import com.fr.chart.web.ChartHyperRelateCellLink; import com.fr.chart.web.ChartHyperRelateFloatLink; +import com.fr.data.SimpleDSColumn; import com.fr.data.impl.NameTableData; import com.fr.invoke.ClassHelper; import com.fr.js.JavaScriptImpl; import com.fr.plugin.chart.base.VanChartHtmlLabel; +import com.fr.report.cell.cellattr.core.group.DSColumn; import com.fr.stable.Filter; import java.util.HashSet; import java.util.Map; @@ -42,6 +44,8 @@ public class ContentObjectManager { set.add(ChartHyperRelateFloatLink.class.getName()); set.add(VanChartHtmlLabel.class.getName()); set.add(NameTableData.class.getName()); + set.add(SimpleDSColumn.class.getName()); + set.add(DSColumn.class.getName()); } public void searchObject(Object ob) { diff --git a/designer-base/src/main/java/com/fr/design/mod/ContentReplacerCenter.java b/designer-base/src/main/java/com/fr/design/mod/ContentReplacerCenter.java index de690e623..c8e459354 100644 --- a/designer-base/src/main/java/com/fr/design/mod/ContentReplacerCenter.java +++ b/designer-base/src/main/java/com/fr/design/mod/ContentReplacerCenter.java @@ -6,9 +6,11 @@ import com.fr.design.mod.event.TableDataModifyEvent; import com.fr.design.mod.event.WidgetNameModifyEvent; import com.fr.design.mod.impl.change.ChartHyperRelateCellLinkContentChange; import com.fr.design.mod.impl.change.ChartHyperRelateFloatLinkContentChange; +import com.fr.design.mod.impl.change.DSColumnContentChange; import com.fr.design.mod.impl.change.FormulaContentChange; import com.fr.design.mod.impl.change.JavaScriptContentChange; import com.fr.design.mod.impl.change.NameTableDataContentChange; +import com.fr.design.mod.impl.change.SimpleDSColumnContentChange; import com.fr.design.mod.impl.change.VanChartHtmlLabelContentChange; import com.fr.event.Event; import com.fr.event.EventDispatcher; @@ -75,6 +77,8 @@ public class ContentReplacerCenter { contentChangeList.add(new JavaScriptContentChange()); contentChangeList.add(new VanChartHtmlLabelContentChange()); contentChangeList.add(new NameTableDataContentChange()); + contentChangeList.add(new SimpleDSColumnContentChange()); + contentChangeList.add(new DSColumnContentChange()); } private void onRename(List contentChangeItemList, List contentChangeList) { diff --git a/designer-base/src/main/java/com/fr/design/mod/impl/change/DSColumnContentChange.java b/designer-base/src/main/java/com/fr/design/mod/impl/change/DSColumnContentChange.java new file mode 100644 index 000000000..be6e6e4ec --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/mod/impl/change/DSColumnContentChange.java @@ -0,0 +1,34 @@ +package com.fr.design.mod.impl.change; + +import com.fr.design.mod.ContentChange; +import com.fr.design.mod.ContentReplacer; +import com.fr.design.mod.bean.ChangeItem; +import com.fr.design.mod.impl.repalce.DSColumnContentReplacer; +import com.fr.report.cell.cellattr.core.group.DSColumn; +import java.util.HashMap; +import java.util.Map; + +/** + * @author hades + * @version 10.0 + * Created by hades on 2021/6/2 + */ +public class DSColumnContentChange implements ContentChange { + + private final Map> map; + + public DSColumnContentChange() { + map = new HashMap<>(); + map.put(ChangeItem.TABLE_DATA_NAME, new DSColumnContentReplacer()); + } + + @Override + public String type() { + return DSColumn.class.getName(); + } + + @Override + public Map> changeInfo() { + return map; + } +} diff --git a/designer-base/src/main/java/com/fr/design/mod/impl/change/SimpleDSColumnContentChange.java b/designer-base/src/main/java/com/fr/design/mod/impl/change/SimpleDSColumnContentChange.java new file mode 100644 index 000000000..b85eb3a2f --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/mod/impl/change/SimpleDSColumnContentChange.java @@ -0,0 +1,34 @@ +package com.fr.design.mod.impl.change; + +import com.fr.data.SimpleDSColumn; +import com.fr.design.mod.ContentChange; +import com.fr.design.mod.ContentReplacer; +import com.fr.design.mod.bean.ChangeItem; +import com.fr.design.mod.impl.repalce.SimpleDSColumnContentReplacer; +import java.util.HashMap; +import java.util.Map; + +/** + * @author hades + * @version 10.0 + * Created by hades on 2021/6/2 + */ +public class SimpleDSColumnContentChange implements ContentChange { + + private Map> map; + + public SimpleDSColumnContentChange() { + map = new HashMap<>(); + map.put(ChangeItem.TABLE_DATA_NAME, new SimpleDSColumnContentReplacer()); + } + + @Override + public String type() { + return SimpleDSColumn.class.getName(); + } + + @Override + public Map> changeInfo() { + return map; + } +} diff --git a/designer-base/src/main/java/com/fr/design/mod/impl/repalce/DSColumnContentReplacer.java b/designer-base/src/main/java/com/fr/design/mod/impl/repalce/DSColumnContentReplacer.java new file mode 100644 index 000000000..a1c131f6b --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/mod/impl/repalce/DSColumnContentReplacer.java @@ -0,0 +1,20 @@ +package com.fr.design.mod.impl.repalce; + +import com.fr.design.mod.ContentReplacer; +import com.fr.general.ComparatorUtils; +import com.fr.report.cell.cellattr.core.group.DSColumn; + +/** + * @author hades + * @version 10.0 + * Created by hades on 2021/6/2 + */ +public class DSColumnContentReplacer implements ContentReplacer { + + @Override + public void replace(DSColumn dsColumn, String oldName, String newName) { + if (ComparatorUtils.equals(dsColumn.getDSName(), oldName)) { + dsColumn.setDSName(newName); + } + } +} diff --git a/designer-base/src/main/java/com/fr/design/mod/impl/repalce/SimpleDSColumnContentReplacer.java b/designer-base/src/main/java/com/fr/design/mod/impl/repalce/SimpleDSColumnContentReplacer.java new file mode 100644 index 000000000..0aa9fdd3d --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/mod/impl/repalce/SimpleDSColumnContentReplacer.java @@ -0,0 +1,20 @@ +package com.fr.design.mod.impl.repalce; + +import com.fr.data.SimpleDSColumn; +import com.fr.design.mod.ContentReplacer; +import com.fr.general.ComparatorUtils; + +/** + * @author hades + * @version 10.0 + * Created by hades on 2021/6/2 + */ +public class SimpleDSColumnContentReplacer implements ContentReplacer { + + @Override + public void replace(SimpleDSColumn simpleDSColumn, String oldName, String newName) { + if (ComparatorUtils.equals(simpleDSColumn.getDsName(), oldName)) { + simpleDSColumn.setDsName(newName); + } + } +} diff --git a/designer-form/src/main/java/com/fr/design/mainframe/FormCreatorDropTarget.java b/designer-form/src/main/java/com/fr/design/mainframe/FormCreatorDropTarget.java index 1b8940064..01a46d25b 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/FormCreatorDropTarget.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/FormCreatorDropTarget.java @@ -5,6 +5,7 @@ import com.fr.base.chart.BaseChartCollection; import com.fr.chart.chartattr.ChartCollection; import com.fr.chartx.attr.ChartProvider; import com.fr.design.DesignModelAdapter; +import com.fr.design.data.DesignTableDataManager; import com.fr.design.data.datapane.TableDataTreePane; import com.fr.design.designer.beans.AdapterBus; import com.fr.design.designer.beans.HoverPainter; @@ -34,6 +35,7 @@ import com.fr.stable.Constants; import com.fr.stable.StringUtils; import java.util.Collections; +import java.util.HashMap; import javax.swing.BorderFactory; import javax.swing.JWindow; import java.util.List; @@ -112,8 +114,13 @@ public class FormCreatorDropTarget extends DropTarget { tdNameMap = TableDataTreePane.getInstance(DesignModelAdapter.getCurrentModelAdapter()).addTableData(bindInfo.getName(), sharableEditor.getTableDataSource(), true); //合并数据集之后,可能会有数据集名称变化,做一下联动 //共享的组件拿的时候都是克隆的,这边改拖拽中克隆的对象而非新克隆对象,上面这个新克隆的对象只是为了拿数据集 + Map map = new HashMap<>(); for (Map.Entry entry : tdNameMap.entrySet()) { designer.getTarget().renameTableData(widget, entry.getKey(), entry.getValue()); + map.put(entry.getKey(), entry.getValue()); + } + if (!map.isEmpty()) { + DesignTableDataManager.fireDSChanged(map); } } EventDispatcher.fire(TableDataModifyEvent.INSTANCE, new ContentChangeItem(tdNameMap, widget, ChangeItem.TABLE_DATA_NAME));