list.jsp 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  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. // 预览事件
  19. function setPermission(){
  20. var data = getSelectedRow("tab_role");
  21. if(null == data){
  22. return;
  23. }
  24. $.openDlg({
  25. url:'transfer.cs?action=setPermission&id=' + data.id,
  26. title:'设定角色权限',
  27. width:'420px',
  28. height:'90%',
  29. });
  30. }
  31. function queryParams(params){
  32. var page = params.offset / params.limit + 1;
  33. var dataObj = new Object();
  34. //alert($("#search").val());
  35. dataObj.name=$("#name").val();
  36. /* dataObj.xmCode=$("#id1").val();
  37. dataObj.xmCode=$("#id2").val();
  38. dataObj.xmCode=$("#id3").val();
  39. dataObj.xmCode=$("#id4").val(); */
  40. return { page:page,
  41. pageSize:params.limit,
  42. search:JSON.stringify(dataObj),
  43. sort:params.sort,
  44. order:params.order,
  45. name:$("#name").val()
  46. };
  47. }
  48. function doQuery(){
  49. $('#tab_role').bootstrapTable('refresh');
  50. }
  51. </script>
  52. </head>
  53. <body class="gray-bg">
  54. <div class="wrapper wrapper-content animated fadeInUp">
  55. <div class="row row-lg">
  56. <div style="padding-bottom: 10px">
  57. <div class="form-inline">
  58. <!-- <div class="form-group">
  59. <label for="code" >角色代码:</label>
  60. <input type="text" placeholder="请输入角色代码" id="code" class="form-control" />
  61. </div> -->
  62. <div class="form-group">
  63. <label for="name" >角色名称:</label>
  64. <input type="text" placeholder="请输入角色名称" id="name" class="form-control" />
  65. </div>
  66. <button class="btn " type="button" onclick="doQuery()">查询</button>
  67. </div>
  68. </div>
  69. <cs:toolbar title="角色" tableId="tab_role" width="768px" height="420px" menuCode="${menuCode }" hdMenu="1">
  70. <p:permission menuCode="${menuCode }" action="16">
  71. <button class="btn btn-sm btn-info" type="button" onclick="setPermission()"><i class="fa fa-info"></i>&nbsp;分配菜单权限</button>
  72. </p:permission>
  73. </cs:toolbar>
  74. <table id="tab_role"
  75. data-toggle="table"
  76. data-url="list2.cs"
  77. data-method="get"
  78. data-click-to-select="true"
  79. data-pagination="true"
  80. data-data-type="json"
  81. data-show-refresh="true"
  82. data-show-columns="true"
  83. data-show-toggle="true"
  84. data-search-on-enter-key="true"
  85. data-toolbar="#def_toolbar"
  86. data-side-pagination="server"
  87. data-query-params="queryParams"
  88. data-mobile-responsive="true"
  89. data-sortable="true"
  90. >
  91. <thead>
  92. <tr>
  93. <th data-checkbox="true" data-click-to-select="true"></th>
  94. <th data-field="id" data-visible="false">id</th>
  95. <th data-field="code">角色代码</th>
  96. <th data-field="name">名称</th>
  97. <th data-field="note">描述</th>
  98. <!-- <th data-formatter="test">操作</th> -->
  99. </tr>
  100. </thead>
  101. </table>
  102. </div>
  103. </div>
  104. </body>
  105. </html>