<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<!DOCTYPE html>
<html>

<head>
    <%@include file="/WEB-INF/views/include/head.jsp" %>
</head>
<style>
    .file {
        position: relative;
        display: inline-block;
        background: #D0EEFF;
        border: 1px solid #99D3F5;
        border-radius: 4px;
        padding: 4px 12px;
        overflow: hidden;
        color: #1E88C7;
        text-decoration: none;
        text-indent: 0;
        line-height: 20px;
    }
    .file input {
        position: absolute;
        font-size: 100px;
        right: 0;
        top: 0;
        opacity: 0;
    }
    .file:hover {
        background: #AADFFD;
        border-color: #78C3F3;
        color: #004974;
        text-decoration: none;
    }
</style>
<%@ page isELIgnored="false"%>
<body>
<div class="pageContent" >
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-content">
                    (excel 格式 第一列姓名 第二列对应证件号)
                   <form class="form-horizontal m-t" method="post" id="batchSecurity" enctype="multipart/form-data" action="<c:url value='/manage/security/exportAppPhoto.json?sid=${sid}' />" class="pageForm required-validate" onsubmit="return validateCallbackDow2(this); ">
                       <a href="javascript:;" class="file">
                        <p><input  type="file" name="file"  class="file">选择文件</p>

                       </a>
                    </form>
                    <span class="showFileName"></span>
                    <span class="fileerrorTip"></span>
                </div>
            </div>
        </div>
    </div>
</div>
<%@include file="/WEB-INF/views/include/foot.jsp" %>
<script type="text/javascript">
    $('form').validate();


    $(".file").on("change","input[type='file']",function(){
        var filePath=$(this).val();
        if(filePath.indexOf("xls")!=-1 || filePath.indexOf("xlsx")!=-1){
            $(".fileerrorTip").html("").hide();
            var arr=filePath.split('\\');
          debugger;
            var fileName=arr[arr.length-1];
            $(".showFileName").html(fileName);
        }else{
            $(".showFileName").html("");
            $(".fileerrorTip").html("您未上传文件，或者您上传文件类型有误！").show();
            return false
        }
    })
</script>
</body>
</html>