Browse Source

Pull request #11206: REPORT-86426 导出excel/pdf 密码支持公式

Merge in DESIGN/design from ~CORAL.CHEN/design:feature/x to feature/x

* commit 'e18d9c5a16025fb81a16461ac645b9fadcbd0bc7':
  REPORT-86426-导出excel/pdf 密码支持公式
  REPORT-86259 【导出excel&word】仅限预览下限制复制 REPORT-86426-导出excel/pdf 密码支持公式
feature/x
Coral.Chen-张晨 2 years ago
parent
commit
d3234316f5
  1. 32
      designer-realize/src/main/java/com/fr/design/report/ExportUniversalPane.java
  2. 5
      designer-realize/src/main/java/com/fr/design/report/ReportExportAttrPane.java

32
designer-realize/src/main/java/com/fr/design/report/ExportUniversalPane.java

@ -1,7 +1,6 @@
package com.fr.design.report; package com.fr.design.report;
import com.fr.base.CustomConfig; import com.fr.base.CustomConfig;
import com.fr.config.Configuration;
import com.fr.design.constants.UIConstants; import com.fr.design.constants.UIConstants;
import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.BasicPane;
import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icheckbox.UICheckBox;
@ -11,16 +10,20 @@ import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.utils.BrowseUtils; import com.fr.design.utils.BrowseUtils;
import com.fr.general.CloudCenter; import com.fr.general.CloudCenter;
import com.fr.io.attr.ReportExportAttr;
import com.fr.transaction.Configurations; import com.fr.transaction.Configurations;
import com.fr.transaction.WorkerFacade; import com.fr.transaction.WorkerFacade;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.Color; import java.awt.Color;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
/** /**
* 通用
*
* @author hades * @author hades
* @version 11.0 * @version 11.0
* Created by hades on 2022/5/26 * Created by hades on 2022/5/26
@ -30,6 +33,8 @@ public class ExportUniversalPane extends BasicPane {
private static final String HELP_URL = CloudCenter.getInstance().acquireUrlByKind("help.alt_font.zh_CN", "https://help.fanruan.com/finereport/doc-view-4707.html"); private static final String HELP_URL = CloudCenter.getInstance().acquireUrlByKind("help.alt_font.zh_CN", "https://help.fanruan.com/finereport/doc-view-4707.html");
private UICheckBox specialCharacterExport; private UICheckBox specialCharacterExport;
// 密码支持公式
private UICheckBox passwordSupportFormula;
public ExportUniversalPane() { public ExportUniversalPane() {
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
@ -55,6 +60,11 @@ public class ExportUniversalPane extends BasicPane {
labelPane.add(centerLabel, BorderLayout.CENTER); labelPane.add(centerLabel, BorderLayout.CENTER);
labelPane.add(rightLabel, BorderLayout.EAST); labelPane.add(rightLabel, BorderLayout.EAST);
northPane.add(labelPane); northPane.add(labelPane);
JPanel passwordSupportPane = FRGUIPaneFactory.createNormalFlowInnerContainer_M_Pane();
passwordSupportFormula = new UICheckBox(Toolkit.i18nText("Fine-Design_Report_Universal_Export_Password_Support_Formula"));
passwordSupportFormula.setSelected(false);
passwordSupportPane.add(passwordSupportFormula);
northPane.add(passwordSupportPane);
outerNorthPane.add(northPane); outerNorthPane.add(northPane);
this.add(outerNorthPane); this.add(outerNorthPane);
} }
@ -64,15 +74,27 @@ public class ExportUniversalPane extends BasicPane {
return "ExportUniversalPane"; return "ExportUniversalPane";
} }
public void populate() { /**
* 填充数据
*
* @param reportExportAttr 报表导出属性
*/
public void populate(ReportExportAttr reportExportAttr) {
this.specialCharacterExport.setSelected(CustomConfig.getInstance().isOptimizedSpecialCharacterExport()); this.specialCharacterExport.setSelected(CustomConfig.getInstance().isOptimizedSpecialCharacterExport());
this.passwordSupportFormula.setSelected(reportExportAttr.isPwdSupportFormula());
} }
public void update() { /**
* 更新界面
*
* @param reportExportAttr 报表导出属性
*/
public void update(ReportExportAttr reportExportAttr) {
Configurations.modify(new WorkerFacade(CustomConfig.class) { Configurations.modify(new WorkerFacade(CustomConfig.class) {
@Override @Override
public void run() { public void run() {
CustomConfig.getInstance().setOptimizedSpecialCharacterExport(specialCharacterExport.isSelected()); CustomConfig.getInstance().setOptimizedSpecialCharacterExport(specialCharacterExport.isSelected());
reportExportAttr.setPwdSupportFormula(passwordSupportFormula.isSelected());
} }
}); });
} }

5
designer-realize/src/main/java/com/fr/design/report/ReportExportAttrPane.java

@ -61,7 +61,7 @@ public class ReportExportAttrPane extends BasicPane {
} }
if (this.exportUniversalPane != null) { if (this.exportUniversalPane != null) {
this.exportUniversalPane.populate(); this.exportUniversalPane.populate(reportExportAttr);
} }
if (this.excelExportPane != null) { if (this.excelExportPane != null) {
@ -84,9 +84,8 @@ public class ReportExportAttrPane extends BasicPane {
public ReportExportAttr update() { public ReportExportAttr update() {
ReportExportAttr reportExportAttr = new ReportExportAttr(); ReportExportAttr reportExportAttr = new ReportExportAttr();
if (this.exportUniversalPane != null) { if (this.exportUniversalPane != null) {
this.exportUniversalPane.update(); this.exportUniversalPane.update(reportExportAttr);
} }
if (this.excelExportPane != null) { if (this.excelExportPane != null) {

Loading…
Cancel
Save