Browse Source

REPORT-56128【开发者预览支持调整模板布局】新自适应-设计画布里拖拽调整组件A大小,挤压绝对画布块,绝对画布块内组件会保持尺寸不变且超出绝对画布块;但开发者调试下,此场景,绝对画布块内组件尺寸适应区域调整。这里要不要统一一下效果啊@kerry

persist/11.0
kerry 3 years ago
parent
commit
74a947c089
  1. 28
      designer-form/src/main/java/com/fr/design/fit/common/AdaptiveSwitchUtil.java

28
designer-form/src/main/java/com/fr/design/fit/common/AdaptiveSwitchUtil.java

@ -1,7 +1,5 @@
package com.fr.design.fit.common; 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.data.DesignTableDataManager;
import com.fr.design.fit.DesignerUIModeConfig; import com.fr.design.fit.DesignerUIModeConfig;
import com.fr.design.fit.NewJForm; import com.fr.design.fit.NewJForm;
@ -13,7 +11,6 @@ import com.fr.design.fit.attrpane.RootDesignExtendDefinePane;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.JForm; import com.fr.design.mainframe.JForm;
import com.fr.design.mainframe.JTemplate; import com.fr.design.mainframe.JTemplate;
import com.fr.design.mainframe.JTemplateFactory;
import com.fr.design.parameter.RootDesignDefinePane; import com.fr.design.parameter.RootDesignDefinePane;
import com.fr.design.preview.FormAdaptivePreview; import com.fr.design.preview.FormAdaptivePreview;
import com.fr.design.preview.FormPreview; import com.fr.design.preview.FormPreview;
@ -25,8 +22,8 @@ import com.fr.design.widget.ui.designer.layout.FRAbsoluteLayoutDefinePane;
import com.fr.design.widget.ui.designer.layout.FRFitLayoutDefinePane; import com.fr.design.widget.ui.designer.layout.FRFitLayoutDefinePane;
import com.fr.file.FILE; import com.fr.file.FILE;
import com.fr.file.MemFILE; import com.fr.file.MemFILE;
import com.fr.form.fit.NewFormMarkAttr;
import com.fr.form.main.Form; import com.fr.form.main.Form;
import com.fr.form.main.WidgetGather;
import com.fr.form.ui.ElementCaseEditor; import com.fr.form.ui.ElementCaseEditor;
import com.fr.form.ui.Widget; import com.fr.form.ui.Widget;
import com.fr.form.ui.container.WAbsoluteBodyLayout; import com.fr.form.ui.container.WAbsoluteBodyLayout;
@ -152,11 +149,34 @@ public class AdaptiveSwitchUtil {
if (DesignerUIModeConfig.getInstance().newUIMode() && jForm.getTarget().getReportFitAttr() != null && isSwitchJFromIng()) { if (DesignerUIModeConfig.getInstance().newUIMode() && jForm.getTarget().getReportFitAttr() != null && isSwitchJFromIng()) {
jForm.getTarget().setReportFitAttr(shiftReportFitAttr(old, jForm.getTarget().getReportFitAttr().isFitFont())); jForm.getTarget().setReportFitAttr(shiftReportFitAttr(old, jForm.getTarget().getReportFitAttr().isFitFont()));
} }
processAbsoluteLayoutCompatible(jForm.getTarget());
TemplateTool.saveForm(jForm); TemplateTool.saveForm(jForm);
} }
return template; return template;
} }
private static void processAbsoluteLayoutCompatible(Form form){
Form.traversalWidget(form.getContainer(), new WidgetGather() {
@Override
public void dealWith(Widget widget) {
if (widget.acceptType(WAbsoluteBodyLayout.class)) {
return;
}
WAbsoluteLayout absoluteLayout = (WAbsoluteLayout) widget;
//切换到新模板后,内部的绝对画布块都要设置成适应缩放的逻辑
absoluteLayout.setCompState(0);
}
@Override
public boolean dealWithAllCards() {
return true;
}
}, WAbsoluteLayout.class);
}
/** /**
* @Description: 创建模板核心方法 * @Description: 创建模板核心方法
* @param old 以前的方法 * @param old 以前的方法

Loading…
Cancel
Save