@@ -5,7 +5,7 @@ import classnames from 'classnames';
55import DraggableContainer from '@/components/DraggableContainer' ;
66import Console , { IAppendValue } from '@/components/Console' ;
77import SearchResult from '@/components/SearchResult' ;
8- import { DatabaseTypeCode , ConsoleStatus } from '@/constants' ;
8+ import { DatabaseTypeCode , ConsoleStatus , TreeNodeType } from '@/constants' ;
99import { IManageResultData , IResultConfig } from '@/typings' ;
1010import { IWorkspaceModelState } from '@/models/workspace' ;
1111import historyServer , { IGetSavedListParams , ISaveBasicInfo } from '@/service/history' ;
@@ -54,11 +54,13 @@ const WorkspaceRightItem = memo<IProps>(function (props) {
5454 if ( ! doubleClickTreeNodeData ) {
5555 return ;
5656 }
57- const { extraParams } = doubleClickTreeNodeData ;
58- const { tableName } = extraParams || { } ;
59- const ddl = `SELECT * FROM ${ tableName } ;\n` ;
60- if ( isActive ) {
61- setAppendValue ( { text : ddl } ) ;
57+ if ( doubleClickTreeNodeData . treeNodeType === TreeNodeType . TABLE ) {
58+ const { extraParams } = doubleClickTreeNodeData ;
59+ const { tableName } = extraParams || { } ;
60+ const ddl = `SELECT * FROM ${ tableName } ;\n` ;
61+ if ( isActive ) {
62+ setAppendValue ( { text : ddl } ) ;
63+ }
6264 }
6365 dispatch ( {
6466 type : 'workspace/setDoubleClickTreeNodeData' ,
0 commit comments