From 7df8d3748619a7395bb95cfd1d6fd9e3cbcb9e92 Mon Sep 17 00:00:00 2001 From: hades Date: Fri, 17 Apr 2020 16:27:53 +0800 Subject: [PATCH] MOBILE-26174 && MOBILE-25651 --- .../fr/design/actions/FormMobileAttrAction.java | 4 ++-- .../actions/report/ReportMobileAttrAction.java | 15 ++++++++++++++- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/actions/FormMobileAttrAction.java b/designer-form/src/main/java/com/fr/design/actions/FormMobileAttrAction.java index b387cbc70..deec25c0b 100644 --- a/designer-form/src/main/java/com/fr/design/actions/FormMobileAttrAction.java +++ b/designer-form/src/main/java/com/fr/design/actions/FormMobileAttrAction.java @@ -82,13 +82,13 @@ public class FormMobileAttrAction extends JTemplateAction { 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(); } }); diff --git a/designer-realize/src/main/java/com/fr/design/actions/report/ReportMobileAttrAction.java b/designer-realize/src/main/java/com/fr/design/actions/report/ReportMobileAttrAction.java index a31108f2c..a002f56e8 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/report/ReportMobileAttrAction.java +++ b/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(); } });