fhbutton_list.jsp 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311
  1. <%@ page language="java" contentType="text/html; charset=UTF-8"
  2. pageEncoding="UTF-8"%>
  3. <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
  4. <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
  5. <%
  6. String path = request.getContextPath();
  7. String basePath = request.getScheme() + "://"
  8. + request.getServerName() + ":" + request.getServerPort()
  9. + path + "/";
  10. %>
  11. <!DOCTYPE html>
  12. <html lang="en">
  13. <head>
  14. <base href="<%=basePath%>">
  15. <!-- jsp文件头和头部 -->
  16. <%@ include file="../../system/index/top.jsp"%>
  17. </head>
  18. <body class="no-skin">
  19. <!-- /section:basics/navbar.layout -->
  20. <div class="main-container" id="main-container">
  21. <!-- /section:basics/sidebar -->
  22. <div class="main-content">
  23. <div class="main-content-inner">
  24. <div class="page-content">
  25. <div class="row">
  26. <div class="col-xs-12">
  27. <!-- 检索 -->
  28. <form action="fhbutton/list.do" method="post" name="Form" id="Form">
  29. <table style="margin-top:5px;">
  30. <tr>
  31. <td>
  32. <div class="nav-search">
  33. <span class="input-icon">
  34. <input type="text" placeholder="这里输入关键词" class="nav-search-input" id="nav-search-input" autocomplete="off" name="keywords" value="${pd.keywords }" placeholder="这里输入关键词"/>
  35. <i class="ace-icon fa fa-search nav-search-icon"></i>
  36. </span>
  37. </div>
  38. </td>
  39. <c:if test="${QX.cha == 1 }">
  40. <td style="vertical-align:top;padding-left:2px"><a class="btn btn-light btn-xs" onclick="tosearch();" title="检索"><i id="nav-search-icon" class="ace-icon fa fa-search bigger-110 nav-search-icon blue"></i></a></td>
  41. </c:if>
  42. </tr>
  43. </table>
  44. <!-- 检索 -->
  45. <table id="simple-table" class="table table-striped table-bordered table-hover" style="margin-top:5px;">
  46. <thead>
  47. <tr>
  48. <th class="center" style="width:35px;">
  49. <label class="pos-rel"><input type="checkbox" class="ace" id="zcheckbox" /><span class="lbl"></span></label>
  50. </th>
  51. <th class="center" style="width:50px;">序号</th>
  52. <th class="center">名称</th>
  53. <th class="center">权限标识</th>
  54. <th class="center">备注</th>
  55. <th class="center">操作</th>
  56. </tr>
  57. </thead>
  58. <tbody>
  59. <!-- 开始循环 -->
  60. <c:choose>
  61. <c:when test="${not empty varList}">
  62. <c:if test="${QX.cha == 1 }">
  63. <c:forEach items="${varList}" var="var" varStatus="vs">
  64. <tr>
  65. <td class='center'>
  66. <label class="pos-rel"><input type='checkbox' name='ids' value="${var.FHBUTTON_ID}" class="ace" /><span class="lbl"></span></label>
  67. </td>
  68. <td class='center' style="width: 30px;">${page.showCount*(page.currentPage-1)+vs.index+1}</td>
  69. <td class='center'>${var.NAME}</td>
  70. <td class='center'>${var.QX_NAME}</td>
  71. <td class='center'>${var.BZ}</td>
  72. <td class="center">
  73. <c:if test="${QX.edit != 1 && QX.del != 1 }">
  74. <span class="label label-large label-grey arrowed-in-right arrowed-in"><i class="ace-icon fa fa-lock" title="无权限"></i></span>
  75. </c:if>
  76. <div class="hidden-sm hidden-xs btn-group">
  77. <c:if test="${QX.edit == 1 }">
  78. <a class="btn btn-xs btn-success" title="编辑" onclick="edit('${var.FHBUTTON_ID}');">
  79. <i class="ace-icon fa fa-pencil-square-o bigger-120" title="编辑"></i>
  80. </a>
  81. </c:if>
  82. <c:if test="${QX.del == 1 }">
  83. <a class="btn btn-xs btn-danger" onclick="del('${var.FHBUTTON_ID}');">
  84. <i class="ace-icon fa fa-trash-o bigger-120" title="删除"></i>
  85. </a>
  86. </c:if>
  87. </div>
  88. <div class="hidden-md hidden-lg">
  89. <div class="inline pos-rel">
  90. <button class="btn btn-minier btn-primary dropdown-toggle" data-toggle="dropdown" data-position="auto">
  91. <i class="ace-icon fa fa-cog icon-only bigger-110"></i>
  92. </button>
  93. <ul class="dropdown-menu dropdown-only-icon dropdown-yellow dropdown-menu-right dropdown-caret dropdown-close">
  94. <c:if test="${QX.edit == 1 }">
  95. <li>
  96. <a style="cursor:pointer;" onclick="edit('${var.FHBUTTON_ID}');" class="tooltip-success" data-rel="tooltip" title="修改">
  97. <span class="green">
  98. <i class="ace-icon fa fa-pencil-square-o bigger-120"></i>
  99. </span>
  100. </a>
  101. </li>
  102. </c:if>
  103. <c:if test="${QX.del == 1 }">
  104. <li>
  105. <a style="cursor:pointer;" onclick="del('${var.FHBUTTON_ID}');" class="tooltip-error" data-rel="tooltip" title="删除">
  106. <span class="red">
  107. <i class="ace-icon fa fa-trash-o bigger-120"></i>
  108. </span>
  109. </a>
  110. </li>
  111. </c:if>
  112. </ul>
  113. </div>
  114. </div>
  115. </td>
  116. </tr>
  117. </c:forEach>
  118. </c:if>
  119. <c:if test="${QX.cha == 0 }">
  120. <tr>
  121. <td colspan="100" class="center">您无权查看</td>
  122. </tr>
  123. </c:if>
  124. </c:when>
  125. <c:otherwise>
  126. <tr class="main_info">
  127. <td colspan="100" class="center" >没有相关数据</td>
  128. </tr>
  129. </c:otherwise>
  130. </c:choose>
  131. </tbody>
  132. </table>
  133. <div class="page-header position-relative">
  134. <table style="width:100%;">
  135. <tr>
  136. <td style="vertical-align:top;">
  137. <c:if test="${QX.add == 1 }">
  138. <a class="btn btn-sm btn-success" onclick="add();">新增</a>
  139. </c:if>
  140. <c:if test="${QX.del == 1 }">
  141. <a class="btn btn-sm btn-danger" onclick="makeAll('确定要删除选中的数据吗?');" title="批量删除" ><i class='ace-icon fa fa-trash-o bigger-120'></i></a>
  142. </c:if>
  143. </td>
  144. <td style="vertical-align:top;"><div class="pagination" style="float: right;padding-top: 0px;margin-top: 0px;">${page.pageStr}</div></td>
  145. </tr>
  146. </table>
  147. </div>
  148. </form>
  149. </div>
  150. <!-- /.col -->
  151. </div>
  152. <!-- /.row -->
  153. </div>
  154. <!-- /.page-content -->
  155. </div>
  156. </div>
  157. <!-- /.main-content -->
  158. <!-- 返回顶部 -->
  159. <a href="#" id="btn-scroll-up" class="btn-scroll-up btn btn-sm btn-inverse">
  160. <i class="ace-icon fa fa-angle-double-up icon-only bigger-110"></i>
  161. </a>
  162. </div>
  163. <!-- /.main-container -->
  164. <!-- basic scripts -->
  165. <!-- 页面底部js¨ -->
  166. <%@ include file="../../system/index/foot.jsp"%>
  167. <!-- 删除时确认窗口 -->
  168. <script src="static/ace/js/bootbox.js"></script>
  169. <!-- ace scripts -->
  170. <script src="static/ace/js/ace/ace.js"></script>
  171. <!--提示框-->
  172. <script type="text/javascript" src="static/js/jquery.tips.js"></script>
  173. <script type="text/javascript">
  174. $(top.hangge());//关闭加载状态
  175. //检索
  176. function tosearch(){
  177. top.jzts();
  178. $("#Form").submit();
  179. }
  180. $(function() {
  181. //复选框全选控制
  182. var active_class = 'active';
  183. $('#simple-table > thead > tr > th input[type=checkbox]').eq(0).on('click', function(){
  184. var th_checked = this.checked;//checkbox inside "TH" table header
  185. $(this).closest('table').find('tbody > tr').each(function(){
  186. var row = this;
  187. if(th_checked) $(row).addClass(active_class).find('input[type=checkbox]').eq(0).prop('checked', true);
  188. else $(row).removeClass(active_class).find('input[type=checkbox]').eq(0).prop('checked', false);
  189. });
  190. });
  191. });
  192. //新增
  193. function add(){
  194. top.jzts();
  195. var diag = new top.Dialog();
  196. diag.Drag=true;
  197. diag.Title ="新增";
  198. diag.URL = '<%=basePath%>fhbutton/goAdd.do';
  199. diag.Width = 450;
  200. diag.Height = 370;
  201. diag.CancelEvent = function(){ //关闭事件
  202. if(diag.innerFrame.contentWindow.document.getElementById('zhongxin').style.display == 'none'){
  203. if('${page.currentPage}' == '0'){
  204. top.jzts();
  205. setTimeout("self.location=self.location",100);
  206. }else{
  207. nextPage(${page.currentPage});
  208. }
  209. }
  210. diag.close();
  211. };
  212. diag.show();
  213. }
  214. //删除
  215. function del(Id){
  216. bootbox.confirm("确定要删除吗?", function(result) {
  217. if(result) {
  218. top.jzts();
  219. var url = "<%=basePath%>fhbutton/delete.do?FHBUTTON_ID="+Id+"&tm="+new Date().getTime();
  220. $.get(url,function(data){
  221. nextPage(${page.currentPage});
  222. });
  223. }
  224. });
  225. }
  226. //修改
  227. function edit(Id){
  228. top.jzts();
  229. var diag = new top.Dialog();
  230. diag.Drag=true;
  231. diag.Title ="编辑";
  232. diag.URL = '<%=basePath%>fhbutton/goEdit.do?FHBUTTON_ID='+Id;
  233. diag.Width = 450;
  234. diag.Height = 370;
  235. diag.CancelEvent = function(){ //关闭事件
  236. if(diag.innerFrame.contentWindow.document.getElementById('zhongxin').style.display == 'none'){
  237. nextPage(${page.currentPage});
  238. }
  239. diag.close();
  240. };
  241. diag.show();
  242. }
  243. //批量操作
  244. function makeAll(msg){
  245. bootbox.confirm(msg, function(result) {
  246. if(result) {
  247. var str = '';
  248. for(var i=0;i < document.getElementsByName('ids').length;i++){
  249. if(document.getElementsByName('ids')[i].checked){
  250. if(str=='') str += document.getElementsByName('ids')[i].value;
  251. else str += ',' + document.getElementsByName('ids')[i].value;
  252. }
  253. }
  254. if(str==''){
  255. bootbox.dialog({
  256. message: "<span class='bigger-110'>您没有选择任何内容!</span>",
  257. buttons:
  258. { "button":{ "label":"确定", "className":"btn-sm btn-success"}}
  259. });
  260. $("#zcheckbox").tips({
  261. side:1,
  262. msg:'点这里全选',
  263. bg:'#AE81FF',
  264. time:8
  265. });
  266. return;
  267. }else{
  268. if(msg == '确定要删除选中的数据吗?'){
  269. top.jzts();
  270. $.ajax({
  271. type: "POST",
  272. url: '<%=basePath%>fhbutton/deleteAll.do?tm='+new Date().getTime(),
  273. data: {DATA_IDS:str},
  274. dataType:'json',
  275. //beforeSend: validateData,
  276. cache: false,
  277. success: function(data){
  278. $.each(data.list, function(i, list){
  279. nextPage(${page.currentPage});
  280. });
  281. }
  282. });
  283. }
  284. }
  285. }
  286. });
  287. };
  288. //导出excel
  289. function toExcel(){
  290. window.location.href='<%=basePath%>fhbutton/excel.do';
  291. }
  292. </script>
  293. </body>
  294. </html>