Browse Source

Pull request #4509: REPORT-53398 【智能联动】组件拖入时,tab2内引用到组件名的地方,替换名称有误

Merge in DESIGN/design from ~HADES/design:feature/10.0 to feature/10.0

* commit '4b2f2d51d8e60ea395c21472fecee26e21c0dae0':
  REPORT-53398 【智能联动】组件拖入时,tab2内引用到组件名的地方,替换名称有误
feature/10.0
Hades 3 years ago
parent
commit
28ba84a129
  1. 8
      designer-form/src/main/java/com/fr/design/designer/beans/models/ModelUtil.java

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