From 086b09bab3331eb1bc547ac70f8c7038202c08ee Mon Sep 17 00:00:00 2001 From: hades Date: Thu, 27 Feb 2020 13:42:23 +0800 Subject: [PATCH] =?UTF-8?q?MOBILE-25615=20=E5=90=8C=E6=AD=A5=E5=88=B0final?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/actions/FormMobileAttrAction.java | 14 ++++++++++---- .../mobile/FormMobileTemplateSettingsPane.java | 4 +--- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/actions/FormMobileAttrAction.java b/designer-form/src/main/java/com/fr/design/actions/FormMobileAttrAction.java index c6f64c498c..b387cbc703 100644 --- a/designer-form/src/main/java/com/fr/design/actions/FormMobileAttrAction.java +++ b/designer-form/src/main/java/com/fr/design/actions/FormMobileAttrAction.java @@ -56,6 +56,9 @@ public class FormMobileAttrAction extends JTemplateAction { final FormMobileAttrPane mobileAttrPane = new FormMobileAttrPane(); mobileAttrPane.populateBean(mobileAttr); + + final boolean oldMobileOnly = mobileAttr.isMobileOnly(); + final boolean oldAdaptive = mobileAttr.isAdaptivePropertyAutoMatch(); BasicDialog dialog = mobileAttrPane.showWindow(DesignerContext.getDesignerFrame(), new DialogActionAdapter() { @Override public void doOk() { @@ -75,13 +78,16 @@ public class FormMobileAttrAction extends JTemplateAction { recordFunction(); // 设置移动端属性并刷新界面 formTpl.setFormMobileAttr(formMobileAttr); // 会调整 body 的自适应布局,放到最后 - ((FormArea)jf.getFormDesign().getParent()).onMobileAttrModified(); + boolean changeSize = (!oldMobileOnly && formMobileAttr.isMobileOnly()) || (oldMobileOnly && !formMobileAttr.isMobileOnly()); + if (changeSize) { + ((FormArea)jf.getFormDesign().getParent()).onMobileAttrModified(); + } jf.getFormDesign().getSelectionModel().setSelectedCreator(jf.getFormDesign().getRootComponent()); - //当自适应属性自动匹配处于勾选状态 进行切换 - if (formMobileAttr.isMobileOnly() && formMobileAttr.isAdaptivePropertyAutoMatch()) { + //改变布局为自适应布局,只在移动端属性设置保存后改变一次 + boolean changeLayout = !oldAdaptive && formMobileAttr.isAdaptivePropertyAutoMatch(); + if (changeLayout) { doChangeBodyLayout(); } - WidgetPropertyPane.getInstance().refreshDockingView(); jf.fireTargetModified(); } diff --git a/designer-form/src/main/java/com/fr/design/form/mobile/FormMobileTemplateSettingsPane.java b/designer-form/src/main/java/com/fr/design/form/mobile/FormMobileTemplateSettingsPane.java index 21f6d3b09f..2eac9c5863 100644 --- a/designer-form/src/main/java/com/fr/design/form/mobile/FormMobileTemplateSettingsPane.java +++ b/designer-form/src/main/java/com/fr/design/form/mobile/FormMobileTemplateSettingsPane.java @@ -47,9 +47,7 @@ public class FormMobileTemplateSettingsPane extends BasicBeanPane