Browse Source

Pull request #5852: REPORT-59143 【设计器适配】模版设置为移动端模版也要支持新旧表单切换

Merge in DESIGN/design from ~HENRY.WANG/design:final/11.0 to final/11.0

* commit '26dcb553cee3bbf896236dcde33a6befe60cef4d':
  REPORT-59143 【设计器适配】模版设置为移动端模版也要支持新旧表单切换
  REPORT-59143 【设计器适配】模版设置为移动端模版也要支持新旧表单切换
  REPORT-59143 【设计器适配】模版设置为移动端模版也要支持新旧表单切换
persist/11.0
Henry.Wang 3 years ago
parent
commit
4a98c1d917
  1. 5
      designer-form/src/main/java/com/fr/design/fit/NewJForm.java
  2. 19
      designer-form/src/main/java/com/fr/design/fit/common/TemplateTool.java

5
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 * @date: 2020/9/13 23:23
*/ */
private void changePaneSize() { private void changePaneSize() {
if (mobileForm())
return;
NewFormMarkAttr newFormMarkAttr = this.getTarget().getAttrMark(NewFormMarkAttr.XML_TAG); NewFormMarkAttr newFormMarkAttr = this.getTarget().getAttrMark(NewFormMarkAttr.XML_TAG);
if (newFormMarkAttr.isNotSetOriginSize()) { if (newFormMarkAttr.isNotSetOriginSize()) {
newFormMarkAttr.setBodyHeight(LayoutTool.getBodyHeight(this)); newFormMarkAttr.setBodyHeight(LayoutTool.getBodyHeight(this));
@ -284,11 +282,8 @@ public class NewJForm extends JForm {
private UIButton[] addAdaptiveSwitchButton(UIButton[] extraButtons) { private UIButton[] addAdaptiveSwitchButton(UIButton[] extraButtons) {
switchAction = new SwitchAction(); switchAction = new SwitchAction();
if (!mobileForm()) {
return ArrayUtils.addAll(extraButtons, new UIButton[]{switchAction.getToolBarButton()}); return ArrayUtils.addAll(extraButtons, new UIButton[]{switchAction.getToolBarButton()});
} }
return extraButtons;
}
public boolean isNewJFrom() { public boolean isNewJFrom() {
return jFormType == null || jFormType.isNewType(); return jFormType == null || jFormType.isNewType();

19
designer-form/src/main/java/com/fr/design/fit/common/TemplateTool.java

@ -45,16 +45,9 @@ public class TemplateTool {
JFormType currentType = JFormType.OLD_TYPE; JFormType currentType = JFormType.OLD_TYPE;
if (AdaptiveSwitchUtil.isSwitchJFromIng()) { if (AdaptiveSwitchUtil.isSwitchJFromIng()) {
currentType = DesignerUIModeConfig.getInstance().newUIMode() ? JFormType.NEW_TYPE : JFormType.OLD_TYPE; currentType = DesignerUIModeConfig.getInstance().newUIMode() ? JFormType.NEW_TYPE : JFormType.OLD_TYPE;
} else { } else if (isNewJForm(jTemplate)) {
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; currentType = JFormType.NEW_TYPE;
} }
}
}
//UI转换 //UI转换
currentType.switchUIMode(); 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<JTemplate> getSwitchListener() { public static Listener<JTemplate> getSwitchListener() {
return switchListener; return switchListener;
} }

Loading…
Cancel
Save