diff --git a/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java b/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java index 8d18bb0db..79762f212 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java @@ -1615,9 +1615,8 @@ public abstract class JTemplate> worker.addSuccessCallback(new Runnable() { @Override public void run() { - //在新建报表流程会走这个流程,应该进行预编译 - if (!JTemplate.this.isSaved() && !DesignModeContext.isVcsMode()){ - //这里要先调下面这行代码 + boolean isChangedFile = !JTemplate.this.isSaved() && !DesignModeContext.isVcsMode(); + if (isChangedFile){ callBackForSave(); CptCompileUtil.compile(JTemplate.this); } @@ -1626,11 +1625,11 @@ public abstract class JTemplate> if (ComparatorUtils.equals(JTemplate.this.template.getTemplateID(), HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().template.getTemplateID())) { refreshToolArea(); + } DesignerFrameFileDealerPane.getInstance().refresh(); } }); - return worker; } @@ -1682,7 +1681,11 @@ public abstract class JTemplate> } if (!result) { //在这里改变报表引擎属性 - CptCompileUtil.changeFrEngineAttr(oldName, this); + boolean ischanged = CptCompileUtil.changeFrEngineAttr(oldName, this); + if (ischanged){ + //如果改变了属性,则需要重新预编译,因此设置jTemplate的保存状态为false + this.saved = false; + } result = this.saveRealFile(); // 更换最近打开 DesignerEnvManager.getEnvManager().replaceRecentOpenedFilePath(oldName, this.getPath());