若依 3.0

This commit is contained in:
RuoYi
2018-10-07 14:16:47 +08:00
parent fed3aa8231
commit e166127c9f
438 changed files with 9987 additions and 3978 deletions

View File

@ -0,0 +1,103 @@
<!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-post-add">
<div class="form-group">
<label class="col-sm-3 control-label">岗位名称:</label>
<div class="col-sm-8">
<input class="form-control" type="text" name="postName" id="postName">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label ">岗位编码:</label>
<div class="col-sm-8">
<input class="form-control" type="text" name="postCode" id="postCode"/>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">显示顺序:</label>
<div class="col-sm-8">
<input class="form-control" type="text" name="postSort" id="postSort">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">岗位状态:</label>
<div class="col-sm-8">
<div class="radio-box" th:each="dict : ${@dict.getType('sys_normal_disable')}">
<input type="radio" th:id="${dict.dictCode}" name="status" th:value="${dict.dictValue}" th:checked="${dict.isDefault == 'Y' ? true : false}">
<label th:for="${dict.dictCode}" th:text="${dict.dictLabel}"></label>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">备注:</label>
<div class="col-sm-8">
<textarea id="remark" name="remark" class="form-control"></textarea>
</div>
</div>
</form>
</div>
<div th:include="include::footer"></div>
<script type="text/javascript">
var prefix = ctx + "system/post";
$("#form-post-add").validate({
rules:{
postName:{
required:true,
remote: {
url: ctx + "system/post/checkPostNameUnique",
type: "post",
dataType: "json",
data: {
"postName" : function() {
return $.common.trim($("#postName").val());
}
},
dataFilter: function(data, type) {
return $.validate.unique(data);
}
}
},
postCode:{
required:true,
remote: {
url: ctx + "system/post/checkPostCodeUnique",
type: "post",
dataType: "json",
data: {
"postCode" : function() {
return $.common.trim($("#postCode").val());
}
},
dataFilter: function(data, type) {
return $.validate.unique(data);
}
}
},
postSort:{
required:true,
digits:true
},
},
messages: {
"postCode": {
remote: "岗位编码已经存在"
},
"postName": {
remote: "岗位名称已经存在"
}
}
});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/add", $('#form-post-add').serialize());
}
}
</script>
</body>
</html>

View File

@ -0,0 +1,110 @@
<!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-post-edit" th:object="${post}">
<input id="postId" name="postId" type="hidden" th:field="*{postId}"/>
<div class="form-group">
<label class="col-sm-3 control-label">岗位名称:</label>
<div class="col-sm-8">
<input class="form-control" type="text" name="postName" id="postName" th:field="*{postName}">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label ">岗位编码:</label>
<div class="col-sm-8">
<input class="form-control" type="text" name="postCode" id="postCode" th:field="*{postCode}"/>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">显示顺序:</label>
<div class="col-sm-8">
<input class="form-control" type="text" name="postSort" id="postSort" th:field="*{postSort}">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">岗位状态:</label>
<div class="col-sm-8">
<div class="radio-box" th:each="dict : ${@dict.getType('sys_normal_disable')}">
<input type="radio" th:id="${dict.dictCode}" name="status" th:value="${dict.dictValue}" th:field="*{status}">
<label th:for="${dict.dictCode}" th:text="${dict.dictLabel}"></label>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">备注:</label>
<div class="col-sm-8">
<textarea id="remark" name="remark" class="form-control">[[*{remark}]]</textarea>
</div>
</div>
</form>
</div>
<div th:include="include::footer"></div>
<script type="text/javascript">
var prefix = ctx + "system/post";
$("#form-post-edit").validate({
rules:{
postName:{
required:true,
remote: {
url: ctx + "system/post/checkPostNameUnique",
type: "post",
dataType: "json",
data: {
"postId": function() {
return $("input[name='postId']").val();
},
"postName" : function() {
return $.common.trim($("#postName").val());
}
},
dataFilter: function(data, type) {
return $.validate.unique(data);
}
}
},
postCode:{
required:true,
remote: {
url: ctx + "system/post/checkPostCodeUnique",
type: "post",
dataType: "json",
data: {
"postId": function() {
return $("input[name='postId']").val();
},
"postCode" : function() {
return $.common.trim($("#postCode").val());
}
},
dataFilter: function(data, type) {
return $.validate.unique(data);
}
}
},
postSort:{
required:true,
digits:true
},
},
messages: {
"postCode": {
remote: "岗位编码已经存在"
},
"postName": {
remote: "岗位名称已经存在"
}
}
});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/edit", $('#form-post-edit').serialize());
}
}
</script>
</body>
</html>

View File

@ -0,0 +1,123 @@
<!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="row">
<div class="col-sm-12 search-collapse">
<form id="post-form">
<div class="select-list">
<ul>
<li>
岗位编码:<input type="text" name="postCode"/>
</li>
<li>
岗位名称:<input type="text" name="postName"/>
</li>
<li>
岗位状态:<select name="status" th:with="type=${@dict.getType('sys_normal_disable')}">
<option value="">所有</option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</li>
<li>
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
</li>
</ul>
</div>
</form>
</div>
<div class="btn-group-sm hidden-xs" id="toolbar" role="group">
<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="system:post:add">
<i class="fa fa-plus"></i> 新增
</a>
<a class="btn btn-primary btn-edit disabled" onclick="$.operate.edit()" shiro:hasPermission="system:post:edit">
<i class="fa fa-edit"></i> 修改
</a>
<a class="btn btn-danger btn-del disabled" onclick="$.operate.removeAll()" shiro:hasPermission="system:post:remove">
<i class="fa fa-remove"></i> 删除
</a>
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="system:post:export">
<i class="fa fa-download"></i> 导出
</a>
</div>
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table" data-mobile-responsive="true"></table>
</div>
</div>
</div>
<div th:include="include :: footer"></div>
<script th:inline="javascript">
var editFlag = [[${@permission.hasPermi('system:post:edit')}]];
var removeFlag = [[${@permission.hasPermi('system:post:remove')}]];
var datas = [[${@dict.getType('sys_normal_disable')}]];
var prefix = ctx + "system/post";
$(function() {
var options = {
url: prefix + "/list",
createUrl: prefix + "/add",
updateUrl: prefix + "/edit/{id}",
removeUrl: prefix + "/remove",
exportUrl: prefix + "/export",
sortName: "postSort",
modalName: "岗位",
search: false,
showExport: false,
columns: [{
checkbox: true
},
{
field: 'postId',
title: '岗位编号'
},
{
field: 'postCode',
title: '岗位编码',
sortable: true
},
{
field: 'postName',
title: '岗位名称',
sortable: true
},
{
field: 'postSort',
title: '显示顺序',
sortable: true
},
{
field: 'status',
title: '状态',
align: 'center',
formatter: function(value, row, index) {
return $.table.selectDictLabel(datas, value);
}
},
{
field: 'createTime',
title: '创建时间',
sortable: true
},
{
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.postId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="#" onclick="$.operate.remove(\'' + row.postId + '\')"><i class="fa fa-remove"></i>删除</a>');
return actions.join('');
}
}]
};
$.table.init(options);
});
</script>
</body>
</html>