فهرست منبع

项目文件上传组件部分功能开发

徐滕 1 هفته پیش
والد
کامیت
ea7fc34874

+ 6 - 6
src/main/webapp/WEB-INF/tags/table/approvalSealAttachment.tag

@@ -43,7 +43,7 @@
 <%-- 4. 组件核心HTML结构 --%>
 <div class="form-group layui-row">
     <%-- 标题区域 --%>
-    <div class="form-group-label"><h2>${title}</h2></div>
+    <div class="form-group-label"><h2>${title}2</h2></div>
 
     <%-- 操作按钮区域(添加附件+下载模板) --%>
     <c:if test="${showOperateBtn}">
@@ -126,7 +126,7 @@
                                                             or fn:containsIgnoreCase(workClientAttachment.attachmentName,'7z')}">
                                             <td>
                                                 <a class="attention-info" href="javascript:void(0)"
-                                                   onclick="openPreview('${workClientAttachment.temporaryUrl}',3)">
+                                                   onclick="openPreview('${workClientAttachment.temporaryUrl}',1)">
                                                         ${workClientAttachment.attachmentName}
                                                 </a>
                                             </td>
@@ -154,7 +154,7 @@
                                             or fn:containsIgnoreCase(workClientAttachment.attachmentName,'bmp')
                                             or fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpeg')}">
                                     <td>
-                                        <img src="${workClientAttachment.temporaryUrl}" width="50" height="50" onclick="openPreview('${workClientAttachment.temporaryUrl}',5)" alt="${workClientAttachment.attachmentName}">
+                                        <img src="${workClientAttachment.temporaryUrl}" width="50" height="50" onclick="openDialogView('预览','${pageContext.request.contextPath}${fns:getAdminPath()}/sys/picturepreview/picturePreview?url=${workClientAttachment.temporaryUrl}','90%','90%')" alt="${workClientAttachment.attachmentName}">
                                     </td>
                                 </c:when>
                                 <%-- 非图片类型 --%>
@@ -180,7 +180,7 @@
                                                                     or fn:containsIgnoreCase(workClientAttachment.attachmentName,'bmp')
                                                                     or fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpeg')}">
                                                             <td>
-                                                                <img src="${workClientAttachment.url}" width="50" height="50" onclick="openDialogView('预览','${pageContext.request.contextPath}${fns:getAdminPath()}/sys/picturepreview/picturePreview?url=${workClientAttachment.url}','90%','90%')" alt="${workClientAttachment.attachmentName}">
+                                                                <img src="${workClientAttachment.temporaryUrl}" width="50" height="50" onclick="openPreview('${workClientAttachment.temporaryUrl}',5)" alt="${workClientAttachment.attachmentName}">
                                                             </td>
                                                         </c:when>
                                                         <c:otherwise>
@@ -199,7 +199,7 @@
                                                                     or fn:containsIgnoreCase(workClientAttachment.attachmentName,'7z')}">
                                                                     <td>
                                                                         <a class="attention-info" href="javascript:void(0)"
-                                                                           onclick="openPreview('${workClientAttachment.url}',3)">
+                                                                           onclick="openPreview('${workClientAttachment.url}',1)">
                                                                                 ${workClientAttachment.attachmentName}
                                                                         </a>
                                                                     </td>
@@ -243,7 +243,7 @@
                                                                     or fn:containsIgnoreCase(workClientAttachment.attachmentName,'7z')}">
                                                                     <td>
                                                                         <a class="attention-info" href="javascript:void(0)"
-                                                                           onclick="openPreview('${workClientAttachment.url}',3)">
+                                                                           onclick="openPreview('${workClientAttachment.url}',1)">
                                                                                 ${workClientAttachment.attachmentName}
                                                                         </a>
                                                                     </td>

+ 14 - 13
src/main/webapp/WEB-INF/tags/table/fileDisplay.tag

@@ -1,4 +1,9 @@
+<%@ include file="/webpage/include/taglib.jsp"%>
 <%@ tag pageEncoding="UTF-8"%>
+<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
+<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
+<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
+
 <%-- 通用文件展示组件:支持动态渲染和多场景适配 --%>
 
 <%-- 核心参数定义 --%>
@@ -14,10 +19,6 @@
 <%@ attribute name="showEditBtn" required="false" type="java.lang.Boolean" description="是否显示编辑按钮,默认false" %>
 <%@ attribute name="showSyncStatus" required="false" type="java.lang.Boolean" description="是否显示同步状态列,默认true" %>
 
-<%-- 标签库导入 --%>
-<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
-<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
-<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
 
 <%-- 可选参数默认值处理 --%>
 <c:set var="showEditBtnValue" value="${not empty showEditBtn ? showEditBtn : false}"/>
@@ -101,7 +102,7 @@
                         <div class="op-btn-box">
                             <c:if test="${showEditBtnValue}">
                                 <a href="javascript:void(0)"
-                                   onclick="openBill2('编辑附件', '${ctx}/projectAccessory/projectAccessory/workAttachmentForm?attachmentId=${filecaseBase.id}&projectId=${projectId}&uploadMode=${uploadMode}','70%','80%',false,'inputForm','upTable_${moduleId}')"
+                                   onclick="openBill2('编辑附件', '${pageContext.request.contextPath}${fns:getAdminPath()}/projectAccessory/projectAccessory/workAttachmentForm?attachmentId=${filecaseBase.id}&projectId=${projectId}&uploadMode=${uploadMode}','70%','80%',false,'inputForm','upTable_${moduleId}')"
                                    class="op-btn op-btn-edit" >
                                     <i class="fa fa-edit"></i> 编辑
                                 </a>
@@ -128,7 +129,7 @@
                                                 or fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpeg')}">
                                         <td>
                                             <img src="${workClientAttachment.temporaryUrl}" width="50" height="50"
-                                                 onclick="openDialogView('预览','${ctx}/sys/picturepreview/picturePreview?url=${workClientAttachment.temporaryUrl}','90%','90%')"
+                                                 onclick="openDialogView('预览','${pageContext.request.contextPath}${fns:getAdminPath()}/sys/picturepreview/picturePreview?url=${workClientAttachment.temporaryUrl}','90%','90%')"
                                                  alt="${workClientAttachment.attachmentName}">
                                         </td>
                                     </c:when>
@@ -150,7 +151,7 @@
                                                                     or fn:containsIgnoreCase(workClientAttachment.attachmentName,'7z')}">
                                                         <td>
                                                             <a class="attention-info" href="javascript:void(0)"
-                                                               onclick="openPreview('${workClientAttachment.temporaryUrl}',3)">
+                                                               onclick="openPreview('${workClientAttachment.temporaryUrl}',1)">
                                                                     ${workClientAttachment.attachmentName}
                                                             </a>
                                                         </td>
@@ -178,7 +179,7 @@
                                                 or fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpeg')}">
                                         <td>
                                             <img src="${workClientAttachment.url}" width="50" height="50"
-                                                 onclick="openDialogView('预览','${ctx}/sys/picturepreview/picturePreview?url=${workClientAttachment.url}','90%','90%')"
+                                                 onclick="openDialogView('预览','${pageContext.request.contextPath}${fns:getAdminPath()}/sys/picturepreview/picturePreview?url=${workClientAttachment.url}','90%','90%')"
                                                  alt="${workClientAttachment.attachmentName}">
                                         </td>
                                     </c:when>
@@ -200,7 +201,7 @@
                                                                     or fn:containsIgnoreCase(workClientAttachment.attachmentName,'7z')}">
                                                         <td>
                                                             <a class="attention-info" href="javascript:void(0)"
-                                                               onclick="openPreview('${workClientAttachment.url}',3)">
+                                                               onclick="openPreview('${workClientAttachment.url}',1)">
                                                                     ${workClientAttachment.attachmentName}
                                                             </a>
                                                         </td>
@@ -252,7 +253,7 @@
                                         <c:choose>
                                             <c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'pdf')}">
                                                 <!-- 前端只需传递文件标识给后端,无需处理文件名 -->
-                                                <a href="javascript:location.href='${ctx}/workfullmanage/workFullManage/downLoadAttach?file='+encodeURIComponent('${workClientAttachment.url}');"
+                                                <a href="javascript:location.href='${pageContext.request.contextPath}${fns:getAdminPath()}/workfullmanage/workFullManage/downLoadAttach?file='+encodeURIComponent('${workClientAttachment.url}');"
                                                    class="op-btn op-btn-download">
                                                     <i class="fa fa-download"></i>&nbsp;下载
                                                 </a>
@@ -264,7 +265,7 @@
                                         </c:choose>
                                     </c:when>
                                     <c:otherwise>
-                                        <a href="javascript:location.href='${ctx}/workfullmanage/workFullManage/downLoadAttach?file='+encodeURIComponent('${workClientAttachment.url}');"
+                                        <a href="javascript:location.href='${pageContext.request.contextPath}${fns:getAdminPath()}/workfullmanage/workFullManage/downLoadAttach?file='+encodeURIComponent('${workClientAttachment.url}');"
                                            class="op-btn op-btn-download"><i class="fa fa-download"></i>&nbsp;下载</a>
                                     </c:otherwise>
                                 </c:choose>
@@ -295,7 +296,7 @@
         <td class="op-td">
             <div class="op-btn-box">
                 <c:if test="${showEditBtnValue}">
-                    <a href="javascript:void(0)"  onclick="openBill2('编辑附件', '${ctx}/projectAccessory/projectAccessory/workAttachmentForm?attachmentId={{row.id}}&projectId=${projectId}','70%','80%',false,'inputForm','upTable_${moduleId}')" class="op-btn op-btn-edit" ><i class="fa fa-edit"></i> 编辑</a>
+                    <a href="javascript:void(0)"  onclick="openBill2('编辑附件', '${pageContext.request.contextPath}${fns:getAdminPath()}/projectAccessory/projectAccessory/workAttachmentForm?attachmentId={{row.id}}&projectId=${projectId}','70%','80%',false,'inputForm','upTable_${moduleId}')" class="op-btn op-btn-edit" ><i class="fa fa-edit"></i> 编辑</a>
                 </c:if>
             </div>
         </td>
@@ -325,7 +326,7 @@
                 var inputForm = body.find('#inputForm');
                 var top_iframe = target ? target : top.getActiveTab().attr("name");
                 inputForm.attr("target", top_iframe);
-                inputForm.attr("action", "${ctx}/projectAccessory/projectAccessory/saveWorkAttachment");
+                inputForm.attr("action", "${pageContext.request.contextPath}${fns:getAdminPath()}/projectAccessory/projectAccessory/saveWorkAttachment");
                 var $document = iframeWin.contentWindow.document;
                 formSubmit2($document, formId, index, tableId);
             }

+ 2 - 2
src/main/webapp/WEB-INF/tags/table/fileUpload.tag

@@ -37,7 +37,7 @@
 <c:set var="defaultUploadMode" value="2" />
 <c:set var="defaultShowCollectBtn" value="true" />
 <c:set var="defaultCollectUrl" value="${pageContext.request.contextPath}${fns:getAdminPath()}/projectAccessory/projectAccessory/getCollectNewList" />
-<c:set var="defaultPicturePreviewUrl" value="${ctx}/sys/picturepreview/picturePreview?url=" />
+<c:set var="defaultPicturePreviewUrl" value="${pageContext.request.contextPath}${fns:getAdminPath()}/sys/picturepreview/picturePreview?url=" />
 <c:set var="defaultStoreAs" value="workAttachment" />
 <c:set var="defaultOssDomain" value="http://gangwan-app.oss-cn-hangzhou.aliyuncs.com" />
 <c:set var="defaultShowOperateArea" value="true" />
@@ -78,7 +78,7 @@
 <%-- 组件HTML结构 --%>
 <div class="form-group layui-row">
     <%-- 标题区域 --%>
-    <div class="form-group-label"><h2>${title}</h2></div>
+    <div class="form-group-label"><h2>${title}3</h2></div>
 
     <%-- 操作按钮区域 --%>
     <c:if test="${showOperateArea}">

+ 3 - 3
src/main/webapp/WEB-INF/tags/table/otherFileDisplay.tag

@@ -106,7 +106,7 @@
                                                        or fn:containsIgnoreCase(fileOther.attachName,'gif')
                                                        or fn:containsIgnoreCase(fileOther.attachName,'bmp')
                                                        or fn:containsIgnoreCase(fileOther.attachName,'jpeg')}">
-                                                <img src="${fileOther.temporaryUrl}" width="50" height="50" onclick="openDialogView('预览','${ctx}/sys/picturepreview/picturePreview?url=${fileOther.temporaryUrl}','90%','90%')" alt="${fileOther.attachName}">
+                                                <img src="${fileOther.temporaryUrl}" width="50" height="50" onclick="openDialogView('预览','${pageContext.request.contextPath}${fns:getAdminPath()}/sys/picturepreview/picturePreview?url=${fileOther.temporaryUrl}','90%','90%')" alt="${fileOther.attachName}">
                                             </c:when>
                                             <c:otherwise>
                                                 <c:choose>
@@ -168,7 +168,7 @@
                                         <c:when test="${projectReportRecord.uploadMode == 2}">
                                             <c:choose>
                                                 <c:when test="${fn:containsIgnoreCase(fileOther.attachName,'pdf')}">
-                                                    <a href="javascript:location.href='${ctx}/workfullmanage/workFullManage/downLoadAttach?file='+encodeURIComponent('${fileOther.url}');"
+                                                    <a href="javascript:location.href='${pageContext.request.contextPath}${fns:getAdminPath()}/workfullmanage/workFullManage/downLoadAttach?file='+encodeURIComponent('${fileOther.url}');"
                                                        class="op-btn op-btn-download">
                                                         <i class="fa fa-download"></i>&nbsp;下载
                                                     </a>
@@ -179,7 +179,7 @@
                                             </c:choose>
                                         </c:when>
                                         <c:otherwise>
-                                            <a href="javascript:location.href='${ctx}/workfullmanage/workFullManage/downLoadAttach?file='+encodeURIComponent('${fileOther.url}');" class="op-btn op-btn-download"><i class="fa fa-download"></i>&nbsp;下载</a>
+                                            <a href="javascript:location.href='${pageContext.request.contextPath}${fns:getAdminPath()}/workfullmanage/workFullManage/downLoadAttach?file='+encodeURIComponent('${fileOther.url}');" class="op-btn op-btn-download"><i class="fa fa-download"></i>&nbsp;下载</a>
                                         </c:otherwise>
                                     </c:choose>
                                 </c:otherwise>

+ 28 - 16
src/main/webapp/WEB-INF/tags/table/otherFileInstallDisplay.tag

@@ -49,7 +49,7 @@
 
     <c:if test="${showAddButtonValue}">
         <div class="layui-item nav-btns">
-            <a href="javascript:void(0)"  onclick="formAttachment('添加类型', '${ctx}/projectAccessoryRelation/projectAccessoryRelation/formAttachment?parentId=${parentId}&projectType=${projectType}&projectId=${projectId}&reviewFee='+$('#${reviewFeeSelector}').val(),'500px','350px',false,'inputForm','file_${moduleId}')" class="nav-btn nav-btn-add" ><i class="fa fa-plus"></i> 添加类型</a>
+            <a href="javascript:void(0)"  onclick="formAttachment('添加类型', '${pageContext.request.contextPath}${fns:getAdminPath()}/projectAccessoryRelation/projectAccessoryRelation/formAttachment?parentId=${parentId}&projectType=${projectType}&projectId=${projectId}&reviewFee='+$('#${reviewFeeSelector}').val(),'500px','350px',false,'inputForm','file_${moduleId}')" class="nav-btn nav-btn-add" ><i class="fa fa-plus"></i> 添加类型</a>
         </div>
     </c:if>
 
@@ -106,7 +106,7 @@
                     <td class="op-td">
                         <div class="op-btn-box">
                             <c:if test="${showEditBtnValue}">
-                                <a href="javascript:void(0)"  onclick="openBill2('编辑附件1', '${ctx}/projectAccessory/projectAccessory/workAttachmentForm?attachmentId=${fileOther.id}&projectId=${projectId}&uploadMode=${uploadMode}','70%','80%',false,'inputForm','upTable_${moduleId}')" class="op-btn op-btn-edit" ><i class="fa fa-edit"></i> 编辑</a>
+                                <a href="javascript:void(0)"  onclick="openBill2('编辑附件', '${pageContext.request.contextPath}${fns:getAdminPath()}/projectAccessory/projectAccessory/workAttachmentForm?attachmentId=${fileOther.id}&projectId=${projectId}&uploadMode=${uploadMode}','70%','80%',false,'inputForm','upTable_${moduleId}')" class="op-btn op-btn-edit" ><i class="fa fa-edit"></i> 编辑</a>
                             </c:if>
                         </div>
                     </td>
@@ -126,12 +126,16 @@
                                                or fn:containsIgnoreCase(workClientAttachment.attachmentName,'gif')
                                                or fn:containsIgnoreCase(workClientAttachment.attachmentName,'bmp')
                                                or fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpeg')}">
-                                        <td><img src="${workClientAttachment.temporaryUrl}" width="50" height="50" onclick="openDialogView('预览','${ctx}/sys/picturepreview/picturePreview?url=${workClientAttachment.temporaryUrl}','90%','90%')" alt="${workClientAttachment.attachmentName}">
+                                        <td>
+                                            <img src="${workClientAttachment.temporaryUrl}" width="50" height="50" onclick="openPreview('${workClientAttachment.temporaryUrl}',5)" alt="${workClientAttachment.attachmentName}">
+                                        </td>
                                     </c:when>
                                     <c:otherwise>
                                         <c:choose>
                                             <c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'pdf')}">
-                                                <td><a class="attention-info" href="javascript:void(0)" onclick="openPreview('${workClientAttachment.temporaryUrl}',1)">${workClientAttachment.attachmentName}</a></td>
+                                                <td>
+                                                    <a class="attention-info" href="javascript:void(0)" onclick="openPreview('${workClientAttachment.temporaryUrl}',1)">${workClientAttachment.attachmentName}</a>
+                                                </td>
                                             </c:when>
                                             <c:otherwise>
                                                 <c:choose>
@@ -139,7 +143,7 @@
                                                                    or fn:containsIgnoreCase(workClientAttachment.attachmentName,'zip')
                                                                    or fn:containsIgnoreCase(workClientAttachment.attachmentName,'jar')
                                                                    or fn:containsIgnoreCase(workClientAttachment.attachmentName,'7z')}">
-                                                        <td><a class="attention-info" href="javascript:void(0)" onclick="openPreview('${workClientAttachment.temporaryUrl}',3)">${workClientAttachment.attachmentName}</a></td>
+                                                        <td><a class="attention-info" href="javascript:void(0)" onclick="openPreview('${workClientAttachment.temporaryUrl}',1)">${workClientAttachment.attachmentName}</a></td>
                                                     </c:when>
                                                     <c:otherwise>
                                                         <td><a class="attention-info" href="javascript:void(0)" onclick="openPreview('${workClientAttachment.temporaryUrl}',2)">${workClientAttachment.attachmentName}</a></td>
@@ -157,7 +161,9 @@
                                                or fn:containsIgnoreCase(workClientAttachment.attachmentName,'gif')
                                                or fn:containsIgnoreCase(workClientAttachment.attachmentName,'bmp')
                                                or fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpeg')}">
-                                        <td><img src="${workClientAttachment.url}" width="50" height="50" onclick="openDialogView('预览','${ctx}/sys/picturepreview/picturePreview?url=${workClientAttachment.url}','90%','90%')" alt="${workClientAttachment.attachmentName}"></td>
+                                        <td>
+                                            <img src="${workClientAttachment.url}" width="50" height="50" onclick="openDialogView('预览','${pageContext.request.contextPath}${fns:getAdminPath()}/sys/picturepreview/picturePreview?url=${workClientAttachment.url}','90%','90%')" alt="${workClientAttachment.attachmentName}">
+                                        </td>
                                     </c:when>
                                     <c:otherwise>
                                         <c:choose>
@@ -170,7 +176,7 @@
                                                                    or fn:containsIgnoreCase(workClientAttachment.attachmentName,'zip')
                                                                    or fn:containsIgnoreCase(workClientAttachment.attachmentName,'jar')
                                                                    or fn:containsIgnoreCase(workClientAttachment.attachmentName,'7z')}">
-                                                        <td><a class="attention-info" href="javascript:void(0)" onclick="openPreview('${workClientAttachment.url}',3)">${workClientAttachment.attachmentName}</a></td>
+                                                        <td><a class="attention-info" href="javascript:void(0)" onclick="openPreview('${workClientAttachment.url}',1)">${workClientAttachment.attachmentName}</a></td>
                                                     </c:when>
                                                     <c:otherwise>
                                                         <td><a class="attention-info" href="javascript:void(0)" onclick="openPreview('${workClientAttachment.url}',2)">${workClientAttachment.attachmentName}</a></td>
@@ -197,7 +203,13 @@
                                     <c:when test="${uploadMode == 2}">
                                         <c:choose>
                                             <c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'pdf')}">
-                                                <a href="javascript:location.href='${ctx}/workfullmanage/workFullManage/downLoadAttach?file='+encodeURIComponent('${workClientAttachment.url}');"
+                                                <a href="javascript:location.href='${pageContext.request.contextPath}${fns:getAdminPath()}/workfullmanage/workFullManage/downLoadAttach?file='+encodeURIComponent('${workClientAttachment.url}');"
+                                                   class="op-btn op-btn-download">
+                                                    <i class="fa fa-download"></i>&nbsp;下载
+                                                </a>
+                                            </c:when>
+                                            <c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'xml')}">
+                                                <a href="javascript:location.href='${pageContext.request.contextPath}${fns:getAdminPath()}/workfullmanage/workFullManage/downLoadAttach?file='+encodeURIComponent('${workClientAttachment.url}');"
                                                    class="op-btn op-btn-download">
                                                     <i class="fa fa-download"></i>&nbsp;下载
                                                 </a>
@@ -208,7 +220,7 @@
                                         </c:choose>
                                     </c:when>
                                     <c:otherwise>
-                                        <a href="javascript:location.href='${ctx}/workfullmanage/workFullManage/downLoadAttach?file='+encodeURIComponent('${workClientAttachment.url}');" class="op-btn op-btn-download"><i class="fa fa-download"></i>&nbsp;下载</a>
+                                        <a href="javascript:location.href='${pageContext.request.contextPath}${fns:getAdminPath()}/workfullmanage/workFullManage/downLoadAttach?file='+encodeURIComponent('${workClientAttachment.url}');" class="op-btn op-btn-download"><i class="fa fa-download"></i>&nbsp;下载</a>
                                     </c:otherwise>
                                 </c:choose>
                             </div>
@@ -244,7 +256,7 @@
         <td class="op-td">
             <div class="op-btn-box">
                 <c:if test="${showEditBtnValue}">
-                    <a href="javascript:void(0)"  onclick="openBill2('编辑附件', '${ctx}/projectAccessory/projectAccessory/workAttachmentForm?attachmentId={{row.id}}&projectId=${projectId}','70%','80%',false,'inputForm','upTable_${moduleId}')" class="op-btn op-btn-edit" ><i class="fa fa-edit"></i> 编辑</a>
+                    <a href="javascript:void(0)"  onclick="openBill2('编辑附件', '${pageContext.request.contextPath}${fns:getAdminPath()}/projectAccessory/projectAccessory/workAttachmentForm?attachmentId={{row.id}}&projectId=${projectId}','70%','80%',false,'inputForm','upTable_${moduleId}')" class="op-btn op-btn-edit" ><i class="fa fa-edit"></i> 编辑</a>
                 </c:if>
             </div>
         </td>
@@ -290,7 +302,7 @@
                 }
 
                 inputForm.attr("target", top_iframe);
-                inputForm.attr("action", "${ctx}/projectAccessory/projectAccessory/saveWorkAttachment");
+                inputForm.attr("action", "${pageContext.request.contextPath}${fns:getAdminPath()}/projectAccessory/projectAccessory/saveWorkAttachment");
                 var $document = iframeWin.contentWindow.document;
 
                 formSubmit2($document, formId, index, tableId);
@@ -375,7 +387,7 @@
                 var iframeWin = layero.find('iframe')[0];
                 var inputForm = body.find('#inputForm');
 
-                inputForm.attr("action", "${ctx}/projectTemplate/projectTemplate/getProjectTemplateInfo");
+                inputForm.attr("action", "${pageContext.request.contextPath}${fns:getAdminPath()}/projectTemplate/projectTemplate/getProjectTemplateInfo");
                 var $document = iframeWin.contentWindow.document;
 
                 formSubmitAjax($document, formId, index, divId);
@@ -458,7 +470,7 @@
 
         $.ajax({
             type: "post",
-            url: '${ctx}/projectcontentinfo/projectContentData/ajaxdelete',
+            url: '${pageContext.request.contextPath}${fns:getAdminPath()}/projectcontentinfo/projectContentData/ajaxdelete',
             data: {"contentId": contentId, "basedId": id, "condition": condition},
             dataType: "json",
             success: function(data) {
@@ -475,7 +487,7 @@
                     }
 
                     if (currentUser == userId) {
-                        confirmDelete('是否同步删除资料库的文件?', '${ctx}/projectcontentinfo/projectcontentinfo/delete?infoId=' + id + '&id=${projectContentInfo.id}&type=1');
+                        confirmDelete('是否同步删除资料库的文件?', '${pageContext.request.contextPath}${fns:getAdminPath()}/projectcontentinfo/projectcontentinfo/delete?infoId=' + id + '&id=${projectContentInfo.id}&type=1');
                     }
                 } else {
                     top.layer.msg("删除依据资料失败!", {icon: 0});
@@ -496,7 +508,7 @@
 
         $.ajax({
             type: "post",
-            url: '${ctx}/projectcontentinfo/projectContentData/ajaxdelete',
+            url: '${pageContext.request.contextPath}${fns:getAdminPath()}/projectcontentinfo/projectContentData/ajaxdelete',
             data: {"contentId": contentId, "basedId": id, "condition": condition},
             dataType: "json",
             success: function(data) {
@@ -513,7 +525,7 @@
                     }
 
                     if (currentUser == userId) {
-                        confirmDelete('是否同步删除资料库的文件?', '${ctx}/projectcontentinfo/projectcontentinfo/delete?infoId=' + id + '&id=${projectContentInfo.id}&type=1');
+                        confirmDelete('是否同步删除资料库的文件?', '${pageContext.request.contextPath}${fns:getAdminPath()}/projectcontentinfo/projectcontentinfo/delete?infoId=' + id + '&id=${projectContentInfo.id}&type=1');
                     }
                 } else {
                     top.layer.msg("删除依据资料失败!", {icon: 0});

+ 6 - 6
src/main/webapp/webpage/modules/projectAccessory/workAttachmentForm.jsp

@@ -38,9 +38,9 @@
 				$("#"+val+"sort").val(i+1);
 			}
 
-			$("#attachment_btn").click(function () {
+			/*$("#attachment_btn").click(function () {
 				$("#attachment_file").click();
-			});
+			});*/
 
 			//文件行拖拽功能
 			$("#upTable tbody").sortable({
@@ -63,7 +63,7 @@
 			}).disableSelection();
 		});
 
-		function insertTitle(tValue){
+		/*function insertTitle(tValue){
 			//文件后缀名
 			var attachTypes = $("#attachTypes").val();
 			//文件大小
@@ -108,7 +108,7 @@
 				var timestamp=new Date().getTime();
 
 				var storeAs = "workAttachment";
-				var uploadPath="http://gangwan-app.oss-cn-hangzhou.aliyuncs.com/"+storeAs;/*将这段字符串存到数据库即可*/
+				var uploadPath="http://gangwan-app.oss-cn-hangzhou.aliyuncs.com/"+storeAs;/!*将这段字符串存到数据库即可*!/
 				var divId = "_attachment";
 				$("#addFile"+divId).show();
 				var fileCount = $("#fileCount").val();
@@ -160,7 +160,7 @@
 				var timestamp=new Date().getTime();
 
 				var storeAs = "workAttachment";
-				var uploadPath="http://gangwan-app.oss-cn-hangzhou.aliyuncs.com/"+storeAs;/*将这段字符串存到数据库即可*/
+				var uploadPath="http://gangwan-app.oss-cn-hangzhou.aliyuncs.com/"+storeAs;/!*将这段字符串存到数据库即可*!/
 				var divId = "_attachment";
 				$("#addFile"+divId).show();
 				var fileCount = $("#fileCount").val();
@@ -168,7 +168,7 @@
 				multipartUploadWithStsCollectionCollect(storeAs, file,attachmentId,attachmentFlag,uploadPath,divId,size,fileCount);
 				//multipartUploadWithStsOnProcessAccessoryCollect(storeAs, file,attachmentId,attachmentFlag,uploadPath,divId,size,fileCount);
 			}
-		}
+		}*/
 		function showfile(){
 			var length=$("#file_attachment tr").length;
 			var files=new Array();

+ 22 - 239
src/main/webapp/webpage/modules/ruralprojectrecords/record/cost/projectRecordDescriptionForm.jsp

@@ -52,9 +52,7 @@
         layui.use(['tree', 'util'], function() {
             var reportId = "${materialDefectRecord.reportId}"
             // var reportId = document.getElementById('reportId').value;
-            console.log('reportId', reportId)
             var id = "${materialDefectRecord.id}"
-            console.log('id', id)
             let re = [];
             $.ajax({
                 //几个参数需要注意一下
@@ -63,7 +61,6 @@
                 url: '${ctx}/projectReportDefectRecord/projectReportDefectRecord/getZuzhi',
                 data: {"reportId": reportId,"id": id},
                 success: function (result) {
-                    console.log('result', result)
                     re=result;
                     var tree = layui.tree;
                     var util = layui.util
@@ -87,7 +84,6 @@
                            checkedData = tree.getChecked('demoId1'); //获取选中节点的数据
 
                             layer.alert(JSON.stringify(checkedData), {shade:0});
-                            console.log('checkedData',checkedData);
                         }
                     });
                 },
@@ -101,10 +97,7 @@
             var tree = layui.tree;
             var test = tree.getChecked('demoId1'); //获取选中节点的数据
 
-            // console.log('test0', test)
-            // console.log('test1', JSON.stringify(test))
             document.getElementById('zuZhiList').value = JSON.stringify(test)
-            console.log('test2', document.getElementById('zuZhiList').value)
             if (validateForm.form()) {
                 var projectId = '${project.id}';
                 var boolFlag = true;
@@ -113,7 +106,6 @@
                 } else {
                     if (boolFlag) {
                         var gistdata = $("#file_attachment tr").length;
-                        console.log('说明扫描件数量:' + gistdata)
                         if (gistdata === 0) {
                             top.layer.msg("请上传说明扫描件!", {icon: 0});
                             return false;
@@ -215,9 +207,9 @@
                     }
                 }
             });
-            $("#attachment_btn").click(function () {
+            /*$("#attachment_btn").click(function () {
                 $("#attachment_file").click();
-            });
+            });*/
             $(".tabMove").mouseover(function () {
                 //tips层-下
                 var td = $(this)
@@ -228,7 +220,7 @@
             })
         });
 
-        function insertTitle(tValue) {
+        /*function insertTitle(tValue) {
             var list = "${materialDefectRecord.workAttachments}";
             var size = (list.split('url')).length - 1;
             var files = $("#attachment_file")[0].files;
@@ -236,16 +228,15 @@
                 var file = files[i];
                 var attachmentId = "";
                 var attachmentFlag = "99";
-                console.log(file);
                 var timestamp = new Date().getTime();
 
                 var storeAs = "projectRecords";
-                var uploadPath = "http://gangwan-app.oss-cn-hangzhou.aliyuncs.com/" + storeAs;/*将这段字符串存到数据库即可*/
+                var uploadPath = "http://gangwan-app.oss-cn-hangzhou.aliyuncs.com/" + storeAs;/!*将这段字符串存到数据库即可*!/
                 var divId = "_attachment";
                 $("#addFile" + divId).show();
                 multipartUploadWithSts(storeAs, file, attachmentId, attachmentFlag, uploadPath, divId, size);
             }
-        }
+        }*/
     </script>
 </head>
 <body>
@@ -364,229 +355,23 @@
                 </div>
             </div>
             <input id="zuZhiList" name="zuZhiList" htmlEscape="false" readonly="true" style="display: none"/>
-            <div class="form-group layui-row">
-                <div class="form-group-label"><h2><span class="require-item">*</span>说明扫描件</h2></div>
-                <div class="layui-item nav-btns">
-                    <a id="attachment_btn" class="nav-btn nav-btn-add" title="添加附件"><i class="fa fa-plus"></i>&nbsp;添加附件</a>
-                        <%--<sys:collectSelect  id="linkman" url="${ctx}/workclientinfo/workClientInfo/linkmanList"
-                                            name="linkman.id"  title="选择资料库"
-                                            cssClass="form-control judgment" fieldLabels="资料库" fieldKeys="name"
-                                            searchLabel="资料库" searchKey="fileName"></sys:collectSelect>--%>
-                </div>
-                <div id="addFile_attachment" style="display: none" class="upload-progress">
-                    <span id="fileName_attachment"></span>
-                    <b><span id="baifenbi_attachment"></span></b>
-                    <div class="progress">
-                        <div id="jindutiao_attachment" class="progress-bar" style="width: 0%" aria-valuenow="0">
-                        </div>
-                    </div>
-                </div>
-                <input id="attachment_file" type="file" name="attachment_file" multiple="multiple"
-                       style="display: none;" onChange="if(this.value)insertTitle(this.value);"/>
-                <span id="attachment_title"></span>
-                <div class="layui-item layui-col-xs12" style="padding:0 16px;">
-                    <table id="listAttachment" class="table table-bordered table-condensed details">
-                        <thead>
-                        <tr>
-                                <%-- <th>序号</th>--%>
-                            <th>文件预览</th>
-                            <th>上传人</th>
-                            <th>上传时间</th>
-                            <th width="200px">操作</th>
-                        </tr>
-                        </thead>
-                        <tbody id="file_attachment">
-                        <c:forEach items="${materialDefectRecord.workAttachments}" var="workClientAttachment"
-                                   varStatus="status">
-                            <tr>
-
-                                    <%-- <td>${status.index + 1}</td>--%>
-                                <c:choose>
-                                    <c:when test="${materialDefectRecord.uploadMode == 2}">
-                                        <c:choose>
-                                            <c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpg')
-                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'png')
-                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'gif')
-                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'bmp')
-                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpeg')}">
-                                                <td><img src="${workClientAttachment.temporaryUrl}" width="50" height="50" onclick="openDialogView('预览','${ctx}/sys/picturepreview/picturePreview?url=${workClientAttachment.temporaryUrl}','90%','90%')" alt="${workClientAttachment.attachmentName}">
-                                            </c:when>
-                                            <c:otherwise>
-                                                <c:choose>
-                                                    <c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'pdf')}">
-                                                        <td><a class="attention-info" href="javascript:void(0)"
-                                                               onclick="openPreview('${workClientAttachment.temporaryUrl}',1)">${workClientAttachment.attachmentName}</a>
-                                                        </td>
-                                                    </c:when>
-                                                    <c:otherwise>
-                                                        <c:choose>
-                                                            <c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'rar')
-                                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'zip')
-                                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'jar')
-                                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'7z')}">
-                                                                <td><a class="attention-info" href="javascript:void(0)"
-                                                                       onclick="openPreview('${workClientAttachment.temporaryUrl}',3)">${workClientAttachment.attachmentName}</a>
-                                                                </td>
-                                                            </c:when>
-                                                            <c:otherwise>
-                                                                <td><a class="attention-info" href="javascript:void(0)"
-                                                                       onclick="openPreview('${workClientAttachment.temporaryUrl}',2)">${workClientAttachment.attachmentName}</a>
-                                                                </td>
-                                                            </c:otherwise>
-                                                        </c:choose>
-                                                    </c:otherwise>
-                                                </c:choose>
-                                            </c:otherwise>
-                                        </c:choose>
-                                    </c:when>
-                                    <c:otherwise>
-                                        <c:choose>
-                                            <c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpg')
-                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'png')
-                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'gif')
-                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'bmp')
-                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpeg')}">
-                                                <td><img src="${workClientAttachment.url}" width="50" height="50" onclick="openDialogView('预览','${ctx}/sys/picturepreview/picturePreview?url=${workClientAttachment.url}','90%','90%')" alt="${workClientAttachment.attachmentName}">
-                                            </c:when>
-                                            <c:otherwise>
-                                                <c:choose>
-                                                    <c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'pdf')}">
-                                                        <td><a class="attention-info" href="javascript:void(0)"
-                                                               onclick="openPreview('${workClientAttachment.url}',1)">${workClientAttachment.attachmentName}</a>
-                                                        </td>
-                                                    </c:when>
-                                                    <c:otherwise>
-                                                        <c:choose>
-                                                            <c:when test="${materialDefectRecord.uploadMode == 2}">
-                                                                <c:choose>
-                                                                    <c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpg')
-                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'png')
-                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'gif')
-                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'bmp')
-                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpeg')}">
-                                                                        <td><img src="${workClientAttachment.temporaryUrl}" width="50" height="50" onclick="openDialogView('预览','${ctx}/sys/picturepreview/picturePreview?url=${workClientAttachment.temporaryUrl}','90%','90%')" alt="${workClientAttachment.attachmentName}">
-                                                                    </c:when>
-                                                                    <c:otherwise>
-                                                                        <c:choose>
-                                                                            <c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'pdf')}">
-                                                                                <td><a class="attention-info"
-                                                                                       href="javascript:void(0)"
-                                                                                       onclick="openPreview('${workClientAttachment.temporaryUrl}',1)">${workClientAttachment.attachmentName}</a>
-                                                                                </td>
-                                                                            </c:when>
-                                                                            <c:otherwise>
-                                                                                <c:choose>
-                                                                                    <c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'rar')
-                                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'zip')
-                                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'jar')
-                                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'7z')}">
-                                                                                        <td><a class="attention-info"
-                                                                                               href="javascript:void(0)"
-                                                                                               onclick="openPreview('${workClientAttachment.temporaryUrl}',3)">${workClientAttachment.attachmentName}</a>
-                                                                                        </td>
-                                                                                    </c:when>
-                                                                                    <c:otherwise>
-                                                                                        <td><a class="attention-info"
-                                                                                               href="javascript:void(0)"
-                                                                                               onclick="openPreview('${workClientAttachment.temporaryUrl}',2)">${workClientAttachment.attachmentName}</a>
-                                                                                        </td>
-                                                                                    </c:otherwise>
-                                                                                </c:choose>
-                                                                            </c:otherwise>
-                                                                        </c:choose>
-                                                                    </c:otherwise>
-                                                                </c:choose>
-                                                            </c:when>
-                                                            <c:otherwise>
-                                                                <c:choose>
-                                                                    <c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpg')
-                                                   or fn:containsIgnoreCase(workClientAttachment.attachmentName,'png')
-                                                   or fn:containsIgnoreCase(workClientAttachment.attachmentName,'gif')
-                                                   or fn:containsIgnoreCase(workClientAttachment.attachmentName,'bmp')
-                                                   or fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpeg')}">
-                                                                        <td><img src="${workClientAttachment.url}" width="50" height="50" onclick="openDialogView('预览','${ctx}/sys/picturepreview/picturePreview?url=${workClientAttachment.url}','90%','90%')" alt="${workClientAttachment.attachmentName}">
-                                                                    </c:when>
-                                                                    <c:otherwise>
-                                                                        <c:choose>
-                                                                            <c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'pdf')}">
-                                                                                <td><a href="javascript:void(0)"
-                                                                                       onclick="openPreview('${workClientAttachment.url}',1)">${workClientAttachment.attachmentName}</a>
-                                                                                </td>
-                                                                            </c:when>
-                                                                            <c:otherwise>
-                                                                                <c:choose>
-                                                                                    <c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'rar')
-                                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'zip')
-                                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'jar')
-                                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'7z')}">
-                                                                                        <td><a class="attention-info"
-                                                                                               href="javascript:void(0)"
-                                                                                               onclick="openPreview('${workClientAttachment.url}',3)">${workClientAttachment.attachmentName}</a>
-                                                                                        </td>
-                                                                                    </c:when>
-                                                                                    <c:otherwise>
-                                                                                        <td><a class="attention-info"
-                                                                                               href="javascript:void(0)"
-                                                                                               onclick="openPreview('${workClientAttachment.url}',2)">${workClientAttachment.attachmentName}</a>
-                                                                                        </td>
-                                                                                    </c:otherwise>
-                                                                                </c:choose>
-                                                                            </c:otherwise>
-                                                                        </c:choose>
-                                                                    </c:otherwise>
-                                                                </c:choose>
-                                                            </c:otherwise>
-                                                        </c:choose>
-                                                    </c:otherwise>
-                                                </c:choose>
-                                            </c:otherwise>
-                                        </c:choose>
-                                    </c:otherwise>
-                                </c:choose>
-
-                                <td>${workClientAttachment.createBy.name}</td>
-                                <td><fmt:formatDate value="${workClientAttachment.createDate}" type="both"/></td>
-                                <td class="op-td">
-                                    <div class="op-btn-box">
-                                            <%--附件下载删除--%>
-                                        <c:choose>
-                                            <c:when test="${materialDefectRecord.uploadMode == 2}">
-                                                <c:choose>
-                                                    <c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'pdf')}">
-                                                        <a href="${workClientAttachment.temporaryUrl}" target="_blank"
-                                                           class="op-btn op-btn-download"><i class="fa fa-download"></i>&nbsp;下载</a>
-                                                    </c:when>
-                                                    <c:otherwise>
-                                                        <a href="${workClientAttachment.temporaryUrl}"
-                                                           class="op-btn op-btn-download"><i class="fa fa-download"></i>&nbsp;下载</a>
-                                                    </c:otherwise>
-                                                </c:choose>
-                                            </c:when>
-                                            <c:otherwise>
-                                                <a href="javascript:location.href='${ctx}/workfullmanage/workFullManage/downLoadAttach?file='+encodeURIComponent('${workClientAttachment.url}');"
-                                                   class="op-btn op-btn-download"><i class="fa fa-download"></i>&nbsp;下载</a>
-                                            </c:otherwise>
-                                        </c:choose>
-                                        <c:if test="${workClientAttachment.collectFlag != 1}">
-                                            <a href="javascript:void(0)"
-                                               onclick="collectingAccessory(this,'${ctx}/projectAccessory/projectAccessory/saveCollectAccessory','${workClientAttachment.url}','${workClientAttachment.createBy.id}','${workClientAttachment.fileSize}')"
-                                               class="op-btn op-btn-delete" style="background-color: #FFB800"><i
-                                                    class="layui-icon layui-icon-rate"></i>&nbsp;收藏</a>
-                                        </c:if>
-                                        <c:if test="${workClientAttachment.createBy.id eq fns:getUser().id}">
-                                            <a href="javascript:void(0)"
-                                               onclick="deleteFileFromAliyun(this,'${ctx}/sys/workattachment/deleteFileFromAliyun?url=${workClientAttachment.url}&id=${workClientAttachment.id}&type=2','addFile_attachment','_attachment')"
-                                               class="op-btn op-btn-delete"><i class="fa fa-trash"></i>&nbsp;删除</a>
-                                        </c:if>
-
-                                    </div>
-                                </td>
-                            </tr>
-                        </c:forEach>
-                        </tbody>
-                    </table>
-                </div>
-            </div>
+
+
+
+            <!-- fileHandlerFuncName="myCustomHandler" 自定义函数名 -->
+            <!-- attachmentFlag="6" 附件标识 -->
+            <!-- storeAs="wrkReimbursement" 存储路径标识 -->
+            <!-- showOperateArea="false" 是否展示新增按钮,默认true -->
+            <table:attachmentManager
+                    title="说明扫描件"
+                    addBtnText="添加附件"
+                    baseId="attachment"
+                    attachments="${materialDefectRecord.workAttachments}"
+                    fileHandlerFuncName="insertTitle"
+                    attachmentFlag="99"
+                    storeAs="projectRecords"
+            />
+
 
         </form:form>
     </div>
@@ -806,7 +591,6 @@
         var id = $(prefix + "_id").val();
         var currentUser = '${fns:getUser().id}';
         var contentId = '${projectcontentinfo.projectContentData.id}';
-        console.log(contentId);
         var condition = "${flag}";
         $.ajax({
             type: "post",
@@ -838,7 +622,6 @@
         var id = $(prefix + "_id").val();
         var currentUser = '${fns:getUser().id}';
         var contentId = '${projectcontentinfo.projectContentData.id}';
-        console.log(contentId);
         var condition = "${flag}";
         $.ajax({
             type: "post",

+ 14 - 175
src/main/webapp/webpage/modules/ruralprojectrecords/record/projectRepordDescriptionAudit.jsp

@@ -196,184 +196,23 @@
 						</div>
 					</div>
 
-					<div class="form-group layui-row">
-						<div class="form-group-label"><h2>说明扫描件</h2></div>
-						<div id="addFile_attachment" style="display: none" class="upload-progress">
-							<span id="fileName_attachment" ></span>
-							<b><span id="baifenbi_attachment" ></span></b>
-							<div class="progress">
-								<div id="jindutiao_attachment" class="progress-bar" style="width: 0%" aria-valuenow="0">
-								</div>
-							</div>
-						</div>
-						<input id="attachment_file" type="file" name="attachment_file" multiple="multiple" style="display: none;" onChange="if(this.value)insertTitle(this.value);"/>
-						<span id="attachment_title"></span>
-						<div class="layui-item layui-col-xs12" style="padding:0 16px;">
-							<table id="listAttachment" class="table table-bordered table-condensed details">
-								<thead>
-								<tr>
-										<%-- <th>序号</th>--%>
-									<th>文件预览</th>
-									<th>上传人</th>
-									<th>上传时间</th>
-									<th width="200px">操作</th>
-								</tr>
-								</thead>
-								<tbody id="file_attachment">
-								<c:forEach items="${materialDefectRecord.workAttachments}" var = "workClientAttachment" varStatus="status">
-									<tr>
 
-											<%-- <td>${status.index + 1}</td>--%>
-										<c:choose>
-											<c:when test="${materialDefectRecord.uploadMode == 2}">
-												<c:choose>
-													<c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpg')
-                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'png')
-                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'gif')
-                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'bmp')
-                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpeg')}">
-														<td><img src="${workClientAttachment.temporaryUrl}" width="50" height="50" onclick="openDialogView('预览','${ctx}/sys/picturepreview/picturePreview?url=${workClientAttachment.temporaryUrl}','90%','90%')" alt="${workClientAttachment.attachmentName}">
-													</c:when>
-													<c:otherwise>
-														<c:choose>
-															<c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'pdf')}">
-																<td><a class="attention-info" href="javascript:void(0)" onclick="openPreview('${workClientAttachment.temporaryUrl}',1)">${workClientAttachment.attachmentName}</a></td>
-															</c:when>
-															<c:otherwise>
-																<c:choose>
-																	<c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'rar')
-                                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'zip')
-                                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'jar')
-                                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'7z')}">
-																		<td><a class="attention-info" href="javascript:void(0)" onclick="openPreview('${workClientAttachment.temporaryUrl}',3)">${workClientAttachment.attachmentName}</a></td>
-																	</c:when>
-																	<c:otherwise>
-																		<td><a class="attention-info" href="javascript:void(0)" onclick="openPreview('${workClientAttachment.temporaryUrl}',2)">${workClientAttachment.attachmentName}</a></td>
-																	</c:otherwise>
-																</c:choose>
-															</c:otherwise>
-														</c:choose>
-													</c:otherwise>
-												</c:choose>
-											</c:when>
-											<c:otherwise>
-												<c:choose>
-													<c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpg')
-                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'png')
-                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'gif')
-                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'bmp')
-                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpeg')}">
-														<td><img src="${workClientAttachment.url}" width="50" height="50" onclick="openDialogView('预览','${ctx}/sys/picturepreview/picturePreview?url=${workClientAttachment.url}','90%','90%')" alt="${workClientAttachment.attachmentName}">
-													</c:when>
-													<c:otherwise>
-														<c:choose>
-															<c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'pdf')}">
-																<td><a class="attention-info" href="javascript:void(0)" onclick="openPreview('${workClientAttachment.url}',1)">${workClientAttachment.attachmentName}</a></td>
-															</c:when>
-															<c:otherwise>
-																<c:choose>
-																	<c:when test="${materialDefectRecord.uploadMode == 2}">
-																		<c:choose>
-																			<c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpg')
-                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'png')
-                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'gif')
-                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'bmp')
-                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpeg')}">
-																				<td><img src="${workClientAttachment.temporaryUrl}" width="50" height="50" onclick="openDialogView('预览','${ctx}/sys/picturepreview/picturePreview?url=${workClientAttachment.temporaryUrl}','90%','90%')" alt="${workClientAttachment.attachmentName}">
-																			</c:when>
-																			<c:otherwise>
-																				<c:choose>
-																					<c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'pdf')}">
-																						<td><a class="attention-info" href="javascript:void(0)" onclick="openPreview('${workClientAttachment.temporaryUrl}',1)">${workClientAttachment.attachmentName}</a></td>
-																					</c:when>
-																					<c:otherwise>
-																						<c:choose>
-																							<c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'rar')
-                                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'zip')
-                                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'jar')
-                                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'7z')}">
-																								<td><a class="attention-info" href="javascript:void(0)" onclick="openPreview('${workClientAttachment.temporaryUrl}',3)">${workClientAttachment.attachmentName}</a></td>
-																							</c:when>
-																							<c:otherwise>
-																								<td><a class="attention-info" href="javascript:void(0)" onclick="openPreview('${workClientAttachment.temporaryUrl}',2)">${workClientAttachment.attachmentName}</a></td>
-																							</c:otherwise>
-																						</c:choose>
-																					</c:otherwise>
-																				</c:choose>
-																			</c:otherwise>
-																		</c:choose>
-																	</c:when>
-																	<c:otherwise>
-																		<c:choose>
-																			<c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpg')
-                                                   or fn:containsIgnoreCase(workClientAttachment.attachmentName,'png')
-                                                   or fn:containsIgnoreCase(workClientAttachment.attachmentName,'gif')
-                                                   or fn:containsIgnoreCase(workClientAttachment.attachmentName,'bmp')
-                                                   or fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpeg')}">
-																				<td><img src="${workClientAttachment.url}" width="50" height="50" onclick="openDialogView('预览','${ctx}/sys/picturepreview/picturePreview?url=${workClientAttachment.url}','90%','90%')" alt="${workClientAttachment.attachmentName}">
-																			</c:when>
-																			<c:otherwise>
-																				<c:choose>
-																					<c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'pdf')}">
-																						<td><a href="javascript:void(0)" onclick="openPreview('${workClientAttachment.url}',1)">${workClientAttachment.attachmentName}</a></td>
-																					</c:when>
-																					<c:otherwise>
-																						<c:choose>
-																							<c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'rar')
-                                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'zip')
-                                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'jar')
-                                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'7z')}">
-																								<td><a class="attention-info" href="javascript:void(0)" onclick="openPreview('${workClientAttachment.url}',3)">${workClientAttachment.attachmentName}</a></td>
-																							</c:when>
-																							<c:otherwise>
-																								<td><a class="attention-info" href="javascript:void(0)" onclick="openPreview('${workClientAttachment.url}',2)">${workClientAttachment.attachmentName}</a></td>
-																							</c:otherwise>
-																						</c:choose>
-																					</c:otherwise>
-																				</c:choose>
-																			</c:otherwise>
-																		</c:choose>
-																	</c:otherwise>
-																</c:choose>
-															</c:otherwise>
-														</c:choose>
-													</c:otherwise>
-												</c:choose>
-											</c:otherwise>
-										</c:choose>
+					<!-- fileHandlerFuncName="myCustomHandler" 自定义函数名 -->
+					<!-- attachmentFlag="6" 附件标识 -->
+					<!-- storeAs="wrkReimbursement" 存储路径标识 -->
+					<!-- showOperateArea="false" 是否展示新增按钮,默认true -->
+					<table:attachmentManager
+							title="说明扫描件"
+							addBtnText="添加附件"
+							baseId="attachment"
+							attachments="${materialDefectRecord.workAttachments}"
+							fileHandlerFuncName="insertTitle"
+							attachmentFlag="99"
+							storeAs="projectRecords"
+							showOperateArea="false"
+					/>
 
-										<td>${workClientAttachment.createBy.name}</td>
-										<td><fmt:formatDate value="${workClientAttachment.createDate}" type="both"/></td>
-										<td class="op-td">
-											<div class="op-btn-box" >
-													<%--附件下载删除--%>
-												<c:choose>
-													<c:when test="${materialDefectRecord.uploadMode == 2}">
-														<c:choose>
-															<c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'pdf')}">
-																<a href="${workClientAttachment.temporaryUrl}" target="_blank" class="op-btn op-btn-download"><i class="fa fa-download"></i>&nbsp;下载</a>
-															</c:when>
-															<c:otherwise>
-																<a href="${workClientAttachment.temporaryUrl}" class="op-btn op-btn-download"><i class="fa fa-download"></i>&nbsp;下载</a>
-															</c:otherwise>
-														</c:choose>
-													</c:when>
-													<c:otherwise>
-														<a href="javascript:location.href='${ctx}/workfullmanage/workFullManage/downLoadAttach?file='+encodeURIComponent('${workClientAttachment.url}');" class="op-btn op-btn-download"><i class="fa fa-download"></i>&nbsp;下载</a>
-													</c:otherwise>
-												</c:choose>
-												<c:if test="${workClientAttachment.collectFlag != 1}">
-													<a href="javascript:void(0)" onclick="collectingAccessory(this,'${ctx}/projectAccessory/projectAccessory/saveCollectAccessory','${workClientAttachment.url}','${workClientAttachment.createBy.id}','${workClientAttachment.fileSize}')" class="op-btn op-btn-delete" style="background-color: #FFB800"><i class="layui-icon layui-icon-rate"></i>&nbsp;收藏</a>
-												</c:if>
 
-											</div>
-										</td>
-									</tr>
-								</c:forEach>
-								</tbody>
-							</table>
-						</div>
-					</div>
 					<div class="form-group layui-row">
 						<div class="form-group-label"><h2>${projectNotifyType}审批流程</h2></div>
 						<div class="layui-item layui-col-xs12 form-table-container" >

+ 20 - 244
src/main/webapp/webpage/modules/ruralprojectrecords/record/projectRepordDescriptionModify.jsp

@@ -108,60 +108,6 @@
 					}
 				}
 
-				// var leng = $("#file_attachment tr").length;
-				// for(var i=0; i<leng; i++) {
-				// 	var numberStr = $("#file_attachment tr").eq(i).find("td:first").html();
-				// 	var second = $("#file_attachment tr").eq(i).find("td:eq(1)").html();
-				// 	var name = $("#file_attachment tr").eq(i).find("td:eq(2)").html();
-				// 	var fileFlag = $("#file_attachment tr").eq(i).find("td:last").html();
-				// 	if(second == 1){
-				// 		if(numberStr != undefined && numberStr !=null && numberStr !=''){
-				// 			if (fileFlag==1){
-				//
-				// 			}else{
-				// 				top.layer.msg("请上传成果文件!", {icon: 0});
-				// 				return false;
-				// 			}
-				// 		}
-				// 	}
-				// }
-				// if(boolFlag){
-				// 	var gistdata = $("#file_gistdata tr").length;
-				// 	for(var i=0; i<gistdata; i++) {
-				// 		var numberStr = $("#file_gistdata tr").eq(i).find("td:first").html();
-				// 		var second = $("#file_gistdata tr").eq(i).find("td:eq(1)").html();
-				// 		var fileFlag = $("#file_gistdata tr").eq(i).find("td:last").html();
-				// 		if(second == 1){
-				// 			if(numberStr != undefined && numberStr !=null && numberStr !=''){
-				// 				if (fileFlag==1){
-				//
-				// 				}else{
-				// 					top.layer.msg("请上传依据性文件!", {icon: 0});
-				// 					return false;
-				// 				}
-				// 			}
-				// 		}
-				// 	}
-				// }
-				// if(boolFlag){
-				// 	var other = $("#file_other tr").length;
-				// 	for(var i=0; i<other; i++) {
-				// 		var numberStr = $("#file_other tr").eq(i).find("td:first").html();
-				// 		var second = $("#file_other tr").eq(i).find("td:eq(1)").html();
-				// 		var fileFlag = $("#file_other tr").eq(i).find("td:last").html();
-				//
-				// 		if(second == 1){
-				// 			if(numberStr != undefined && numberStr !=null && numberStr !=''){
-				// 				if (fileFlag==1){
-				//
-				// 				}else{
-				// 					top.layer.msg("请上传其它文件!", {icon: 0});
-				// 					return false;
-				// 				}
-				// 			}
-				// 		}
-				// 	}
-				// }
 				if(boolFlag) {
 					$("#inputForm").submit();
 					return true;
@@ -195,12 +141,12 @@
                     }
                 }
             });
-            $("#attachment_btn").click(function () {
+            /*$("#attachment_btn").click(function () {
                 $("#attachment_file").click();
-            });
+            });*/
 
         });
-        function insertTitle(tValue){
+        /*function insertTitle(tValue){
             var list = "${materialDefectRecord.workAttachments}";
             var size = (list.split('url')).length-1;
             var files = $("#attachment_file")[0].files;            for(var i = 0;i<files.length;i++) {                var file = files[i];
@@ -210,11 +156,11 @@
             var timestamp=new Date().getTime();
 
             var storeAs = "projectRecords";
-            var uploadPath="http://gangwan-app.oss-cn-hangzhou.aliyuncs.com/"+storeAs;/*将这段字符串存到数据库即可*/
+            var uploadPath="http://gangwan-app.oss-cn-hangzhou.aliyuncs.com/"+storeAs;/!*将这段字符串存到数据库即可*!/
             var divId = "_attachment";
             $("#addFile"+divId).show();
             multipartUploadWithSts(storeAs, file,attachmentId,attachmentFlag,uploadPath,divId,size);}
-        }
+        }*/
 
         function setValuee(obj){
             $("#reportId").val(obj.id);
@@ -353,194 +299,24 @@
 				</div>
 			</div>
 			<input id="zuZhiList" name="zuZhiList" htmlEscape="false" readonly="true" style="display: none"/>
-			<div class="form-group layui-row">
-				<div class="form-group-label"><h2><span class="require-item">*</span>说明扫描件</h2></div>
-				<div class="layui-item nav-btns">
-					<a id="attachment_btn" class="nav-btn nav-btn-add" title="添加附件"><i class="fa fa-plus"></i>&nbsp;添加附件</a>
-						<%--<sys:collectSelect  id="linkman" url="${ctx}/workclientinfo/workClientInfo/linkmanList"
-                                            name="linkman.id"  title="选择资料库"
-                                            cssClass="form-control judgment" fieldLabels="资料库" fieldKeys="name"
-                                            searchLabel="资料库" searchKey="fileName"></sys:collectSelect>--%>
-				</div>
-				<div id="addFile_attachment" style="display: none" class="upload-progress">
-					<span id="fileName_attachment" ></span>
-					<b><span id="baifenbi_attachment" ></span></b>
-					<div class="progress">
-						<div id="jindutiao_attachment" class="progress-bar" style="width: 0%" aria-valuenow="0">
-						</div>
-					</div>
-				</div>
-				<input id="attachment_file" type="file" name="attachment_file" multiple="multiple" style="display: none;" onChange="if(this.value)insertTitle(this.value);"/>
-				<span id="attachment_title"></span>
-				<div class="layui-item layui-col-xs12" style="padding:0 16px;">
-					<table id="listAttachment" class="table table-bordered table-condensed details">
-						<thead>
-						<tr>
-								<%-- <th>序号</th>--%>
-							<th>文件预览</th>
-							<th>上传人</th>
-							<th>上传时间</th>
-							<th width="200px">操作</th>
-						</tr>
-						</thead>
-						<tbody id="file_attachment">
-						<c:forEach items="${materialDefectRecord.workAttachments}" var = "workClientAttachment" varStatus="status">
-							<tr>
 
-									<%-- <td>${status.index + 1}</td>--%>
-								<c:choose>
-									<c:when test="${materialDefectRecord.uploadMode == 2}">
-										<c:choose>
-											<c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpg')
-                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'png')
-                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'gif')
-                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'bmp')
-                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpeg')}">
-												<td><img src="${workClientAttachment.temporaryUrl}" width="50" height="50" onclick="openDialogView('预览','${ctx}/sys/picturepreview/picturePreview?url=${workClientAttachment.temporaryUrl}','90%','90%')" alt="${workClientAttachment.attachmentName}">
-											</c:when>
-											<c:otherwise>
-												<c:choose>
-													<c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'pdf')}">
-														<td><a class="attention-info" href="javascript:void(0)" onclick="openPreview('${workClientAttachment.temporaryUrl}',1)">${workClientAttachment.attachmentName}</a></td>
-													</c:when>
-													<c:otherwise>
-														<c:choose>
-															<c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'rar')
-                                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'zip')
-                                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'jar')
-                                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'7z')}">
-																<td><a class="attention-info" href="javascript:void(0)" onclick="openPreview('${workClientAttachment.temporaryUrl}',3)">${workClientAttachment.attachmentName}</a></td>
-															</c:when>
-															<c:otherwise>
-																<td><a class="attention-info" href="javascript:void(0)" onclick="openPreview('${workClientAttachment.temporaryUrl}',2)">${workClientAttachment.attachmentName}</a></td>
-															</c:otherwise>
-														</c:choose>
-													</c:otherwise>
-												</c:choose>
-											</c:otherwise>
-										</c:choose>
-									</c:when>
-									<c:otherwise>
-										<c:choose>
-											<c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpg')
-                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'png')
-                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'gif')
-                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'bmp')
-                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpeg')}">
-												<td><img src="${workClientAttachment.url}" width="50" height="50" onclick="openDialogView('预览','${ctx}/sys/picturepreview/picturePreview?url=${workClientAttachment.url}','90%','90%')" alt="${workClientAttachment.attachmentName}">
-											</c:when>
-											<c:otherwise>
-												<c:choose>
-													<c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'pdf')}">
-														<td><a class="attention-info" href="javascript:void(0)" onclick="openPreview('${workClientAttachment.url}',1)">${workClientAttachment.attachmentName}</a></td>
-													</c:when>
-													<c:otherwise>
-														<c:choose>
-															<c:when test="${materialDefectRecord.uploadMode == 2}">
-																<c:choose>
-																	<c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpg')
-                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'png')
-                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'gif')
-                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'bmp')
-                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpeg')}">
-																		<td><img src="${workClientAttachment.temporaryUrl}" width="50" height="50" onclick="openDialogView('预览','${ctx}/sys/picturepreview/picturePreview?url=${workClientAttachment.temporaryUrl}','90%','90%')" alt="${workClientAttachment.attachmentName}">
-																	</c:when>
-																	<c:otherwise>
-																		<c:choose>
-																			<c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'pdf')}">
-																				<td><a class="attention-info" href="javascript:void(0)" onclick="openPreview('${workClientAttachment.temporaryUrl}',1)">${workClientAttachment.attachmentName}</a></td>
-																			</c:when>
-																			<c:otherwise>
-																				<c:choose>
-																					<c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'rar')
-                                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'zip')
-                                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'jar')
-                                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'7z')}">
-																						<td><a class="attention-info" href="javascript:void(0)" onclick="openPreview('${workClientAttachment.temporaryUrl}',3)">${workClientAttachment.attachmentName}</a></td>
-																					</c:when>
-																					<c:otherwise>
-																						<td><a class="attention-info" href="javascript:void(0)" onclick="openPreview('${workClientAttachment.temporaryUrl}',2)">${workClientAttachment.attachmentName}</a></td>
-																					</c:otherwise>
-																				</c:choose>
-																			</c:otherwise>
-																		</c:choose>
-																	</c:otherwise>
-																</c:choose>
-															</c:when>
-															<c:otherwise>
-																<c:choose>
-																	<c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpg')
-                                                   or fn:containsIgnoreCase(workClientAttachment.attachmentName,'png')
-                                                   or fn:containsIgnoreCase(workClientAttachment.attachmentName,'gif')
-                                                   or fn:containsIgnoreCase(workClientAttachment.attachmentName,'bmp')
-                                                   or fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpeg')}">
-																		<td><img src="${workClientAttachment.url}" width="50" height="50" onclick="openDialogView('预览','${ctx}/sys/picturepreview/picturePreview?url=${workClientAttachment.url}','90%','90%')" alt="${workClientAttachment.attachmentName}">
-																	</c:when>
-																	<c:otherwise>
-																		<c:choose>
-																			<c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'pdf')}">
-																				<td><a href="javascript:void(0)" onclick="openPreview('${workClientAttachment.url}',1)">${workClientAttachment.attachmentName}</a></td>
-																			</c:when>
-																			<c:otherwise>
-																				<c:choose>
-																					<c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'rar')
-                                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'zip')
-                                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'jar')
-                                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'7z')}">
-																						<td><a class="attention-info" href="javascript:void(0)" onclick="openPreview('${workClientAttachment.url}',3)">${workClientAttachment.attachmentName}</a></td>
-																					</c:when>
-																					<c:otherwise>
-																						<td><a class="attention-info" href="javascript:void(0)" onclick="openPreview('${workClientAttachment.url}',2)">${workClientAttachment.attachmentName}</a></td>
-																					</c:otherwise>
-																				</c:choose>
-																			</c:otherwise>
-																		</c:choose>
-																	</c:otherwise>
-																</c:choose>
-															</c:otherwise>
-														</c:choose>
-													</c:otherwise>
-												</c:choose>
-											</c:otherwise>
-										</c:choose>
-									</c:otherwise>
-								</c:choose>
 
-								<td>${workClientAttachment.createBy.name}</td>
-								<td><fmt:formatDate value="${workClientAttachment.createDate}" type="both"/></td>
-								<td class="op-td">
-									<div class="op-btn-box" >
-											<%--附件下载删除--%>
-										<c:choose>
-											<c:when test="${materialDefectRecord.uploadMode == 2}">
-												<c:choose>
-													<c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'pdf')}">
-														<a href="${workClientAttachment.temporaryUrl}" target="_blank" class="op-btn op-btn-download"><i class="fa fa-download"></i>&nbsp;下载</a>
-													</c:when>
-													<c:otherwise>
-														<a href="${workClientAttachment.temporaryUrl}" class="op-btn op-btn-download"><i class="fa fa-download"></i>&nbsp;下载</a>
-													</c:otherwise>
-												</c:choose>
-											</c:when>
-											<c:otherwise>
-												<a href="javascript:location.href='${ctx}/workfullmanage/workFullManage/downLoadAttach?file='+encodeURIComponent('${workClientAttachment.url}');" class="op-btn op-btn-download"><i class="fa fa-download"></i>&nbsp;下载</a>
-											</c:otherwise>
-										</c:choose>
-										<c:if test="${workClientAttachment.collectFlag != 1}">
-											<a href="javascript:void(0)" onclick="collectingAccessory(this,'${ctx}/projectAccessory/projectAccessory/saveCollectAccessory','${workClientAttachment.url}','${workClientAttachment.createBy.id}','${workClientAttachment.fileSize}')" class="op-btn op-btn-delete" style="background-color: #FFB800"><i class="layui-icon layui-icon-rate"></i>&nbsp;收藏</a>
-										</c:if>
-										<c:if test="${workClientAttachment.createBy.id eq fns:getUser().id}">
-											<a href="javascript:void(0)" onclick="deleteFileFromAliyun(this,'${ctx}/sys/workattachment/deleteFileFromAliyun?url=${workClientAttachment.url}&id=${workClientAttachment.id}&type=2','addFile_attachment','_attachment')" class="op-btn op-btn-delete" ><i class="fa fa-trash"></i>&nbsp;删除</a>
-										</c:if>
 
-									</div>
-								</td>
-							</tr>
-						</c:forEach>
-						</tbody>
-					</table>
-				</div>
-			</div>
+			<!-- fileHandlerFuncName="myCustomHandler" 自定义函数名 -->
+			<!-- attachmentFlag="6" 附件标识 -->
+			<!-- storeAs="wrkReimbursement" 存储路径标识 -->
+			<!-- showOperateArea="false" 是否展示新增按钮,默认true -->
+			<table:attachmentManager
+					title="说明扫描件"
+					addBtnText="添加附件"
+					baseId="attachment"
+					attachments="${materialDefectRecord.workAttachments}"
+					fileHandlerFuncName="insertTitle"
+					attachmentFlag="99"
+					storeAs="projectRecords"
+			/>
+
+
 
 
 			<div class="form-group layui-row">

+ 14 - 176
src/main/webapp/webpage/modules/ruralprojectrecords/record/projectRepordDescriptionView.jsp

@@ -461,185 +461,23 @@
 									<div id="test2" class="demo-tree-more"></div>
 								</div>
 							</div>
-							<div class="form-group layui-row">
-								<div class="form-group-label"><h2>说明扫描件</h2></div>
-								<div id="addFile_attachment" style="display: none" class="upload-progress">
-									<span id="fileName_attachment" ></span>
-									<b><span id="baifenbi_attachment" ></span></b>
-									<div class="progress">
-										<div id="jindutiao_attachment" class="progress-bar" style="width: 0%" aria-valuenow="0">
-										</div>
-									</div>
-								</div>
-								<input id="attachment_file" type="file" name="attachment_file" multiple="multiple" style="display: none;" onChange="if(this.value)insertTitle(this.value);"/>
-								<span id="attachment_title"></span>
-								<div class="layui-item layui-col-xs12" style="padding:0 16px;">
-									<table id="listAttachment" class="table table-bordered table-condensed details">
-										<thead>
-										<tr>
-												<%-- <th>序号</th>--%>
-											<th>文件预览</th>
-											<th>上传人</th>
-											<th>上传时间</th>
-											<th width="200px">操作</th>
-										</tr>
-										</thead>
-										<tbody id="file_attachment">
-										<c:forEach items="${materialDefectRecord.workAttachments}" var = "workClientAttachment" varStatus="status">
-											<tr>
 
-													<%-- <td>${status.index + 1}</td>--%>
-												<c:choose>
-													<c:when test="${materialDefectRecord.uploadMode == 2}">
-														<c:choose>
-															<c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpg')
-                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'png')
-                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'gif')
-                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'bmp')
-                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpeg')}">
-																<td><img src="${workClientAttachment.temporaryUrl}" width="50" height="50" onclick="openDialogView('预览','${ctx}/sys/picturepreview/picturePreview?url=${workClientAttachment.temporaryUrl}','90%','90%')" alt="${workClientAttachment.attachmentName}">
-															</c:when>
-															<c:otherwise>
-																<c:choose>
-																	<c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'pdf')}">
-																		<td><a class="attention-info" href="javascript:void(0)" onclick="openPreview('${workClientAttachment.temporaryUrl}',1)">${workClientAttachment.attachmentName}</a></td>
-																	</c:when>
-																	<c:otherwise>
-																		<c:choose>
-																			<c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'rar')
-                                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'zip')
-                                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'jar')
-                                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'7z')}">
-																				<td><a class="attention-info" href="javascript:void(0)" onclick="openPreview('${workClientAttachment.temporaryUrl}',3)">${workClientAttachment.attachmentName}</a></td>
-																			</c:when>
-																			<c:otherwise>
-																				<td><a class="attention-info" href="javascript:void(0)" onclick="openPreview('${workClientAttachment.temporaryUrl}',2)">${workClientAttachment.attachmentName}</a></td>
-																			</c:otherwise>
-																		</c:choose>
-																	</c:otherwise>
-																</c:choose>
-															</c:otherwise>
-														</c:choose>
-													</c:when>
-													<c:otherwise>
-														<c:choose>
-															<c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpg')
-                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'png')
-                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'gif')
-                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'bmp')
-                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpeg')}">
-																<td><img src="${workClientAttachment.url}" width="50" height="50" onclick="openDialogView('预览','${ctx}/sys/picturepreview/picturePreview?url=${workClientAttachment.url}','90%','90%')" alt="${workClientAttachment.attachmentName}">
-															</c:when>
-															<c:otherwise>
-																<c:choose>
-																	<c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'pdf')}">
-																		<td><a class="attention-info" href="javascript:void(0)" onclick="openPreview('${workClientAttachment.url}',1)">${workClientAttachment.attachmentName}</a></td>
-																	</c:when>
-																	<c:otherwise>
-																		<c:choose>
-																			<c:when test="${materialDefectRecord.uploadMode == 2}">
-																				<c:choose>
-																					<c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpg')
-                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'png')
-                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'gif')
-                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'bmp')
-                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpeg')}">
-																						<td><img src="${workClientAttachment.temporaryUrl}" width="50" height="50" onclick="openDialogView('预览','${ctx}/sys/picturepreview/picturePreview?url=${workClientAttachment.temporaryUrl}','90%','90%')" alt="${workClientAttachment.attachmentName}">
-																					</c:when>
-																					<c:otherwise>
-																						<c:choose>
-																							<c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'pdf')}">
-																								<td><a class="attention-info" href="javascript:void(0)" onclick="openPreview('${workClientAttachment.temporaryUrl}',1)">${workClientAttachment.attachmentName}</a></td>
-																							</c:when>
-																							<c:otherwise>
-																								<c:choose>
-																									<c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'rar')
-                                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'zip')
-                                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'jar')
-                                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'7z')}">
-																										<td><a class="attention-info" href="javascript:void(0)" onclick="openPreview('${workClientAttachment.temporaryUrl}',3)">${workClientAttachment.attachmentName}</a></td>
-																									</c:when>
-																									<c:otherwise>
-																										<td><a class="attention-info" href="javascript:void(0)" onclick="openPreview('${workClientAttachment.temporaryUrl}',2)">${workClientAttachment.attachmentName}</a></td>
-																									</c:otherwise>
-																								</c:choose>
-																							</c:otherwise>
-																						</c:choose>
-																					</c:otherwise>
-																				</c:choose>
-																			</c:when>
-																			<c:otherwise>
-																				<c:choose>
-																					<c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpg')
-                                                   or fn:containsIgnoreCase(workClientAttachment.attachmentName,'png')
-                                                   or fn:containsIgnoreCase(workClientAttachment.attachmentName,'gif')
-                                                   or fn:containsIgnoreCase(workClientAttachment.attachmentName,'bmp')
-                                                   or fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpeg')}">
-																						<td><img src="${workClientAttachment.url}" width="50" height="50" onclick="openDialogView('预览','${ctx}/sys/picturepreview/picturePreview?url=${workClientAttachment.url}','90%','90%')" alt="${workClientAttachment.attachmentName}">
-																					</c:when>
-																					<c:otherwise>
-																						<c:choose>
-																							<c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'pdf')}">
-																								<td><a href="javascript:void(0)" onclick="openPreview('${workClientAttachment.url}',1)">${workClientAttachment.attachmentName}</a></td>
-																							</c:when>
-																							<c:otherwise>
-																								<c:choose>
-																									<c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'rar')
-                                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'zip')
-                                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'jar')
-                                                       or fn:containsIgnoreCase(workClientAttachment.attachmentName,'7z')}">
-																										<td><a class="attention-info" href="javascript:void(0)" onclick="openPreview('${workClientAttachment.url}',3)">${workClientAttachment.attachmentName}</a></td>
-																									</c:when>
-																									<c:otherwise>
-																										<td><a class="attention-info" href="javascript:void(0)" onclick="openPreview('${workClientAttachment.url}',2)">${workClientAttachment.attachmentName}</a></td>
-																									</c:otherwise>
-																								</c:choose>
-																							</c:otherwise>
-																						</c:choose>
-																					</c:otherwise>
-																				</c:choose>
-																			</c:otherwise>
-																		</c:choose>
-																	</c:otherwise>
-																</c:choose>
-															</c:otherwise>
-														</c:choose>
-													</c:otherwise>
-												</c:choose>
 
-												<td>${workClientAttachment.createBy.name}</td>
-												<td><fmt:formatDate value="${workClientAttachment.createDate}" type="both"/></td>
-												<td class="op-td">
-													<div class="op-btn-box" >
-															<%--附件下载删除--%>
-														<c:choose>
-															<c:when test="${materialDefectRecord.uploadMode == 2}">
-																<c:choose>
-																	<c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'pdf')}">
-																		<a href="${workClientAttachment.temporaryUrl}" target="_blank" class="op-btn op-btn-download"><i class="fa fa-download"></i>&nbsp;下载</a>
-																	</c:when>
-																	<c:otherwise>
-																		<a href="${workClientAttachment.temporaryUrl}" class="op-btn op-btn-download"><i class="fa fa-download"></i>&nbsp;下载</a>
-																	</c:otherwise>
-																</c:choose>
-															</c:when>
-															<c:otherwise>
-																<a href="javascript:location.href='${ctx}/workfullmanage/workFullManage/downLoadAttach?file='+encodeURIComponent('${workClientAttachment.url}');" class="op-btn op-btn-download"><i class="fa fa-download"></i>&nbsp;下载</a>
-															</c:otherwise>
-														</c:choose>
-														<c:if test="${workClientAttachment.collectFlag != 1}">
-															<a href="javascript:void(0)" onclick="collectingAccessory(this,'${ctx}/projectAccessory/projectAccessory/saveCollectAccessory','${workClientAttachment.url}','${workClientAttachment.createBy.id}','${workClientAttachment.fileSize}')" class="op-btn op-btn-delete" style="background-color: #FFB800"><i class="layui-icon layui-icon-rate"></i>&nbsp;收藏</a>
-														</c:if>
-
-													</div>
-												</td>
-											</tr>
-										</c:forEach>
-										</tbody>
-									</table>
-								</div>
-							</div>
 
+							<!-- fileHandlerFuncName="myCustomHandler" 自定义函数名 -->
+							<!-- attachmentFlag="6" 附件标识 -->
+							<!-- storeAs="wrkReimbursement" 存储路径标识 -->
+							<!-- showOperateArea="false" 是否展示新增按钮,默认true -->
+							<table:attachmentManager
+									title="说明扫描件"
+									addBtnText="添加附件"
+									baseId="attachment"
+									attachments="${materialDefectRecord.workAttachments}"
+									fileHandlerFuncName="insertTitle"
+									attachmentFlag="99"
+									storeAs="projectRecords"
+									showOperateArea="false"
+							/>