feat: 数据操作按钮跳转

This commit is contained in:
刘宗洋
2023-02-07 10:32:42 +08:00
parent 4c2c6f613e
commit 3da9ecfaa3
6 changed files with 132 additions and 49 deletions

View File

@@ -714,7 +714,6 @@ select * from invisit v where`.match(/(join|from)\s+(\w*-?\w*\.?\w+)\s*(as)?\s*(
onMounted(() => {
self.completionItemProvider?.dispose()
setHeight();
instManage.loadSelectScheme()
// 监听浏览器窗口大小变化,更新对应组件高度
window.onresize = () => setHeight();
});
@@ -1734,13 +1733,15 @@ const loadSchemaTables = async (inst: any, schema: string, fn: Function) => {
}else {
tables.forEach((a:any)=>a.show=true)
}
fn()
fn(state.instances.tables[id+schema])
}
// 选择数据库实例
const changeInstance = (inst: any) => {
const changeInstance = (inst: any, fn?: Function) => {
debugger
state.dbId = inst.id
state.dbType = inst.type
fn && fn()
}
// 选择数据库
const changeSchema = (inst: any, schema: string) => {
@@ -1800,23 +1801,6 @@ const addQueryTab = async () => {
}
const instManage = {
loadSelectScheme: ()=>{
let {tagPath, dbId, db} = store.state.sqlExecInfo.dbOptInfo;
if(dbId){
state.dbId = dbId;
state.db = db;
addQueryTab()
// fixme 差展开菜单树至对应的db
}
}
}
watch(()=>store.state.sqlExecInfo.dbOptInfo, () => {
instManage.loadSelectScheme()
})
</script>
<style lang="scss">