diff --git a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java index 3636a18daf..0fb8380905 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java @@ -1009,16 +1009,7 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta */ private void activeTemplate(FILE tplFile, JTemplate jt) { // 如果该模板已经打开,则进行激活就可以了 - String fullName = StableUtils.pathJoin(new String[]{ProjectConstants.REPORTLETS_NAME, tplFile.getName()}); - if (tplFile instanceof FileNodeFILE) { - fullName = ((FileNodeFILE) tplFile).getEnvPath() + "/" + tplFile.getPath(); - } - // 如果是从文件夹打开的文件,不是从设计器文件树打开的文件,则直接取path就行 - if (tplFile instanceof FileFILE) { - fullName = tplFile.getPath(); - } - fullName = OperatingSystem.isWindows() ? fullName.replaceAll("/", "\\\\") : fullName.replaceAll("\\\\", "/"); - int index = HistoryTemplateListPane.getInstance().contains(fullName); + int index = HistoryTemplateListPane.getInstance().contains(tplFile.getPath()); List> historyList = HistoryTemplateListPane.getInstance().getHistoryList(); if (index != -1) { historyList.get(index).activeJTemplate(index, jt); diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/FileModel.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/FileModel.java index 70d55b872b..377c2c8ebd 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/FileModel.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/FileModel.java @@ -22,8 +22,8 @@ public class FileModel extends AlphaCellModel { public FileModel(String name, String filePath) { super(name, null, CellType.FILE); - this.filePath = filePath; - setDescription(AlphaFineHelper.findFolderName(filePath)); + this.filePath = filePath.replaceAll("\\\\", "/"); + setDescription(AlphaFineHelper.findFolderName(this.filePath)); } public String getFilePath() {