group_user_list.html 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. <!DOCTYPE HTML>
  2. <html xmlns:th="http://www.thymeleaf.org"
  3. xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
  4. layout:decorate="~{admin/common/common}">
  5. <head>
  6. <title>添加用户</title>
  7. </head>
  8. <body layout:fragment="content">
  9. <form id="myForm" th:action="@{'/admin/group/userList?groupId='+${groupId}}" th:method="get">
  10. <div class="page-container">
  11. <div class="text-c" style="padding-bottom: 20px">
  12. <input type="text" class="input-text" style="width:250px" placeholder="输入用户名或姓名" name="keyword"
  13. th:value="${keyword}"/>
  14. <button type="submit" class="btn btn-primary">
  15. 搜索
  16. </button>
  17. </div>
  18. <table class="table table-border table-bordered table-hover table-bg">
  19. <thead>
  20. <tr class="text-c">
  21. <th width="40"><input name="" type="checkbox" value=""></th>
  22. <th>用户名</th>
  23. <th>姓名</th>
  24. <th>角色</th>
  25. <th>所属部门</th>
  26. </tr>
  27. </thead>
  28. <tbody>
  29. <tr class="text-c" th:each="model:${pageInfo?.list}" th:object="${model}">
  30. <td>
  31. <input type="checkbox" class="checkbox" th:value="*{id}" name="id"
  32. th:attr="nick_name=*{nick_name},user_name=*{user_name},role_names=*{role_names},department_name=*{department_name}"/>
  33. </td>
  34. <td th:text="*{nick_name}" itemAttr="nick_name"></td>
  35. <td th:text="*{user_name}" itemAttr="user_name"></td>
  36. <td th:text="*{role_names}" itemAttr="role_names"></td>
  37. <td th:text="*{department_name}" itemAttr="department_name"></td>
  38. </tbody>
  39. </table>
  40. <input type="hidden" name="user_selected" id="user_selected" value=""/>
  41. <div th:replace="admin/common/page :: page"></div>
  42. </div>
  43. <div class="row cl">
  44. <div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-2">
  45. <a class="btn btn-primary radius" onClick="saveSelect();"><i class="Hui-iconfont">&#xe632;</i>确定</a>
  46. <button onClick="removeIframe();" class="btn btn-default radius" type="button">&nbsp;&nbsp;取消&nbsp;&nbsp;
  47. </button>
  48. </div>
  49. </div>
  50. </form>
  51. <script type="text/javascript" th:src="@{/js/common/page.js}"></script>
  52. <script th:inline="javascript">
  53. /**
  54. * 取消
  55. */
  56. function removeIframe() {
  57. var index = parent.layer.getFrameIndex(window.name);
  58. parent.layer.close(index);
  59. }
  60. function saveSelect() {
  61. var userList = getSelectedItem();
  62. /* $(".checkbox:checked").each(function () {
  63. var id = $(this).val();
  64. var nick_name = $(this).attr("nick_name");
  65. if(typeof nick_name == "undefined"){
  66. nick_name='';
  67. }
  68. var user_name = $(this).attr("user_name");
  69. if(typeof user_name == "undefined"){
  70. user_name='';
  71. }
  72. var role_names = $(this).attr("role_names");
  73. if(typeof role_names == "undefined"){
  74. role_names='';
  75. }
  76. var department_name = $(this).attr("department_name");
  77. if(typeof department_name == "undefined"){
  78. department_name='';
  79. }
  80. userList.push({
  81. id: id,
  82. nick_name: nick_name,
  83. user_name: user_name,
  84. role_names: role_names,
  85. department_name: department_name
  86. })
  87. }); */
  88. parent.addUsers(userList);
  89. index = parent.layer.getFrameIndex(window.name);
  90. parent.layer.close(index);
  91. }
  92. </script>
  93. </body>
  94. </html>