From 7abec9974f69f7323b5d623065cfb443bb7ca59b 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, 23 Mar 2022 20:57:43 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96component=E6=8F=92=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- data/magic-api/api/后台/安全/登录.ms | 2 +- .../后台/数据字典/字典项/获取所有字典项.ms | 22 ++- data/magic-api/api/后台/数据字典/所有字典.ms | 135 +++++++++++++ data/magic-api/api/后台/组件/保存.ms | 37 ---- data/magic-api/api/后台/组件/列表.ms | 63 ++++-- data/magic-api/api/后台/组件/删除.ms | 25 --- data/magic-api/api/后台/组件/详情.ms | 97 ---------- data/magic-api/api/后台/组件/选择组件.ms | 182 ++++++++++++++++-- .../api/后台/菜单管理/当前用户菜单.ms | 23 ++- .../api/后台/菜单管理/获取菜单tree.ms | 20 +- .../src/components/magic-component-info.vue | 6 +- .../src/console/src/i18n/en.js | 6 +- .../src/console/src/i18n/zh-cn.js | 6 +- .../console/src/service/magic-component.js | 2 +- .../ComponentInfoMagicResourceStorage.java | 48 ----- magic-boot-ui/src/scripts/dynamicComponent.js | 2 +- .../src/views/lowcode/component-list.vue | 161 ---------------- 17 files changed, 421 insertions(+), 416 deletions(-) create mode 100644 data/magic-api/api/后台/数据字典/所有字典.ms delete mode 100644 data/magic-api/api/后台/组件/保存.ms delete mode 100644 data/magic-api/api/后台/组件/删除.ms delete mode 100644 data/magic-api/api/后台/组件/详情.ms delete mode 100644 magic-boot-ui/src/views/lowcode/component-list.vue diff --git a/data/magic-api/api/后台/安全/登录.ms b/data/magic-api/api/后台/安全/登录.ms index d00ab57..d64b86c 100644 --- a/data/magic-api/api/后台/安全/登录.ms +++ b/data/magic-api/api/后台/安全/登录.ms @@ -5,7 +5,7 @@ "groupId" : "1952f25c81084e24b55b11385767dc38", "name" : "登录", "createTime" : null, - "updateTime" : 1647561372842, + "updateTime" : 1647790320949, "lock" : "0", "createBy" : null, "updateBy" : null, diff --git a/data/magic-api/api/后台/数据字典/字典项/获取所有字典项.ms b/data/magic-api/api/后台/数据字典/字典项/获取所有字典项.ms index 9cfbdb9..126868b 100644 --- a/data/magic-api/api/后台/数据字典/字典项/获取所有字典项.ms +++ b/data/magic-api/api/后台/数据字典/字典项/获取所有字典项.ms @@ -4,8 +4,8 @@ "script" : null, "groupId" : "376f26eb43a44a3daeafd27020a96f48", "name" : "获取所有字典项", - "createTime" : 1646490239446, - "updateTime" : 1634735167647, + "createTime" : null, + "updateTime" : 1647790331786, "lock" : "0", "createBy" : null, "updateBy" : null, @@ -16,9 +16,21 @@ "requestBody" : "{\r\n\t\r\n}", "headers" : [ ], "paths" : [ ], - "responseBody" : "{\n \"code\": 402,\n \"message\": \"凭证已过期\",\n \"data\": null,\n \"timestamp\": 1634093797926,\n \"executeTime\": null\n}", + "responseBody" : "{\n \"code\": 402,\n \"message\": \"凭证已过期\",\n \"data\": null,\n \"timestamp\": 1647790314936,\n \"executeTime\": null\n}", "description" : null, - "requestBodyDefinition" : null, + "requestBodyDefinition" : { + "name" : "", + "value" : "", + "description" : "", + "required" : false, + "dataType" : "Object", + "type" : null, + "defaultValue" : null, + "validateType" : "", + "error" : "", + "expression" : "", + "children" : [ ] + }, "responseBodyDefinition" : { "name" : "", "value" : "", @@ -68,7 +80,7 @@ "children" : [ ] }, { "name" : "timestamp", - "value" : "1634093797926", + "value" : "1647790314936", "description" : "", "required" : false, "dataType" : "Long", diff --git a/data/magic-api/api/后台/数据字典/所有字典.ms b/data/magic-api/api/后台/数据字典/所有字典.ms new file mode 100644 index 0000000..7bd1fd1 --- /dev/null +++ b/data/magic-api/api/后台/数据字典/所有字典.ms @@ -0,0 +1,135 @@ +{ + "properties" : { }, + "id" : "e516cf1dd64742a2b8a652b4c1224dd1", + "script" : null, + "groupId" : "c7ce65f5b3cf4aaa913f6fec7d35d176", + "name" : "所有字典", + "createTime" : null, + "updateTime" : 1647790584427, + "lock" : null, + "createBy" : null, + "updateBy" : null, + "path" : "/all", + "method" : "GET", + "parameters" : [ ], + "options" : [ ], + "requestBody" : "", + "headers" : [ ], + "paths" : [ ], + "responseBody" : "{\n \"code\": 200,\n \"message\": \"success\",\n \"data\": [{\n \"label\": \"测试1\",\n \"value\": \"测试1\"\n }, {\n \"label\": \"组织机构类型\",\n \"value\": \"office_type\"\n }, {\n \"label\": \"字典类型\",\n \"value\": \"dict_type\"\n }, {\n \"label\": \"是否登录\",\n \"value\": \"is_login\"\n }],\n \"timestamp\": 1647790533379,\n \"executeTime\": 13\n}", + "description" : null, + "requestBodyDefinition" : null, + "responseBodyDefinition" : { + "name" : "", + "value" : "", + "description" : "", + "required" : false, + "dataType" : "Object", + "type" : null, + "defaultValue" : null, + "validateType" : "", + "error" : "", + "expression" : "", + "children" : [ { + "name" : "code", + "value" : "200", + "description" : "", + "required" : false, + "dataType" : "Integer", + "type" : null, + "defaultValue" : null, + "validateType" : "", + "error" : "", + "expression" : "", + "children" : [ ] + }, { + "name" : "message", + "value" : "success", + "description" : "", + "required" : false, + "dataType" : "String", + "type" : null, + "defaultValue" : null, + "validateType" : "", + "error" : "", + "expression" : "", + "children" : [ ] + }, { + "name" : "data", + "value" : "", + "description" : "", + "required" : false, + "dataType" : "Object", + "type" : null, + "defaultValue" : null, + "validateType" : "", + "error" : "", + "expression" : "", + "children" : [ { + "name" : "", + "value" : "", + "description" : "", + "required" : false, + "dataType" : "Object", + "type" : null, + "defaultValue" : null, + "validateType" : "", + "error" : "", + "expression" : "", + "children" : [ { + "name" : "label", + "value" : "测试1", + "description" : "", + "required" : false, + "dataType" : "String", + "type" : null, + "defaultValue" : null, + "validateType" : "", + "error" : "", + "expression" : "", + "children" : [ ] + }, { + "name" : "value", + "value" : "测试1", + "description" : "", + "required" : false, + "dataType" : "String", + "type" : null, + "defaultValue" : null, + "validateType" : "", + "error" : "", + "expression" : "", + "children" : [ ] + } ] + } ] + }, { + "name" : "timestamp", + "value" : "1647790533379", + "description" : "", + "required" : false, + "dataType" : "Long", + "type" : null, + "defaultValue" : null, + "validateType" : "", + "error" : "", + "expression" : "", + "children" : [ ] + }, { + "name" : "executeTime", + "value" : "13", + "description" : "", + "required" : false, + "dataType" : "Integer", + "type" : null, + "defaultValue" : null, + "validateType" : "", + "error" : "", + "expression" : "", + "children" : [ ] + } ] + } +} +================================ +return db.select(""" + select desc_ribe label,type value from sys_dict where is_del = 0 +""") \ No newline at end of file diff --git a/data/magic-api/api/后台/组件/保存.ms b/data/magic-api/api/后台/组件/保存.ms deleted file mode 100644 index 8aa5ac3..0000000 --- a/data/magic-api/api/后台/组件/保存.ms +++ /dev/null @@ -1,37 +0,0 @@ -{ - "properties" : { }, - "id" : "7879aae4cb5f40969b7de3db0dc4307c", - "script" : null, - "groupId" : "6f106ebdee21489db34b956f7770ff03", - "name" : "保存", - "createTime" : null, - "updateTime" : 1646552458651, - "lock" : "0", - "createBy" : null, - "updateBy" : null, - "path" : "/save", - "method" : "POST", - "parameters" : [ ], - "options" : [ { - "name" : "wrap_request_parameter", - "value" : "data", - "description" : "包装请求参数到一个变量中", - "required" : false, - "dataType" : "String", - "type" : null, - "defaultValue" : null, - "validateType" : null, - "error" : null, - "expression" : null, - "children" : null - } ], - "requestBody" : "", - "headers" : [ ], - "paths" : [ ], - "responseBody" : null, - "description" : null, - "requestBodyDefinition" : null, - "responseBodyDefinition" : null -} -================================ -return db.table("sys_component").primary("id").saveOrUpdate(data) \ No newline at end of file diff --git a/data/magic-api/api/后台/组件/列表.ms b/data/magic-api/api/后台/组件/列表.ms index ff0c301..b04e22c 100644 --- a/data/magic-api/api/后台/组件/列表.ms +++ b/data/magic-api/api/后台/组件/列表.ms @@ -5,7 +5,7 @@ "groupId" : "6f106ebdee21489db34b956f7770ff03", "name" : "列表", "createTime" : null, - "updateTime" : 1646552470091, + "updateTime" : 1648017562433, "lock" : "0", "createBy" : null, "updateBy" : null, @@ -16,7 +16,7 @@ "requestBody" : "", "headers" : [ ], "paths" : [ ], - "responseBody" : "{\"code\":402,\"message\":\"凭证已过期\",\"data\":null,\"timestamp\":1646545653430,\"executeTime\":null}", + "responseBody" : "{\n \"code\": 200,\n \"message\": \"success\",\n \"data\": [{\n \"name\": \"sys-dict-list\",\n \"code\": \"\\n\\n\\n\"\n }],\n \"timestamp\": 1648017503577,\n \"executeTime\": 12\n}", "description" : null, "requestBodyDefinition" : null, "responseBodyDefinition" : { @@ -32,7 +32,7 @@ "expression" : "", "children" : [ { "name" : "code", - "value" : "402", + "value" : "200", "description" : "", "required" : false, "dataType" : "Integer", @@ -44,7 +44,7 @@ "children" : [ ] }, { "name" : "message", - "value" : "凭证已过期", + "value" : "success", "description" : "", "required" : false, "dataType" : "String", @@ -56,7 +56,7 @@ "children" : [ ] }, { "name" : "data", - "value" : "null", + "value" : "", "description" : "", "required" : false, "dataType" : "Object", @@ -65,10 +65,46 @@ "validateType" : "", "error" : "", "expression" : "", - "children" : [ ] + "children" : [ { + "name" : "", + "value" : "", + "description" : "", + "required" : false, + "dataType" : "Object", + "type" : null, + "defaultValue" : null, + "validateType" : "", + "error" : "", + "expression" : "", + "children" : [ { + "name" : "name", + "value" : "sys-dict-list", + "description" : "", + "required" : false, + "dataType" : "String", + "type" : null, + "defaultValue" : null, + "validateType" : "", + "error" : "", + "expression" : "", + "children" : [ ] + }, { + "name" : "code", + "value" : "\\n\\n\\n", + "description" : "", + "required" : false, + "dataType" : "String", + "type" : null, + "defaultValue" : null, + "validateType" : "", + "error" : "", + "expression" : "", + "children" : [ ] + } ] + } ] }, { "name" : "timestamp", - "value" : "1646545653430", + "value" : "1648017503577", "description" : "", "required" : false, "dataType" : "Long", @@ -80,7 +116,7 @@ "children" : [ ] }, { "name" : "executeTime", - "value" : "null", + "value" : "12", "description" : "", "required" : false, "dataType" : "Object", @@ -94,8 +130,9 @@ } } ================================ -return db.page(""" - select * from sys_component where 1=1 - ?{name, and name like concat('%',#{name},'%')} - ?{descRibe, and desc_ribe like concat('%',#{descRibe},'%')} -""") \ No newline at end of file +import org.ssssssss.magicapi.utils.PathUtils +import org.ssssssss.magicapi.core.service.MagicResourceService +return MagicResourceService.files('component').map(it => { + name: PathUtils.replaceSlash(String.format("%s-%s", MagicResourceService.getGroupPath(it.groupId), it.path)).replace('/', '-'), + code: it.script +}) \ No newline at end of file diff --git a/data/magic-api/api/后台/组件/删除.ms b/data/magic-api/api/后台/组件/删除.ms deleted file mode 100644 index 612aeec..0000000 --- a/data/magic-api/api/后台/组件/删除.ms +++ /dev/null @@ -1,25 +0,0 @@ -{ - "properties" : { }, - "id" : "529cbe774ebe4565b091a30e806a5085", - "script" : null, - "groupId" : "6f106ebdee21489db34b956f7770ff03", - "name" : "删除", - "createTime" : null, - "updateTime" : 1646553123792, - "lock" : "0", - "createBy" : null, - "updateBy" : null, - "path" : "/delete", - "method" : "DELETE", - "parameters" : [ ], - "options" : [ ], - "requestBody" : "", - "headers" : [ ], - "paths" : [ ], - "responseBody" : null, - "description" : null, - "requestBodyDefinition" : null, - "responseBodyDefinition" : null -} -================================ -return db.table("sys_component").logic().where().eq("id",id).delete() \ No newline at end of file diff --git a/data/magic-api/api/后台/组件/详情.ms b/data/magic-api/api/后台/组件/详情.ms deleted file mode 100644 index ded25fd..0000000 --- a/data/magic-api/api/后台/组件/详情.ms +++ /dev/null @@ -1,97 +0,0 @@ -{ - "properties" : { }, - "id" : "59ce5de20a8b46599cb72c164a9500d1", - "script" : null, - "groupId" : "6f106ebdee21489db34b956f7770ff03", - "name" : "详情", - "createTime" : null, - "updateTime" : 1646552459844, - "lock" : "0", - "createBy" : null, - "updateBy" : null, - "path" : "/get", - "method" : "GET", - "parameters" : [ ], - "options" : [ ], - "requestBody" : "", - "headers" : [ ], - "paths" : [ ], - "responseBody" : "{\"code\":402,\"message\":\"凭证已过期\",\"data\":null,\"timestamp\":1646545664781,\"executeTime\":null}", - "description" : null, - "requestBodyDefinition" : null, - "responseBodyDefinition" : { - "name" : "", - "value" : "", - "description" : "", - "required" : false, - "dataType" : "Object", - "type" : null, - "defaultValue" : null, - "validateType" : "", - "error" : "", - "expression" : "", - "children" : [ { - "name" : "code", - "value" : "402", - "description" : "", - "required" : false, - "dataType" : "Integer", - "type" : null, - "defaultValue" : null, - "validateType" : "", - "error" : "", - "expression" : "", - "children" : [ ] - }, { - "name" : "message", - "value" : "凭证已过期", - "description" : "", - "required" : false, - "dataType" : "String", - "type" : null, - "defaultValue" : null, - "validateType" : "", - "error" : "", - "expression" : "", - "children" : [ ] - }, { - "name" : "data", - "value" : "null", - "description" : "", - "required" : false, - "dataType" : "Object", - "type" : null, - "defaultValue" : null, - "validateType" : "", - "error" : "", - "expression" : "", - "children" : [ ] - }, { - "name" : "timestamp", - "value" : "1646545664781", - "description" : "", - "required" : false, - "dataType" : "Long", - "type" : null, - "defaultValue" : null, - "validateType" : "", - "error" : "", - "expression" : "", - "children" : [ ] - }, { - "name" : "executeTime", - "value" : "null", - "description" : "", - "required" : false, - "dataType" : "Object", - "type" : null, - "defaultValue" : null, - "validateType" : "", - "error" : "", - "expression" : "", - "children" : [ ] - } ] - } -} -================================ -return db.table("sys_component").where().eq("id",id).selectOne() \ No newline at end of file diff --git a/data/magic-api/api/后台/组件/选择组件.ms b/data/magic-api/api/后台/组件/选择组件.ms index 1cdb869..50c2ab0 100644 --- a/data/magic-api/api/后台/组件/选择组件.ms +++ b/data/magic-api/api/后台/组件/选择组件.ms @@ -4,8 +4,8 @@ "script" : null, "groupId" : "6f106ebdee21489db34b956f7770ff03", "name" : "选择组件", - "createTime" : 1646490239487, - "updateTime" : 1646402724502, + "createTime" : null, + "updateTime" : 1648025271406, "lock" : "0", "createBy" : null, "updateBy" : null, @@ -16,7 +16,7 @@ "requestBody" : "", "headers" : [ ], "paths" : [ ], - "responseBody" : "{\n \"code\": 1,\n \"message\": \"success\",\n \"data\": null,\n \"timestamp\": 1646402708142,\n \"executeTime\": 2\n}", + "responseBody" : "{\n \"code\": 200,\n \"message\": \"success\",\n \"data\": [{\n \"id\": \"9bf92d503f4242d39a0f271c577aa3ac\",\n \"label\": \"系统管理\",\n \"children\": [{\n \"id\": \"6bee7576eea04963a573b21bb657784d\",\n \"label\": \"字典管理\",\n \"children\": [{\n \"id\": \"sys-dict-list\",\n \"label\": \"列表(sys-dict-list)\"\n }]\n }]\n }],\n \"timestamp\": 1648025200208,\n \"executeTime\": 14\n}", "description" : null, "requestBodyDefinition" : null, "responseBodyDefinition" : { @@ -32,7 +32,7 @@ "expression" : "", "children" : [ { "name" : "code", - "value" : "1", + "value" : "200", "description" : "", "required" : false, "dataType" : "Integer", @@ -56,7 +56,7 @@ "children" : [ ] }, { "name" : "data", - "value" : "null", + "value" : "", "description" : "", "required" : false, "dataType" : "Object", @@ -65,10 +65,142 @@ "validateType" : "", "error" : "", "expression" : "", - "children" : [ ] + "children" : [ { + "name" : "", + "value" : "", + "description" : "", + "required" : false, + "dataType" : "Object", + "type" : null, + "defaultValue" : null, + "validateType" : "", + "error" : "", + "expression" : "", + "children" : [ { + "name" : "id", + "value" : "9bf92d503f4242d39a0f271c577aa3ac", + "description" : "", + "required" : false, + "dataType" : "String", + "type" : null, + "defaultValue" : null, + "validateType" : "", + "error" : "", + "expression" : "", + "children" : [ ] + }, { + "name" : "label", + "value" : "系统管理", + "description" : "", + "required" : false, + "dataType" : "String", + "type" : null, + "defaultValue" : null, + "validateType" : "", + "error" : "", + "expression" : "", + "children" : [ ] + }, { + "name" : "children", + "value" : "", + "description" : "", + "required" : false, + "dataType" : "Array", + "type" : null, + "defaultValue" : null, + "validateType" : "", + "error" : "", + "expression" : "", + "children" : [ { + "name" : "", + "value" : "", + "description" : "", + "required" : false, + "dataType" : "Object", + "type" : null, + "defaultValue" : null, + "validateType" : "", + "error" : "", + "expression" : "", + "children" : [ { + "name" : "id", + "value" : "6bee7576eea04963a573b21bb657784d", + "description" : "", + "required" : false, + "dataType" : "String", + "type" : null, + "defaultValue" : null, + "validateType" : "", + "error" : "", + "expression" : "", + "children" : [ ] + }, { + "name" : "label", + "value" : "字典管理", + "description" : "", + "required" : false, + "dataType" : "String", + "type" : null, + "defaultValue" : null, + "validateType" : "", + "error" : "", + "expression" : "", + "children" : [ ] + }, { + "name" : "children", + "value" : "", + "description" : "", + "required" : false, + "dataType" : "Array", + "type" : null, + "defaultValue" : null, + "validateType" : "", + "error" : "", + "expression" : "", + "children" : [ { + "name" : "", + "value" : "", + "description" : "", + "required" : false, + "dataType" : "Object", + "type" : null, + "defaultValue" : null, + "validateType" : "", + "error" : "", + "expression" : "", + "children" : [ { + "name" : "id", + "value" : "sys-dict-list", + "description" : "", + "required" : false, + "dataType" : "String", + "type" : null, + "defaultValue" : null, + "validateType" : "", + "error" : "", + "expression" : "", + "children" : [ ] + }, { + "name" : "label", + "value" : "列表(sys-dict-list)", + "description" : "", + "required" : false, + "dataType" : "String", + "type" : null, + "defaultValue" : null, + "validateType" : "", + "error" : "", + "expression" : "", + "children" : [ ] + } ] + } ] + } ] + } ] + } ] + } ] }, { "name" : "timestamp", - "value" : "1646402708142", + "value" : "1648025200208", "description" : "", "required" : false, "dataType" : "Long", @@ -80,7 +212,7 @@ "children" : [ ] }, { "name" : "executeTime", - "value" : "2", + "value" : "14", "description" : "", "required" : false, "dataType" : "Integer", @@ -94,6 +226,34 @@ } } ================================ -return db.select(""" - select id value,name label from sys_component where is_del = 0 -""") \ No newline at end of file +import org.ssssssss.magicapi.utils.PathUtils +import org.ssssssss.magicapi.core.service.MagicResourceService +var getFiles = (groupId) => { + return MagicResourceService.listFiles(groupId).map(file => { + id: PathUtils.replaceSlash(String.format("%s-%s", MagicResourceService.getGroupPath(file.groupId), file.path)).replace('/', '-'), + label: `${file.name}(${file.path})` + }) +} +var toTree = (children) => { + var treeData = [] + children.forEach(it => { + var chi = {} + chi.id = it.node.id + chi.label = `${it.node.name}(${it.node.path})` + if(it.children.length > 0){ + chi.children = toTree(it.children) + var files = getFiles(it.node.id) + if(files.length > 0){ + chi.children.push(...files) + } + }else{ + var files = getFiles(it.node.id) + if(files.length > 0){ + chi.children = files + } + } + treeData.push(chi) + }) + return treeData +} +return toTree(MagicResourceService.tree('component').children) \ No newline at end of file diff --git a/data/magic-api/api/后台/菜单管理/当前用户菜单.ms b/data/magic-api/api/后台/菜单管理/当前用户菜单.ms index 658f228..3a9525f 100644 --- a/data/magic-api/api/后台/菜单管理/当前用户菜单.ms +++ b/data/magic-api/api/后台/菜单管理/当前用户菜单.ms @@ -4,8 +4,8 @@ "script" : null, "groupId" : "67b2ce258e24491194b74992958c74aa", "name" : "当前用户菜单", - "createTime" : 1646490239513, - "updateTime" : 1646450734459, + "createTime" : null, + "updateTime" : 1648013721548, "lock" : "0", "createBy" : null, "updateBy" : null, @@ -18,7 +18,19 @@ "paths" : [ ], "responseBody" : "{\n \"code\": 200,\n \"message\": \"success\",\n \"data\": [{\n \"id\": \"b1851d1b13594e71840103c11a37a669\",\n \"name\": \"系统设置\",\n \"pid\": \"0\",\n \"isShow\": 1,\n \"url\": \"/system\",\n \"sort\": 10,\n \"icon\": \"settings\",\n \"keepAlive\": 0,\n \"code\": null,\n \"componentname\": null,\n \"component\": \"Layout\",\n \"path\": \"/system\",\n \"meta\": {\n \"title\": \"系统设置\",\n \"icon\": \"settings\",\n \"keepAlive\": false\n },\n \"redirect\": \"noRedirect\",\n \"alwaysShow\": true,\n \"children\": [{\n \"id\": \"39be13ef6f0745568c80bf35202ddb2b\",\n \"name\": \"菜单管理\",\n \"pid\": \"b1851d1b13594e71840103c11a37a669\",\n \"isShow\": 1,\n \"url\": \"/system/menu/menu-list\",\n \"sort\": 10,\n \"icon\": \"menu\",\n \"keepAlive\": 1,\n \"code\": null,\n \"componentname\": null,\n \"component\": \"/system/menu/menu-list\",\n \"path\": \"/system/menu/menu-list\",\n \"meta\": {\n \"title\": \"菜单管理\",\n \"icon\": \"menu\",\n \"keepAlive\": true\n }\n }, {\n \"id\": \"6f3594d0-5445-41e1-a13c-890a57485036\",\n \"name\": \"组织机构\",\n \"pid\": \"b1851d1b13594e71840103c11a37a669\",\n \"isShow\": 1,\n \"url\": \"/system/office/office-list\",\n \"sort\": 20,\n \"icon\": \"office\",\n \"keepAlive\": 0,\n \"code\": null,\n \"componentname\": null,\n \"component\": \"/system/office/office-list\",\n \"path\": \"/system/office/office-list\",\n \"meta\": {\n \"title\": \"组织机构\",\n \"icon\": \"office\",\n \"keepAlive\": false\n }\n }, {\n \"id\": \"8e9455740091486c914495cfb0c7faa5\",\n \"name\": \"角色管理\",\n \"pid\": \"b1851d1b13594e71840103c11a37a669\",\n \"isShow\": 1,\n \"url\": \"/system/role/role-list\",\n \"sort\": 40,\n \"icon\": \"role\",\n \"keepAlive\": 0,\n \"code\": null,\n \"componentname\": null,\n \"component\": \"/system/role/role-list\",\n \"path\": \"/system/role/role-list\",\n \"meta\": {\n \"title\": \"角色管理\",\n \"icon\": \"role\",\n \"keepAlive\": false\n }\n }, {\n \"id\": \"06b8a427e4cd4c1ba11752070f565f20\",\n \"name\": \"用户管理\",\n \"pid\": \"b1851d1b13594e71840103c11a37a669\",\n \"isShow\": 1,\n \"url\": \"/system/user/user-list\",\n \"sort\": 50,\n \"icon\": \"user\",\n \"keepAlive\": 0,\n \"code\": null,\n \"componentname\": null,\n \"component\": \"/system/user/user-list\",\n \"path\": \"/system/user/user-list\",\n \"meta\": {\n \"title\": \"用户管理\",\n \"icon\": \"user\",\n \"keepAlive\": false\n }\n }, {\n \"id\": \"c5f407478c4e4c9cbcdbee6389d2c909\",\n \"name\": \"数据字典\",\n \"pid\": \"b1851d1b13594e71840103c11a37a669\",\n \"isShow\": 1,\n \"url\": \"/system/dict/dict-list\",\n \"sort\": 60,\n \"icon\": \"dict\",\n \"keepAlive\": 0,\n \"code\": null,\n \"componentname\": null,\n \"component\": \"/system/dict/dict-list\",\n \"path\": \"/system/dict/dict-list\",\n \"meta\": {\n \"title\": \"数据字典\",\n \"icon\": \"dict\",\n \"keepAlive\": false\n }\n }, {\n \"id\": \"10fc3bdde0c642aea2af34d281a49cf9\",\n \"name\": \"测试数据\",\n \"pid\": \"b1851d1b13594e71840103c11a37a669\",\n \"isShow\": 1,\n \"url\": \"/system/test/test-list\",\n \"sort\": 100,\n \"icon\": \"home\",\n \"keepAlive\": 1,\n \"code\": null,\n \"componentname\": null,\n \"component\": \"/system/test/test-list\",\n \"path\": \"/system/test/test-list\",\n \"meta\": {\n \"title\": \"测试数据\",\n \"icon\": \"home\",\n \"keepAlive\": true\n }\n }]\n }, {\n \"id\": \"641253af-8ea1-4b5d-8bc3-a7165ef60ff2\",\n \"name\": \"一些例子\",\n \"pid\": \"0\",\n \"isShow\": 1,\n \"url\": \"/examples\",\n \"sort\": 20,\n \"icon\": \"examples\",\n \"keepAlive\": 0,\n \"code\": null,\n \"componentname\": null,\n \"component\": \"Layout\",\n \"path\": \"/examples\",\n \"meta\": {\n \"title\": \"一些例子\",\n \"icon\": \"examples\",\n \"keepAlive\": false\n },\n \"redirect\": \"noRedirect\",\n \"alwaysShow\": true,\n \"children\": [{\n \"id\": \"dc332875-831e-4937-86ff-0c7420915ce9\",\n \"name\": \"三级联动\",\n \"pid\": \"641253af-8ea1-4b5d-8bc3-a7165ef60ff2\",\n \"isShow\": 1,\n \"url\": \"/examples/three-linkage\",\n \"sort\": 10,\n \"icon\": \"\",\n \"keepAlive\": 0,\n \"code\": null,\n \"componentname\": null,\n \"component\": \"/examples/three-linkage\",\n \"path\": \"/examples/three-linkage\",\n \"meta\": {\n \"title\": \"三级联动\",\n \"icon\": \"\",\n \"keepAlive\": false\n }\n }, {\n \"id\": \"f09410d5-5043-4164-9f68-8d135de71b29\",\n \"name\": \"上传文件\",\n \"pid\": \"641253af-8ea1-4b5d-8bc3-a7165ef60ff2\",\n \"isShow\": 1,\n \"url\": \"/examples/upload-file\",\n \"sort\": 20,\n \"icon\": \"\",\n \"keepAlive\": 0,\n \"code\": null,\n \"componentname\": null,\n \"component\": \"/examples/upload-file\",\n \"path\": \"/examples/upload-file\",\n \"meta\": {\n \"title\": \"上传文件\",\n \"icon\": \"\",\n \"keepAlive\": false\n }\n }, {\n \"id\": \"74c852ea-be4b-4533-b146-cfbd776045d5\",\n \"name\": \"富文本\",\n \"pid\": \"641253af-8ea1-4b5d-8bc3-a7165ef60ff2\",\n \"isShow\": 1,\n \"url\": \"/examples/ueditor-example\",\n \"sort\": 30,\n \"icon\": \"\",\n \"keepAlive\": 0,\n \"code\": null,\n \"componentname\": null,\n \"component\": \"/examples/ueditor-example\",\n \"path\": \"/examples/ueditor-example\",\n \"meta\": {\n \"title\": \"富文本\",\n \"icon\": \"\",\n \"keepAlive\": false\n }\n }, {\n \"id\": \"91bdb7d742a64a8c8a8fdc6d3bb61581\",\n \"name\": \"可编辑表格\",\n \"pid\": \"641253af-8ea1-4b5d-8bc3-a7165ef60ff2\",\n \"isShow\": 1,\n \"url\": \"/examples/editor-table\",\n \"sort\": 40,\n \"icon\": \"\",\n \"keepAlive\": 0,\n \"code\": null,\n \"componentname\": null,\n \"component\": \"/examples/editor-table\",\n \"path\": \"/examples/editor-table\",\n \"meta\": {\n \"title\": \"可编辑表格\",\n \"icon\": \"\",\n \"keepAlive\": false\n }\n }, {\n \"id\": \"0ca23f378d794b23b935d6045bb54915\",\n \"name\": \"页面设计\",\n \"pid\": \"641253af-8ea1-4b5d-8bc3-a7165ef60ff2\",\n \"isShow\": 1,\n \"url\": \"/examples/page-design\",\n \"sort\": 50,\n \"icon\": \"\",\n \"keepAlive\": 0,\n \"code\": null,\n \"componentname\": null,\n \"component\": \"/examples/page-design\",\n \"path\": \"/examples/page-design\",\n \"meta\": {\n \"title\": \"页面设计\",\n \"icon\": \"\",\n \"keepAlive\": false\n }\n }, {\n \"id\": \"2664b76cb2904227bce5b0f7d1dd6e7b\",\n \"name\": \"下拉框\",\n \"pid\": \"641253af-8ea1-4b5d-8bc3-a7165ef60ff2\",\n \"isShow\": 1,\n \"url\": \"/examples/select-example\",\n \"sort\": 60,\n \"icon\": \"\",\n \"keepAlive\": 0,\n \"code\": null,\n \"componentname\": null,\n \"component\": \"/examples/select-example\",\n \"path\": \"/examples/select-example\",\n \"meta\": {\n \"title\": \"下拉框\",\n \"icon\": \"\",\n \"keepAlive\": false\n }\n }]\n }, {\n \"id\": \"d7f8d052d4864bd285c575c3cf2dce69\",\n \"name\": \"低代码\",\n \"pid\": \"0\",\n \"isShow\": 1,\n \"url\": \"/lowcode\",\n \"sort\": 30,\n \"icon\": null,\n \"keepAlive\": 1,\n \"code\": null,\n \"componentname\": null,\n \"component\": \"Layout\",\n \"path\": \"/lowcode\",\n \"meta\": {\n \"title\": \"低代码\",\n \"icon\": null,\n \"keepAlive\": true\n },\n \"redirect\": \"noRedirect\",\n \"alwaysShow\": true,\n \"children\": [{\n \"id\": \"9de78e0a6042469c891af82fbc21ba90\",\n \"name\": \"组件管理\",\n \"pid\": \"d7f8d052d4864bd285c575c3cf2dce69\",\n \"isShow\": 1,\n \"url\": \"/lowcode/component-list\",\n \"sort\": 10,\n \"icon\": null,\n \"keepAlive\": 1,\n \"code\": null,\n \"componentname\": null,\n \"component\": \"/lowcode/component-list\",\n \"path\": \"/lowcode/component-list\",\n \"meta\": {\n \"title\": \"组件管理\",\n \"icon\": null,\n \"keepAlive\": true\n }\n }, {\n \"id\": \"c7445e2ac6144a15a76d723607fbfb9d\",\n \"name\": \"接口管理\",\n \"pid\": \"d7f8d052d4864bd285c575c3cf2dce69\",\n \"isShow\": 1,\n \"url\": \"/lowcode/magic-editor\",\n \"sort\": 20,\n \"icon\": null,\n \"keepAlive\": 1,\n \"code\": null,\n \"componentname\": null,\n \"component\": \"/lowcode/magic-editor\",\n \"path\": \"/lowcode/magic-editor\",\n \"meta\": {\n \"title\": \"接口管理\",\n \"icon\": null,\n \"keepAlive\": true\n }\n }]\n }],\n \"timestamp\": 1646400974566,\n \"executeTime\": 41\n}", "description" : null, - "requestBodyDefinition" : null, + "requestBodyDefinition" : { + "name" : "", + "value" : "", + "description" : "", + "required" : false, + "dataType" : "Object", + "type" : null, + "defaultValue" : null, + "validateType" : "", + "error" : "", + "expression" : "", + "children" : [ ] + }, "responseBodyDefinition" : { "name" : "", "value" : "", @@ -552,9 +564,8 @@ var menus = db.select(""" sm.sort, sm.icon, sm.keep_alive, - sc.name component_name - from sys_menu sm - left join sys_component sc on sm.component_id = sc.id where 1=1 + sm.component_name + from sys_menu sm where 1=1 ?{userId != '1', and sm.id in ( select menu_id from sys_role_menu where role_id in ( diff --git a/data/magic-api/api/后台/菜单管理/获取菜单tree.ms b/data/magic-api/api/后台/菜单管理/获取菜单tree.ms index d29169b..e80fc66 100644 --- a/data/magic-api/api/后台/菜单管理/获取菜单tree.ms +++ b/data/magic-api/api/后台/菜单管理/获取菜单tree.ms @@ -4,8 +4,8 @@ "script" : null, "groupId" : "67b2ce258e24491194b74992958c74aa", "name" : "获取菜单tree", - "createTime" : 1646490239523, - "updateTime" : 1646402874965, + "createTime" : null, + "updateTime" : 1648014003694, "lock" : "0", "createBy" : null, "updateBy" : null, @@ -30,7 +30,19 @@ "paths" : [ ], "responseBody" : "{\n \"code\": 402,\n \"message\": \"凭证已过期\",\n \"data\": null,\n \"timestamp\": 1634309660370,\n \"executeTime\": null\n}", "description" : null, - "requestBodyDefinition" : null, + "requestBodyDefinition" : { + "name" : "", + "value" : "", + "description" : "", + "required" : false, + "dataType" : "Object", + "type" : null, + "defaultValue" : null, + "validateType" : "", + "error" : "", + "expression" : "", + "children" : [ ] + }, "responseBodyDefinition" : { "name" : "", "value" : "", @@ -107,7 +119,7 @@ } ================================ var toTree = (list,pid) => select t.*,toTree(list,t.id) children from list t where t.pid = pid -var list = toTree(db.select('select id,name,pid,is_show,url,sort,permission,desc_ribe,icon,keep_alive,component_id from sys_menu where is_del = 0 order by sort'),'0') +var list = toTree(db.select('select id,name,pid,is_show,url,sort,permission,desc_ribe,icon,keep_alive,component_name from sys_menu where is_del = 0 order by sort'),'0') return { list: list, diff --git a/magic-api-plugin-component/src/console/src/components/magic-component-info.vue b/magic-api-plugin-component/src/console/src/components/magic-component-info.vue index 440b9f4..f3234cf 100644 --- a/magic-api-plugin-component/src/console/src/components/magic-component-info.vue +++ b/magic-api-plugin-component/src/console/src/components/magic-component-info.vue @@ -1,8 +1,10 @@