Browse Source

Merge branch 'feature/10.0' of https://code.fineres.com/scm/~bruce.deng/design into feature/10.0

feature/10.0
Bruce.Deng 3 years ago
parent
commit
d3801369d8
  1. 6
      designer-base/src/main/java/com/fr/design/ui/ModernUIConstants.java
  2. 2
      designer-base/src/main/java/com/fr/design/ui/compatible/NxInterceptRequestCallback.java
  3. 8
      designer-form/src/main/java/com/fr/design/designer/beans/models/ModelUtil.java

6
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");
}

2
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) {

8
designer-form/src/main/java/com/fr/design/designer/beans/models/ModelUtil.java

@ -32,6 +32,8 @@ abstract class ModelUtil {
//直接遍历出来目标值,然后按需处理
xCreator.traversalNameRelatedXCreators(nameRelatedCreators);
Map<String, String> 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<XCreator> nameRelatedCreators, Set<String> duplicated) {
for (XCreator xCreator : nameRelatedCreators) {
duplicated.add(xCreator.toData().getWidgetName());
}
}
private static String uniqueName(Form form, XCreator xCreator, Set<String> duplicated) {

Loading…
Cancel
Save