selectUser.html 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. <!DOCTYPE html>
  2. <html lang="zh" xmlns:th="http://www.thymeleaf.org" >
  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="role-form">
  11. <input type="hidden" id="roleId" name="roleId" th:value="${role.roleId}">
  12. <div class="select-list">
  13. <ul>
  14. <li>
  15. 登录名称:<input type="text" name="loginName"/>
  16. </li>
  17. <li>
  18. 手机号码:<input type="text" name="phonenumber"/>
  19. </li>
  20. <li>
  21. <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
  22. <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
  23. </li>
  24. </ul>
  25. </div>
  26. </form>
  27. </div>
  28. <div class="col-sm-12 select-table table-striped">
  29. <table id="bootstrap-table"></table>
  30. </div>
  31. </div>
  32. </div>
  33. <th:block th:include="include :: footer" />
  34. <script th:inline="javascript">
  35. var datas = [[${@dict.getType('sys_normal_disable')}]];
  36. var prefix = ctx + "system/role/authUser";
  37. $(function() {
  38. var options = {
  39. url: prefix + "/unallocatedList",
  40. createUrl: prefix + "/add",
  41. updateUrl: prefix + "/edit/{id}",
  42. removeUrl: prefix + "/remove",
  43. exportUrl: prefix + "/export",
  44. importUrl: prefix + "/importData",
  45. importTemplateUrl: prefix + "/importTemplate",
  46. queryParams: queryParams,
  47. sortName: "createTime",
  48. sortOrder: "desc",
  49. modalName: "用户",
  50. showSearch: false,
  51. showRefresh: false,
  52. showToggle: false,
  53. showColumns: false,
  54. clickToSelect: true,
  55. rememberSelected: true,
  56. columns: [{
  57. field: 'state',
  58. checkbox: true
  59. },
  60. {
  61. field: 'userId',
  62. title: '用户ID',
  63. visible: false
  64. },
  65. {
  66. field: 'loginName',
  67. title: '登录名称',
  68. sortable: true
  69. },
  70. {
  71. field: 'userName',
  72. title: '用户名称'
  73. },
  74. {
  75. field: 'email',
  76. title: '邮箱'
  77. },
  78. {
  79. field: 'phonenumber',
  80. title: '手机'
  81. },
  82. {
  83. field: 'status',
  84. title: '用户状态',
  85. align: 'center',
  86. formatter: function (value, row, index) {
  87. return $.table.selectDictLabel(datas, value);
  88. }
  89. },
  90. {
  91. field: 'createTime',
  92. title: '创建时间',
  93. sortable: true
  94. }]
  95. };
  96. $.table.init(options);
  97. });
  98. function queryParams(params) {
  99. var search = $.table.queryParams(params);
  100. search.roleId = $("#roleId").val();
  101. return search;
  102. }
  103. /* 添加用户-选择用户-提交 */
  104. function submitHandler() {
  105. var rows = $.table.selectFirstColumns();
  106. if (rows.length == 0) {
  107. $.modal.alertWarning("请至少选择一条记录");
  108. return;
  109. }
  110. var data = { "roleId": $("#roleId").val(), "userIds": rows.join() };
  111. $.operate.save(prefix + "/selectAll", data);
  112. }
  113. </script>
  114. </body>
  115. </html>