diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/ChoosePane.java b/designer-base/src/main/java/com/fr/design/data/datapane/ChoosePane.java index 99a294fdde..ce76a77751 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/ChoosePane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/ChoosePane.java @@ -355,7 +355,6 @@ public class ChoosePane extends BasicBeanPane implements Refresha */ @Override public void refresh() { - DBUtils.refreshDatabase(); String schema = StringUtils.isEmpty(schemaBox.getSelectedItem()) ? null : schemaBox.getSelectedItem(); DataCoreUtils.refreshTables(getConnection(), TableProcedure.TABLE, schema); FineJOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Refresh_Successfully") + "!", com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Refresh_Database"), diff --git a/designer-base/src/main/java/com/fr/design/editlock/EditLockChangeChecker.java b/designer-base/src/main/java/com/fr/design/editlock/EditLockChangeChecker.java index d45c4c1813..cb4d5550f7 100644 --- a/designer-base/src/main/java/com/fr/design/editlock/EditLockChangeChecker.java +++ b/designer-base/src/main/java/com/fr/design/editlock/EditLockChangeChecker.java @@ -32,7 +32,7 @@ public abstract class EditLockChangeChecker { */ public void start() { this.scheduler = Executors.newSingleThreadScheduledExecutor(new NamedThreadFactory("EditLockChangeChecker")); - this.scheduler.scheduleAtFixedRate(new Runnable() { + this.scheduler.scheduleWithFixedDelay(new Runnable() { @Override public void run() { // 判断是否为远程设计环境 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 3cd8fdb78c..9697113e27 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 @@ -6,6 +6,7 @@ import com.fr.base.extension.FileExtension; import com.fr.base.info.TemplateSaveInfoContext; import com.fr.base.io.BaseBook; import com.fr.base.iofile.attr.DesignBanCopyAttrMark; +import com.fr.base.iofile.attr.ForkIdAttrMark; import com.fr.base.iofile.attr.TemplateIdAttrMark; import com.fr.base.iofile.attr.TemplateThemeAttrMark; import com.fr.base.svg.IconUtils; @@ -343,6 +344,18 @@ public abstract class JTemplate> generateTemplateId(); } + /** + * 如果没有 forkId, 则计算 forkId + * 要求在 templateId, 创建后执行。 + */ + protected void computeForkIdIfAbsent() { + + ForkIdAttrMark forkIdAttrMark = this.template.getAttrMark(ForkIdAttrMark.XML_TAG); + if (forkIdAttrMark == null || StringUtils.isEmpty(forkIdAttrMark.getForkId())) { + this.template.addAttrMark(new ForkIdAttrMark(this.template.getTemplateID())); + } + } + /** * 收集图表信息 */ @@ -971,6 +984,7 @@ public abstract class JTemplate> } // 在保存之前,初始化 templateID generateNewTemplateIdForSaveAs(); + computeForkIdIfAbsent(); this.editingFILE = editingFILE; TemplateSaveInfoContext.getInstance().startCollect(template); @@ -1855,6 +1869,8 @@ public abstract class JTemplate> } // 在保存之前,初始化 templateID generateNewTemplateIdForSaveAs(); + computeForkIdIfAbsent(); + this.editingFILE = editingFILE; boolean result = this.saveToNewRealFile(oldName); if (result) {