Compare commits

...

3 Commits

Author SHA1 Message Date
Destiny.Lin-林锦龙 19c592e2ed Pull request #15502: REPORT-140743 【数据集替换】下拉树和视图树的数据集替换后,实际并未生效 6 days ago
Destiny.Lin a0fa7a079d REPORT-140743 【数据集替换】下拉树和视图树的数据集替换后,实际并未生效 6 days ago
Destiny.Lin 1a3fcb92a7 REPORT-140743 【数据集替换】下拉树和视图树的数据集替换后,实际并未生效 6 days ago
  1. 13
      designer-realize/src/main/java/com/fr/design/actions/replace/utils/ReplaceUtils.java

13
designer-realize/src/main/java/com/fr/design/actions/replace/utils/ReplaceUtils.java

@ -560,7 +560,7 @@ public class ReplaceUtils {
} }
if (widget instanceof DataControl) { if (widget instanceof DataControl) {
ValueInitializer value = ((DataControl) widget).getWidgetValue(); ValueInitializer value = ((DataControl) widget).getWidgetValue();
if (value.getValue() instanceof DataBinding) { if (value != null && value.getValue() instanceof DataBinding) {
DataBinding binding = (DataBinding) value.getValue(); DataBinding binding = (DataBinding) value.getValue();
for (TableReplacementEntity entity : entities) { for (TableReplacementEntity entity : entities) {
if (StringUtils.equals(entity.getOldName(), binding.getDataSourceName())) { if (StringUtils.equals(entity.getOldName(), binding.getDataSourceName())) {
@ -572,7 +572,14 @@ public class ReplaceUtils {
} }
} }
private static void replaceTreeConfig(Object config, List<TableReplacementEntity> entities) {
/**
* 处理树结构的config
*
* @param config 树结构配置
* @param entities 替换信息
*/
public static void replaceTreeConfig(Object config, List<TableReplacementEntity> entities) {
if (config instanceof LayerConfig[]) { if (config instanceof LayerConfig[]) {
LayerConfig[] layerConfigs = (LayerConfig[]) config; LayerConfig[] layerConfigs = (LayerConfig[]) config;
dealWithLayerConfigs(layerConfigs, entities); dealWithLayerConfigs(layerConfigs, entities);
@ -600,6 +607,8 @@ public class ReplaceUtils {
for (TableReplacementEntity entity : entities) { for (TableReplacementEntity entity : entities) {
if (layerConfig.getTableData() instanceof NameTableData && StringUtils.equals(layerConfig.getTableData().getName(), entity.getOldName())) { if (layerConfig.getTableData() instanceof NameTableData && StringUtils.equals(layerConfig.getTableData().getName(), entity.getOldName())) {
layerConfig.setTableData(new NameTableData(entity.getNewName())); layerConfig.setTableData(new NameTableData(entity.getNewName()));
layerConfig.setViewColumn(entity.getTargetIndex(layerConfig.getViewColumn()));
layerConfig.setModelColumn(entity.getTargetIndex(layerConfig.getModelColumn()));
} }
} }
ElementCaseHelper.replaceTableDataDictionary(layerConfig.getDictionary(), (NameTableData) layerConfig.getDictionary().getTableData(), entities); ElementCaseHelper.replaceTableDataDictionary(layerConfig.getDictionary(), (NameTableData) layerConfig.getDictionary().getTableData(), entities);

Loading…
Cancel
Save