<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/webpage/include/taglib.jsp"%>
<html>
<head>
	<title>项目竣工附件查看</title>
	<meta name="decorator" content="default"/>
	<style type="text/css">
		.table{
			margin-bottom: 0px;
		}
	</style>
	<script type="text/javascript">
		$(function(){
		    var oneSize = $(".oneTab").size();
		    for(var i = 0;i < oneSize;i++){
                var hei = $(".twoTab:eq("+i+")").parent().height();
                $(".oneTab:eq("+i+")").css("height",hei)
                    .css("vertical-align","middle")
                    .css("line-height",hei+"px")
                $(".twoTab:eq("+i+")").css("height",hei);
			}
		})
		function urlRedict(id,file,attach,attachment){
            var index = parent.layer.load(0, {shade: false});
            $.post("${ctx}/workfullmanage/workFullManage/deleteFile",
				{"id":id,"file":file,"attach":attach,"attachment":attachment},
				function(result){
		        	var d = JSON.parse(result);
					if(d.str){
					    location.reload();
					    parent.layer.msg("删除成功！！！",{icon:6});
					    parent.layer.close(index);
					}
				});
		}
	</script>
</head>
<body class="hideScroll">
<div class="wrapper wrapper-content">
	<div class="ibox">
		<div class="ibox-content">
			<div class="col-sm-12">
				<div class="col-sm-2 gray-bg text-center oneTab">
					<label>附件信息</label>
				</div>
				<div class="col-sm-10 " >
					<!-- 表格 -->
					<table class="table table-striped table-bordered table-hover table-condensed dataTables-example twoTab">
						<thead>
							<tr>
								<%--<th>序号</th>--%>
								<th>文件名称</th>
								<th>上传人</th>
								<th>上传时间</th>
								<th>操作</th>
							</tr>
						</thead>
						<tbody>
							<c:forEach items="${list}" var="workClientAttachment" varStatus="status">
								<tr>
									<%--<td>${status.index + 1}</td>--%>
									<%--<td>${workAttach.attachmentName}</td>--%>
									<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,'jpeg')}">
											<td><img src="${workClientAttachment.url}" width="50" height="50" alt="${workClientAttachment.attachmentName}"/></td>
										</c:when>
										<c:otherwise>
											<c:choose>
												<c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'pdf')}">
													<td><a href="${workClientAttachment.url}">${workClientAttachment.attachmentName}</a></td>
												</c:when>
												<c:otherwise>
													<td><a href="javascript:void(0)" onclick="openDialogViewPre('预览','${ctx}/previewController/previewUrl?fileUrl=${workClientAttachment.url}','80%','80%')">${workClientAttachment.attachmentName}</a></td>
												</c:otherwise>
											</c:choose>
										</c:otherwise>
									</c:choose>
									<td>${workClientAttachment.createBy.name}</td>
									<td><fmt:formatDate value="${workClientAttachment.createDate}" pattern="yyyy-MM-dd HH:mm:ss" /> </td>
									<td>
										<a href="${ctx}/workfullmanage/workFullManage/downLoadAttach?file=${workClientAttachment.url}" class="btn btn-success btn-xs">下载</a>
										<%--<a href="javascript:void(0)" onclick=urlRedict("${id}","${workAttach.url}","${workAttach.id}","${workAttach.attachmentFlag}") class="btn btn-danger btn-xs">删除</a>--%>
									</td>
								</tr>
							</c:forEach>
						</tbody>
					</table>
				</div>
			</div>
		</div>
	</div>
</div>
</body>
</html>