diff --git a/src/main/resources/modules/SpringBoot/java/module/system/mgr/ResourceManagerImpl.java b/src/main/resources/modules/SpringBoot/java/module/system/mgr/ResourceManagerImpl.java index 84ab095f..d99b3572 100644 --- a/src/main/resources/modules/SpringBoot/java/module/system/mgr/ResourceManagerImpl.java +++ b/src/main/resources/modules/SpringBoot/java/module/system/mgr/ResourceManagerImpl.java @@ -14,6 +14,7 @@ import ${basePackage}.frame.utils.MapperUtil; import ${basePackage}.frame.utils.Message; import ${basePackage}.frame.utils.ValidationUtil; import ${basePackage}.module.system.ent.Resource; +import ${basePackage}.module.system.ent.ResourceTree; import ${basePackage}.module.system.mpr.ResourceMapper; import ${basePackage}.module.system.req.ResourceCreateRequest; import ${basePackage}.module.system.req.ResourceDeleteRequest; @@ -28,6 +29,7 @@ import ${basePackage}.module.system.rsp.ResourceGetResponse; import ${basePackage}.module.system.rsp.ResourceTreeResponse; import ${basePackage}.module.system.rsp.ResourceUpdateResponse; +import java.util.ArrayList; import java.util.HashMap; import java.util.Iterator; import java.util.List; @@ -204,11 +206,10 @@ public class ResourceManagerImpl implements ResourceManager { return response; } - Map treeMap = new HashMap<>(); + List data = new ArrayList<>(); Map allMap = new HashMap<>(); List result = resourceFindResponse.getResult(); // 获取最顶级资源 - int level = 1; while (result.size() > 0) { Iterator iterator = result.iterator(); @@ -217,7 +218,11 @@ public class ResourceManagerImpl implements ResourceManager { ResourceTree tree = new ResourceTree(); tree.setId(next.getId()); tree.setCode(next.getCode()); + tree.setResourceType(next.getResourceType()); + tree.setValid(next.getValid()); tree.setComment(next.getComment()); + tree.setValue(next.getValue()); + tree.setRowVersion(next.getRowVersion()); if (next.getCode() != null && next.getCode().split("_").length == level) { allMap.put(tree.getCode(), tree); @@ -231,16 +236,17 @@ public class ResourceManagerImpl implements ResourceManager { if (Ptree != null) break; } if (Ptree != null) { - tree.setpId(Ptree.getpId()); + tree.setpId(Ptree.getId()); Ptree.getChildren().add(tree); } else { - treeMap.put(tree.getCode(), tree); + data.add(tree); } } } level++; } + response.setResult(data); return response; } } diff --git a/src/main/resources/modules/SpringBoot/resources/static/css/base.css b/src/main/resources/modules/SpringBoot/resources/static/css/base.css index 5615e176..8d49641e 100644 --- a/src/main/resources/modules/SpringBoot/resources/static/css/base.css +++ b/src/main/resources/modules/SpringBoot/resources/static/css/base.css @@ -702,27 +702,25 @@ code { min-width: 1060px; } -.box-card.search .el-form-item__content, -.box-card.search .el-form-item__content > div { +.el-form.form .el-form-item__content, +.el-form.form .el-form-item__content > div, +.el-form.search .el-form-item__content, +.el-form.search .el-form-item__content > div { width: 220px; } -.box-card.data .el-table { +.form-dialog .el-dialog{ + width: 700px; +} + +.el-table.data { margin-top: 10px; width: 100%; } -.box-card.data .el-table .cell { +.el-table.data .cell { max-height: 46px; min-height: 23px; } -.form .el-dialog { - width: 700px; -} - -.form .el-dialog .el-form-item__content, -.form .el-dialog .el-form-item__content > div{ - width: 220px; -} /* 以上为APP样式 */ \ No newline at end of file diff --git a/src/main/resources/modules/SpringBoot/resources/templates/control/nav.ftl b/src/main/resources/modules/SpringBoot/resources/templates/control/nav.ftl index 61efbc81..9c352c70 100644 --- a/src/main/resources/modules/SpringBoot/resources/templates/control/nav.ftl +++ b/src/main/resources/modules/SpringBoot/resources/templates/control/nav.ftl @@ -98,7 +98,7 @@ // 正则匹配文件名 var fileName = dis.match(/filename="(.*\..*)"/)[1]; // 模拟下载 - utils.blobtoDown(decodeURIComponent(fileName),new Blob([response.data])) + utils.blobtoDown(decodeURIComponent(fileName), new Blob([response.data])) return Promise.resolve({errors: []}); } }, function (error) { @@ -140,7 +140,7 @@ // 正则匹配文件名 var fileName = dis.match(/filename="(.*\..*)"/)[1]; // 模拟下载 - utils.blobtoDown(decodeURIComponent(fileName),new Blob([response.data])) + utils.blobtoDown(decodeURIComponent(fileName), new Blob([response.data])) return Promise.resolve({errors: []}); } }, function (response) { @@ -149,6 +149,12 @@ }; // 定义共享异步请求对象 Vue.prototype.$ajax = { + post: function (config) { + return jsonRequest({ + url: "/ajax/" + config["module"] + "/" + config["target"] + "/" + config["method"], + data: JSON.stringify(config["data"]), + }) + }, login: function (data) { return jsonRequest({ url: "/ajax/system/User/login", @@ -169,7 +175,7 @@ }, create: function (module, target, data) { return jsonRequest({ - url: '/ajax/' + module + "/" + target + "/create", + url: '/ajax/' + module + "/" + target + "/create", data: JSON.stringify(data), }) }, @@ -472,7 +478,7 @@ }).then(function () { for (var i = 0; i < this.select.length; i++) { (function (obj) { - this.$ajax.delete(this.module, this.target, {id: obj.id}).then(function (response) { + this.$ajax.delete(this.module, this.target, {id: obj.id}).then(function (response) { if (response.errors.length > 0) { this.e(response.errors[0].message); } else { diff --git a/src/main/resources/modules/SpringBoot/resources/templates/screen/module/mgr.ftl b/src/main/resources/modules/SpringBoot/resources/templates/screen/module/mgr.ftl index db62c483..17653955 100644 --- a/src/main/resources/modules/SpringBoot/resources/templates/screen/module/mgr.ftl +++ b/src/main/resources/modules/SpringBoot/resources/templates/screen/module/mgr.ftl @@ -1,7 +1,7 @@ <#-- since ${date?string("yyyy-MM-dd")}-->
- - + + <#list fields as item> <#if item.isQuery> <#if item.fieldType.javaType() =="Boolean"> @@ -72,84 +72,12 @@ - + 新增 导出 - - - - <#list fields as item> - <#if !item.isSystem> - <#if item.fieldType.javaType() =="Boolean"> - - - - - - - <#elseif item.fieldType.javaType() =="String" && item.fieldType != "Dict"> - - - - <#elseif item.fieldType.javaType() =="String" && item.fieldType == "Dict"> - - - - <#elseif item.fieldType.javaType() =="Byte"> - - - - <#elseif item.fieldType.javaType() =="Short"> - - - - <#elseif item.fieldType.javaType() =="Integer"> - - - - <#elseif item.fieldType.javaType() =="Long"> - - - - <#elseif item.fieldType.javaType() =="Float"> - - - - <#elseif item.fieldType.javaType() =="Double"> - - - - <#elseif item.fieldType.javaType() =="Character"> - - - - <#elseif item.fieldType.javaType() =="Date"> - - - - - <#elseif item.fieldType.javaType() =="BigDecimal"> - - - - - - - - - 取 消 - 保存 - - @@ -174,6 +102,7 @@ + + + + <#list fields as item> + <#if !item.isSystem> + <#if item.fieldType.javaType() =="Boolean"> + + + + + + + <#elseif item.fieldType.javaType() =="String" && item.fieldType != "Dict"> + + + + <#elseif item.fieldType.javaType() =="String" && item.fieldType == "Dict"> + + + + <#elseif item.fieldType.javaType() =="Byte"> + + + + <#elseif item.fieldType.javaType() =="Short"> + + + + <#elseif item.fieldType.javaType() =="Integer"> + + + + <#elseif item.fieldType.javaType() =="Long"> + + + + <#elseif item.fieldType.javaType() =="Float"> + + + + <#elseif item.fieldType.javaType() =="Double"> + + + + <#elseif item.fieldType.javaType() =="Character"> + + + + <#elseif item.fieldType.javaType() =="Date"> + + + + + <#elseif item.fieldType.javaType() =="BigDecimal"> + + + + + + + + + 取 消 + 保存 + +
diff --git a/src/main/resources/modules/SpringBoot/resources/templates/screen/module/system/role.ftl b/src/main/resources/modules/SpringBoot/resources/templates/screen/module/system/role.ftl index 4b91f368..0eba8c0b 100644 --- a/src/main/resources/modules/SpringBoot/resources/templates/screen/module/system/role.ftl +++ b/src/main/resources/modules/SpringBoot/resources/templates/screen/module/system/role.ftl @@ -1,6 +1,6 @@
- - + + @@ -23,24 +23,6 @@ 新增 导出 - - - - - - - - - - - - - - - 取 消 - 保存 - - @@ -65,6 +47,7 @@ + + + + + + + + + + + + + + + 取 消 + 保存 + +