From f4820d2769a2f70bc3830e0f6539b550b093af32 Mon Sep 17 00:00:00 2001 From: "fly.li" Date: Thu, 2 Sep 2021 19:33:41 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-55243=EF=BC=9A=E6=94=B9=E5=8F=98?= =?UTF-8?q?=E6=8A=A5=E8=A1=A8=E5=BC=95=E6=93=8E=E5=B1=9E=E6=80=A7=E5=90=8E?= =?UTF-8?q?=EF=BC=8C=E9=9C=80=E8=A6=81=E6=94=B9=E5=8F=98=E4=B8=80=E4=B8=8B?= =?UTF-8?q?JTemplate=E7=9A=84=E4=BF=9D=E5=AD=98=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/mainframe/JTemplate.java | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) 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 8d18bb0db3..79762f212a 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());