fhfile_list.jsp 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364
  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. <%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
  6. <%
  7. String path = request.getContextPath();
  8. String basePath = request.getScheme() + "://"
  9. + request.getServerName() + ":" + request.getServerPort()
  10. + path + "/";
  11. %>
  12. <!DOCTYPE html>
  13. <html lang="en">
  14. <head>
  15. <base href="<%=basePath%>">
  16. <!-- 下拉框 -->
  17. <link rel="stylesheet" href="static/ace/css/chosen.css" />
  18. <!-- jsp文件头和头部 -->
  19. <%@ include file="../../system/index/top.jsp"%>
  20. <!-- 日期框 -->
  21. <link rel="stylesheet" href="static/ace/css/datepicker.css" />
  22. <style type="text/css">
  23. .yulantu{
  24. z-index: 9999999999999999;
  25. position:absolute;
  26. border:3px solid #438EB9;
  27. display: none;
  28. }
  29. </style>
  30. </head>
  31. <body class="no-skin">
  32. <!-- /section:basics/navbar.layout -->
  33. <div class="main-container" id="main-container">
  34. <!-- /section:basics/sidebar -->
  35. <div class="main-content">
  36. <div class="main-content-inner">
  37. <div class="page-content">
  38. <div class="row">
  39. <div class="col-xs-12">
  40. <!-- 检索 -->
  41. <form action="fhfile/list.do" method="post" name="Form" id="Form">
  42. <table style="margin-top:5px;">
  43. <tr>
  44. <td>
  45. <div class="nav-search">
  46. <span class="input-icon">
  47. <input type="text" placeholder="这里输入关键词" class="nav-search-input" id="nav-search-input" autocomplete="off" name="keywords" value="${pd.keywords }" placeholder="这里输入关键词"/>
  48. <i class="ace-icon fa fa-search nav-search-icon"></i>
  49. </span>
  50. </div>
  51. </td>
  52. <c:if test="${QX.cha == 1 }">
  53. <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>
  54. </c:if>
  55. </tr>
  56. </table>
  57. <!-- 检索 -->
  58. <table id="simple-table" class="table table-striped table-bordered table-hover" style="margin-top:5px;">
  59. <thead>
  60. <tr>
  61. <th class="center" style="width:35px;">
  62. <label class="pos-rel"><input type="checkbox" class="ace" id="zcheckbox" /><span class="lbl"></span></label>
  63. </th>
  64. <th class="center" style="width:50px;">序号</th>
  65. <th class="center">文件名</th>
  66. <th class="center">上传者</th>
  67. <th class="center">备注</th>
  68. <th class="center">上传时间</th>
  69. <th class="center">文件大小</th>
  70. <th class="center">操作</th>
  71. </tr>
  72. </thead>
  73. <tbody>
  74. <!-- 开始循环 -->
  75. <c:choose>
  76. <c:when test="${not empty varList}">
  77. <c:if test="${QX.cha == 1 }">
  78. <c:forEach items="${varList}" var="var" varStatus="vs">
  79. <tr>
  80. <td class='center'>
  81. <label class="pos-rel"><input type='checkbox' name='ids' value="${var.FHFILE_ID}" class="ace" /><span class="lbl"></span></label>
  82. </td>
  83. <td class='center' style="width: 30px;">${page.showCount*(page.currentPage-1)+vs.index+1}</td>
  84. <td class='center'>
  85. <img style="margin-top: -3px;" alt="${var.NAME}" src="static/images/extension/${var.fileType}.png">
  86. ${var.NAME}${fn:substring(var.FILEPATH ,19,fn:length(var.FILEPATH))}
  87. &nbsp;
  88. <c:if test="${var.fileType == 'tupian' }"><a style="cursor:pointer;" onmouseover="showTU('uploadFiles/uploadFile/${var.FILEPATH}','yulantu${vs.index+1}');" onmouseout="hideTU('yulantu${vs.index+1}');">[预览]</a></c:if>
  89. <c:if test="${var.fileType == 'pdf' }"><a style="cursor:pointer;" onclick="goViewPdf('${var.NAME}${fn:substring(var.FILEPATH ,19,fn:length(var.FILEPATH))}','${var.FHFILE_ID}');">[预览]</a></c:if>
  90. <c:if test="${var.fileType == 'wenben' }"><a style="cursor:pointer;" onclick="goViewTxt('${var.NAME}${fn:substring(var.FILEPATH ,19,fn:length(var.FILEPATH))}','${var.FHFILE_ID}','gbk');">[预览]</a></c:if>
  91. <div class="yulantu" id="yulantu${vs.index+1}"></div>
  92. </td>
  93. <td class='center'>${var.USERNAME}</td>
  94. <td class='center'>${var.BZ}</td>
  95. <td class='center' style="width:150px;">${var.CTIME}</td>
  96. <td class='center' style="width:100px;">${var.FILESIZE}&nbsp;KB</td>
  97. <td class="center" style="width:150px;">
  98. <c:if test="${QX.edit != 1 && QX.del != 1 }">
  99. <span class="label label-large label-grey arrowed-in-right arrowed-in"><i class="ace-icon fa fa-lock" title="无权限"></i></span>
  100. </c:if>
  101. <div class="hidden-sm hidden-xs btn-group">
  102. <c:if test="${QX.edit == 1 }">
  103. <a class="btn btn-xs btn-success" title="下载" onclick="window.location.href='<%=basePath%>/fhfile/download.do?FHFILE_ID=${var.FHFILE_ID}'">
  104. <i class="ace-icon fa fa-cloud-download bigger-120" title="下载"></i>
  105. </a>
  106. </c:if>
  107. <c:if test="${QX.del == 1 }">
  108. <a class="btn btn-xs btn-danger" onclick="del('${var.FHFILE_ID}');">
  109. <i class="ace-icon fa fa-trash-o bigger-120" title="删除"></i>
  110. </a>
  111. </c:if>
  112. </div>
  113. <div class="hidden-md hidden-lg">
  114. <div class="inline pos-rel">
  115. <button class="btn btn-minier btn-primary dropdown-toggle" data-toggle="dropdown" data-position="auto">
  116. <i class="ace-icon fa fa-cog icon-only bigger-110"></i>
  117. </button>
  118. <ul class="dropdown-menu dropdown-only-icon dropdown-yellow dropdown-menu-right dropdown-caret dropdown-close">
  119. <c:if test="${QX.edit == 1 }">
  120. <li>
  121. <a style="cursor:pointer;" onclick="window.location.href='<%=basePath%>/fhfile/download.do?FHFILE_ID=${var.FHFILE_ID}'" class="tooltip-success" data-rel="tooltip" title="下载">
  122. <span class="green">
  123. <i class="ace-icon fa fa-cloud-download bigger-120"></i>
  124. </span>
  125. </a>
  126. </li>
  127. </c:if>
  128. <c:if test="${QX.del == 1 }">
  129. <li>
  130. <a style="cursor:pointer;" onclick="del('${var.FHFILE_ID}');" class="tooltip-error" data-rel="tooltip" title="删除">
  131. <span class="red">
  132. <i class="ace-icon fa fa-trash-o bigger-120"></i>
  133. </span>
  134. </a>
  135. </li>
  136. </c:if>
  137. </ul>
  138. </div>
  139. </div>
  140. </td>
  141. </tr>
  142. </c:forEach>
  143. </c:if>
  144. <c:if test="${QX.cha == 0 }">
  145. <tr>
  146. <td colspan="100" class="center">您无权查看</td>
  147. </tr>
  148. </c:if>
  149. </c:when>
  150. <c:otherwise>
  151. <tr class="main_info">
  152. <td colspan="100" class="center" >没有相关数据</td>
  153. </tr>
  154. </c:otherwise>
  155. </c:choose>
  156. </tbody>
  157. </table>
  158. <div class="page-header position-relative">
  159. <table style="width:100%;">
  160. <tr>
  161. <td style="vertical-align:top;">
  162. <c:if test="${QX.add == 1 }">
  163. <a class="btn btn-mini btn-success" onclick="add();">新增</a>
  164. </c:if>
  165. <c:if test="${QX.del == 1 }">
  166. <a class="btn btn-mini btn-danger" onclick="makeAll('确定要删除选中的数据吗?');" title="批量删除" ><i class='ace-icon fa fa-trash-o bigger-120'></i></a>
  167. </c:if>
  168. </td>
  169. <td style="vertical-align:top;"><div class="pagination" style="float: right;padding-top: 0px;margin-top: 0px;">${page.pageStr}</div></td>
  170. </tr>
  171. </table>
  172. </div>
  173. </form>
  174. </div>
  175. <!-- /.col -->
  176. </div>
  177. <!-- /.row -->
  178. </div>
  179. <!-- /.page-content -->
  180. </div>
  181. </div>
  182. <!-- /.main-content -->
  183. <!-- 返回顶部 -->
  184. <a href="#" id="btn-scroll-up" class="btn-scroll-up btn btn-sm btn-inverse">
  185. <i class="ace-icon fa fa-angle-double-up icon-only bigger-110"></i>
  186. </a>
  187. </div>
  188. <!-- /.main-container -->
  189. <!-- basic scripts -->
  190. <!-- 页面底部js¨ -->
  191. <%@ include file="../../system/index/foot.jsp"%>
  192. <!-- 删除时确认窗口 -->
  193. <script src="static/ace/js/bootbox.js"></script>
  194. <!-- ace scripts -->
  195. <script src="static/ace/js/ace/ace.js"></script>
  196. <!-- 下拉框 -->
  197. <script src="static/ace/js/chosen.jquery.js"></script>
  198. <!--提示框-->
  199. <script type="text/javascript" src="static/js/jquery.tips.js"></script>
  200. <script type="text/javascript">
  201. $(top.hangge());//关闭加载状态
  202. //检索
  203. function tosearch(){
  204. top.jzts();
  205. $("#Form").submit();
  206. }
  207. $(function() {
  208. //复选框全选控制
  209. var active_class = 'active';
  210. $('#simple-table > thead > tr > th input[type=checkbox]').eq(0).on('click', function(){
  211. var th_checked = this.checked;//checkbox inside "TH" table header
  212. $(this).closest('table').find('tbody > tr').each(function(){
  213. var row = this;
  214. if(th_checked) $(row).addClass(active_class).find('input[type=checkbox]').eq(0).prop('checked', true);
  215. else $(row).removeClass(active_class).find('input[type=checkbox]').eq(0).prop('checked', false);
  216. });
  217. });
  218. });
  219. //新增
  220. function add(){
  221. top.jzts();
  222. var diag = new top.Dialog();
  223. diag.Drag=true;
  224. diag.Title ="新增";
  225. diag.URL = '<%=basePath%>fhfile/goAdd.do';
  226. diag.Width = 460;
  227. diag.Height = 290;
  228. diag.Modal = true; //有无遮罩窗口
  229. diag. ShowMaxButton = true; //最大化按钮
  230. diag.ShowMinButton = true; //最小化按钮
  231. diag.CancelEvent = function(){ //关闭事件
  232. if(diag.innerFrame.contentWindow.document.getElementById('zhongxin').style.display == 'none'){
  233. if('${page.currentPage}' == '0'){
  234. top.jzts();
  235. setTimeout("self.location=self.location",100);
  236. }else{
  237. nextPage(${page.currentPage});
  238. }
  239. }
  240. diag.close();
  241. };
  242. diag.show();
  243. }
  244. //预览pdf
  245. function goViewPdf(fileName,Id){
  246. var diag = new top.Dialog();
  247. diag.Drag=true;
  248. diag.Title =fileName;
  249. diag.URL = '<%=basePath%>fhfile/goViewPdf.do?FHFILE_ID='+Id;
  250. diag.Width = 1000;
  251. diag.Height = 600;
  252. diag.Modal = false; //有无遮罩窗口
  253. diag. ShowMaxButton = true; //最大化按钮
  254. diag.ShowMinButton = true; //最小化按钮
  255. diag.CancelEvent = function(){ //关闭事件
  256. diag.close();
  257. };
  258. diag.show();
  259. }
  260. //预览txt,java,php,等文本文件页面
  261. function goViewTxt(fileName,Id,encoding){
  262. var diag = new top.Dialog();
  263. diag.Drag=true;
  264. diag.Title =fileName;
  265. diag.URL = '<%=basePath%>fhfile/goViewTxt.do?FHFILE_ID='+Id+'&encoding='+encoding;
  266. diag.Width = 1000;
  267. diag.Height = 608;
  268. diag.Modal = false; //有无遮罩窗口
  269. diag.ShowMinButton = true; //最小化按钮
  270. diag.CancelEvent = function(){ //关闭事件
  271. diag.close();
  272. };
  273. diag.show();
  274. }
  275. //显示图片
  276. function showTU(path,TPID){
  277. $("#"+TPID).html('<img width="300" src="'+path+'">');
  278. $("#"+TPID).show();
  279. }
  280. //隐藏图片
  281. function hideTU(TPID){
  282. $("#"+TPID).hide();
  283. }
  284. //删除
  285. function del(Id){
  286. bootbox.confirm("确定要删除吗?", function(result) {
  287. if(result) {
  288. top.jzts();
  289. var url = "<%=basePath%>fhfile/delete.do?FHFILE_ID="+Id+"&tm="+new Date().getTime();
  290. $.get(url,function(data){
  291. nextPage(${page.currentPage});
  292. });
  293. }
  294. });
  295. }
  296. //批量操作
  297. function makeAll(msg){
  298. bootbox.confirm(msg, function(result) {
  299. if(result) {
  300. var str = '';
  301. for(var i=0;i < document.getElementsByName('ids').length;i++){
  302. if(document.getElementsByName('ids')[i].checked){
  303. if(str=='') str += document.getElementsByName('ids')[i].value;
  304. else str += ',' + document.getElementsByName('ids')[i].value;
  305. };
  306. }
  307. if(str==''){
  308. bootbox.dialog({
  309. message: "<span class='bigger-110'>您没有选择任何内容!</span>",
  310. buttons:
  311. { "button":{ "label":"确定", "className":"btn-sm btn-success"}}
  312. });
  313. $("#zcheckbox").tips({
  314. side:1,
  315. msg:'点这里全选',
  316. bg:'#AE81FF',
  317. time:8
  318. });
  319. return;
  320. }else{
  321. if(msg == '确定要删除选中的数据吗?'){
  322. top.jzts();
  323. $.ajax({
  324. type: "POST",
  325. url: '<%=basePath%>fhfile/deleteAll.do?tm='+new Date().getTime(),
  326. data: {DATA_IDS:str},
  327. dataType:'json',
  328. //beforeSend: validateData,
  329. cache: false,
  330. success: function(data){
  331. $.each(data.list, function(i, list){
  332. nextPage(${page.currentPage});
  333. });
  334. }
  335. });
  336. }
  337. };
  338. };
  339. });
  340. };
  341. </script>
  342. </body>
  343. </html>