Browse Source

Merge pull request #1599 in DESIGN/design from ~HADES/design:release/10.0 to release/10.0

* commit '7df8d3748619a7395bb95cfd1d6fd9e3cbcb9e92':
  MOBILE-26174 && MOBILE-25651
feature/big-screen
Hades 5 years ago
parent
commit
278f7baaf2
  1. 4
      designer-form/src/main/java/com/fr/design/actions/FormMobileAttrAction.java
  2. 15
      designer-realize/src/main/java/com/fr/design/actions/report/ReportMobileAttrAction.java

4
designer-form/src/main/java/com/fr/design/actions/FormMobileAttrAction.java

@ -82,13 +82,13 @@ public class FormMobileAttrAction extends JTemplateAction<JForm> {
if (changeSize) {
((FormArea)jf.getFormDesign().getParent()).onMobileAttrModified();
}
jf.getFormDesign().getSelectionModel().setSelectedCreator(jf.getFormDesign().getRootComponent());
//改变布局为自适应布局,只在移动端属性设置保存后改变一次
boolean changeLayout = !oldAdaptive && formMobileAttr.isAdaptivePropertyAutoMatch();
if (changeLayout) {
jf.getFormDesign().getSelectionModel().setSelectedCreator(jf.getFormDesign().getRootComponent());
doChangeBodyLayout();
WidgetPropertyPane.getInstance().refreshDockingView();
}
WidgetPropertyPane.getInstance().refreshDockingView();
jf.fireTargetModified();
}
});

15
designer-realize/src/main/java/com/fr/design/actions/report/ReportMobileAttrAction.java

@ -1,5 +1,6 @@
package com.fr.design.actions.report;
import com.fr.base.PaperSize;
import com.fr.base.iofile.attr.MobileOnlyTemplateAttrMark;
import com.fr.design.actions.JWorkBookAction;
import com.fr.design.dialog.BasicDialog;
@ -13,8 +14,10 @@ import com.fr.general.IOUtils;
import com.fr.intelli.record.Focus;
import com.fr.main.TemplateWorkBook;
import com.fr.page.PaperSettingProvider;
import com.fr.record.analyzer.EnableMetrics;
import com.fr.report.mobile.ElementCaseMobileAttr;
import com.fr.report.report.Report;
import javax.swing.*;
import java.awt.event.ActionEvent;
@ -51,6 +54,7 @@ public class ReportMobileAttrAction extends JWorkBookAction{
final ReportMobileAttrPane mobileAttrPane = new ReportMobileAttrPane();
mobileAttrPane.populateBean(mobileAttr);
final boolean oldMobileCanvasSize = mobileAttr.isMobileCanvasSize();
BasicDialog dialog = mobileAttrPane.showWindow(DesignerContext.getDesignerFrame(), new DialogActionAdapter() {
@Override
public void doOk() {
@ -69,7 +73,16 @@ public class ReportMobileAttrAction extends JWorkBookAction{
}
recordFunction();
// 设置移动端属性并刷新界面
wbTpl.setReportMobileAttr(elementCaseMobileAttr); // 会同时修改页面设置,放到最后
wbTpl.setReportMobileAttr(elementCaseMobileAttr);
boolean change = !oldMobileCanvasSize && elementCaseMobileAttr.isMobileCanvasSize();
if (change) {
// 当相关属性从未勾选到勾选状态时 设置成移动端标准页面大小
for (int i = 0; i < wbTpl.getReportCount(); i++) {
Report report = wbTpl.getReport(i);
PaperSettingProvider paperSetting = report.getReportSettings().getPaperSetting();
paperSetting.setPaperSize(PaperSize.PAPERSIZE_MOBILE);
}
}
jwb.fireTargetModified();
}
});

Loading…
Cancel
Save