地质所 沉降监测网建设项目
zmk
2024-05-17 8722d2bb39c6c0697647e77a879d14b28d3ef0f5
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
<!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>&nbsp;上传</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>