Browse Source

REPORT-56855 树数据集修改名称后-数据字典内的树数据集名称不会改变

fix-lag
方磊 3 years ago
parent
commit
c81cccaa8a
  1. 9
      designer-base/src/main/java/com/fr/design/data/DesignTableDataManager.java
  2. 10
      designer-base/src/main/java/com/fr/design/data/datapane/TreeTableDataComboBox.java

9
designer-base/src/main/java/com/fr/design/data/DesignTableDataManager.java

@ -168,6 +168,15 @@ public abstract class DesignTableDataManager {
} }
} }
public static String getFinalChangedDsNameByOldDsName(String oldDsName) {
String changeName = getChangedDsNameByOldDsName(oldDsName);
if (StringUtils.isNotEmpty(changeName)) {
return getFinalChangedDsNameByOldDsName(changeName);
} else {
return oldDsName;
}
}
public static void addGlobalDsChangeListener(ChangeListener l) { public static void addGlobalDsChangeListener(ChangeListener l) {
globalDsListeners.add(l); globalDsListeners.add(l);
} }

10
designer-base/src/main/java/com/fr/design/data/datapane/TreeTableDataComboBox.java

@ -9,6 +9,7 @@ import com.fr.design.data.tabledata.wrapper.TemplateTableDataWrapper;
import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.icombobox.UIComboBoxRenderer; import com.fr.design.gui.icombobox.UIComboBoxRenderer;
import com.fr.file.TableDataConfig; import com.fr.file.TableDataConfig;
import com.fr.stable.StringUtils;
import javax.swing.*; import javax.swing.*;
import java.awt.*; import java.awt.*;
@ -80,12 +81,13 @@ public class TreeTableDataComboBox extends UIComboBox {
} }
public void setSelectedTableDataByName(String name) { public void setSelectedTableDataByName(String name) {
refresh();
TableDataWrapper tableDataWrapper; TableDataWrapper tableDataWrapper;
if (res_map.get(name) != null) { String changeName = DesignTableDataManager.getFinalChangedDsNameByOldDsName(name);
tableDataWrapper = res_map.get(name); if (StringUtils.isNotEmpty(changeName)) {
} else {
String changeName = DesignTableDataManager.getChangedDsNameByOldDsName(name);
tableDataWrapper = res_map.get(changeName); tableDataWrapper = res_map.get(changeName);
} else {
tableDataWrapper = res_map.get(name);
} }
this.getModel().setSelectedItem(tableDataWrapper); this.getModel().setSelectedItem(tableDataWrapper);
} }

Loading…
Cancel
Save