@@ -7,6 +7,7 @@ import historyService from '@/service/history';
77import Iconfont from '@/components/Iconfont' ;
88import { databaseMap } from '@/constants/database' ;
99import styles from './index.less' ;
10+ import { setRegisterProvider } from '@/store/monaco'
1011
1112import {
1213 // registerIntelliSenseField,
@@ -50,6 +51,7 @@ const SelectBoundInfo = memo(
5051 // 当数据源变化时,重新获取数据库列表
5152 useEffect ( ( ) => {
5253 getDatabaseList ( ) ;
54+ setSchemaList ( [ ] ) ;
5355 } , [ boundInfo . dataSourceId ] ) ;
5456
5557 // 当数据库名变化时,重新获取schema列表
@@ -79,8 +81,9 @@ const SelectBoundInfo = memo(
7981 if ( ! _databaseNameList . length ) {
8082 getSchemaList ( ) ;
8183 }
84+ setRegisterProvider ( boundInfo . dataSourceId , editorDatabaseTips ) ;
8285 setDatabaseNameList ( _databaseNameList ) ;
83- registerIntelliSenseDatabase ( editorDatabaseTips ) ;
86+ // registerIntelliSenseDatabase(editorDatabaseTips);
8487 } ) ;
8588 }
8689
@@ -108,7 +111,6 @@ const SelectBoundInfo = memo(
108111 // 选择数据源
109112 const changeDataSource = ( item ) => {
110113 const currentData = dataSourceList . find ( ( i ) => i . key === item . key ) ! ;
111-
112114 setBoundInfo ( {
113115 ...boundInfo ,
114116 dataSourceId : currentData . value ,
@@ -117,6 +119,11 @@ const SelectBoundInfo = memo(
117119 databaseName : void 0 ,
118120 schemaName : void 0 ,
119121 } ) ;
122+ historyService . updateSavedConsole ( {
123+ id : boundInfo . consoleId ,
124+ dataSourceId : currentData . value ,
125+ dataSourceName : currentData . label
126+ } )
120127 } ;
121128
122129 // 选择数据库
@@ -146,11 +153,10 @@ const SelectBoundInfo = memo(
146153 schemaName : _schemaName ,
147154 } )
148155 } ;
149-
150- console . log ( boundInfo )
151156
152157 return (
153158 < div className = { styles . consoleOptionsRight } >
159+ < div className = { styles . boundInfoBoxSpacer } />
154160 < Dropdown
155161 menu = { {
156162 items : dataSourceList ,
0 commit comments