From 633dd6dbdafc4c45e34126e3ee46055fc6c27662 Mon Sep 17 00:00:00 2001 From: hades Date: Wed, 26 Feb 2020 11:24:21 +0800 Subject: [PATCH 1/2] =?UTF-8?q?MOBILE-25615=20=E9=AB=98=E5=BA=A6=E9=87=8D?= =?UTF-8?q?=E7=BD=AE=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/actions/FormMobileAttrAction.java | 18 +++++++++++++++--- .../mobile/FormMobileTemplateSettingsPane.java | 4 +--- 2 files changed, 16 insertions(+), 6 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 d77078fad..63cb6a606 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,11 +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()); //改变布局为自适应布局,只在移动端属性设置保存后改变一次 - doChangeBodyLayout(); - + boolean changeLayout = !oldAdaptive && formMobileAttr.isAdaptivePropertyAutoMatch(); + if (changeLayout) { + doChangeBodyLayout(); + } WidgetPropertyPane.getInstance().refreshDockingView(); jf.fireTargetModified(); } @@ -87,6 +95,10 @@ public class FormMobileAttrAction extends JTemplateAction { dialog.setVisible(true); } + private boolean isAttrChange(boolean oldValue, boolean newValue) { + return !oldValue && newValue; + } + private void doChangeBodyLayout(){ FormDesigner formDesigner = WidgetPropertyPane.getInstance().getEditingFormDesigner(); XLayoutContainer rootLayout = formDesigner.getRootComponent(); 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 21f6d3b09..2eac9c586 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 Date: Wed, 26 Feb 2020 11:25:39 +0800 Subject: [PATCH 2/2] fix --- .../main/java/com/fr/design/actions/FormMobileAttrAction.java | 4 ---- 1 file changed, 4 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 63cb6a606..b387cbc70 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 @@ -95,10 +95,6 @@ public class FormMobileAttrAction extends JTemplateAction { dialog.setVisible(true); } - private boolean isAttrChange(boolean oldValue, boolean newValue) { - return !oldValue && newValue; - } - private void doChangeBodyLayout(){ FormDesigner formDesigner = WidgetPropertyPane.getInstance().getEditingFormDesigner(); XLayoutContainer rootLayout = formDesigner.getRootComponent();