From 4c2c6f613e584cdf4fd994badcd08a7d081ef343 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E5=AE=97=E6=B4=8B?= Date: Tue, 7 Feb 2023 08:39:14 +0800 Subject: [PATCH 1/2] =?UTF-8?q?feat:=20redis=E6=96=B0=E5=A2=9E=E5=AE=9E?= =?UTF-8?q?=E4=BE=8B=E6=A0=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/views/ops/redis/DataOperation.vue | 275 +++++++----------- mayfly_go_web/src/views/ops/redis/Info.vue | 1 - .../src/views/ops/redis/RedisEdit.vue | 7 - .../src/views/ops/redis/RedisInstanceTree.vue | 156 ++++++++++ 4 files changed, 266 insertions(+), 173 deletions(-) create mode 100644 mayfly_go_web/src/views/ops/redis/RedisInstanceTree.vue diff --git a/mayfly_go_web/src/views/ops/redis/DataOperation.vue b/mayfly_go_web/src/views/ops/redis/DataOperation.vue index 96a3b934..7bb37739 100644 --- a/mayfly_go_web/src/views/ops/redis/DataOperation.vue +++ b/mayfly_go_web/src/views/ops/redis/DataOperation.vue @@ -1,88 +1,71 @@ - - - - - diff --git a/mayfly_go_web/src/views/ops/redis/RedisInstanceTree.vue b/mayfly_go_web/src/views/ops/redis/RedisInstanceTree.vue new file mode 100644 index 00000000..3fafe252 --- /dev/null +++ b/mayfly_go_web/src/views/ops/redis/RedisInstanceTree.vue @@ -0,0 +1,156 @@ + + + + + \ No newline at end of file -- Gitee From 3da9ecfaa32d54d3007d87d6a68dd37fac122f2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E5=AE=97=E6=B4=8B?= Date: Tue, 7 Feb 2023 10:32:42 +0800 Subject: [PATCH 2/2] =?UTF-8?q?feat:=20=E6=95=B0=E6=8D=AE=E6=93=8D?= =?UTF-8?q?=E4=BD=9C=E6=8C=89=E9=92=AE=E8=B7=B3=E8=BD=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mayfly_go_web/src/views/ops/db/SqlExec.vue | 24 ++------ .../views/ops/db/component/InstanceTree.vue | 55 ++++++++++++++++--- .../src/views/ops/mongo/MongoDataOp.vue | 6 +- .../src/views/ops/mongo/MongoInstanceTree.vue | 54 +++++++++++++++--- .../src/views/ops/redis/DataOperation.vue | 5 +- .../src/views/ops/redis/RedisInstanceTree.vue | 37 ++++++++++--- 6 files changed, 132 insertions(+), 49 deletions(-) diff --git a/mayfly_go_web/src/views/ops/db/SqlExec.vue b/mayfly_go_web/src/views/ops/db/SqlExec.vue index 8b1dc84c..1c898fb5 100644 --- a/mayfly_go_web/src/views/ops/db/SqlExec.vue +++ b/mayfly_go_web/src/views/ops/db/SqlExec.vue @@ -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() -}) -