<!DOCTYPE html> 
 | 
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro"> 
 | 
  
 | 
<head> 
 | 
    <th:block th:include="include :: header('文档描述列表')" /> 
 | 
       <th:block th:include="include :: select2-css" /> 
 | 
</head> 
 | 
  
 | 
<body class="gray-bg"> 
 | 
    <div class="container-div"> 
 | 
        <div class="row"> 
 | 
            <div class="col-sm-12 search-collapse"> 
 | 
                <form id="formId"  enctype="multipart/form-data"> 
 | 
                    <div class="select-list"> 
 | 
                        <ul> 
 | 
                            <li> 
 | 
                                <p>匹配字段:</p> 
 | 
                                <select id="docId" name="docId" class="form-control m-b"> 
 | 
                                     <option value="filename">图片名称</option> 
 | 
                                </select> 
 | 
                            </li> 
 | 
                      
 | 
                             <li> 
 | 
                                <p>压缩包:</p> 
 | 
                               <input type="file" id="file" name="file"/>        
 | 
                             </li>   
 | 
                              
 | 
                             <li> 
 | 
                                 <a class="btn btn-primary btn-rounded btn-sm" onclick="upload()"><i class="fa fa-search"></i> 上传</a> 
 | 
                             </li>   
 | 
                                
 | 
                        </ul> 
 | 
                    </div> 
 | 
                </form> 
 | 
            </div> 
 | 
  
 | 
            <div class="col-sm-12 select-table table-striped"> 
 | 
                <span>1、单个或者多个文件请以.ZIP压缩包的形式上传,把单个或者多个文件放到文件夹中,压缩文件夹为zip格式<br> </span> 
 | 
                <span>1、附件名称需要与系统内的资料名称一致<br> </span> 
 | 
                <span>2、文件不允许包含特殊字符:空格 、正反斜线、问号、星号等<br> </span> 
 | 
                <span>3、上传文件经过了 解压 、 移动  、遍历 、更新数据库等多个步骤,请耐心等待<br> </span> 
 | 
            </div> 
 | 
         
 | 
        </div> 
 | 
    </div> 
 | 
  
 | 
    <th:block th:include="include :: footer" /> 
 | 
    <th:block th:include="include :: select2-js" /> 
 | 
    <script th:inline="javascript"> 
 | 
     
 | 
    function upload(){ 
 | 
        var file = $('#file').val(); 
 | 
        if (file == '' || (!$.common.endWith(file, '.zip'))){ 
 | 
            $.modal.msgWarning("请选择压缩包"); 
 | 
            return false; 
 | 
        } 
 | 
     
 | 
        var formData = new FormData(); 
 | 
        formData.append("file", $('#file')[0].files[0]); 
 | 
        formData.append("fieldname", $('#docId').val()); 
 | 
        $.modal.loading("数据上传解析中"); 
 | 
  
 | 
        $.ajax({ 
 | 
            url: ctx + "geo/projectData/uploadZIP", 
 | 
            data: formData, 
 | 
            cache: false, 
 | 
            contentType: false, 
 | 
            processData: false, 
 | 
            type: 'POST', 
 | 
            success: function (result) { 
 | 
                if (result.code == web_status.SUCCESS) { 
 | 
                    $.modal.closeLoading();     
 | 
                    $.modal.alertSuccess(result.msg); 
 | 
                } else if (result.code == web_status.WARNING) { 
 | 
  
 | 
                    $.modal.closeLoading();         
 | 
                    $.modal.alertWarning(result.msg) 
 | 
                } else { 
 | 
                 
 | 
                    $.modal.closeLoading(); 
 | 
                    $.modal.alertError(result.msg); 
 | 
                } 
 | 
            } 
 | 
        }); 
 | 
    } 
 | 
  
 | 
    </script> 
 | 
</body> 
 | 
  
 | 
</html> 
 |