diff --git a/designer-base/src/main/java/com/fr/design/ui/ModernUIConstants.java b/designer-base/src/main/java/com/fr/design/ui/ModernUIConstants.java index ed6fb542e9..8f7bf07034 100644 --- a/designer-base/src/main/java/com/fr/design/ui/ModernUIConstants.java +++ b/designer-base/src/main/java/com/fr/design/ui/ModernUIConstants.java @@ -7,9 +7,9 @@ import com.fr.general.IOUtils; * @version 10.0 * Created by richie on 2019-03-05 */ -class ModernUIConstants { +public class ModernUIConstants { - static final String SCRIPT_INIT_NAME_SPACE = IOUtils.readResourceAsString("/com/fr/design/ui/InitNameSpace.js"); + public static final String SCRIPT_INIT_NAME_SPACE = IOUtils.readResourceAsString("/com/fr/design/ui/InitNameSpace.js"); - static final String HTML_TPL = IOUtils.readResourceAsString("/com/fr/design/ui/tpl.html"); + public static final String HTML_TPL = IOUtils.readResourceAsString("/com/fr/design/ui/tpl.html"); } diff --git a/designer-base/src/main/java/com/fr/design/ui/compatible/NxInterceptRequestCallback.java b/designer-base/src/main/java/com/fr/design/ui/compatible/NxInterceptRequestCallback.java index 5ec0ff4339..7b4977e77b 100644 --- a/designer-base/src/main/java/com/fr/design/ui/compatible/NxInterceptRequestCallback.java +++ b/designer-base/src/main/java/com/fr/design/ui/compatible/NxInterceptRequestCallback.java @@ -124,7 +124,7 @@ public class NxInterceptRequestCallback implements InterceptRequestCallback { if (path.endsWith(".gif")) { return "image/gif"; } - Path file = new File("D:\\Fanruan\\FR10.0\\final_05_27\\FineReport_10.0\\webapps\\webroot\\upm\\lib\\locale\\plugin_zh_CN.js").toPath(); + Path file = new File(path).toPath(); try { return Files.probeContentType(file); } catch (IOException e) { diff --git a/designer-form/src/main/java/com/fr/design/designer/beans/models/ModelUtil.java b/designer-form/src/main/java/com/fr/design/designer/beans/models/ModelUtil.java index 10e672f58b..0f75896e1b 100644 --- a/designer-form/src/main/java/com/fr/design/designer/beans/models/ModelUtil.java +++ b/designer-form/src/main/java/com/fr/design/designer/beans/models/ModelUtil.java @@ -32,6 +32,8 @@ abstract class ModelUtil { //直接遍历出来目标值,然后按需处理 xCreator.traversalNameRelatedXCreators(nameRelatedCreators); Map renameMap = new HashMap<>(); + // 避免与旧名称重复 + initDuplicated(nameRelatedCreators, duplicated); for (XCreator target : nameRelatedCreators) { String uniqueName = uniqueName(form, target, duplicated); String oldName = target.toData().getWidgetName(); @@ -42,6 +44,12 @@ abstract class ModelUtil { } EventDispatcher.fire(WidgetNameModifyEvent.INSTANCE, new ContentChangeItem(renameMap, xCreator.toData(), ChangeItem.WIDGET_NAME)); } + + private static void initDuplicated(Set nameRelatedCreators, Set duplicated) { + for (XCreator xCreator : nameRelatedCreators) { + duplicated.add(xCreator.toData().getWidgetName()); + } + } private static String uniqueName(Form form, XCreator xCreator, Set duplicated) {