Files
RuoYi/ruoyi-admin/src/main/resources/templates/system/dept/dept.html

112 lines
4.3 KiB
HTML
Raw Normal View History

2018-07-09 08:44:52 +08:00
<!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">
2018-10-01 21:32:01 +08:00
<div class="col-sm-12 search-collapse">
2018-07-15 20:39:59 +08:00
<form id="dept-form">
2018-08-01 10:07:28 +08:00
<div class="select-list">
<ul>
<li>
部门名称:<input type="text" name="deptName"/>
</li>
<li>
2018-07-22 23:05:50 +08:00
部门状态:<select name="status" th:with="type=${@dict.getType('sys_normal_disable')}">
<option value="">所有</option>
2018-08-23 17:06:31 +08:00
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</li>
<li>
2018-07-27 21:56:08 +08:00
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.treeTable.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
2018-08-25 10:42:10 +08:00
<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>
2019-02-28 20:52:07 +08:00
<div class="btn-group-sm" id="toolbar" role="group">
2018-10-05 18:43:41 +08:00
<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.edit()" shiro:hasPermission="system:dept:edit">
2018-10-05 18:43:41 +08:00
<i class="fa fa-edit"></i> 修改
</a>
<a class="btn btn-info" id="expandAllBtn">
<i class="fa fa-exchange"></i> 展开/折叠
2018-07-09 08:44:52 +08:00
</a>
</div>
2018-08-23 17:06:31 +08:00
<div class="col-sm-12 select-table table-striped">
2018-11-25 17:27:57 +08:00
<table id="bootstrap-tree-table" data-mobile-responsive="true"></table>
</div>
</div>
2018-07-09 08:44:52 +08:00
</div>
<div th:include="include :: footer"></div>
<script th:inline="javascript">
2018-07-22 23:05:50 +08:00
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')}]];
2018-07-09 08:44:52 +08:00
var prefix = ctx + "system/dept"
2018-07-23 15:33:28 +08:00
$(function() {
2018-07-09 08:44:52 +08:00
var options = {
2018-10-12 14:10:25 +08:00
code: "deptId",
parentCode: "parentId",
uniqueId: "deptId",
2018-07-09 08:44:52 +08:00
url: prefix + "/list",
createUrl: prefix + "/add/{id}",
updateUrl: prefix + "/edit/{id}",
removeUrl: prefix + "/remove/{id}",
modalName: "部门",
columns: [{
2018-10-05 18:43:41 +08:00
field: 'selectItem',
radio: true
},
{
2018-07-09 08:44:52 +08:00
field: 'deptName',
title: '部门名称',
2018-10-05 18:43:41 +08:00
align: "left"
2018-07-09 08:44:52 +08:00
},
{
field: 'orderNum',
title: '排序',
2018-10-05 18:43:41 +08:00
align: "left"
2018-07-09 08:44:52 +08:00
},
{
field: 'status',
title: '状态',
2018-10-05 18:43:41 +08:00
align: "left",
formatter: function(value, item, index) {
2018-07-22 23:05:50 +08:00
return $.table.selectDictLabel(datas, item.status);
2018-07-09 08:44:52 +08:00
}
},
{
2018-07-19 21:17:17 +08:00
field: 'createTime',
2018-07-09 08:44:52 +08:00
title: '创建时间',
2018-10-05 18:43:41 +08:00
align: "left"
2018-07-09 08:44:52 +08:00
},
{
title: '操作',
2018-10-05 18:43:41 +08:00
align: 'left',
formatter: function(value, row, index) {
2018-07-09 08:44:52 +08:00
if (row.parentId != 0) {
var actions = [];
2019-02-28 16:23:09 +08:00
actions.push('<a class="' + editFlag + '" href="#" onclick="$.operate.edit(\'' + row.deptId + '\')"><i class="fa fa-edit"></i>编辑</a>');
actions.push('<a class="' + removeFlag + '" href="#" onclick="$.operate.remove(\'' + row.deptId + '\')"><i class="fa fa-trash"></i>删除</a>');
actions.push('<a class="' + addFlag + '" href="#" onclick="$.operate.add(\'' + row.deptId + '\')"><i class="fa fa-plus"></i>添加下级部门</a>');
return $.table.dropdownToggle(actions.join(''));
2018-07-09 08:44:52 +08:00
} else {
return "";
}
}
}]
};
$.treeTable.init(options);
2018-07-23 15:33:28 +08:00
});
2018-07-09 08:44:52 +08:00
</script>
</body>
</html>