list.jsp 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  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. }else if(value==1){
  35. return '机场管理员';
  36. }else if(value==2){
  37. return '航空公司管理员';
  38. }
  39. }
  40. $(function(){
  41. $('#btnSearch').click(function () {
  42. $('#tab_user').bootstrapTable('refresh');
  43. });
  44. $('#clearHref').click(function () {
  45. $('#myform')[0].reset();
  46. });
  47. });
  48. // 分配角色
  49. function setRole(){
  50. var data = getSelectedRow("tab_user");
  51. if(null == data){
  52. return;
  53. }
  54. $.openDlg({
  55. url:'transfer.cs?action=setRole&id=' + data.id,
  56. title:'分配角色',
  57. width:'100%',
  58. height:'100%',
  59. });
  60. }
  61. function queryParams(params){
  62. var page = params.offset / params.limit + 1;
  63. var dataObj = new Object();
  64. //alert($("#search").val());
  65. dataObj.name=$("#name").val();
  66. return { page:page,
  67. pageSize:params.limit,
  68. search:JSON.stringify(dataObj),
  69. sort:params.sort,
  70. order:params.order,
  71. };
  72. }
  73. </script>
  74. </head>
  75. <body class="gray-bg">
  76. <div class="wrapper wrapper-content animated fadeInUp">
  77. <!-- <div class="ibox " style=""> -->
  78. <!-- <div class="ibox-content"> -->
  79. <div class="row row-lg">
  80. <div class="col-sm-12">
  81. <div class="ibox-content m-b-sm border-bottom">
  82. <div class="ibox-title">
  83. <h5>查询条件</h5>
  84. </div>
  85. <form class="form-inline" id="myform">
  86. <div class="form-group"><label>&nbsp;项目名称:</label><input id="name" name="name" class="form-control" type="text" value=""></div>
  87. &nbsp;&nbsp;
  88. <label><a href="#" id="btnSearch" class="btn btn-primary"><i class="icon-search"></i> 搜索</a></label>&nbsp;&nbsp;
  89. <label><a href="#" id="clearHref" class="btn btn-primary"><i class="icon-search"></i> 清除搜索条件</a></label>
  90. </form>
  91. </div>
  92. <cs:toolbar title="项目" tableId="tab_user" width="100%" height="100%" menuCode="${menuCode }">
  93. <p:permission menuCode="${menuCode }" action="16">
  94. <button class="btn btn-sm btn-info" type="button" onclick="init_pwd()"><i class="fa fa-info"></i>&nbsp;初始化密码</button>
  95. </p:permission>
  96. <p:permission menuCode="${menuCode }" action="32">
  97. <button class="btn btn-sm btn-info" type="button" onclick="setRole()"><i class="fa fa-info"></i>&nbsp;分配角色</button>
  98. </p:permission>
  99. </cs:toolbar>
  100. <table id="tab_user"
  101. data-toggle="table"
  102. data-url="list2.cs"
  103. data-method="get"
  104. data-click-to-select="true"
  105. data-pagination="true"
  106. data-data-type="json"
  107. data-show-refresh="true"
  108. data-show-columns="true"
  109. data-show-toggle="true"
  110. data-search-on-enter-key="true"
  111. data-toolbar="#def_toolbar"
  112. data-side-pagination="server"
  113. data-query-params="queryParams"
  114. data-mobile-responsive="true"
  115. >
  116. <thead>
  117. <tr>
  118. <th data-checkbox="true" data-click-to-select="true"></th>
  119. <th data-field="ID" data-visible="false">id</th>
  120. <th data-field="NAME">项目名称</th>
  121. <th data-field="CREATEDATE" data-formatter="format_time">创建时间</th>
  122. </tr>
  123. </thead>
  124. </table>
  125. </div>
  126. </div>
  127. <!-- </div> -->
  128. <!-- </div> -->
  129. </div>
  130. </body>
  131. </html>