diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/util/InstallUtils.java b/designer-form/src/main/java/com/fr/design/mainframe/share/util/InstallUtils.java index c25f53f51..610f688a4 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/share/util/InstallUtils.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/util/InstallUtils.java @@ -84,7 +84,7 @@ public class InstallUtils { @Nullable private static Group createComponentGroup(String fileName) { - String groupName = fileName.substring(0, fileName.indexOf(DOT + ReuxUtils.REUS_SUFFIX)); + String groupName = createGroupName(fileName); //有重名分组则加后缀 if (DefaultShareGroupManager.getInstance().getGroup(groupName) != null) { @@ -101,6 +101,15 @@ public class InstallUtils { return DefaultShareGroupManager.getInstance().getGroup(groupName); } + private static String createGroupName(String fileName) { + for (String suffix : ReuxUtils.SUPPORT_REUS_SUFFIX) { + if (fileName.endsWith(suffix)) { + return fileName.substring(0, fileName.indexOf(DOT + suffix)); + } + } + return fileName; + } + private static boolean installReuFile(Group group, File chosenFile, long installTime) { try { if (!group.installModule(chosenFile)) {