diff --git a/mayfly_go_web/src/views/ops/db/SqlExec.vue b/mayfly_go_web/src/views/ops/db/SqlExec.vue index 085a741d..7f2d2d20 100644 --- a/mayfly_go_web/src/views/ops/db/SqlExec.vue +++ b/mayfly_go_web/src/views/ops/db/SqlExec.vue @@ -116,7 +116,7 @@ const loadTableData = async (inst: any, schema: string, tableName: string) => { tab.dbType = inst.type; tab.db = schema; tab.type = TabType.TableData; - tab.other = { + tab.params = { table: tableName } state.tabs.set(label, tab) @@ -136,7 +136,7 @@ const addQueryTab = async (inst: any, db: string, sqlName: string = '') => { } else { let count = 1; state.tabs.forEach((v) => { - if (v.type == TabType.Query && !v.other.sqlName) { + if (v.type == TabType.Query && !v.params.sqlName) { count++; } }) @@ -153,7 +153,7 @@ const addQueryTab = async (inst: any, db: string, sqlName: string = '') => { tab.dbType = inst.type; tab.db = db; tab.type = TabType.Query; - tab.other = { + tab.params = { sqlName: sqlName, dbs: instanceTreeRef.value.getSchemas(dbId) } @@ -258,7 +258,7 @@ const registerSqlCompletionItemProvider = () => { const tokens = textBeforePointer.trim().split(/\s+/) const lastToken = tokens[tokens.length - 1].toLowerCase() - const dbs = nowTab.other && nowTab.other.dbs; + const dbs = nowTab.params && nowTab.params.dbs; // console.log("光标前文本:=>" + textBeforePointerMulti) // console.log("最后输入的:=>" + lastToken) @@ -291,14 +291,6 @@ const registerSqlCompletionItemProvider = () => { if (tableInfo.tableName) { let table = tableInfo.tableName let db = tableInfo.dbName; - // // 取出表名并提示 - // let dbs = state.monacoOptions.dbTables[dbId + db] - // let columns = dbs ? (dbs[table] || []) : []; - // if ((!columns || columns.length === 0) && db) { - // state.monacoOptions.dbTables[dbId + db] = await loadHintTables(dbId, db) - // dbs = state.monacoOptions.dbTables[dbId + db] - // columns = dbs ? (dbs[table] || []) : []; - // } // 取出表名并提示 let dbHits = await dbInst.loadDbHints(db) let columns = dbHits[table] diff --git a/mayfly_go_web/src/views/ops/db/component/DbTable.vue b/mayfly_go_web/src/views/ops/db/component/DbTable.vue new file mode 100644 index 00000000..b01dec6c --- /dev/null +++ b/mayfly_go_web/src/views/ops/db/component/DbTable.vue @@ -0,0 +1,323 @@ + + + + + diff --git a/mayfly_go_web/src/views/ops/db/component/tab/Query.vue b/mayfly_go_web/src/views/ops/db/component/tab/Query.vue index 99aa20f9..133397a3 100644 --- a/mayfly_go_web/src/views/ops/db/component/tab/Query.vue +++ b/mayfly_go_web/src/views/ops/db/component/tab/Query.vue @@ -51,33 +51,28 @@ 导出 - + 提交 - + 取消 - - - - - + diff --git a/mayfly_go_web/src/views/ops/db/component/tab/TableData.vue b/mayfly_go_web/src/views/ops/db/component/tab/TableData.vue index 56ee36a5..7a32ba7f 100644 --- a/mayfly_go_web/src/views/ops/db/component/tab/TableData.vue +++ b/mayfly_go_web/src/views/ops/db/component/tab/TableData.vue @@ -28,13 +28,11 @@ - + 提交 - - + + 取消 @@ -65,22 +63,12 @@ - - - - - - + + + @@ -115,16 +103,16 @@