若依 2.0
This commit is contained in:
41
src/main/resources/templates/vm/html/add.html.vm
Normal file
41
src/main/resources/templates/vm/html/add.html.vm
Normal file
@ -0,0 +1,41 @@
|
||||
<!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
|
||||
<div class="form-group">
|
||||
<div class="form-control-static col-sm-offset-9">
|
||||
<button type="submit" class="btn btn-primary">提交</button>
|
||||
<button onclick="$.modal.close()" class="btn btn-danger" type="button">关闭</button>
|
||||
</div>
|
||||
</div>
|
||||
</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,
|
||||
},
|
||||
},
|
||||
submitHandler: function(form) {
|
||||
$.operate.save(prefix + "/save", $('#form-${classname}-add').serialize());
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
42
src/main/resources/templates/vm/html/edit.html.vm
Normal file
42
src/main/resources/templates/vm/html/edit.html.vm
Normal file
@ -0,0 +1,42 @@
|
||||
<!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="${config}">
|
||||
<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
|
||||
<div class="form-group">
|
||||
<div class="form-control-static col-sm-offset-9">
|
||||
<button type="submit" class="btn btn-primary">提交</button>
|
||||
<button onclick="$.modal.close()" class="btn btn-danger" type="button">关闭</button>
|
||||
</div>
|
||||
</div>
|
||||
</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,
|
||||
},
|
||||
},
|
||||
submitHandler: function(form) {
|
||||
$.operate.save(prefix + "/save", $('#form-${classname}-edit').serialize());
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
55
src/main/resources/templates/vm/html/list.html.vm
Normal file
55
src/main/resources/templates/vm/html/list.html.vm
Normal file
@ -0,0 +1,55 @@
|
||||
<!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="wrapper wrapper-content">
|
||||
<div class="btn-group hidden-xs" id="toolbar" role="group">
|
||||
<button class="btn btn-outline btn-default" onclick="$.operate.add()" shiro:hasPermission="${moduleName}:${classname}:add">
|
||||
<i class="fa fa-plus"></i> 新增
|
||||
</button>
|
||||
<button class="btn btn-outline btn-default" onclick="$.operate.batRemove()" shiro:hasPermission="${moduleName}:${classname}:remove">
|
||||
<i class="fa fa-trash-o"></i> 删除
|
||||
</button>
|
||||
</div>
|
||||
<table id="bootstrap-table" data-mobile-responsive="true">
|
||||
</table>
|
||||
</div>
|
||||
<div th:include="include :: footer"></div>
|
||||
<script th:inline="javascript">
|
||||
var editFlag = [[${@permissionService.hasPermi('${moduleName}:${classname}:edit')}]];
|
||||
var removeFlag = [[${@permissionService.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>
|
Reference in New Issue
Block a user