From c81cccaa8a45a668306095ae56cc20afdd2340d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=B9=E7=A3=8A?= <294531121@qq.com> Date: Mon, 23 Aug 2021 18:05:26 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-56855=20=E6=A0=91=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E9=9B=86=E4=BF=AE=E6=94=B9=E5=90=8D=E7=A7=B0=E5=90=8E-?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=AD=97=E5=85=B8=E5=86=85=E7=9A=84=E6=A0=91?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E9=9B=86=E5=90=8D=E7=A7=B0=E4=B8=8D=E4=BC=9A?= =?UTF-8?q?=E6=94=B9=E5=8F=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/data/DesignTableDataManager.java | 9 +++++++++ .../fr/design/data/datapane/TreeTableDataComboBox.java | 10 ++++++---- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/data/DesignTableDataManager.java b/designer-base/src/main/java/com/fr/design/data/DesignTableDataManager.java index f1758f0689..4018a4f1d2 100644 --- a/designer-base/src/main/java/com/fr/design/data/DesignTableDataManager.java +++ b/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) { globalDsListeners.add(l); } diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/TreeTableDataComboBox.java b/designer-base/src/main/java/com/fr/design/data/datapane/TreeTableDataComboBox.java index 8964ff8de0..7ab969ae6f 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/TreeTableDataComboBox.java +++ b/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.UIComboBoxRenderer; import com.fr.file.TableDataConfig; +import com.fr.stable.StringUtils; import javax.swing.*; import java.awt.*; @@ -80,12 +81,13 @@ public class TreeTableDataComboBox extends UIComboBox { } public void setSelectedTableDataByName(String name) { + refresh(); TableDataWrapper tableDataWrapper; - if (res_map.get(name) != null) { - tableDataWrapper = res_map.get(name); - } else { - String changeName = DesignTableDataManager.getChangedDsNameByOldDsName(name); + String changeName = DesignTableDataManager.getFinalChangedDsNameByOldDsName(name); + if (StringUtils.isNotEmpty(changeName)) { tableDataWrapper = res_map.get(changeName); + } else { + tableDataWrapper = res_map.get(name); } this.getModel().setSelectedItem(tableDataWrapper); }