From b6b477c9360e31325aeeba005b333f09c05fba77 Mon Sep 17 00:00:00 2001 From: "Henry.Wang" Date: Wed, 11 Aug 2021 18:18:28 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-56679=20=E6=96=B0=E8=87=AA=E9=80=82?= =?UTF-8?q?=E5=BA=942=E6=9C=88=E4=BB=BD=E5=90=88=E5=85=A5=E4=B8=BB=20jar?= =?UTF-8?q?=E5=90=8E=E5=9C=A8=E6=8F=92=E4=BB=B6=E4=B8=AD=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E7=9A=84=20bug=20=E5=90=8C=E6=AD=A5=E5=88=B0=20FR11?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/fr/design/fit/NewJForm.java | 5 ++++ .../design/fit/common/AdaptiveSwitchUtil.java | 23 ++++++++++++++++++- .../fr/design/fit/common/TemplateTool.java | 1 + .../fit/menupane/BrowserFitAttrPane.java | 2 +- 4 files changed, 29 insertions(+), 2 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/fit/NewJForm.java b/designer-form/src/main/java/com/fr/design/fit/NewJForm.java index b8d429ca9..74737f8ce 100644 --- a/designer-form/src/main/java/com/fr/design/fit/NewJForm.java +++ b/designer-form/src/main/java/com/fr/design/fit/NewJForm.java @@ -1,6 +1,7 @@ package com.fr.design.fit; import com.fr.base.DynamicUnitList; +import com.fr.base.Parameter; import com.fr.design.actions.TemplateParameterAction; import com.fr.design.designer.beans.AdapterBus; import com.fr.design.designer.beans.LayoutAdapter; @@ -52,6 +53,10 @@ public class NewJForm extends JForm { changePaneSize(); } + public NewJForm(Form form, FILE file, Parameter[] parameters) { + this(form, file); + } + public NewJForm(Form form, FILE file) { super(form, file); if (DesignerUIModeConfig.getInstance().newUIMode()) { diff --git a/designer-form/src/main/java/com/fr/design/fit/common/AdaptiveSwitchUtil.java b/designer-form/src/main/java/com/fr/design/fit/common/AdaptiveSwitchUtil.java index 5d9c9463c..fde06ecd1 100644 --- a/designer-form/src/main/java/com/fr/design/fit/common/AdaptiveSwitchUtil.java +++ b/designer-form/src/main/java/com/fr/design/fit/common/AdaptiveSwitchUtil.java @@ -1,5 +1,7 @@ package com.fr.design.fit.common; +import com.fr.decision.ExtraDecisionClassManager; +import com.fr.decision.fun.EmailSendProvider; import com.fr.design.data.DesignTableDataManager; import com.fr.design.fit.DesignerUIModeConfig; import com.fr.design.fit.NewJForm; @@ -23,6 +25,8 @@ import com.fr.design.widget.ui.designer.layout.FRAbsoluteLayoutDefinePane; import com.fr.design.widget.ui.designer.layout.FRFitLayoutDefinePane; import com.fr.file.FILE; import com.fr.file.MemFILE; +import com.fr.form.fit.NewFormMarkAttr; +import com.fr.form.main.Form; import com.fr.form.ui.ElementCaseEditor; import com.fr.form.ui.Widget; import com.fr.form.ui.container.WAbsoluteBodyLayout; @@ -34,6 +38,7 @@ import com.fr.log.FineLoggerFactory; import com.fr.report.fit.ReportFitAttr; import javax.swing.SwingUtilities; +import java.util.Set; /** * Created by kerry on 2020-06-02 @@ -167,7 +172,23 @@ public class AdaptiveSwitchUtil { } TemplateTool.saveForm(old); } - return JTemplateFactory.createJTemplate(old.getEditingFILE()); + if (old.getTarget() instanceof Form) { + Form form = (Form) old.getTarget(); + try { + NewFormMarkAttr newFormMarkAttr = form.getAttrMark(NewFormMarkAttr.XML_TAG); + }catch (Exception e){ + //插件启用的时候走到这里 + return JTemplateFactory.createJTemplate(old.getEditingFILE()); + } + try { + return new NewJForm((Form) (old.getTarget()).clone(), old.getEditingFILE()); + } catch (Exception e) { + FineLoggerFactory.getLogger().error(e, e.getMessage()); + return null; + } + } else { + return null; + } } /** diff --git a/designer-form/src/main/java/com/fr/design/fit/common/TemplateTool.java b/designer-form/src/main/java/com/fr/design/fit/common/TemplateTool.java index c760d01da..eca7af50b 100644 --- a/designer-form/src/main/java/com/fr/design/fit/common/TemplateTool.java +++ b/designer-form/src/main/java/com/fr/design/fit/common/TemplateTool.java @@ -12,6 +12,7 @@ import com.fr.design.fit.NewJForm; import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.FormArea; import com.fr.design.mainframe.FormDesigner; +import com.fr.design.mainframe.JForm; import com.fr.design.mainframe.JTemplate; import com.fr.event.Event; import com.fr.event.Listener; diff --git a/designer-form/src/main/java/com/fr/design/fit/menupane/BrowserFitAttrPane.java b/designer-form/src/main/java/com/fr/design/fit/menupane/BrowserFitAttrPane.java index fdc2f8332..32fe81ded 100644 --- a/designer-form/src/main/java/com/fr/design/fit/menupane/BrowserFitAttrPane.java +++ b/designer-form/src/main/java/com/fr/design/fit/menupane/BrowserFitAttrPane.java @@ -181,7 +181,7 @@ public class BrowserFitAttrPane extends BasicBeanPane { boolean isLocalConfig = !globalCheck.isSelected(); //勾选全局时,采用全局保存的自适应属性更新界面 if (!isLocalConfig) { - ReportFitAttr attr = globalFitAttr; + ReportFitAttr attr = jFormType.obtainFitAttr(); populateAttrPane(attr); remove(BrowserFitAttrPane.this.borderPane); initBorderPane(Toolkit.i18nText("Fine-Designer_Fit-Global"));