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 74737f8ce6..fe192b59b9 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 @@ -73,8 +73,6 @@ public class NewJForm extends JForm { * @date: 2020/9/13 23:23 */ private void changePaneSize() { - if (mobileForm()) - return; NewFormMarkAttr newFormMarkAttr = this.getTarget().getAttrMark(NewFormMarkAttr.XML_TAG); if (newFormMarkAttr.isNotSetOriginSize()) { newFormMarkAttr.setBodyHeight(LayoutTool.getBodyHeight(this)); @@ -284,10 +282,7 @@ public class NewJForm extends JForm { private UIButton[] addAdaptiveSwitchButton(UIButton[] extraButtons) { switchAction = new SwitchAction(); - if (!mobileForm()) { - return ArrayUtils.addAll(extraButtons, new UIButton[]{switchAction.getToolBarButton()}); - } - return extraButtons; + return ArrayUtils.addAll(extraButtons, new UIButton[]{switchAction.getToolBarButton()}); } public boolean isNewJFrom() { 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 323a28ad04..cb415df591 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 @@ -45,15 +45,8 @@ public class TemplateTool { JFormType currentType = JFormType.OLD_TYPE; if (AdaptiveSwitchUtil.isSwitchJFromIng()) { currentType = DesignerUIModeConfig.getInstance().newUIMode() ? JFormType.NEW_TYPE : JFormType.OLD_TYPE; - } else { - if (jTemplate instanceof NewJForm) { - NewJForm newJForm = (NewJForm) jTemplate; - if (newJForm.mobileForm()) { - currentType = JFormType.OLD_TYPE; - } else if (LightTool.containNewFormFlag(newJForm.getTarget()) || newJForm.getTarget().getTemplateID() == null) { - currentType = JFormType.NEW_TYPE; - } - } + } else if (isNewJForm(jTemplate)) { + currentType = JFormType.NEW_TYPE; } //UI转换 currentType.switchUIMode(); @@ -64,6 +57,16 @@ public class TemplateTool { } }; + private static boolean isNewJForm(JTemplate jTemplate) { + if (jTemplate instanceof NewJForm) { + NewJForm newJForm = (NewJForm) jTemplate; + if (LightTool.containNewFormFlag(newJForm.getTarget()) || newJForm.getTarget().getTemplateID() == null) { + return true; + } + } + return false; + } + public static Listener getSwitchListener() { return switchListener; }