Browse Source

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

Merge in DESIGN/design from ~LINK.ZHAO/design:release/11.0 to release/11.0

* commit 'df318442cf986b65d9a6fef3eea9ba2970014dcf':
  REPORT-79456 【运营产品化二期】远程设计下 立即使用下载不成功 远程设计获取的下载路径是个url,不可用 改为下载到桌面
newui
Link.Zhao 2 years ago
parent
commit
c20888aa0d
  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(); }.execute();
} }
/**
* 打开模板并打开文件目录
* */
void open(String fileName) throws IOException { void open(String fileName) throws IOException {
if (Strings.isEmpty(fileName)) { if (Strings.isEmpty(fileName)) {
return; return;
} }
// 打开模板
openInDesigner(fileName);
// 打开系统文件夹
File parentDir = new File(fileName).getParentFile();
Desktop.getDesktop().open(parentDir);
}
void openInDesigner(String fileName) {
File fileNeedOpen = new File(fileName); File fileNeedOpen = new File(fileName);
if (fileName.endsWith(FineMarketConstants.ZIP)) { if (fileName.endsWith(FineMarketConstants.ZIP)) {
File[] files = fileNeedOpen.getParentFile().listFiles(); File[] files = fileNeedOpen.getParentFile().listFiles();
fileNeedOpen = getFirstCptOrFrm(files); fileNeedOpen = getFirstCptOrFrm(files);
} else if (fileName.endsWith(FineMarketConstants.RAR)) { } else if (fileName.endsWith(FineMarketConstants.RAR)) {
// rar直接打开系统文件夹 // rar资源没有解压,所以不用打开模板
File parentDir = new File(fileName).getParentFile();
Desktop.getDesktop().open(parentDir);
return; 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.design.mainframe.toast.SimpleToast;
import com.fr.log.FineLoggerFactory; import com.fr.log.FineLoggerFactory;
import com.fr.third.jodd.io.ZipUtil; import com.fr.third.jodd.io.ZipUtil;
import com.fr.workspace.WorkContext;
import javax.swing.SwingUtilities; import javax.swing.SwingUtilities;
import javax.swing.filechooser.FileSystemView;
import java.awt.Window; import java.awt.Window;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
@ -57,8 +57,8 @@ public class FineMarketDownloadManager {
} }
private String install(TemplateResource resource, Window parentWindow) { 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); File destDir = new File(workDir);
DownloadProcess downloadProcess = new DownloadProcess(parentWindow); DownloadProcess downloadProcess = new DownloadProcess(parentWindow);

Loading…
Cancel
Save