<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/include/taglib.jsp"%>
<!DOCTYPE html>
<html>
<head>
<%@ include file="/include/header2.jsp"%>

<script src="${ctx}/component/My97DatePicker/WdatePicker.js" type="text/javascript"></script>
<title>案件白名单</title>
<style>
	/*导入数据按钮,2018-01-08*/
	/*.exportData_btn{
		color: #fff;
		margin-top: 10px;
	}
	.exportData_btn li{
		float: left;
		margin-right: 5px;
	}
	.exportData_btn li .data_btn{
		cursor: pointer;
	    height: 22px;
	    padding: 1px 5px;
	    text-align: center;
	    line-height: 22px;
	    background-color: #00bb9c;
	    border-radius: 3px;
	}*/
	.reSearch button{
		float: left;
		margin-right: 6px;
	}
</style>
</head>
<body class="bg1">
	<div class="headCon">
		<jsp:include page="/WEB-INF/jsp/top2.jsp">
			<jsp:param name="index" value="专项模型" />
		</jsp:include>
	</div>	
	<div class="clear"></div>

	<div class="container_fluid">
		<div class="searchCon left_menu managerLeft">
			<jsp:include page="/include/manageLeft.jsp">
				<jsp:param name="index" value="案件白名单" />
			</jsp:include>
		</div>
	<!-- <div id="resultCon1" class="resultCon" style="margin-left: 255px;"> -->
		<div class="resultCon" style="margin-left: 255px;position:relative;">
			<input type="hidden" id="CSRFToken" value="${csrfToken }"/>
			<div class="reSearch">
				<div class="p_bar" style="border-bottom: 1px dashed #afb4bb;">您当前的位置：案件白名单</div>
				<div class="search-group" style="overflow:hidden;">
					<button class="btn btn-primary" id="importBtn"><span class="glyphicon glyphicon-file" aria-hidden="ture"></span>导入</button>
					<button style="display:none;"><input type="file" id="importBtnCon" name="markFile"/></button>
					<button class="btn btn-primary" id="importModelBtn"><span class="glyphicon glyphicon-import" aria-hidden="ture"></span>下载模板</button>	
				</div>	
			</div>
		</div>
	</div>	

	<!-- 模态框（Modal）,正在导入 -->
 	<div id="importModal" style="width: 100%;position: absolute;top: 0;bottom: 0;z-index: 999999999;background-color: rgba(0,0,0,0.5);color:#eee;font-size: 32px;display: none;align-items: center;justify-content: center;">正在导入...</div>

	<script src="${ctx}/js/lib/core.js"></script>
	<script src="${ctx}/js/lib/perfect-scrollbar.jquery.js"></script>
	<script src="${ctx}/js/lib/jquery.ajaxfileupload.js"></script>
	<script>		
		//导入数据
		$(function(){
			//导入数据模板下载
			$("#importModelBtn").click(function(){
				window.location.href="${ctx}/sysTaskPlus/updateWeaverStatus.do";
			});
			//导入数据
			$("#importBtn").click(function(){
				$("#importBtnCon").click();
			})
			$("#importBtnCon").ajaxfileupload({
			    action:'${ctx}/baseInfo/updateCaseStatus.do',
			    valid_extensions : ['xls','xlsx'],
			    params: {
					extra: 'markFile'
			    },				
			    onComplete: function(data,a,b,c) {
					if(data.status=="err"){
						alert(data.mess);
						$("#importBtn").text("导入");
						$("#importModal").css("display","none");
						return;
					}else{
						alert(data.mess);
						$("#importBtn").text("导入");
						$("#importModal").css("display","none");
					}
					var result=data;

					console.log(data);
					//alert(JSON.stringify(data));
			    },
			    onStart: function() {
			    	$("#importModal").css("display","flex");
					$("#importBtn").text("正在导入...");
					$("#importBtn").attr("title","正在导入...");
					//if(weWantedTo) return false; // cancels upload
			    },
			    onCancel: function() {
					console.log('no file selected');
			    },
				errow:function(data){
					alert("上传失败");
				}
			});
			//窗口大小变化
			$(".searchCon").perfectScrollbar();
			resize();
            $(window).resize(function(){
				resize();
			});
			function resize(){
				//获取窗口高度
				var windowheight=$(window).height();
				var leftList = windowheight-40;
				$(".searchCon").css({"height":leftList+"px"});
				$(".resultCon").css({"height":leftList-10+"px"});
				$(".searchCon").perfectScrollbar("update");
			}
		});
	</script>
</body>
</html>
