Browse Source

REPORT-58301 【决策报表】布局切换以后,body背景样式不保留

【问题原因】
切换布局类型时,保留body背景样式

【改动思路】
同上
research/11.0
Starryi 3 years ago
parent
commit
708443c19c
  1. 7
      designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/FRAbsoluteBodyLayoutDefinePane.java
  2. 4
      designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/FRFitLayoutDefinePane.java

7
designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/FRAbsoluteBodyLayoutDefinePane.java

@ -27,6 +27,7 @@ import com.fr.form.ui.LayoutBorderStyle;
import com.fr.form.ui.container.WAbsoluteBodyLayout; import com.fr.form.ui.container.WAbsoluteBodyLayout;
import com.fr.form.ui.container.WAbsoluteLayout; import com.fr.form.ui.container.WAbsoluteLayout;
import com.fr.form.ui.container.WBodyLayoutType; import com.fr.form.ui.container.WBodyLayoutType;
import com.fr.form.ui.container.WFitLayout;
import com.fr.general.act.BorderPacker; import com.fr.general.act.BorderPacker;
import com.fr.report.core.ReportUtils; import com.fr.report.core.ReportUtils;
@ -173,6 +174,12 @@ public class FRAbsoluteBodyLayoutDefinePane extends FRAbsoluteLayoutDefinePane {
if (state == WBodyLayoutType.FIT.getTypeValue()) { if (state == WBodyLayoutType.FIT.getTypeValue()) {
XWFitLayout xwFitLayout = ((XWFitLayout)creator.getBackupParent()); XWFitLayout xwFitLayout = ((XWFitLayout)creator.getBackupParent());
xwFitLayout.switch2FitBodyLayout(creator); xwFitLayout.switch2FitBodyLayout(creator);
WFitLayout wFitLayout = xwFitLayout.toData();
// 切换布局类型时,保留body背景样式
if (wFitLayout != null) {
wFitLayout.setBorderStyleFollowingTheme(layout.isBorderStyleFollowingTheme());
wFitLayout.setBorderStyle(layout.getBorderStyle());
}
copyLayoutAttr(layout, xwFitLayout.toData()); copyLayoutAttr(layout, xwFitLayout.toData());
} }
} }

4
designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/FRFitLayoutDefinePane.java

@ -215,9 +215,13 @@ public class FRFitLayoutDefinePane extends AbstractFRLayoutDefinePane<WFitLayout
layout.setLayoutType(WBodyLayoutType.parse(state)); layout.setLayoutType(WBodyLayoutType.parse(state));
layout.setCompState(adaptComboBox.getSelectedIndex()); layout.setCompState(adaptComboBox.getSelectedIndex());
try { try {
// 自适应布局切换到绝对布局
if (state == WBodyLayoutType.ABSOLUTE.getTypeValue()) { if (state == WBodyLayoutType.ABSOLUTE.getTypeValue()) {
WAbsoluteBodyLayout wAbsoluteBodyLayout = new WAbsoluteBodyLayout("body"); WAbsoluteBodyLayout wAbsoluteBodyLayout = new WAbsoluteBodyLayout("body");
wAbsoluteBodyLayout.setCompState(WAbsoluteLayout.STATE_FIXED); wAbsoluteBodyLayout.setCompState(WAbsoluteLayout.STATE_FIXED);
// 切换布局类型时,保留body背景样式
wAbsoluteBodyLayout.setBorderStyleFollowingTheme(layout.isBorderStyleFollowingTheme());
wAbsoluteBodyLayout.setBorderStyle((BorderPacker) (layout.getBorderStyle().clone()));
Component[] components = xWFitLayout.getComponents(); Component[] components = xWFitLayout.getComponents();
xWFitLayout.removeAll(); xWFitLayout.removeAll();
layout.resetStyle(); layout.resetStyle();

Loading…
Cancel
Save