Browse Source

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

zheng-1641779399395
hades 3 years ago
parent
commit
6cfbdf33a2
  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.byteDataToIamge(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.byteDataToIamge(bytes);
}
@Override

Loading…
Cancel
Save