cmOrderArchiveFileList.jsp 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. <%@ page contentType="text/html;charset=UTF-8" %>
  2. <%@ include file="/WEB-INF/views/include/taglib.jsp" %>
  3. <html>
  4. <head>
  5. <title>资料列表</title>
  6. <meta name="decorator" content="default"/>
  7. <style type="text/css">
  8. .table th {
  9. text-align: center;
  10. }
  11. .table td {
  12. text-align: center;
  13. }
  14. #searchForm label {
  15. width: 90px;
  16. text-align: left;
  17. margin-top: 15px
  18. }
  19. </style>
  20. <script type="text/javascript">
  21. $(document).ready(function () {
  22. });
  23. function page(n, s) {
  24. $("#pageNo").val(n);
  25. $("#pageSize").val(s);
  26. $("#searchForm").submit();
  27. return false;
  28. }
  29. function onlynum(obj) {
  30. obj.value = obj.value.replace(/[^\d]/g, ""); //清除"数字"以外的字符
  31. }
  32. function downAllFile(allFileIds) {
  33. var fileIdArr = allFileIds.toString().split(",");
  34. for (var i = 0; i < fileIdArr.length; i++) {
  35. var fileId = fileIdArr[i];
  36. if (fileId != '') {
  37. if (i > 0) {
  38. sleep(500);
  39. window.location.href = "${ctx}/archive/cmOrderArchive/downFile?fileId=" + fileId;
  40. } else {
  41. window.location.href = "${ctx}/archive/cmOrderArchive/downFile?fileId=" + fileId;
  42. }
  43. }
  44. }
  45. }
  46. function sleep(numberMillis) {
  47. var now = new Date();
  48. var exitTime = now.getTime() + numberMillis;
  49. while (true) {
  50. now = new Date();
  51. if (now.getTime() > exitTime)
  52. return;
  53. }
  54. }
  55. function previewFile(url) {
  56. var index = url.lastIndexOf(".");
  57. var suffix = url.substring(index);
  58. if (suffix.startsWith(".png") || suffix.startsWith(".jpg") || suffix.startsWith(".pdf")) {
  59. window.open(url, '_blank');
  60. } else {
  61. var previewUrl = "https://view.officeapps.live.com/op/view.aspx?src="+encodeURIComponent(url);
  62. window.open(previewUrl, '_blank');
  63. }
  64. }
  65. </script>
  66. </head>
  67. <body>
  68. <ul class="nav nav-tabs">
  69. </ul>
  70. <sys:message content="${message}"/>
  71. <div>
  72. <label style="margin:10px 15px;font-size: 15px;display: inline">资料列表(订单资料编号:${cmOrderArchive.archiveNo})</label>
  73. <a href="javascript:;" class="btn btn-primary" style="display: inline;float: right;margin:0 10px 5px 0" onclick="downAllFile('${allFileIds}')">下载全部</a>
  74. </div>
  75. <table id="contentTable" class="table table-striped table-bordered table-condensed">
  76. <thead>
  77. <tr>
  78. <th>序号</th>
  79. <th>资料</th>
  80. <th>时间</th>
  81. <th>操作</th>
  82. </tr>
  83. </thead>
  84. <tbody>
  85. <c:forEach items="${page.list}" var="cmOrderArchiveFile" varStatus="varIndex">
  86. <tr>
  87. <td>${varIndex.index+1}</td>
  88. <td>
  89. ${cmOrderArchiveFile.fileName}
  90. </td>
  91. <td>
  92. <fmt:formatDate value="${cmOrderArchiveFile.uploadTime}" pattern="yyyy-MM-dd HH:mm:ss"/>
  93. </td>
  94. <td>
  95. <a onclick="previewFile('${cmOrderArchiveFile.ossUrl}')" target="_blank">预览</a>
  96. <a href="${ctx}/archive/cmOrderArchive/downFile?fileId=${cmOrderArchiveFile.id}">下载</a>
  97. </td>
  98. </tr>
  99. </c:forEach>
  100. </tbody>
  101. </table>
  102. <div class="pagination">${page}</div>
  103. </body>
  104. </html>