
<div class="layuimini-main">

              
    <div class="layui-form">
     

      
     
 
<div class="layui-upload-drag" id="test10">
   <i class="layui-icon"></i>
  <p>点击上传，或将文件拖拽到此处，必须 是xlsx文件</p>
  <div class="layui-hide" id="uploadDemoView">
    <hr>
    <img src="" alt="上传成功后渲染" style="max-width: 196px">
  </div>
</div>
        
        

     
    </div>
</div>


<script>
    layui.use(['form', 'table','laydate','upload','miniAdmin'], function () {
       var form = layui.form,
            layer = layui.layer,
            upload = layui.upload,
            table = layui.table,
            miniAdmin = layui.miniAdmin,
            $ = layui.jquery;
         
          laydate = layui.laydate;
        /**
         * 初始化表单，要加上，不然刷新部分组件可能会不加载
         */
        form.render();
      
        //执行实例
    var uploadInst = upload.render({
     elem: '#test10' //绑定元素
    ,url: '<?=u(MOD,ACT,array("sub"=>1))?>' //上传接口
    ,accept: 'file' //允许上传的文件类型
    ,exts:"xlsx"
    ,multiple:true,
    number:1
    
    ,done: function(res){
      //上传完毕回调
      if (res.code==1){
        miniAdmin.success("导入成功")
        window.location.href="res.data.url";
      }else{
        miniAdmin.error(res.data.msg)
      }
  }
    ,error: function(){
      //请求异常回调
      
    }
  });



       

    });
</script>

<div id="msg">
  
  <div class="msgitem">zip文件上传解析中...</div>
  
</div>
<style type="text/css">
  #msg{padding: 20px; display: none}
  .msgitem{line-height: 30px;font-size: 14px}
  .red{color: red}
</style>