list.jsp 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  1. <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
  2. <%@taglib prefix="p" uri="http://www.test.com/jsp/permission" %>
  3. <!doctype html>
  4. <html>
  5. <head>
  6. <%@ include file="../../common/head.jsp"%>
  7. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  8. <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  9. <link href="../res/css/plugins/bootstrap-table/bootstrap-table.min.css" rel="stylesheet" />
  10. <script src="../res/js/plugins/bootstrap-table/bootstrap-table.js"></script>
  11. <script src="../res/js/plugins/bootstrap-table/bootstrap-table-mobile.min.js"></script>
  12. <script src="../res/js/plugins/bootstrap-table/locale/bootstrap-table-zh-CN.min.js"></script>
  13. <script>
  14. function test(value,row,index){
  15. // return '<a href="#">' + row['id'] + '</a>';
  16. return '<a href="#">编辑 </a>|<a href="#">删除</a>';
  17. }
  18. function init_pwd(){
  19. var data = getSelectedRow("tab_user");
  20. if(null == data){
  21. return;
  22. }
  23. $.confirm("确定初始化密码吗? ", function(){
  24. $.post('initPwd.cs?id=' + data.id,
  25. function(result){
  26. window.location.reload();
  27. }
  28. );
  29. });
  30. }
  31. function format_type(value,row,index){
  32. if(value == 0){
  33. return '平台管理员';
  34. }
  35. }
  36. // 分配角色
  37. function setRole(){
  38. var data = getSelectedRow("tab_user");
  39. if(null == data){
  40. return;
  41. }
  42. $.openDlg({
  43. url:'transfer.cs?action=setRole&id=' + data.id,
  44. title:'分配角色',
  45. width:'100%',
  46. height:'100%',
  47. });
  48. }
  49. $(function(){
  50. $('#btnSearch').click(function () {
  51. $('#tab_user').bootstrapTable('refresh');
  52. });
  53. $('#clearHref').click(function () {
  54. $('#myform')[0].reset();
  55. });
  56. });
  57. function queryParams(params){
  58. var page = params.offset / params.limit + 1;
  59. var dataObj = new Object();
  60. dataObj.name=$("#account").val();
  61. return { page:page,
  62. pageSize:params.limit,
  63. search:JSON.stringify(dataObj),
  64. sort:params.sort,
  65. order:params.order,
  66. };
  67. }
  68. </script>
  69. </head>
  70. <body class="gray-bg">
  71. <div class="wrapper wrapper-content animated fadeInUp">
  72. <!-- <div class="ibox " style=""> -->
  73. <!-- <div class="ibox-content"> -->
  74. <div class="row row-lg">
  75. <div class="col-sm-12">
  76. <div class="ibox-content m-b-sm border-bottom">
  77. <div class="ibox-title">
  78. <h5>查询条件</h5>
  79. </div>
  80. <form class="form-inline" id="myform">
  81. <div class="form-group"><label>&nbsp;登录账户:</label><input id="account" name="account" class="form-control" type="text" value=""></div>
  82. <!-- <div class="form-group">
  83. <label>&nbsp;用户类型:</label>
  84. <select class="form-control" id="orderState">
  85. <option value="">--全部--</option>
  86. <option value="0">未付款</option>
  87. <option value="1">已付款</option>
  88. <option value="2">已投保</option>
  89. </select>
  90. </div> -->
  91. <%-- <div class="form-group">
  92. <label>&nbsp;所在机场:</label>
  93. <select class="form-control" id="airportId" onchange="doItem(this.value);">
  94. <option value="">--全部--</option>
  95. <c:forEach items="${airportList}" var="airport">
  96. <option value="${airport.id}">${airport.name}</option>
  97. </c:forEach>
  98. </select>
  99. </div>
  100. <div class="form-group">
  101. <label>&nbsp;所在航空公司:</label>
  102. <select class="form-control" id="airwaysId">
  103. <option value="">全部</option>
  104. </select>
  105. </div> --%>
  106. &nbsp;&nbsp;
  107. <label><a href="#" id="btnSearch" class="btn btn-primary"><i class="icon-search"></i> 搜索</a></label>&nbsp;&nbsp;
  108. <label><a href="#" id="clearHref" class="btn btn-primary"><i class="icon-search"></i> 清除搜索条件</a></label>
  109. </form>
  110. </div>
  111. <cs:toolbar title="用户" tableId="tab_user" width="70%" height="90%" menuCode="${menuCode }">
  112. <p:permission menuCode="${menuCode }" action="16">
  113. <button class="btn btn-sm btn-info" type="button" onclick="init_pwd()"><i class="fa fa-info"></i>&nbsp;初始化密码</button>
  114. </p:permission>
  115. <p:permission menuCode="${menuCode }" action="32">
  116. <button class="btn btn-sm btn-info" type="button" onclick="setRole()"><i class="fa fa-info"></i>&nbsp;分配角色</button>
  117. </p:permission>
  118. </cs:toolbar>
  119. <table id="tab_user"
  120. data-toggle="table"
  121. data-url="list2.cs"
  122. data-method="get"
  123. data-click-to-select="true"
  124. data-pagination="true"
  125. data-data-type="json"
  126. data-show-refresh="true"
  127. data-show-columns="true"
  128. data-show-toggle="true"
  129. data-search-on-enter-key="true"
  130. data-toolbar="#def_toolbar"
  131. data-side-pagination="server"
  132. data-query-params="queryParams"
  133. data-mobile-responsive="true"
  134. >
  135. <thead>
  136. <tr>
  137. <th data-checkbox="true" data-click-to-select="true"></th>
  138. <th data-field="id" data-visible="false">id</th>
  139. <th data-field="code">代码</th>
  140. <th data-field="name">姓名</th>
  141. <th data-field="account">账户</th>
  142. <%-- <th data-field="pwd">密码</th>--%>
  143. <!-- <th data-field="type" data-formatter="format_type">用户类型</th> -->
  144. <!-- <th data-field="status">状态</th> -->
  145. <th data-field="createDate" data-formatter="format_time">创建时间</th>
  146. </tr>
  147. </thead>
  148. </table>
  149. </div>
  150. </div>
  151. <!-- </div> -->
  152. <!-- </div> -->
  153. </div>
  154. </body>
  155. </html>