104 lines
5.2 KiB
Plaintext
104 lines
5.2 KiB
Plaintext
<%@ page contentType="text/html; charset=GBK"%><%@
|
|
include file="/IncludeBegin.jsp"%><%
|
|
/*
|
|
Ò³ÃæËµÃ÷:Îĵµ¸½¼þÁбí
|
|
*/
|
|
String sDocNo = CurPage.getParameter("RELATIVE_ID");
|
|
boolean isReadOnly = "true".equals(CurPage.getParameter("isRead"));
|
|
String compClientID = request.getParameter("CompClientID");
|
|
%>
|
|
<link rel="stylesheet" type="text/css" href="<%=sWebRootPath%>/Frame/page/resources/css/attachment.css"/>
|
|
<body style="height: 100%;overflow: hidden;">
|
|
<div class="attachment_wrap" name="attachment_wrap" style="height:30px;">
|
|
<%
|
|
String iconClass = "icon icon_file";
|
|
int attachmentSize=0;
|
|
DecimalFormat FORMAT = new DecimalFormat("###.0");
|
|
List<BizObject> list = JBOFactory.createBizObjectQuery("jbo.app.tenwa.doc.LB_DOCATTRIBUTE",
|
|
"select id,FileName,CONTENT_TYPE,FILESIZE,INPUTTIME,INPUTUSERID,remark from O left join jbo.app.tenwa.doc.LB_DOCLIBRARY lib on O.library_id=lib.id where lib.relative_id=:id order by INPUTTIME desc")
|
|
.setParameter("id", sDocNo).getResultList(false);
|
|
attachmentSize=list.size();
|
|
for(BizObject bo : list){
|
|
String isEdit="false";
|
|
String attachmentNo = bo.getAttribute("id").getString();
|
|
String fileName = bo.getAttribute("FileName").getString();
|
|
String showFileName=fileName.length()>14?fileName.substring(0, 14)+".....":fileName;
|
|
String sContentType = bo.getAttribute("CONTENT_TYPE").getString().trim();
|
|
String begintime=bo.getAttribute("INPUTTIME").getString().trim();
|
|
String inputuser=NameManager.getUserName(bo.getAttribute("INPUTUSERID").getString().trim());
|
|
String remark=bo.getAttribute("remark").getString().trim();
|
|
if(sContentType.equals("application/msword") || sContentType.equals("application/kswps")||sContentType.indexOf("officedocument.wordprocessingml.document")>0) iconClass = "icon icon_word";
|
|
else if(sContentType.equals("application/vnd.ms-excel") || sContentType.equals("application/kset")||sContentType.indexOf("officedocument.spreadsheetml.sheet")>0) iconClass = "icon icon_excel";
|
|
else if(sContentType.equals("application/vnd.ms-powerpoint")) iconClass = "icon icon_ppt";
|
|
else if(sContentType.equals("application/pdf")) iconClass = "icon icon_pdf";
|
|
else if(sContentType.equals("image/bmp")) iconClass = "icon icon_bmp";
|
|
else if(sContentType.equals("image/gif")) iconClass = "icon icon_gif";
|
|
else if(sContentType.equals("image/jpeg")) iconClass = "icon icon_jpeg";
|
|
else if(sContentType.equals("image/png") || sContentType.equals("image/x-png")) iconClass = "icon icon_png";
|
|
else if (sContentType.equals("application/zip")
|
|
|| sContentType.equals("application/x-rar")
|
|
|| sContentType.equals("application/x-java-archive")
|
|
|| sContentType.equals("application/x-7z-compressed")){
|
|
iconClass = "icon icon_compress";
|
|
}else if(sContentType.equals("text/plain")) iconClass = "icon icon_text";
|
|
else if(sContentType.equals("text/html")) iconClass = "icon icon_html";
|
|
else if(sContentType.equals("text/css")) iconClass = "icon icon_css";
|
|
else iconClass = "icon icon_file";
|
|
double iContentLength = bo.getAttribute("FILESIZE").getDouble(); //×Ö½ÚÊý
|
|
String sLength ="";
|
|
if(iContentLength >= 1024*1024) sLength = FORMAT.format(iContentLength/(1024*1024)) +" MB";
|
|
else sLength = FORMAT.format(iContentLength/1024) +" KB";
|
|
if(iconClass.equals("icon icon_word")||iconClass.equals("icon icon_excel")||iconClass.equals("icon icon_ppt")){
|
|
isEdit="true";
|
|
}
|
|
%>
|
|
<div class="attachment_block" >
|
|
<div class="attachment_show">
|
|
<div>
|
|
<%
|
|
if(isReadOnly==false){%>
|
|
<a class="attachment_delete" title="ɾ³ý¸½¼þ" href="javascript:void(0);" onmousedown="AsLink.stopEvent(event);" onclick="deleteFile('<%=attachmentNo%>');return false;" hidefocus=""> </a>
|
|
<%} %>
|
|
</div>
|
|
<table style="width:100%">
|
|
<tr>
|
|
<td rowspan="4"><span class="<%=iconClass%>" style="margin-top:0px;"></span></td>
|
|
<td><a class="attachment_name" title="<%=fileName %>" onclick="downloadFile('<%=attachmentNo%>');return false;"><%=showFileName%></a></td>
|
|
</tr>
|
|
<tr><td>ÉÏ´«ÈË :<%=inputuser%></td></tr>
|
|
<tr><td>ÉÏ´«Ê±¼ä:<%=begintime%></td></tr>
|
|
<tr><td><div class="attachment_info">´óС£º <%=sLength%></div></td></tr>
|
|
</table>
|
|
</div>
|
|
<div class="attachment_shadow"></div>
|
|
</div>
|
|
<%} %>
|
|
</div>
|
|
|
|
</body>
|
|
<script type="text/javascript">
|
|
(function(){
|
|
var body = $(document.body);
|
|
var div1 = $(">div:eq(0)", body);
|
|
$(window).resize(function(){
|
|
div1.height(body.innerHeight());
|
|
if(window.parent.setIframeHeight){
|
|
window.parent.setIframeHeight("<%=sDocNo%>",div1[0].scrollHeight,"<%=attachmentSize%>");
|
|
}
|
|
}).resize();
|
|
})();
|
|
|
|
function downloadFile(id){
|
|
if(!frames["downloadTemplate"]) $("<iframe name='downloadTemplate' style='display:none;'></iframe>").appendTo("body");
|
|
window.open(sWebRootPath+"/servlet/view/docDownloadServlet?CompClientID=<%=sCompClientID%>&sqlString=save@"+id, "downloadTemplate");
|
|
}
|
|
function deleteFile(id){
|
|
if(confirm("ÊÇ·ñɾ³ý£¿")){
|
|
var sParams="attId="+id;
|
|
var sReturnInfo = RunJavaMethodTrans("com.tenwa.doc.action.DocListAction","deleteAttr",sParams);
|
|
reloadSelf();
|
|
};
|
|
}
|
|
|
|
</script>
|
|
<%@ include file="/IncludeEnd.jsp"%> |