From cf8d1fa9b5f85fccd51afeaf765e481c2f1aeb56 Mon Sep 17 00:00:00 2001 From: wangbing <1919101440@qq.com> Date: Mon, 4 Nov 2019 00:58:27 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E5=8D=87=E7=BA=A7=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../manger/callable/SpringBootCallable.java | 86 ++++- .../java/action/GlobalController.java | 2 +- .../SpringBoot/java/config/ActionConfig.java | 33 +- .../resources/dbtool/system/DICT.sql | 24 ++ .../resources/dbtool/system/DICT_ITEM.sql | 25 ++ .../SpringBoot/resources/static/js/ajax.js | 82 ++++- .../modules/SpringBoot/resources/table.ftl | 42 --- .../modules/SpringBoot/resources/tableAll.ftl | 34 -- .../resources/templates/screen/index.ftl | 3 +- .../resources/templates/screen/login.ftl | 1 + .../resources/templates/screen/module/mgr.ftl | 35 +- .../templates/screen/module/system/dict.ftl | 343 ++++++++++++++++++ .../screen/module/system/dictItem.ftl | 339 +++++++++++++++++ 13 files changed, 939 insertions(+), 110 deletions(-) create mode 100644 src/main/resources/modules/SpringBoot/resources/dbtool/system/DICT.sql create mode 100644 src/main/resources/modules/SpringBoot/resources/dbtool/system/DICT_ITEM.sql delete mode 100644 src/main/resources/modules/SpringBoot/resources/table.ftl delete mode 100644 src/main/resources/modules/SpringBoot/resources/tableAll.ftl create mode 100644 src/main/resources/modules/SpringBoot/resources/templates/screen/module/system/dict.ftl create mode 100644 src/main/resources/modules/SpringBoot/resources/templates/screen/module/system/dictItem.ftl 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 f5f73388..efc3fb3f 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 @@ -145,6 +145,15 @@ public class SpringBootCallable implements Callable { System.out.println("生成模块:Response"); generateResponse(new File(modulePath.getAbsolutePath(), "rsp"), module, dataBase, option); } + + { + Module module = new Module(); + module.setModuleName("system"); + module.setProjectAuthor(project.getProjectAuthor()); + module.setProjectBasePackage(project.getProjectBasePackage()); + module.setProjectName(project.getProjectName()); + generateSystemModule(new File(moduleDir.getAbsolutePath(), "system"), module, dataBase, option); + } } //frame @@ -223,6 +232,8 @@ public class SpringBootCallable implements Callable { freeMarkerManager.outputTemp(new File(control.getAbsolutePath(), "Header.java"), option + "/java/action/control/Header.java", ctx); freeMarkerManager.outputTemp(new File(system.getAbsolutePath(), "AuthAjax.java"), option + "/java/action/ajax/system/AuthAjax.java", ctx); + freeMarkerManager.outputTemp(new File(system.getAbsolutePath(), "DictAjax.java"), option + "/java/action/ajax/system/DictAjax.java", ctx); + freeMarkerManager.outputTemp(new File(system.getAbsolutePath(), "DictItemAjax.java"), option + "/java/action/ajax/system/DictItemAjax.java", ctx); for (Module module : project.getModules()) { @@ -472,6 +483,63 @@ public class SpringBootCallable implements Callable { } } + public void generateSystemModule(File root, Module md, DataBase dataBase, String option) { + File ent = new File(root.getAbsolutePath(), "ent"); + ent.mkdirs(); + File mpr = new File(root.getAbsolutePath(), "mpr"); + mpr.mkdirs(); + File mgr = new File(root.getAbsolutePath(), "mgr"); + mgr.mkdirs(); + File req = new File(root.getAbsolutePath(), "req"); + req.mkdirs(); + File rsp = new File(root.getAbsolutePath(), "rsp"); + rsp.mkdirs(); + + HashMap ctx = new HashMap(); + ctx.put("basePackage", md.getProjectBasePackage()); + ctx.put("moduleName", md.getModuleName()); + ctx.put("author", md.getProjectAuthor()); + ctx.put("date", new Date()); + + freeMarkerManager.outputTemp(new File(ent.getAbsolutePath(),"Dict.java"), option + "/java/module/system/ent/Dict.java", ctx); + freeMarkerManager.outputTemp(new File(ent.getAbsolutePath(),"DictItem.java"), option + "/java/module/system/ent/DictItem.java", ctx); + + freeMarkerManager.outputTemp(new File(mgr.getAbsolutePath(),"DictItemManager.java"), option + "/java/module/system/mgr/DictItemManager.java", ctx); + freeMarkerManager.outputTemp(new File(mgr.getAbsolutePath(),"DictItemManagerImpl.java"), option + "/java/module/system/mgr/DictItemManagerImpl.java", ctx); + freeMarkerManager.outputTemp(new File(mgr.getAbsolutePath(),"DictManager.java"), option + "/java/module/system/mgr/DictManager.java", ctx); + freeMarkerManager.outputTemp(new File(mgr.getAbsolutePath(),"DictManagerImpl.java"), option + "/java/module/system/mgr/DictManagerImpl.java", ctx); + + freeMarkerManager.outputTemp(new File(mpr.getAbsolutePath(),"DictItemMapper.java"), option + "/java/module/system/mpr/DictItemMapper.java", ctx); + freeMarkerManager.outputTemp(new File(mpr.getAbsolutePath(),"DictItemMapper.xml"), option + "/java/module/system/mpr/DictItemMapper.xml", ctx); + freeMarkerManager.outputTemp(new File(mpr.getAbsolutePath(),"DictMapper.java"), option + "/java/module/system/mpr/DictMapper.java", ctx); + freeMarkerManager.outputTemp(new File(mpr.getAbsolutePath(),"DictMapper.xml"), option + "/java/module/system/mpr/DictMapper.xml", ctx); + + freeMarkerManager.outputTemp(new File(req.getAbsolutePath(),"DictCreateRequest.java"), option + "/java/module/system/req/DictCreateRequest.java", ctx); + freeMarkerManager.outputTemp(new File(req.getAbsolutePath(),"DictDeleteRequest.java"), option + "/java/module/system/req/DictDeleteRequest.java", ctx); + freeMarkerManager.outputTemp(new File(req.getAbsolutePath(),"DictFindRequest.java"), option + "/java/module/system/req/DictFindRequest.java", ctx); + freeMarkerManager.outputTemp(new File(req.getAbsolutePath(),"DictGetRequest.java"), option + "/java/module/system/req/DictGetRequest.java", ctx); + freeMarkerManager.outputTemp(new File(req.getAbsolutePath(),"DictItemCreateRequest.java"), option + "/java/module/system/req/DictItemCreateRequest.java", ctx); + freeMarkerManager.outputTemp(new File(req.getAbsolutePath(),"DictItemDeleteRequest.java"), option + "/java/module/system/req/DictItemDeleteRequest.java", ctx); + freeMarkerManager.outputTemp(new File(req.getAbsolutePath(),"DictItemFindRequest.java"), option + "/java/module/system/req/DictItemFindRequest.java", ctx); + freeMarkerManager.outputTemp(new File(req.getAbsolutePath(),"DictItemGetRequest.java"), option + "/java/module/system/req/DictItemGetRequest.java", ctx); + freeMarkerManager.outputTemp(new File(req.getAbsolutePath(),"DictItemUpdateRequest.java"), option + "/java/module/system/req/DictItemUpdateRequest.java", ctx); + freeMarkerManager.outputTemp(new File(req.getAbsolutePath(),"DictLoadRequest.java"), option + "/java/module/system/req/DictLoadRequest.java", ctx); + freeMarkerManager.outputTemp(new File(req.getAbsolutePath(),"DictUpdateRequest.java"), option + "/java/module/system/req/DictUpdateRequest.java", ctx); + + freeMarkerManager.outputTemp(new File(rsp.getAbsolutePath(),"DictCreateResponse.java"), option + "/java/module/system/rsp/DictCreateResponse.java", ctx); + freeMarkerManager.outputTemp(new File(rsp.getAbsolutePath(),"DictDeleteResponse.java"), option + "/java/module/system/rsp/DictDeleteResponse.java", ctx); + freeMarkerManager.outputTemp(new File(rsp.getAbsolutePath(),"DictFindResponse.java"), option + "/java/module/system/rsp/DictFindResponse.java", ctx); + freeMarkerManager.outputTemp(new File(rsp.getAbsolutePath(),"DictGetResponse.java"), option + "/java/module/system/rsp/DictGetResponse.java", ctx); + freeMarkerManager.outputTemp(new File(rsp.getAbsolutePath(),"DictItemCreateResponse.java"), option + "/java/module/system/rsp/DictItemCreateResponse.java", ctx); + freeMarkerManager.outputTemp(new File(rsp.getAbsolutePath(),"DictItemDeleteResponse.java"), option + "/java/module/system/rsp/DictItemDeleteResponse.java", ctx); + freeMarkerManager.outputTemp(new File(rsp.getAbsolutePath(),"DictItemFindResponse.java"), option + "/java/module/system/rsp/DictItemFindResponse.java", ctx); + freeMarkerManager.outputTemp(new File(rsp.getAbsolutePath(),"DictItemGetResponse.java"), option + "/java/module/system/rsp/DictItemGetResponse.java", ctx); + freeMarkerManager.outputTemp(new File(rsp.getAbsolutePath(),"DictItemUpdateResponse.java"), option + "/java/module/system/rsp/DictItemUpdateResponse.java", ctx); + freeMarkerManager.outputTemp(new File(rsp.getAbsolutePath(),"DictLoadResponse.java"), option + "/java/module/system/rsp/DictLoadResponse.java", ctx); + freeMarkerManager.outputTemp(new File(rsp.getAbsolutePath(),"DictUpdateResponse.java"), option + "/java/module/system/rsp/DictUpdateResponse.java", ctx); + + } + /** * 生成frame类 * @@ -609,11 +677,20 @@ public class SpringBootCallable implements Callable { for (Table table : module.getTables()) { ctx.put("table", table); - freeMarkerManager.outputTemp(new File(tableDir.getAbsolutePath(), table.getTableName() + ".sql"), option + "/resources/table.ftl", ctx); + freeMarkerManager.outputTemp(new File(tableDir.getAbsolutePath(), table.getTableName() + ".sql"), option + "/resources/dbtool/table.ftl", ctx); } - freeMarkerManager.outputTemp(new File(tableDir.getAbsolutePath(), "ALL_TABLE.sql"), option + "/resources/tableAll.ftl", ctx); + freeMarkerManager.outputTemp(new File(tableDir.getAbsolutePath(), "ALL_TABLE.sql"), option + "/resources/dbtool/tableAll.ftl", ctx); } + { + File system = new File(dbtool.getAbsolutePath(), "system"); + system.mkdirs(); + + freeMarkerManager.outputTemp(new File(system.getAbsolutePath(), "DICT.sql"), option + "/resources/dbtool/system/DICT.sql", ctx); + freeMarkerManager.outputTemp(new File(system.getAbsolutePath(), "DICT_ITEM.sql"), option + "/resources/dbtool/system/DICT_ITEM.sql", ctx); + } + + } public void generateTestResources(File root, Project project, DataBase dataBase, String option) { @@ -715,6 +792,8 @@ public class SpringBootCallable implements Callable { layout.mkdirs(); File screen = new File(templates.getAbsolutePath(), "screen"); screen.mkdirs(); + File system = new File(screen.getAbsolutePath(), "system"); + system.mkdirs(); Tool.outputResource(option + "/resources/templates/control/nav.ftl", new File(control.getAbsolutePath(), "nav.ftl")); Tool.outputResource(option + "/resources/templates/control/header.ftl", new File(control.getAbsolutePath(), "header.ftl")); // Tool.outputResource(option + "/resources/templates/control/footer.ftl", new File(control.getAbsolutePath(), "footer.ftl")); @@ -729,6 +808,9 @@ public class SpringBootCallable implements Callable { 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")); + Tool.outputResource(option + "/resources/templates/screen/module/system/dict.ftl", new File(system.getAbsolutePath(), "dict.ftl")); + Tool.outputResource(option + "/resources/templates/screen/module/system/dictItem.ftl", new File(system.getAbsolutePath(), "dictItem.ftl")); + { HashMap ctx = new HashMap(); ctx.put("basePackage", project.getProjectBasePackage()); diff --git a/src/main/resources/modules/SpringBoot/java/action/GlobalController.java b/src/main/resources/modules/SpringBoot/java/action/GlobalController.java index c9430a20..6483782e 100644 --- a/src/main/resources/modules/SpringBoot/java/action/GlobalController.java +++ b/src/main/resources/modules/SpringBoot/java/action/GlobalController.java @@ -254,7 +254,7 @@ public class GlobalController implements ErrorController { BaseResponse baseResponse = null; try { - Object ajax = LocalData.getApplicationContext().getBean(ActionConfig.AJAX_PREFIX + module + "." + target); + Object ajax = LocalData.getApplicationContext().getBean(ActionConfig.AJAX_PREFIX + module + "/" + target); Class ajaxClass = ajax.getClass(); Method methodC = ajaxClass.getMethod(method, String.class); diff --git a/src/main/resources/modules/SpringBoot/java/config/ActionConfig.java b/src/main/resources/modules/SpringBoot/java/config/ActionConfig.java index 2d0b3567..1d382368 100644 --- a/src/main/resources/modules/SpringBoot/java/config/ActionConfig.java +++ b/src/main/resources/modules/SpringBoot/java/config/ActionConfig.java @@ -2,6 +2,7 @@ package ${basePackage}.config; import ${basePackage}.frame.base.Control; import ${basePackage}.frame.base.Screen; +import ${basePackage}.frame.utils.LogUtil; import org.springframework.beans.BeansException; import org.springframework.beans.factory.config.BeanDefinition; import org.springframework.beans.factory.config.ConfigurableListableBeanFactory; @@ -15,6 +16,8 @@ import org.springframework.core.type.classreading.MetadataReaderFactory; import org.springframework.core.type.filter.TypeFilter; import java.io.IOException; +import java.util.regex.Matcher; +import java.util.regex.Pattern; /** * 请求处理器配置类,Screen及Control @@ -36,10 +39,14 @@ public class ActionConfig implements BeanDefinitionRegistryPostProcessor { @Override public void postProcessBeanDefinitionRegistry(BeanDefinitionRegistry beanDefinitionRegistry) throws BeansException { String aPackage = this.getClass().getPackage().getName(); - int i = registryScreen("${basePackage}.action.screen", beanDefinitionRegistry); - int i1 = registryControl("${basePackage}.action.control", beanDefinitionRegistry); - int i2 = registryAjax("${basePackage}.action.ajax", beanDefinitionRegistry); - System.out.println(); + Pattern compile = Pattern.compile("(.*)\\.config"); + Matcher matcher = compile.matcher(aPackage); + if (matcher.find()) { + String basePackage = matcher.group(1); + registryScreen(basePackage + ".action.screen", beanDefinitionRegistry); + registryControl(basePackage + ".action.control", beanDefinitionRegistry); + registryAjax(basePackage + ".action.ajax", beanDefinitionRegistry); + } } @Override @@ -62,8 +69,12 @@ public class ActionConfig implements BeanDefinitionRegistryPostProcessor { @Override public String generateBeanName(BeanDefinition beanDefinition, BeanDefinitionRegistry beanDefinitionRegistry) { String beanClassName = beanDefinition.getBeanClassName(); - String s = beanClassName.replaceAll(basePackage+ ".", SCREEN_PREFIX); - return s.toLowerCase(); + String beamName = beanClassName.replaceAll(basePackage + ".", SCREEN_PREFIX).replaceAll("\\.","/"); + char[] chars = beamName.toCharArray(); + if (chars[8] >= 65 && chars[8] <= 90) chars[8] += 32; + beamName = String.valueOf(chars); + LogUtil.i("registry screen " + beamName); + return beamName; } }); return classPathBeanDefinitionScanner.scan(basePackage); @@ -84,8 +95,9 @@ public class ActionConfig implements BeanDefinitionRegistryPostProcessor { @Override public String generateBeanName(BeanDefinition beanDefinition, BeanDefinitionRegistry beanDefinitionRegistry) { String beanClassName = beanDefinition.getBeanClassName(); - String s = beanClassName.replaceAll(basePackage+ ".", CONTROL_PREFIX); - return s.toLowerCase(); + String beamName = beanClassName.replaceAll(basePackage + ".", CONTROL_PREFIX).replaceAll("\\.","/"); + LogUtil.i("registry control " + beamName); + return beamName; } }); return classPathBeanDefinitionScanner.scan(basePackage); @@ -106,8 +118,9 @@ public class ActionConfig implements BeanDefinitionRegistryPostProcessor { if (beanClassName != null && beanClassName.endsWith("Ajax")) { beanClassName = beanClassName.substring(0, beanClassName.length() - 4); } - String s = beanClassName.replaceAll(basePackage+ ".", AJAX_PREFIX); - return s.toLowerCase(); + String beamName = beanClassName.replaceAll(basePackage + ".", AJAX_PREFIX).replaceAll("\\.","/"); + LogUtil.i("registry ajax " + beamName); + return beamName; } }); return classPathBeanDefinitionScanner.scan(basePackage); diff --git a/src/main/resources/modules/SpringBoot/resources/dbtool/system/DICT.sql b/src/main/resources/modules/SpringBoot/resources/dbtool/system/DICT.sql new file mode 100644 index 00000000..52594044 --- /dev/null +++ b/src/main/resources/modules/SpringBoot/resources/dbtool/system/DICT.sql @@ -0,0 +1,24 @@ +/* +Target : MYSQL +Author +Date: 2019-10-08 +*/ + +-- ---------------------------- +-- Table structure for DICT - 字典 +-- ---------------------------- + +CREATE TABLE `SYS_DICT` ( + `ID` BIGINT(20) NOT NULL COMMENT '主键', + `DICT_NAME` VARCHAR(50) NOT NULL COMMENT '字典名称', + `DICT_CODE` VARCHAR(50) NOT NULL COMMENT '字典代码', + `VERSION` VARCHAR(50) NOT NULL COMMENT '字典版本号', + `VALID` TINYINT(1) NOT NULL COMMENT '是否有效', + `ROW_VERSION` BIGINT(20) NOT NULL DEFAULT 0 COMMENT '行版本', + `IS_DELETED` TINYINT(1) NOT NULL DEFAULT 0 COMMENT '是否已删除', + `CREATE_BY` BIGINT(20) NOT NULL COMMENT '创建用户', + `CREATE_TIME` DATETIME NOT NULL COMMENT '创建时间', + `LAST_UPDATE_BY` BIGINT(20) DEFAULT NULL COMMENT '最后更新用户', + `LAST_UPDATE_TIME` DATETIME DEFAULT NULL COMMENT '最后更新时间', +PRIMARY KEY (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='字典'; diff --git a/src/main/resources/modules/SpringBoot/resources/dbtool/system/DICT_ITEM.sql b/src/main/resources/modules/SpringBoot/resources/dbtool/system/DICT_ITEM.sql new file mode 100644 index 00000000..9af5fa71 --- /dev/null +++ b/src/main/resources/modules/SpringBoot/resources/dbtool/system/DICT_ITEM.sql @@ -0,0 +1,25 @@ +/* +Target : MYSQL +Author +Date: 2019-10-08 +*/ + +-- ---------------------------- +-- Table structure for DICT_ITEM - 字典项 +-- ---------------------------- + +CREATE TABLE `SYS_DICT_ITEM` ( + `ID` BIGINT(20) NOT NULL COMMENT '主键', + `DICT_ID` BIGINT(20) NOT NULL COMMENT '字典ID', + `KEY` CHAR(10) NOT NULL COMMENT '字典KEY', + `VALUE` VARCHAR(100) NOT NULL COMMENT '字典VALUE', + `SORT` INTEGER(10) NOT NULL COMMENT '排序', + `VALID` TINYINT(1) NOT NULL COMMENT '是否有效', + `ROW_VERSION` BIGINT(20) NOT NULL DEFAULT 0 COMMENT '行版本', + `IS_DELETED` TINYINT(1) NOT NULL DEFAULT 0 COMMENT '是否已删除', + `CREATE_BY` BIGINT(20) NOT NULL COMMENT '创建用户', + `CREATE_TIME` DATETIME NOT NULL COMMENT '创建时间', + `LAST_UPDATE_BY` BIGINT(20) DEFAULT NULL COMMENT '最后更新用户', + `LAST_UPDATE_TIME` DATETIME DEFAULT NULL COMMENT '最后更新时间', +PRIMARY KEY (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='字典项'; diff --git a/src/main/resources/modules/SpringBoot/resources/static/js/ajax.js b/src/main/resources/modules/SpringBoot/resources/static/js/ajax.js index f9590b2d..fa17d2bd 100644 --- a/src/main/resources/modules/SpringBoot/resources/static/js/ajax.js +++ b/src/main/resources/modules/SpringBoot/resources/static/js/ajax.js @@ -95,7 +95,7 @@ fileRequest = function (config) { window.ajax = { authLogin: function (data) { return jsonRequest({ - url: "/system/auth/login", + url: "/system/Auth/login", data: JSON.stringify(data), }) }, @@ -106,12 +106,78 @@ window.ajax = { data: fd }) }, + dictCreate: function (data) { + return jsonRequest({ + url: "/system/Dict/create", + data: JSON.stringify(data), + }) + }, + dictUpdate: function (data) { + return jsonRequest({ + url: "/system/Dict/update", + data: JSON.stringify(data), + }) + }, + dictDelete: function (data) { + return jsonRequest({ + url: "/system/Dict/delete", + data: JSON.stringify(data), + }) + }, + dictFind: function (data) { + return jsonRequest({ + url: "/system/Dict/find", + data: JSON.stringify(data), + }) + }, + dictGet: function (data) { + return jsonRequest({ + url: "/system/Dict/get", + data: JSON.stringify(data), + }) + }, + dictLoad: function (data) { + return jsonRequest({ + url: "/system/Dict/load", + data: JSON.stringify(data), + }) + }, + dictItemCreate: function (data) { + return jsonRequest({ + url: "/system/DictItem/create", + data: JSON.stringify(data), + }) + }, + dictItemUpdate: function (data) { + return jsonRequest({ + url: "/system/DictItem/update", + data: JSON.stringify(data), + }) + }, + dictItemDelete: function (data) { + return jsonRequest({ + url: "/system/DictItem/delete", + data: JSON.stringify(data), + }) + }, + dictItemFind: function (data) { + return jsonRequest({ + url: "/system/DictItem/find", + data: JSON.stringify(data), + }) + }, + dictItemGet: function (data) { + return jsonRequest({ + url: "/system/DictItem/get", + data: JSON.stringify(data), + }) + }, <#list modules as db> <#list db.tables as table> <#if table.getCreate()> ${table.getFName()}Create: function (data) { return jsonRequest({ - url: "/${db.moduleName}/${table.getLName()}/create", + url: "/${db.moduleName}/${table.getCName()}/create", data: JSON.stringify(data), }) }, @@ -119,7 +185,7 @@ window.ajax = { <#if table.getDelete()> ${table.getFName()}Delete: function (data) { return jsonRequest({ - url: "/${db.moduleName}/${table.getLName()}/delete", + url: "/${db.moduleName}/${table.getCName()}/delete", data: JSON.stringify(data), }) }, @@ -127,7 +193,7 @@ window.ajax = { <#if table.getUpdate()> ${table.getFName()}Update: function (data) { return jsonRequest({ - url: "/${db.moduleName}/${table.getLName()}/update", + url: "/${db.moduleName}/${table.getCName()}/update", data: JSON.stringify(data), }) }, @@ -135,7 +201,7 @@ window.ajax = { <#if table.getFind()> ${table.getFName()}Find: function (data) { return jsonRequest({ - url: "/${db.moduleName}/${table.getLName()}/find", + url: "/${db.moduleName}/${table.getCName()}/find", data: JSON.stringify(data), }) }, @@ -143,7 +209,7 @@ window.ajax = { <#if table.getGet()> ${table.getFName()}Get: function(data) { return jsonRequest({ - url: "/${db.moduleName}/${table.getLName()}/get", + url: "/${db.moduleName}/${table.getCName()}/get", data: JSON.stringify(data), }) }, @@ -151,7 +217,7 @@ window.ajax = { <#if table.getSearch()> ${table.getFName()}Search: function (data) { return jsonRequest({ - url: "/${db.moduleName}/${table.getLName()}/search", + url: "/${db.moduleName}/${table.getCName()}/search", data: JSON.stringify(data), }) }, @@ -159,7 +225,7 @@ window.ajax = { <#if table.getGetAll()> ${table.getFName()}GetAll: function (data) { return jsonRequest({ - url: "/${db.moduleName}/${table.getLName()}/getAll", + url: "/${db.moduleName}/${table.getCName()}/getAll", data: JSON.stringify(data), }) }, diff --git a/src/main/resources/modules/SpringBoot/resources/table.ftl b/src/main/resources/modules/SpringBoot/resources/table.ftl deleted file mode 100644 index 9ddc7a3a..00000000 --- a/src/main/resources/modules/SpringBoot/resources/table.ftl +++ /dev/null @@ -1,42 +0,0 @@ -<#if dataBase == 'ORACLE'> -/* -Target : ORACLE -Author -Date: ${date?string("yyyy-MM-dd")} -*/ - --- ---------------------------- --- Table structure for ${table.tableName} - ${table.tableComment?default("")} --- ---------------------------- - -CREATE TABLE "${module.modulePrefix}${table.tableName}" ( -<#list table.fields as field> - ${dBmapper.getFieldSql(field)}<#if field_has_next>, - -); - -COMMENT ON TABLE "${module.modulePrefix?default("")}${table.tableName}" is '${table.tableComment}'; -<#list table.fields as field> -COMMENT ON COLUMN "${module.modulePrefix?default("")}${table.tableName}"."${field.fieldName?default("")}" is '${field.fieldComment?default("")}'; - - -<#if dataBase == 'MYSQL'> -/* -Target : MYSQL -Author -Date: ${date?string("yyyy-MM-dd")} -*/ - --- ---------------------------- --- Table structure for ${table.tableName} - ${table.tableComment?default("")} --- ---------------------------- - -CREATE TABLE `${module.modulePrefix?default("")}${table.tableName}` ( - <#list table.fields as field> - ${dBmapper.getFieldSql(field)}<#if field_has_next||module.hasSysFields>, - -<#if module.hasSysFields> -PRIMARY KEY (`ID`) - -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='${table.tableComment?default("")}'; - \ No newline at end of file diff --git a/src/main/resources/modules/SpringBoot/resources/tableAll.ftl b/src/main/resources/modules/SpringBoot/resources/tableAll.ftl deleted file mode 100644 index 88f44f19..00000000 --- a/src/main/resources/modules/SpringBoot/resources/tableAll.ftl +++ /dev/null @@ -1,34 +0,0 @@ -<#if dataBase == 'ORACLE'> -<#list module.tables as table> --- ---------------------------- --- Table structure for ${table.tableName} - ${table.tableComment?default("")} --- ---------------------------- -CREATE TABLE "${module.modulePrefix?default("")}${table.tableName}" ( -<#list table.fields as field> -${dBmapper.getFieldSql(field)}<#if field_has_next>, - -); -COMMENT ON TABLE "${module.modulePrefix?default("")}${table.tableName}" is '${table.tableComment?default("")}'; - <#list table.fields as field> -COMMENT ON COLUMN "${module.modulePrefix?default("")}${table.tableName}"."${field.fieldName?default("")}" is '${field.fieldComment?default("")}'; - - - - - -<#if dataBase == 'MYSQL'> -<#list module.tables as table> --- ---------------------------- --- Table structure for ${table.tableName} - ${table.tableComment?default("")} --- ---------------------------- -CREATE TABLE `${module.modulePrefix?default("")}${table.tableName}` ( -<#list table.fields as field> - ${dBmapper.getFieldSql(field)}<#if field_has_next||module.hasSysFields>, - -<#if module.hasSysFields> -PRIMARY KEY (`ID`) - -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='${table.tableComment?default("")}'; - - - 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 07caa44b..147e38ca 100644 --- a/src/main/resources/modules/SpringBoot/resources/templates/screen/index.ftl +++ b/src/main/resources/modules/SpringBoot/resources/templates/screen/index.ftl @@ -17,7 +17,7 @@ 系统设置 - 用户管理 + 字典管理 <#list modules as item> @@ -278,7 +278,6 @@ uniqueOpened: true,//是否保持一个子菜单展开 isCollapse: false,//左侧菜单是否收缩 transition:false, - defaultActive:"1-1", } }, methods: { diff --git a/src/main/resources/modules/SpringBoot/resources/templates/screen/login.ftl b/src/main/resources/modules/SpringBoot/resources/templates/screen/login.ftl index 7fea1edd..403ae113 100644 --- a/src/main/resources/modules/SpringBoot/resources/templates/screen/login.ftl +++ b/src/main/resources/modules/SpringBoot/resources/templates/screen/login.ftl @@ -117,6 +117,7 @@ if (valid) { this.isLogin = true; ajax.authLogin(this.form).then(function (response) { + this.isLogin = false; if (response.errors.length > 0) { nav.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 b9f6c588..bfd34303 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 @@ -114,6 +114,11 @@ .form .el-dialog{ width: 700px; } + + .form .el-dialog .el-form-item__content { + width: 220px; + } + diff --git a/src/main/resources/modules/SpringBoot/resources/templates/screen/module/system/dictItem.ftl b/src/main/resources/modules/SpringBoot/resources/templates/screen/module/system/dictItem.ftl new file mode 100644 index 00000000..17e2d490 --- /dev/null +++ b/src/main/resources/modules/SpringBoot/resources/templates/screen/module/system/dictItem.ftl @@ -0,0 +1,339 @@ +
+ + + + + + + + + + + + + + + + + + + + 搜索 + 重置 + + + + + + + + 新增 + 导出 + + + + + + + + + + + + + + + + + + 取消 + 保存 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +