From 915fe860cc643f9f042f65c9f8d338774792f3d0 Mon Sep 17 00:00:00 2001 From: Yvan Date: Thu, 31 Mar 2022 11:17:58 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-68405=20=E3=80=90=E8=BF=AD=E4=BB=A3?= =?UTF-8?q?=E3=80=91=E3=80=90=E6=95=B0=E6=8D=AE=E9=9B=86=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E4=BC=98=E5=8C=96=E3=80=91=E6=98=BE=E7=A4=BA=E6=A3=80=E7=B4=A2?= =?UTF-8?q?=E5=AE=8C=E6=88=90=E4=BA=86=EF=BC=8C=E4=BD=86=E6=98=AF=E7=BB=93?= =?UTF-8?q?=E6=9E=9C=E4=B8=BA=E7=A9=BA=EF=BC=8C=E5=AE=9E=E9=99=85=E6=9C=89?= =?UTF-8?q?=E7=BB=93=E6=9E=9C=20=E3=80=90=E9=97=AE=E9=A2=98=E5=8E=9F?= =?UTF-8?q?=E5=9B=A0=E3=80=911.=E7=8A=B6=E6=80=81=E8=B7=B3=E8=BD=AC?= =?UTF-8?q?=E6=97=B6=EF=BC=8C=E7=BB=93=E6=9E=9C=E9=9B=86=E8=A2=AB=E9=87=8D?= =?UTF-8?q?=E7=BD=AE=E4=BA=86=EF=BC=8C=E6=89=80=E4=BB=A5=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E6=97=A0=E7=BB=93=E6=9E=9C;2.=E4=B9=8B=E5=89=8D=E6=B2=A1?= =?UTF-8?q?=E6=90=9E=E6=98=8E=E7=99=BD=E7=9A=84count=E5=87=8F=E5=88=B00?= =?UTF-8?q?=E8=BF=87=E5=BF=AB=E7=9A=84=E5=8E=9F=E5=9B=A0=E6=90=9E=E6=B8=85?= =?UTF-8?q?=E6=A5=9A=E4=BA=86=EF=BC=8C=E6=98=AF=E5=9B=A0=E4=B8=BA=E9=A2=84?= =?UTF-8?q?=E5=8A=A0=E8=BD=BD=E4=BB=BB=E5=8A=A1=E5=9B=9E=E8=B0=83=E5=BF=98?= =?UTF-8?q?=E4=BA=86=E9=87=8D=E5=86=99done=E6=96=B9=E6=B3=95=E4=BA=86=20?= =?UTF-8?q?=E3=80=90=E6=94=B9=E5=8A=A8=E6=80=9D=E8=B7=AF=E3=80=911.?= =?UTF-8?q?=E5=B0=86=E9=87=8D=E7=BD=AE=E6=94=BE=E5=88=B0=E6=90=9C=E7=B4=A2?= =?UTF-8?q?=E5=BC=80=E5=A7=8B=E5=89=8D=EF=BC=9B2.=E9=A2=84=E5=8A=A0?= =?UTF-8?q?=E8=BD=BD=E4=BB=BB=E5=8A=A1=E5=9B=9E=E8=B0=83=E5=A4=84=E7=90=86?= =?UTF-8?q?=EF=BC=9B3.=E9=83=A8=E5=88=86=E4=BB=A3=E7=A0=81=E8=B4=A8?= =?UTF-8?q?=E9=87=8F=E9=97=AE=E9=A2=98=20=E3=80=90review=E5=BB=BA=E8=AE=AE?= =?UTF-8?q?=E3=80=91=E6=97=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../search/TableDataTreeSearchManager.java | 13 ++++++++++--- .../control/common/TableDataSearchCallBack.java | 4 ++-- .../control/pre/TableDataPreSearchCallBack.java | 6 ++++++ .../search/searcher/TableDataTreeSearcher.java | 10 +++++----- .../search/searcher/TreeSearchStatus.java | 4 +++- 5 files changed, 26 insertions(+), 11 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/management/search/TableDataTreeSearchManager.java b/designer-base/src/main/java/com/fr/design/data/datapane/management/search/TableDataTreeSearchManager.java index f47f457aa3..bb98fdeffa 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/management/search/TableDataTreeSearchManager.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/management/search/TableDataTreeSearchManager.java @@ -136,7 +136,7 @@ public class TableDataTreeSearchManager { } setTreeSearchStatus(TreeSearchStatus.SEARCHING); rendererHelper.replaceTreeRenderer(getCurrentTableDataTree(), searchText); - count = new AtomicInteger(treeSearcher.getNotCalculatedSetsSize()); + count = new AtomicInteger(treeSearcher.getAllWrappersSize()); // 计时开始 TableDataSearchTimer.getInstance().startClock(); treeSearcher.startSearch(searchText); @@ -192,17 +192,24 @@ public class TableDataTreeSearchManager { } /** - * 切换回工具栏 + * 切换回工具栏,恢复数据集树UI */ public void restoreToolBarAndTreePane() { setTreeSearchStatus(TreeSearchStatus.NOT_IN_SEARCH_MODE); if (treeSearcher != null) { treeSearcher.afterSearch(); } - restoreTreePane(); + lastSearchText = null; + if (rendererHelper != null) { + rendererHelper.restore(getCurrentTableDataTree()); + } } + /** + * 恢复数据集树UI + */ public void restoreTreePane() { + setTreeSearchStatus(TreeSearchStatus.SEARCH_NOT_BEGIN); lastSearchText = null; if (rendererHelper != null) { rendererHelper.restore(getCurrentTableDataTree()); diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/management/search/control/common/TableDataSearchCallBack.java b/designer-base/src/main/java/com/fr/design/data/datapane/management/search/control/common/TableDataSearchCallBack.java index c544921c5b..d4233d8bf9 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/management/search/control/common/TableDataSearchCallBack.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/management/search/control/common/TableDataSearchCallBack.java @@ -38,8 +38,8 @@ public class TableDataSearchCallBack implements TreeSearchCallback { return; } TableDataTreeSearchManager.getInstance().updateTableDataTree(); - // todo 没想清楚为啥会这么快结束,暂时取消搜索计数 -// TableDataTreeSearchManager.getInstance().decreaseCount(); + // 搜索计数 + TableDataTreeSearchManager.getInstance().decreaseCount(); }); } diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/management/search/control/pre/TableDataPreSearchCallBack.java b/designer-base/src/main/java/com/fr/design/data/datapane/management/search/control/pre/TableDataPreSearchCallBack.java index a4826918d5..929c81a12a 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/management/search/control/pre/TableDataPreSearchCallBack.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/management/search/control/pre/TableDataPreSearchCallBack.java @@ -1,5 +1,6 @@ package com.fr.design.data.datapane.management.search.control.pre; +import com.fr.design.data.datapane.management.search.control.TreeSearchResult; import com.fr.design.data.datapane.management.search.control.common.TableDataSearchCallBack; import com.fr.design.data.datapane.management.search.searcher.TableDataTreeSearcher; @@ -14,4 +15,9 @@ public class TableDataPreSearchCallBack extends TableDataSearchCallBack { public TableDataPreSearchCallBack(TableDataTreeSearcher treeSearcher) { super(treeSearcher); } + + @Override + public void done(TreeSearchResult treeSearchResult) { + // do nothing + } } diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/management/search/searcher/TableDataTreeSearcher.java b/designer-base/src/main/java/com/fr/design/data/datapane/management/search/searcher/TableDataTreeSearcher.java index 7569491e99..160d462b47 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/management/search/searcher/TableDataTreeSearcher.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/management/search/searcher/TableDataTreeSearcher.java @@ -45,8 +45,8 @@ public class TableDataTreeSearcher implements TreeSearcher { return matchSets.isEmpty(); } - public int getNotCalculatedSetsSize() { - return notCalculatedSets.size(); + public int getAllWrappersSize() { + return allWrappers.size(); } public synchronized void addToCalculatedSets(List tableDataNames) { @@ -55,7 +55,6 @@ public class TableDataTreeSearcher implements TreeSearcher { if (tableDataWrapper == null) { return; } - notCalculatedSets.remove(tableDataName); calculatedSets.add(tableDataName); } } @@ -111,6 +110,7 @@ public class TableDataTreeSearcher implements TreeSearcher { @Override public void startSearch(String searchText) { + reset(); for (String notCalculatedSet : notCalculatedSets) { TableDataWrapper tableDataWrapper = allWrappers.get(notCalculatedSet); if (TableDataTreeSearchManager.getInstance().getTreeSearchStatus() == TreeSearchStatus.SEARCHING) { @@ -121,12 +121,12 @@ public class TableDataTreeSearcher implements TreeSearcher { @Override public void stopSearch() { - reset(); + } @Override public void completeSearch() { - reset(); + } private void reset() { diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/management/search/searcher/TreeSearchStatus.java b/designer-base/src/main/java/com/fr/design/data/datapane/management/search/searcher/TreeSearchStatus.java index 835e9ded6d..ff577995f2 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/management/search/searcher/TreeSearchStatus.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/management/search/searcher/TreeSearchStatus.java @@ -5,8 +5,10 @@ package com.fr.design.data.datapane.management.search.searcher; */ public enum TreeSearchStatus { + /** + * 非搜索模式 + */ NOT_IN_SEARCH_MODE, - /** * 搜索未开始 */