123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112 |
- <%@ page contentType="text/html;charset=UTF-8" %>
- <%@ include file="/WEB-INF/views/include/taglib.jsp" %>
- <html>
- <head>
- <title>资料列表</title>
- <meta name="decorator" content="default"/>
- <style type="text/css">
- .table th {
- text-align: center;
- }
- .table td {
- text-align: center;
- }
- #searchForm label {
- width: 90px;
- text-align: left;
- margin-top: 15px
- }
- </style>
- <script type="text/javascript">
- $(document).ready(function () {
- });
- function page(n, s) {
- $("#pageNo").val(n);
- $("#pageSize").val(s);
- $("#searchForm").submit();
- return false;
- }
- function onlynum(obj) {
- obj.value = obj.value.replace(/[^\d]/g, ""); //清除"数字"以外的字符
- }
- function downAllFile(allFileIds) {
- var fileIdArr = allFileIds.toString().split(",");
- for (var i = 0; i < fileIdArr.length; i++) {
- var fileId = fileIdArr[i];
- if (fileId != '') {
- if (i > 0) {
- sleep(500);
- window.location.href = "${ctx}/archive/cmOrderArchive/downFile?fileId=" + fileId;
- } else {
- window.location.href = "${ctx}/archive/cmOrderArchive/downFile?fileId=" + fileId;
- }
- }
- }
- }
- function sleep(numberMillis) {
- var now = new Date();
- var exitTime = now.getTime() + numberMillis;
- while (true) {
- now = new Date();
- if (now.getTime() > exitTime)
- return;
- }
- }
- function previewFile(url) {
- var index = url.lastIndexOf(".");
- var suffix = url.substring(index);
- if (suffix.startsWith(".png") || suffix.startsWith(".jpg") || suffix.startsWith(".pdf")) {
- window.open(url, '_blank');
- } else {
- var previewUrl = "https://view.officeapps.live.com/op/view.aspx?src="+encodeURIComponent(url);
- window.open(previewUrl, '_blank');
- }
- }
- </script>
- </head>
- <body>
- <ul class="nav nav-tabs">
- </ul>
- <sys:message content="${message}"/>
- <div>
- <label style="margin:10px 15px;font-size: 15px;display: inline">资料列表(订单资料编号:${cmOrderArchive.archiveNo})</label>
- <a href="javascript:;" class="btn btn-primary" style="display: inline;float: right;margin:0 10px 5px 0" onclick="downAllFile('${allFileIds}')">下载全部</a>
- </div>
- <table id="contentTable" class="table table-striped table-bordered table-condensed">
- <thead>
- <tr>
- <th>序号</th>
- <th>资料</th>
- <th>时间</th>
- <th>操作</th>
- </tr>
- </thead>
- <tbody>
- <c:forEach items="${page.list}" var="cmOrderArchiveFile" varStatus="varIndex">
- <tr>
- <td>${varIndex.index+1}</td>
- <td>
- ${cmOrderArchiveFile.fileName}
- </td>
- <td>
- <fmt:formatDate value="${cmOrderArchiveFile.uploadTime}" pattern="yyyy-MM-dd HH:mm:ss"/>
- </td>
- <td>
- <a onclick="previewFile('${cmOrderArchiveFile.ossUrl}')" target="_blank">预览</a>
- <a href="${ctx}/archive/cmOrderArchive/downFile?fileId=${cmOrderArchiveFile.id}">下载</a>
- </td>
- </tr>
- </c:forEach>
- </tbody>
- </table>
- <div class="pagination">${page}</div>
- </body>
- </html>
|