若依 3.0
This commit is contained in:
125
ruoyi-admin/src/main/resources/templates/system/dept/add.html
Normal file
125
ruoyi-admin/src/main/resources/templates/system/dept/add.html
Normal file
@@ -0,0 +1,125 @@
|
||||
<!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-dept-add">
|
||||
<input id="treeId" name="parentId" type="hidden" th:value="${dept.deptId}" />
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label ">上级部门:</label>
|
||||
<div class="col-sm-8">
|
||||
<input class="form-control" type="text" onclick="selectDeptTree()" id="treeName" readonly="true" th:value="${dept.deptName}"/>
|
||||
</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="deptName" id="deptName">
|
||||
</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="orderNum">
|
||||
</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="leader">
|
||||
</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="phone">
|
||||
</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="email">
|
||||
</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>
|
||||
</form>
|
||||
</div>
|
||||
<div th:include="include::footer"></div>
|
||||
<script type="text/javascript">
|
||||
var prefix = ctx + "system/dept";
|
||||
|
||||
$("#form-dept-add").validate({
|
||||
rules:{
|
||||
deptName:{
|
||||
required:true,
|
||||
remote: {
|
||||
url: prefix + "/checkDeptNameUnique",
|
||||
type: "post",
|
||||
dataType: "json",
|
||||
data: {
|
||||
"parentId": function() {
|
||||
return $("input[name='parentId']").val();
|
||||
},
|
||||
"deptName" : function() {
|
||||
return $.common.trim($("#deptName").val());
|
||||
}
|
||||
},
|
||||
dataFilter: function(data, type) {
|
||||
return $.validate.unique(data);
|
||||
}
|
||||
}
|
||||
},
|
||||
orderNum:{
|
||||
required:true,
|
||||
digits:true
|
||||
},
|
||||
email:{
|
||||
email:true,
|
||||
},
|
||||
phone:{
|
||||
isPhone:true,
|
||||
},
|
||||
},
|
||||
messages: {
|
||||
"deptName": {
|
||||
remote: "部门已经存在"
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
function submitHandler() {
|
||||
if ($.validate.form()) {
|
||||
$.operate.save(prefix + "/add", $('#form-dept-add').serialize());
|
||||
}
|
||||
}
|
||||
|
||||
/*部门管理-新增-选择父部门树*/
|
||||
function selectDeptTree() {
|
||||
var options = {
|
||||
title: '部门选择',
|
||||
width: "380",
|
||||
height: "380",
|
||||
url: prefix + "/selectDeptTree/" + $("#treeId").val(),
|
||||
callBack: doSubmit
|
||||
};
|
||||
$.modal.openOptions(options);
|
||||
}
|
||||
|
||||
function doSubmit(index, layero){
|
||||
var body = layer.getChildFrame('body', index);
|
||||
$("#treeId").val(body.find('#treeId').val());
|
||||
$("#treeName").val(body.find('#treeName').val());
|
||||
layer.close(index);
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
128
ruoyi-admin/src/main/resources/templates/system/dept/dept.html
Normal file
128
ruoyi-admin/src/main/resources/templates/system/dept/dept.html
Normal file
@@ -0,0 +1,128 @@
|
||||
<!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="dept-form">
|
||||
<div class="select-list">
|
||||
<ul>
|
||||
<li>
|
||||
部门名称:<input type="text" name="deptName"/>
|
||||
</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="$.treeTable.search()"><i class="fa fa-search"></i> 搜索</a>
|
||||
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i> 重置</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(100)" shiro:hasPermission="system:dept:add">
|
||||
<i class="fa fa-plus"></i> 新增
|
||||
</a>
|
||||
<a class="btn btn-primary" onclick="$.operate.editTree()" shiro:hasPermission="system:dept:edit">
|
||||
<i class="fa fa-edit"></i> 修改
|
||||
</a>
|
||||
<a class="btn btn-info" id="expandAllBtn">
|
||||
<i class="fa fa-exchange"></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 addFlag = [[${@permission.hasPermi('system:dept:add')}]];
|
||||
var editFlag = [[${@permission.hasPermi('system:dept:edit')}]];
|
||||
var removeFlag = [[${@permission.hasPermi('system:dept:remove')}]];
|
||||
var datas = [[${@dict.getType('sys_normal_disable')}]];
|
||||
var prefix = ctx + "system/dept"
|
||||
|
||||
$(function() {
|
||||
var options = {
|
||||
id: "deptId",
|
||||
parentId: "parentId",
|
||||
url: prefix + "/list",
|
||||
createUrl: prefix + "/add/{id}",
|
||||
updateUrl: prefix + "/edit/{id}",
|
||||
removeUrl: prefix + "/remove/{id}",
|
||||
modalName: "部门",
|
||||
columns: [{
|
||||
field: 'selectItem',
|
||||
radio: true
|
||||
},
|
||||
{
|
||||
field: 'deptName',
|
||||
title: '部门名称',
|
||||
align: "left"
|
||||
},
|
||||
{
|
||||
field: 'orderNum',
|
||||
title: '排序',
|
||||
align: "left"
|
||||
},
|
||||
{
|
||||
field: 'status',
|
||||
title: '状态',
|
||||
align: "left",
|
||||
formatter: function(value, item, index) {
|
||||
return $.table.selectDictLabel(datas, item.status);
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'createTime',
|
||||
title: '创建时间',
|
||||
align: "left"
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
align: 'left',
|
||||
formatter: function(value, row, index) {
|
||||
if (row.parentId != 0) {
|
||||
var actions = [];
|
||||
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="#" onclick="$.operate.edit(\'' + row.deptId + '\')"><i class="fa fa-edit">编辑</i></a> ');
|
||||
actions.push('<a class="btn btn-info btn-xs ' + addFlag + '" href="#" onclick="$.operate.add(\'' + row.deptId + '\')"><i class="fa fa-plus">新增</i></a> ');
|
||||
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="#" onclick="remove(\'' + row.deptId + '\')"><i class="fa fa-remove">删除</i></a>');
|
||||
return actions.join('');
|
||||
} else {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
}]
|
||||
};
|
||||
$.treeTable.init(options);
|
||||
});
|
||||
|
||||
function remove(id) {
|
||||
$.modal.confirm("确定删除该条" + $.table._option.modalName + "信息吗?", function() {
|
||||
$.ajax({
|
||||
type : 'post',
|
||||
url: prefix + "/remove/" + id,
|
||||
success : function(result) {
|
||||
if (result.code == web_status.SUCCESS) {
|
||||
$.modal.msgSuccess(result.msg);
|
||||
$.treeTable.refresh();
|
||||
} else {
|
||||
$.modal.msgError(result.msg);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
129
ruoyi-admin/src/main/resources/templates/system/dept/edit.html
Normal file
129
ruoyi-admin/src/main/resources/templates/system/dept/edit.html
Normal file
@@ -0,0 +1,129 @@
|
||||
<!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-dept-edit" th:object="${dept}">
|
||||
<input name="deptId" type="hidden" th:field="*{deptId}" />
|
||||
<input id="treeId" name="parentId" type="hidden" th:field="*{parentId}" />
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label ">上级部门:</label>
|
||||
<div class="col-sm-8">
|
||||
<input class="form-control" type="text" id="treeName" onclick="selectDeptTree()" readonly="true" th:field="*{parentName}"/>
|
||||
</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="deptName" th:field="*{deptName}" id="deptName">
|
||||
</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="orderNum" th:field="*{orderNum}">
|
||||
</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="leader" th:field="*{leader}">
|
||||
</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="phone" th:field="*{phone}">
|
||||
</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="email" th:field="*{email}">
|
||||
</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>
|
||||
</form>
|
||||
</div>
|
||||
<div th:include="include::footer"></div>
|
||||
<script type="text/javascript">
|
||||
var prefix = ctx + "system/dept";
|
||||
|
||||
$("#form-dept-edit").validate({
|
||||
rules:{
|
||||
deptName:{
|
||||
required:true,
|
||||
remote: {
|
||||
url: prefix + "/checkDeptNameUnique",
|
||||
type: "post",
|
||||
dataType: "json",
|
||||
data: {
|
||||
"deptId": function() {
|
||||
return $("#deptId").val();
|
||||
},
|
||||
"parentId": function() {
|
||||
return $("input[name='parentId']").val();
|
||||
},
|
||||
"deptName": function() {
|
||||
return $.common.trim($("#deptName").val());
|
||||
}
|
||||
},
|
||||
dataFilter: function(data, type) {
|
||||
return $.validate.unique(data);
|
||||
}
|
||||
}
|
||||
},
|
||||
orderNum:{
|
||||
required:true,
|
||||
digits:true
|
||||
},
|
||||
email:{
|
||||
email:true,
|
||||
},
|
||||
phone:{
|
||||
isPhone:true,
|
||||
},
|
||||
},
|
||||
messages: {
|
||||
"deptName": {
|
||||
remote: "部门已经存在"
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
function submitHandler() {
|
||||
if ($.validate.form()) {
|
||||
$.operate.save(prefix + "/edit", $('#form-dept-edit').serialize());
|
||||
}
|
||||
}
|
||||
|
||||
/*部门管理-修改-选择部门树*/
|
||||
function selectDeptTree() {
|
||||
var options = {
|
||||
title: '部门选择',
|
||||
width: "380",
|
||||
height: "380",
|
||||
url: prefix + "/selectDeptTree/" + $("#treeId").val(),
|
||||
callBack: doSubmit
|
||||
};
|
||||
$.modal.openOptions(options);
|
||||
}
|
||||
|
||||
function doSubmit(index, layero){
|
||||
var body = layer.getChildFrame('body', index);
|
||||
$("#treeId").val(body.find('#treeId').val());
|
||||
$("#treeName").val(body.find('#treeName').val());
|
||||
layer.close(index);
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@@ -0,0 +1,48 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
|
||||
<meta charset="utf-8">
|
||||
<head th:include="include :: header"></head>
|
||||
<link th:href="@{/ajax/libs/jquery-ztree/3.5/css/metro/zTreeStyle.css}" rel="stylesheet"/>
|
||||
<style>
|
||||
body{height:auto;font-family: "Microsoft YaHei";}
|
||||
button{font-family: "SimSun","Helvetica Neue",Helvetica,Arial;}
|
||||
</style>
|
||||
<body class="hold-transition box box-main">
|
||||
<input id="treeId" name="treeId" type="hidden" th:value="${dept.deptId}"/>
|
||||
<input id="treeName" name="treeName" type="hidden" th:value="${dept.deptName}"/>
|
||||
<div class="wrapper"><div class="treeShowHideButton" onclick="$.tree.toggleSearch();">
|
||||
<label id="btnShow" title="显示搜索" style="display:none;">︾</label>
|
||||
<label id="btnHide" title="隐藏搜索">︽</label>
|
||||
</div>
|
||||
<div class="treeSearchInput" id="search">
|
||||
<label for="keyword">关键字:</label><input type="text" class="empty" id="keyword" maxlength="50">
|
||||
<button class="btn" id="btn" onclick="$.tree.searchNode()"> 搜索 </button>
|
||||
</div>
|
||||
<div class="treeExpandCollapse">
|
||||
<a href="#" onclick="$.tree.expand()">展开</a> /
|
||||
<a href="#" onclick="$.tree.collapse()">折叠</a>
|
||||
</div>
|
||||
<div id="tree" class="ztree treeselect"></div>
|
||||
</div>
|
||||
<div th:include="include::footer"></div>
|
||||
<script th:src="@{/ajax/libs/jquery-ztree/3.5/js/jquery.ztree.all-3.5.js}"></script>
|
||||
<script th:inline="javascript">
|
||||
$(function() {
|
||||
var url = ctx + "system/dept/treeData";
|
||||
var options = {
|
||||
url: url,
|
||||
expandLevel: 2,
|
||||
onClick : zOnClick
|
||||
};
|
||||
$.tree.init(options);
|
||||
});
|
||||
|
||||
function zOnClick(event, treeId, treeNode) {
|
||||
var treeId = treeNode.id;
|
||||
var treeName = treeNode.name;
|
||||
$("#treeId").val(treeId);
|
||||
$("#treeName").val(treeName);
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
Reference in New Issue
Block a user