Skip to content

Commit 3adb4fe

Browse files
committed
fix:schema list
1 parent 414a3d6 commit 3adb4fe

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

  • chat2db-client/src/pages/main/workspace/components/TableList

chat2db-client/src/pages/main/workspace/components/TableList/index.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import OperationLine from '../OperationLine';
1010
import Tree from '@/blocks/Tree';
1111
import { treeConfig } from '@/blocks/Tree/treeConfig';
1212
import { ITreeNode } from '@/typings';
13+
import { TreeNodeType } from '@/constants';
1314

1415
interface IProps {
1516
className?: string;
@@ -28,8 +29,9 @@ export default memo<IProps>((props) => {
2829
setTreeData([]);
2930
return;
3031
}
32+
const treeNodeType = currentConnectionDetails.supportDatabase ? TreeNodeType.DATA_SOURCE : TreeNodeType.DATABASE;
3133
setTreeData(null);
32-
treeConfig['dataSource']
34+
treeConfig[treeNodeType]
3335
.getChildren?.({
3436
dataSourceId: currentConnectionDetails.id,
3537
dataSourceName: currentConnectionDetails.alias,
@@ -55,7 +57,6 @@ export default memo<IProps>((props) => {
5557
return (
5658
<div className={classnames(styles.treeContainer, className)}>
5759
<OperationLine getTreeData={getTreeData} searchValue={searchValue} setSearchValue={setSearchValue} />
58-
{/* <Tree className={styles.treeBox} searchValue={searchValue} treeData={treeData} /> */}
5960
<Tree className={styles.treeBox} searchValue={searchValue} treeData={treeData} />
6061
</div>
6162
);

0 commit comments

Comments
 (0)