diff --git a/src/main/java/xyz/wbsite/dbtool/javafx/manger/callable/SpringBootCallable.java b/src/main/java/xyz/wbsite/dbtool/javafx/manger/callable/SpringBootCallable.java index 52348ad3..5ab06cd4 100644 --- a/src/main/java/xyz/wbsite/dbtool/javafx/manger/callable/SpringBootCallable.java +++ b/src/main/java/xyz/wbsite/dbtool/javafx/manger/callable/SpringBootCallable.java @@ -7,10 +7,12 @@ import xyz.wbsite.dbtool.javafx.manger.ProjectManager; import xyz.wbsite.dbtool.javafx.manger.XmlManager; import xyz.wbsite.dbtool.javafx.po.*; import xyz.wbsite.dbtool.javafx.tool.Tool; +import xyz.wbsite.dbtool.web.framework.IDgenerator; import java.io.File; import java.util.Date; import java.util.HashMap; +import java.util.UUID; import java.util.concurrent.Callable; public class SpringBootCallable implements Callable { @@ -723,13 +725,23 @@ public class SpringBootCallable implements Callable { Tool.outputResource(option + "/resources/templates/layout/index.ftl", new File(layout.getAbsolutePath(), "index.ftl")); Tool.outputResource(option + "/resources/templates/layout/app.ftl", new File(layout.getAbsolutePath(), "app.ftl")); Tool.outputResource(option + "/resources/templates/screen/demo.ftl", new File(screen.getAbsolutePath(), "demo.ftl")); - Tool.outputResource(option + "/resources/templates/screen/index.ftl", new File(screen.getAbsolutePath(), "index.ftl")); Tool.outputResource(option + "/resources/templates/screen/home.ftl", new File(screen.getAbsolutePath(), "home.ftl")); Tool.outputResource(option + "/resources/templates/screen/login.ftl", new File(screen.getAbsolutePath(), "login.ftl")); Tool.outputResource(option + "/resources/templates/403.ftl", new File(templates.getAbsolutePath(), "403.ftl")); Tool.outputResource(option + "/resources/templates/404.ftl", new File(templates.getAbsolutePath(), "404.ftl")); Tool.outputResource(option + "/resources/templates/500.ftl", new File(templates.getAbsolutePath(), "500.ftl")); + { + HashMap ctx = new HashMap(); + ctx.put("basePackage", project.getProjectBasePackage()); + ctx.put("tool", new Tool()); + ctx.put("author", project.getProjectAuthor()); + ctx.put("date", new Date()); + ctx.put("modules", project.getModules()); + freeMarkerManager.outputTemp(new File(screen.getAbsolutePath(), "index.ftl"), option + "/resources/templates/screen/index.ftl", ctx); + + } + for (Module mo : project.getModules()) { if (mo.isHasSysFields()) {//标准模型才好生成简单的htm diff --git a/src/main/java/xyz/wbsite/dbtool/javafx/tool/Tool.java b/src/main/java/xyz/wbsite/dbtool/javafx/tool/Tool.java index b0ff5faa..d1755913 100644 --- a/src/main/java/xyz/wbsite/dbtool/javafx/tool/Tool.java +++ b/src/main/java/xyz/wbsite/dbtool/javafx/tool/Tool.java @@ -3,6 +3,7 @@ package xyz.wbsite.dbtool.javafx.tool; import java.io.*; import java.net.URL; import java.util.List; +import java.util.UUID; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -60,7 +61,9 @@ public class Tool { return sb.toString().toLowerCase(); } - + public static String uuid() { + return UUID.randomUUID().toString(); + } /** * FileCreateRequest -> file * diff --git a/src/main/resources/modules/SpringBoot/resources/templates/screen/index.ftl b/src/main/resources/modules/SpringBoot/resources/templates/screen/index.ftl index d893aeb0..07caa44b 100644 --- a/src/main/resources/modules/SpringBoot/resources/templates/screen/index.ftl +++ b/src/main/resources/modules/SpringBoot/resources/templates/screen/index.ftl @@ -12,22 +12,24 @@ background-color="#252a2f" text-color="#d6d6d6" active-text-color="#ffd04b"> - + - 用户管理 - 机构管理 - 角色管理 + 用户管理 - +<#list modules as item> + - 登录日志 + <#list item.tables as table> + ${table.tableComment} + + @@ -41,23 +43,32 @@ @@ -275,7 +286,7 @@ this.addTab({ title: '首页', name: 'home', - url: '${contextPath}/home.htm' + url: '${r"${contextPath}"}/home.htm' }) }, collapseSwitch: function () { @@ -288,18 +299,7 @@ }, handleSelect: function (index) { - switch (index) { - case "1-1": - this.addTab({title: "用户管理", name: "usersManager", url: "about:blank"}); - break; - case "1-2": - this.addTab({title: "机构管理", name: "departmentsManager", url: "about:blank"}); - break; - case "1-3": - this.addTab({title: "角色管理", name: "rolesManager", url: "about:blank"}); - break; - } - return false; + }, addTab: function (tab) { //查找是否存在该tab 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 a3f5e350..b9f6c588 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 @@ -3,8 +3,8 @@ <#list fields as item> <#if item.isQuery> - - + + @@ -22,14 +22,13 @@ 导出 - - + + <#list fields as item> <#if item.isQuery && !item.isSystem> - - - + + + @@ -42,16 +41,18 @@ + + label="${item.fieldComment?default("")}">