Browse Source

Pull request #6093: REPORT-50201 远程af搜索模板,部分模板右侧加载不出来

Merge in DESIGN/design from ~HADES/design:release/10.0 to release/10.0

* commit '25f5999d450e06a472edfa5db935e76ddc5f5347':
  REPORT-50201 fix 拼写错误
  REPORT-50201 远程af搜索模板,部分模板右侧加载不出来
zheng-1641779399395
Hades 3 years ago
parent
commit
6c47b1513c
  1. 35
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java

35
designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java

@ -32,19 +32,17 @@ import com.fr.design.mainframe.alphafine.search.manager.impl.RecentSearchManager
import com.fr.design.mainframe.alphafine.search.manager.impl.RecommendSearchManager;
import com.fr.design.mainframe.alphafine.search.manager.impl.SegmentationManager;
import com.fr.design.mainframe.alphafine.search.manager.impl.SimilarSearchManager;
import com.fr.form.main.Form;
import com.fr.form.main.FormIO;
import com.fr.general.ComparatorUtils;
import com.fr.general.http.HttpClient;
import com.fr.io.TemplateWorkBookIO;
import com.fr.io.exporter.ImageExporter;
import com.fr.json.JSONObject;
import com.fr.log.FineLoggerFactory;
import com.fr.main.impl.WorkBook;
import com.fr.stable.CodeUtils;
import com.fr.stable.StringUtils;
import com.fr.stable.project.ProjectConstants;
import com.fr.workspace.WorkContext;
import com.fr.workspace.server.exporter.LocalExportOperator;
import com.fr.workspace.server.exporter.TemplateExportOperator;
import javax.imageio.ImageIO;
import javax.swing.BorderFactory;
import javax.swing.DefaultListModel;
@ -601,14 +599,15 @@ public class AlphaFineDialog extends UIDialog {
checkWorker();
this.showWorker = new SwingWorker<BufferedImage, Void>() {
@Override
protected BufferedImage doInBackground() {
Form form = null;
protected BufferedImage doInBackground() throws Exception {
byte[] bytes = null;
try {
form = FormIO.readForm(fileName);
} catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
bytes = WorkContext.getCurrent().get(TemplateExportOperator.class).exportFormAsImageData(fileName);
} catch (Exception ignored) {
// 兼容下老版本
bytes = new LocalExportOperator().exportFormAsImageData(fileName);
}
return FormIO.exportFormAsImage(form);
return TemplateExportOperator.byteDataToImage(bytes);
}
@Override
@ -631,15 +630,15 @@ public class AlphaFineDialog extends UIDialog {
checkWorker();
this.showWorker = new SwingWorker<BufferedImage, Void>() {
@Override
protected BufferedImage doInBackground() {
WorkBook workBook = null;
protected BufferedImage doInBackground() throws Exception {
byte[] bytes = null;
try {
workBook = (WorkBook) TemplateWorkBookIO.readTemplateWorkBook(fileName);
} catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
bytes = WorkContext.getCurrent().get(TemplateExportOperator.class).exportWorkBookAsImageData(fileName);
} catch (Exception ignored) {
// 兼容下老版本
bytes = new LocalExportOperator().exportWorkBookAsImageData(fileName);
}
BufferedImage bufferedImage = new ImageExporter().exportToImage(workBook);
return bufferedImage;
return TemplateExportOperator.byteDataToImage(bytes);
}
@Override

Loading…
Cancel
Save