<apex:page action="{!init}" controller="AttachmentPreviewController" id="allPage" showheader="false" sidebar="false">
|
<apex:stylesheet value="{!URLFOR($Resource.blockUIcss)}">
|
</apex:stylesheet>
|
<apex:includescript value="{!URLFOR($Resource.jquery183minjs)}">
|
</apex:includescript>
|
<apex:includescript value="{!URLFOR($Resource.PleaseWaitDialog)}">
|
</apex:includescript>
|
<apex:includescript value="/soap/ajax/29.0/connection.js">
|
</apex:includescript>
|
<apex:includescript value="/soap/ajax/29.0/apex.js">
|
</apex:includescript>
|
<style type="text/css">
|
body {
|
margin: 0;
|
}
|
table {
|
border-collapse: collapse;
|
border-spacing: 0;
|
}
|
|
td,th {
|
padding: 0;
|
}
|
|
.pure-table {
|
border-collapse: collapse;
|
border-spacing: 0;
|
empty-cells: show;
|
border: 1px solid #cbcbcb;
|
}
|
|
.pure-table caption {
|
color: #000;
|
font: italic 85%/1 arial,sans-serif;
|
/* padding: 1em 0;*/
|
text-align: center;
|
}
|
|
.pure-table td,.pure-table th {
|
border-left: 1px solid #cbcbcb;
|
border-width: 0 0 0 1px;
|
font-size: inherit;
|
margin: 0;
|
overflow: visible;
|
padding: .5em 1em;
|
}
|
|
.pure-table thead {
|
background-color: #c3bfbf;
|
color: #000;
|
text-align: left;
|
vertical-align: bottom;
|
}
|
|
.pure-table td {
|
background-color: transparent;
|
}
|
.pure-table-horizontal td,.pure-table-horizontal th {
|
border-width: 0 0 1px 0;
|
border-bottom: 1px solid #cbcbcb;
|
}
|
|
.pure-table-horizontal tbody>tr:last-child>td {
|
border-bottom-width: 0;
|
}
|
</style>
|
<!-- 20201224 liying statr -->
|
<script language="javascript" type="text/javascript">
|
//20201225 liying start
|
//判断附件名称后缀名
|
function openUrl(id,name){
|
var picArr=['jpg','png','jpeg','PNG','JPG','JPEG','bmp','BMP'];
|
var wordArr=['doc','pdf','PDF','xlsx','xls','csv','txt','docx','mov','DOC','XLSX','XLS','CSV','TXT','DOCX','MOV'];
|
//lastIndexOf 是要判断最后一个'.',判断出来才能根据后缀截取
|
//IndexOf 如果在名称中包含'.'则判断不出来
|
|
//定义后缀名 suffix
|
var suffix=name.substring(name.lastIndexOf('.')+1);
|
if(picArr.indexOf(suffix)>-1){
|
if((!!window.ActiveXObject || "ActiveXObject" in window)&&(suffix=='bmp'||suffix=='BMP')) {
|
alert("IE浏览器不能打开后缀是bmp的文件,请使用其他浏览器!");
|
}
|
else{
|
window.location.href=' https://ocsm--stagefull--c.visualforce.com/apex/eSignFormAttachment?id='+id;
|
// window.location.href=' https://ocsm--c.ap0.visual.force.com/apex/eSignFormAttachment?id='+id;
|
}
|
}else{
|
window.location.href='https://ocsm--stagefull--c.documentforce.com/servlet/servlet.FileDownload?file='+id;
|
// window.location.href='https://ocsm--c.ap0.content.force.com/servlet/servlet.FileDownload?file='+id;
|
}
|
}
|
|
|
// 20201225 liying end
|
// 20201224 liying start
|
// 返回按钮根据传id返回上一级操作
|
function test(){
|
var queryVal=GetQueryValue('parentId');
|
var url='https://ocsm--stagefull.my.salesforce.com/'+queryVal;
|
// var url='https://ocsm.my.salesforce.com/'+queryVal;
|
window.location.href=url;
|
}
|
// 20201224 liying end
|
//js取参
|
//20201221 liying start
|
function GetQueryValue(queryName) {
|
var query = decodeURI(window.location.search.substring(1));
|
var vars = query.split("&");
|
for (var i = 0; i < vars.length; i++) {
|
var pair = vars[i].split("=");
|
if (pair[0] == queryName) { return pair[1]; }
|
}
|
return null;
|
}
|
//20201221 liying end
|
</script>
|
<body>
|
<div style="height: 40px;background-color:#0f218b;width: 100%; ">
|
<h1 style="color: white;margin-left: 45%;font-size: 24px;">
|
附件一览表
|
</h1>
|
</div>
|
<table class="pure-table pure-table-horizontal" id="theTable_header" styleclass="list" style="width: 100%">
|
<thead>
|
<tr style="text-align: center;">
|
<th scope="col" style="width:60%; font-size: 13px;text-align: center;">
|
附件名称
|
</th>
|
<apex:variable rendered="{!IF(attachmentInfo.isShow,true,false)}" value="Society" var="Society">
|
<th scope="col" style="width: 40%;font-size: 13px;text-align: center;">
|
附件类型
|
</th>
|
</apex:variable>
|
<!-- <td scope="col" style="width: 40%;height: 30px;">
|
附件类型
|
</td> -->
|
</tr>
|
</thead>
|
</table>
|
<div id="tablediv" style="overflow:auto; width: 100%; height:100%;">
|
<apex:datatable border="0" id="theTable_content" style="width:100%;border-bottom-width: 0px; font-size:11px; border-spacing:0;" styleclass="list" value="{!attachmentInfo.attachMentList}" var="attach">
|
<apex:column style="width: 60%; height: 25px;text-align: center;font-size: 13px;
|
border-left: 1px solid #cbcbcb;">
|
<!-- //javascript:void(0) 为了实现a标签跳转 -->
|
<a href="javascript:void(0);" onclick="openUrl('{!attach.Id}','{!attach.Name}')">
|
<apex:outputfield id="attachMentName" value="{!attach.Name}">
|
</apex:outputfield>
|
</a>
|
</apex:column>
|
<apex:column style="width:40%; height: 25px;text-align: center; font-size: 13px; border-right: 1px solid #cbcbcb;">
|
<apex:variable rendered="{!IF(attachmentInfo.isShow,true,false)}" value="Society1" var="Society1">
|
<apex:outputtext value="{!attach.ContentType}">
|
</apex:outputtext>
|
</apex:variable>
|
</apex:column>
|
</apex:datatable>
|
</div>
|
<input id="left" onclick="test()" style="margin-left: 80%; margin-top: 100px;border-radius: 3px; /* 边框半径 */width: 50px; height: 30px;background: #1E90FF; /* 背景颜色 */ cursor: pointer; /* 鼠标移入按钮范围时出现手势 */
|
outline: none; /* 不显示轮廓线 */font-family: Microsoft YaHei; /* 设置字体 */color: white; /* 字体颜色 */font-size: 14px; /* 字体大小 */border: 1px solid #1E90FF " type="button" value="返回"/>
|
</body>
|
</apex:page>
|