Browse Source

REPORT-79456 【运营产品化二期】远程设计下 立即使用下载不成功

远程设计获取的下载路径是个url,不可用
改为下载到桌面
release/11.0
Link.Zhao 2 years ago
parent
commit
3b309e8b2a
  1. 23
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/action/StartUseAction.java
  2. 6
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/download/FineMarketDownloadManager.java

23
designer-realize/src/main/java/com/fr/design/mainframe/alphafine/action/StartUseAction.java

@ -54,28 +54,33 @@ public class StartUseAction implements ActionListener {
}.execute();
}
/**
* 打开模板并打开文件目录
* */
void open(String fileName) throws IOException {
if (Strings.isEmpty(fileName)) {
return;
}
// 打开模板
openInDesigner(fileName);
// 打开系统文件夹
File parentDir = new File(fileName).getParentFile();
Desktop.getDesktop().open(parentDir);
}
void openInDesigner(String fileName) {
File fileNeedOpen = new File(fileName);
if (fileName.endsWith(FineMarketConstants.ZIP)) {
File[] files = fileNeedOpen.getParentFile().listFiles();
fileNeedOpen = getFirstCptOrFrm(files);
} else if (fileName.endsWith(FineMarketConstants.RAR)) {
// rar直接打开系统文件夹
File parentDir = new File(fileName).getParentFile();
Desktop.getDesktop().open(parentDir);
// rar资源没有解压,所以不用打开模板
return;
}
openInDesigner(fileNeedOpen);
}
void openInDesigner(File file) {
// 刷新目录
DesignerFrameFileDealerPane.getInstance().refresh();
// 打开模板
DesignerContext.getDesignerFrame().openTemplate(new FileFILE(file));
DesignerContext.getDesignerFrame().openTemplate(new FileFILE(fileNeedOpen));
}

6
designer-realize/src/main/java/com/fr/design/mainframe/alphafine/download/FineMarketDownloadManager.java

@ -13,9 +13,9 @@ import com.fr.design.mainframe.alphafine.search.helper.FineMarketClientHelper;
import com.fr.design.mainframe.toast.SimpleToast;
import com.fr.log.FineLoggerFactory;
import com.fr.third.jodd.io.ZipUtil;
import com.fr.workspace.WorkContext;
import javax.swing.SwingUtilities;
import javax.swing.filechooser.FileSystemView;
import java.awt.Window;
import java.io.File;
import java.io.IOException;
@ -57,8 +57,8 @@ public class FineMarketDownloadManager {
}
private String install(TemplateResource resource, Window parentWindow) {
// 获取报表录作为下载位置
String workDir = WorkContext.getCurrent().getPath() + FineMarketConstants.REPORTLETS;
// 默认下载到桌面
String workDir = FileSystemView.getFileSystemView().getHomeDirectory().getPath();
File destDir = new File(workDir);
DownloadProcess downloadProcess = new DownloadProcess(parentWindow);

Loading…
Cancel
Save