From 00dad13df3846de83c02c01f4a1cab4802c17ce2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=95=E9=87=91=E6=B3=BD?= <1098696801@qq.com> Date: Wed, 8 Jun 2022 22:06:49 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E7=94=9F=E6=88=90=E4=BF=A1=E6=81=AF=20=E5=8F=8D=E6=98=BE?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/系统管理/代码生成/执行生成.ms | 8 +++---- .../api/系统管理/代码生成/查出所有表.ms | 4 ++-- .../系统管理/代码生成/根据表名查出所有列.ms | 4 ++-- .../src/views/lowcode/code-gen-form.vue | 23 ++++++++++++------- .../src/views/lowcode/code-gen-list.vue | 2 +- 5 files changed, 24 insertions(+), 17 deletions(-) diff --git a/data/magic-api/api/系统管理/代码生成/执行生成.ms b/data/magic-api/api/系统管理/代码生成/执行生成.ms index 2aa4e24..132192d 100644 --- a/data/magic-api/api/系统管理/代码生成/执行生成.ms +++ b/data/magic-api/api/系统管理/代码生成/执行生成.ms @@ -5,7 +5,7 @@ "groupId" : "f2538e0f370a4cabab0ae920f5e77ae7", "name" : "执行生成", "createTime" : null, - "updateTime" : 1653992145291, + "updateTime" : 1654682481038, "lock" : null, "createBy" : null, "updateBy" : null, @@ -324,12 +324,12 @@ columns.forEach(it => { } } }) - +datasource = datasource || '' var commonField = db[datasource].select(""" SELECT column_name FROM - information_schema.COLUMNS + information_schema.COLUMNS WHERE table_name = #{tableName} AND column_name IN ( 'is_del', 'create_by', 'create_date', 'update_by', 'update_date' ) AND table_schema = DATABASE() """) @@ -406,4 +406,4 @@ componentInfo.setPath("/list") componentInfo.setScript(componentScript) MagicResourceService.saveFile(componentInfo) -return 1 \ No newline at end of file +return 1 diff --git a/data/magic-api/api/系统管理/代码生成/查出所有表.ms b/data/magic-api/api/系统管理/代码生成/查出所有表.ms index 87437eb..7fa4704 100644 --- a/data/magic-api/api/系统管理/代码生成/查出所有表.ms +++ b/data/magic-api/api/系统管理/代码生成/查出所有表.ms @@ -5,7 +5,7 @@ "groupId" : "f2538e0f370a4cabab0ae920f5e77ae7", "name" : "查出所有表", "createTime" : null, - "updateTime" : 1653990626738, + "updateTime" : 1654682333737, "lock" : null, "createBy" : null, "updateBy" : null, @@ -130,6 +130,6 @@ } } ================================ -return db[datasource].select(""" +return db[datasource || ''].select(""" select table_name, table_comment from information_schema.tables where table_schema = database() """).map(it => { label: it.tableName + `(${it.tableComment})`, value: it.tableName }) \ No newline at end of file diff --git a/data/magic-api/api/系统管理/代码生成/根据表名查出所有列.ms b/data/magic-api/api/系统管理/代码生成/根据表名查出所有列.ms index 168b11d..12c680b 100644 --- a/data/magic-api/api/系统管理/代码生成/根据表名查出所有列.ms +++ b/data/magic-api/api/系统管理/代码生成/根据表名查出所有列.ms @@ -5,7 +5,7 @@ "groupId" : "f2538e0f370a4cabab0ae920f5e77ae7", "name" : "根据表名查出所有列", "createTime" : null, - "updateTime" : 1653991292310, + "updateTime" : 1654682348773, "lock" : null, "createBy" : null, "updateBy" : null, @@ -191,7 +191,7 @@ } ================================ return { - columns: db[datasource].select(""" + columns: db[datasource || ''].select(""" SELECT column_name, column_comment, diff --git a/magic-boot-ui/src/views/lowcode/code-gen-form.vue b/magic-boot-ui/src/views/lowcode/code-gen-form.vue index dc3512f..d42aded 100644 --- a/magic-boot-ui/src/views/lowcode/code-gen-form.vue +++ b/magic-boot-ui/src/views/lowcode/code-gen-form.vue @@ -1,6 +1,6 @@