new element-ui,bootstrap modules

This commit is contained in:
moshowgame@126.com
2018-10-03 00:38:25 +08:00
parent fc06166da5
commit 2267e9d644
7 changed files with 64 additions and 2 deletions

View File

@@ -79,6 +79,9 @@ public class IndexController {
result.put("beetlentity", freemarkerTool.processString("xxl-code-generator/beetlentity.ftl", params));
result.put("beetlcontroller", freemarkerTool.processString("xxl-code-generator/beetlcontroller.ftl", params));
result.put("elementui", freemarkerTool.processString("xxl-code-generator/element-ui.ftl", params));
result.put("bootstrap", freemarkerTool.processString("xxl-code-generator/bootstrap.ftl", params));
// 计算,生成代码行数
int lineNum = 0;
for (Map.Entry<String, String> item: result.entrySet()) {

View File

@@ -159,5 +159,17 @@ $(function () {
genCodeArea.setSize('auto', 'auto');
}
});
$('#bootstrap').click(function () {
if(!$.isEmptyObject(codeData)) {
genCodeArea.setValue(codeData.bootstrap);
genCodeArea.setSize('auto', 'auto');
}
});
$('#element-ui').click(function () {
if(!$.isEmptyObject(codeData)) {
genCodeArea.setValue(codeData.elementui);
genCodeArea.setSize('auto', 'auto');
}
});
});

View File

@@ -30,7 +30,7 @@
<div class="jumbotron">
<div class="container">
<h1>Spring Boot Code Generator!</h1>
基于<code>SpringBoot2</code>+<code>Freemarker</code>的代码生成器,用<code>DDL SQL</code>语句生成<code>JPA</code>/<code>JdbcTemplate</code>/<code>Mybatis</code>/<code>BeetlSQL</code>相关代码,支持<code>mysql</code>/<code>oracle</code>/<code>pgsql</code>三大数据库。目前以<code>JPA</code>的为主各大模板也在陆续优化。欢迎大家提交模板和交流想法如果发现有SQL语句不能识别请<a href="https://github.com/moshowgame/SpringBootCodeGenerator/issues">留言</a>给我分析,谢谢!
基于<code>SpringBoot2</code>+<code>Freemarker</code>的代码生成器,用<code>DDL SQL</code>语句生成<code>JPA</code>/<code>JdbcTemplate</code>/<code>Mybatis</code>/<code>BeetlSQL</code>相关代码,支持<code>mysql</code>/<code>oracle</code>/<code>pgsql</code>三大数据库。以<code>释放双手</code>为目的,各大模板也在陆续补充和优化。欢迎大家多多提交模板和交流想法如果发现有SQL语句不能识别请<a href="https://github.com/moshowgame/SpringBootCodeGenerator/issues">留言</a>给我分析,谢谢!
</p>
<div class="input-group mb-3">
<div class="input-group-prepend">
@@ -84,6 +84,17 @@ CREATE TABLE `userinfo` (
</div>
<div class="btn-group mr-2" role="group" aria-label="First group">
<button type="button" class="btn btn-default" id="swaggerui">swagger-ui</button>
<button type="button" class="btn btn-default" id="element-ui">element-ui</button>
<button type="button" class="btn btn-default" id="bootstrap">bootstrap</button>
</div>
</div>
<div class="btn-toolbar mb-3" role="toolbar" aria-label="Toolbar with button groups">
<div class="input-group">
<div class="input-group-prepend">
<div class="input-group-text" id="btnGroupAddon">JPA</div>
</div>
</div>
<div class="btn-group mr-2" role="group" aria-label="First group">
<button type="button" class="btn btn-default" id="entity">entity</button>
<button type="button" class="btn btn-default" id="repository">repository</button>
<button type="button" class="btn btn-default" id="jpacontroller">controller</button>

View File

@@ -0,0 +1,13 @@
<form action="/${classInfo.className?uncap_first}/save">
<#if classInfo.fieldList?exists && classInfo.fieldList?size gt 0>
<#list classInfo.fieldList as fieldItem >
<div class="form-group">
<label for="${fieldItem.fieldName}Label">${fieldItem.fieldComment}</label>
<input type="input" class="form-control" id="${fieldItem.fieldName}" name="${fieldItem.fieldName}}" placeholder="请输入${fieldItem.fieldComment}">
</div>
</#list>
</#if>
<button type="submit" class="btn btn-primary">保存</button>
</form>

View File

@@ -0,0 +1,18 @@
<el-form :inline="true" :model="submitData" class="demo-form-inline" :rules="rules" ref="ruleForm">
<el-card class="box-card">
<div slot="header" class="header clearfix">
<span>${classInfo.classComment}</span>
<el-button v-if="!ischeck && !isFind" class="fr" type="primary" @click="validate('ruleForm')">提交</el-button>
<el-button v-else class="fr" type="primary" @click="goBack">返回</el-button>
</div>
<#if classInfo.fieldList?exists && classInfo.fieldList?size gt 0>
<#list classInfo.fieldList as fieldItem >
<el-form-item label="${fieldItem.fieldComment}" prop="${fieldItem.fieldName}">
<el-input placeholder="${fieldItem.fieldComment}" v-model="submitData.${fieldItem.fieldName}"></el-input>
</el-form-item>
</#list>
</#if>
</el-card>
</el-form>