代码生成路径调整

This commit is contained in:
RuoYi
2018-10-10 21:56:19 +08:00
parent 4ac96a8348
commit b5e8432e2f
32 changed files with 45 additions and 47 deletions

View File

@ -0,0 +1,38 @@
<!DOCTYPE HTML>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-${classname}-add">
#foreach($column in $columns)
#if($column.columnName != $primaryKey.columnName)
<div class="form-group">
<label class="col-sm-3 control-label">${column.columnComment}</label>
<div class="col-sm-8">
<input id="${column.attrname}" name="${column.attrname}" class="form-control" type="text">
</div>
</div>
#end
#end
</form>
</div>
<div th:include="include::footer"></div>
<script type="text/javascript">
var prefix = ctx + "${moduleName}/${classname}"
$("#form-${classname}-add").validate({
rules:{
xxxx:{
required:true,
},
}
});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/add", $('#form-${classname}-add').serialize());
}
}
</script>
</body>
</html>

View File

@ -0,0 +1,39 @@
<!DOCTYPE HTML>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-${classname}-edit" th:object="${${classname}}">
<input id="${primaryKey.attrname}" name="${primaryKey.attrname}" th:field="*{${primaryKey.attrname}}" type="hidden">
#foreach($column in $columns)
#if($column.columnName != $primaryKey.columnName)
<div class="form-group">
<label class="col-sm-3 control-label">${column.columnComment}</label>
<div class="col-sm-8">
<input id="${column.attrname}" name="${column.attrname}" th:field="*{${column.attrname}}" class="form-control" type="text">
</div>
</div>
#end
#end
</form>
</div>
<div th:include="include::footer"></div>
<script type="text/javascript">
var prefix = ctx + "${moduleName}/${classname}"
$("#form-${classname}-edit").validate({
rules:{
xxxx:{
required:true,
},
}
});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/edit", $('#form-${classname}-edit').serialize());
}
}
</script>
</body>
</html>

View File

@ -0,0 +1,60 @@
<!DOCTYPE HTML>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="gray-bg">
<div class="container-div">
<div class="btn-group-sm hidden-xs" id="toolbar" role="group">
<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="${moduleName}:${classname}:add">
<i class="fa fa-plus"></i> 添加
</a>
<a class="btn btn-primary btn-edit disabled" onclick="$.operate.edit()" shiro:hasPermission="${moduleName}:${classname}:edit">
<i class="fa fa-edit"></i> 修改
</a>
<a class="btn btn-danger btn-del btn-del disabled" onclick="$.operate.removeAll()" shiro:hasPermission="${moduleName}:${classname}:remove">
<i class="fa fa-remove"></i> 删除
</a>
</div>
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table" data-mobile-responsive="true"></table>
</div>
</div>
<div th:include="include :: footer"></div>
<script th:inline="javascript">
var editFlag = [[${@permission.hasPermi('${moduleName}:${classname}:edit')}]];
var removeFlag = [[${@permission.hasPermi('${moduleName}:${classname}:remove')}]];
var prefix = ctx + "${moduleName}/${classname}";
$(function() {
var options = {
url: prefix + "/list",
createUrl: prefix + "/add",
updateUrl: prefix + "/edit/{id}",
removeUrl: prefix + "/remove",
modalName: "${tableComment}",
columns: [{
checkbox: true
},
#foreach($column in $columns)
{
field : '${column.attrname}',
title : '${column.columnComment}'
},
#end
{
title: '操作',
align: 'center',
formatter: function(value, row, index) {
var actions = [];
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="#" onclick="$.operate.edit(\'' + row.${primaryKey.attrname} + '\')"><i class="fa fa-edit"></i>编辑</a> ');
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="#" onclick="$.operate.remove(\'' + row.${primaryKey.attrname} + '\')"><i class="fa fa-remove"></i>删除</a>');
return actions.join('');
}
}]
};
$.table.init(options);
});
</script>
</body>
</html>