Skip to content

Commit

Permalink
delete console
Browse files Browse the repository at this point in the history
  • Loading branch information
shanhexi committed Dec 15, 2023
1 parent 09d45f9 commit 3aa781a
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions chat2db-client/src/blocks/Tree/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ const isMatch = (target: string, searchValue: string) => {
function searchTree(treeData: ITreeNode[], searchValue: string): ITreeNode[] {
let result: ITreeNode[] = [];
function dfs(node: ITreeNode, path: ITreeNode[] = []) {
console.log(node.name, searchValue, isMatch(node.name, searchValue));
if (isMatch(node.name, searchValue)) {
result = [...result,...path, node];
return true;
Expand All @@ -72,8 +71,6 @@ function searchTree(treeData: ITreeNode[], searchValue: string): ITreeNode[] {

treeData.forEach((node) => dfs(node));

console.log(result,'result')

result.forEach((item) => {
if(!isMatch(item.name, searchValue)){
item.children = null;
Expand Down Expand Up @@ -128,7 +125,6 @@ const Tree = (props: IProps) => {
useEffect(() => {
if (searchValue && treeData) {
const _searchTreeData = searchTree(cloneDeep(treeData), searchValue)
console.log(_searchTreeData)
setSearchTreeData(_searchTreeData);
} else {
setSearchTreeData(null);
Expand All @@ -142,7 +138,6 @@ const Tree = (props: IProps) => {
<div
className={classnames(styles.scrollBox)}
onScroll={(e: any) => {
console.log(e.target.scrollTop);
setScrollTop(e.target.scrollTop);
}}
>
Expand Down

0 comments on commit 3aa781a

Please sign in to comment.