dept.html 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. <!DOCTYPE html>
  2. <html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
  3. <head>
  4. <th:block th:include="include :: header('部门列表')" />
  5. </head>
  6. <body class="gray-bg">
  7. <div class="container-div">
  8. <div class="row">
  9. <div class="col-sm-12 search-collapse">
  10. <form id="dept-form">
  11. <div class="select-list">
  12. <ul>
  13. <li>
  14. 部门名称:<input type="text" name="deptName"/>
  15. </li>
  16. <li>
  17. 部门状态:<select name="status" th:with="type=${@dict.getType('sys_normal_disable')}">
  18. <option value="">所有</option>
  19. <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
  20. </select>
  21. </li>
  22. <li>
  23. <a class="btn btn-primary btn-rounded btn-sm" onclick="$.treeTable.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
  24. <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
  25. </li>
  26. </ul>
  27. </div>
  28. </form>
  29. </div>
  30. <div class="btn-group-sm" id="toolbar" role="group">
  31. <a class="btn btn-success" onclick="$.operate.add(100)" shiro:hasPermission="system:dept:add">
  32. <i class="fa fa-plus"></i> 新增
  33. </a>
  34. <a class="btn btn-primary" onclick="$.operate.edit()" shiro:hasPermission="system:dept:edit">
  35. <i class="fa fa-edit"></i> 修改
  36. </a>
  37. <a class="btn btn-info" id="expandAllBtn">
  38. <i class="fa fa-exchange"></i> 展开/折叠
  39. </a>
  40. </div>
  41. <div class="col-sm-12 select-table table-striped">
  42. <table id="bootstrap-tree-table" data-mobile-responsive="true"></table>
  43. </div>
  44. </div>
  45. </div>
  46. <th:block th:include="include :: footer" />
  47. <script th:inline="javascript">
  48. var addFlag = [[${@permission.hasPermi('system:dept:add')}]];
  49. var editFlag = [[${@permission.hasPermi('system:dept:edit')}]];
  50. var removeFlag = [[${@permission.hasPermi('system:dept:remove')}]];
  51. var datas = [[${@dict.getType('sys_normal_disable')}]];
  52. var prefix = ctx + "system/dept"
  53. $(function() {
  54. var options = {
  55. code: "deptId",
  56. parentCode: "parentId",
  57. uniqueId: "deptId",
  58. url: prefix + "/list",
  59. createUrl: prefix + "/add/{id}",
  60. updateUrl: prefix + "/edit/{id}",
  61. removeUrl: prefix + "/remove/{id}",
  62. modalName: "部门",
  63. columns: [{
  64. field: 'selectItem',
  65. radio: true
  66. },
  67. {
  68. field: 'deptName',
  69. title: '部门名称',
  70. align: "left"
  71. },
  72. {
  73. field: 'orderNum',
  74. title: '排序',
  75. align: "left"
  76. },
  77. {
  78. field: 'status',
  79. title: '状态',
  80. align: "left",
  81. formatter: function(value, item, index) {
  82. return $.table.selectDictLabel(datas, item.status);
  83. }
  84. },
  85. {
  86. field: 'createTime',
  87. title: '创建时间',
  88. align: "left"
  89. },
  90. {
  91. title: '操作',
  92. align: 'left',
  93. formatter: function(value, row, index) {
  94. if (row.parentId != 0) {
  95. var actions = [];
  96. actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.deptId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
  97. actions.push('<a class="btn btn-info btn-xs ' + addFlag + '" href="javascript:void(0)" onclick="$.operate.add(\'' + row.deptId + '\')"><i class="fa fa-plus"></i>新增</a> ');
  98. actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.deptId + '\')"><i class="fa fa-trash"></i>删除</a>');
  99. return actions.join('');
  100. } else {
  101. return "";
  102. }
  103. }
  104. }]
  105. };
  106. $.treeTable.init(options);
  107. });
  108. </script>
  109. </body>
  110. </html>