多单位版国产化地质资料管理系统
zhai
2025-11-17 378d576468f1378179a8a184e78b8aa6309edc0f
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
<%@ page language="java" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
            + path + "/";
%>
 
<!DOCTYPE HTML>
<html>
<head>
    <base href="<%=basePath%>">
    <meta name="viewport" charset="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>数据导入</title>
    <!--[if !IE]><!-->
    <link href="static/plugins/font-awesome/css/font-awesome.css" rel="stylesheet" type="text/css">
    <!--<![endif]-->
    <!--[if gt IE 8]>
    <link href="static/plugins/font-awesome/css/font-awesome.css" rel="stylesheet" type="text/css">
    <![endif]-->
    <link href="static/plugins/jquery-easyui/themes/bootstrap/easyui.css" rel="stylesheet" type="text/css">
    <link rel="stylesheet" href="static/styles/initialize.css" type="text/css">
    <link rel="stylesheet" href="static/styles/common.css" type="text/css">
    <link rel="stylesheet" href="static/plugins/layer/skin/default/layer.css" type="text/css">
    <link rel="stylesheet" href="static/plugins/webuploader/webuploader.css" type="text/css">
 
    <script type="text/javascript" src="static/plugins/jquery/jquery.min.js"></script>
    <script type="text/javascript" src="static/plugins/jquery-easyui/jquery.easyui.min.js"></script>
    <script type="text/javascript" src="static/plugins/jquery-easyui/locale/easyui-lang-zh_CN.js"></script>
    <script type="text/javascript" src="static/scripts/easyuiExtend.js"></script>
    <script type="text/javascript" src="static/scripts/jquery-extend.js"></script>
    <script type="text/javascript" src="static/plugins/layer/layer.js"></script>
    <script type="text/javascript" src="static/plugins/slimScroll/jquery.slimscroll.min.js"></script>
    <script type="text/javascript" src="static/plugins/jquery-easyui-datagrid-dnd/datagrid-dnd.js"></script>
    <script src="static/plugins/jquery.redirect.js" type="text/javascript"></script>
    <script type="text/javascript" src="static/plugins/webuploader/webuploader.js"></script>
 
    <!-- 弹窗加载组件 -->
    <script type="text/javascript" src="static/plugins/layer/layer.js"></script>
    <script type="text/javascript" src="static/plugins/spinjs/spin.js"></script>
    <script type="text/javascript" src="static/plugins/spinjs/jquery.spin.js"></script>
    <script type="text/javascript" src="static/plugins/jquery.blockUI.js"></script>
    <!-- wcp组件 -->
    <script type="text/javascript" src="static/wcp/scripts/wcp.js"></script>
    <script type="text/javascript" src="static/wcp/scripts/libs/wcp.layer.js"></script>
    <script type="text/javascript" src="static/wcp/scripts/libs/wcp.blockUI.js"></script>
    <script type="text/javascript" src="static/wcp/scripts/libs/wcp.spin.js"></script>
    <script type="text/javascript" src="static/wcp/scripts/libs/wcp.jquery.js"></script>
 
    <!--[if lt IE 9]>
    <script type="text/javascript" src="static/plugins/json2.js"></script>
    <![endif]-->
    <script type="text/javascript" src="static/wcp/scripts/libs/wcp.infoPicker.js"></script>
    <style>
        .combobox-group {
            clear: both;
        }
 
        .combobox-gitem {
            float: left;
            padding-right: 10px;
        }
 
        .progress {
            border: 1px solid #1483d8;
            width: 100%;
            background: #fff;
            height: 18px;
            /*line-height: 20px;*/
            display: inline-block;
            text-align: center;
            color: #6dbfff;
            position: absolute;
            margin-right: 10px;
            top: 290px;
        }
 
        .progress span.percentage {
            width: 0;
            height: 100%;
            left: 0;
            top: 0;
            background: #1483d8;
            position: absolute;
        }
 
        .progress span.text {
            position: relative;
            z-index: 10;
        }
    </style>
 
</head>
<body>
<div class="margin-lr">
    <div class="pt-main-top clear">
        <div class="pt-nav">
                <span class="pt-title-icon"> <i class="fa fa-upload"></i>
                </span>
            <div class="pt-title">
                <div>
                    <h4>xml数据导入信息</h4>
                </div>
            </div>
        </div>
    </div>
    <div class="pt-form">
        <form id="formImportTemplate">
            <div class="ptbody">
                <table style="width: 100%;">
                        <tr>
                            <td class="tbtitle">移交时间:</td>
                            <td>
                                <div>
                                    <input id="startData" class="easyui-datebox" style="width:200px"
                                           required="required" data-options="required:true,showSeconds:false"><br/>
                                        <%--                                <input class="easyui-datetimebox" name="birthday" data-options="required:true,showSeconds:false" value="3/4/2010 2:3" style="width:150px">--%>
                                </div>
                            </td>
                        </tr>
                    <tr>
                        <td class="tbtitle">文件:</td>
                        <td>
                            <div>
                                <div id="picker">选择文件</div>
                                <div style="margin-top:10px;">
                                    <span id="fileName"></span>
                                </div>
                            </div>
                        </td>
                    </tr>
                </table>
                <div class="progress" style="display: none;">
                    <span class="text">0%</span>
                    <span class="percentage"></span>
                </div>
            </div>
            <div class="pt-form-btn">
                <div class="form-group">
                    <a id="btnSave" class="pt-btn pt-btn-primary">导入</a>
                    <a id="btnClose" class="pt-btn pt-btn-default">关闭</a>
                </div>
            </div>
        </form>
    </div>
</div>
</body>
<script type="text/javascript" src="static/scripts/ResizeScroll.js"></script>
<script>
    //窗口参数,用于弹窗传递
    var params = {
        callBack: null
    };
    var fileName;
    var uploader;
    var falg = false;
    var _extensions = "xml";
    var _mimeTypes = ".xml";
    var _mountFileFlag = false;
    var _importLogId;
    $(function () {
        // $("input[radiobuttonName='importTemplate'][value='2017']").radiobutton('check');
        initData();
        new ResizeScroll({
            "id": ".ptbody",
            fun: function () {
                var wh = $(window).height();
                $("body").height(wh);
                return (wh - 69 - 62);
            }
        });
 
 
        $("#btnSave").click(function () {
            if (!falg) {
                wcp.notify.warn('请选择文件!');
                return false;
            }
            var obj = $('#formImportTemplate').serializeObject();//new Object();
            <c:if test="${ not archivesCustomConfig.enableSimple}">
            obj.startData = $('#startData').textbox("getValue");
            </c:if>
            uploader.options.formData = obj;
            uploader.upload();
        });
        uploadFile();
        $("#btnClose").click(function () {
            closeWindow();
        });
    });
 
    function closeWindow() {
        var index = top.layer.getFrameIndex(window.name); //获取窗口索引
        top.layer.close(index);
    }
 
    function uploadFile() {
        //var imgFileExtensions = 'xlsx,xls';
        uploader = WebUploader.create({
            swf: 'static/plugins/webuploader/Uploader.swf',
            server: 'catAjjxx/importBaoPanXML',
            timeout: 0,
            pick: {
                id: "#picker",
                multiple: false
            },
            accept: {
                title: '选择文件',
                extensions: "xml",
                mimeTypes: '.xml'
            },
            auto: false,
            duplicate: true
        });
        uploader.on("uploadSuccess", function (file, response) { //上传成功事件
            var obj = response;
            if (obj.success != undefined) {
                //ie8无需转换 TRANSFER_NUM
            } else {
                obj = eval('(' + response + ')');
            }
            //系统校验拦截时返回错误信息
            if (obj.error != undefined && obj.error.message != undefined) {
                // layer.alert(obj.error.message);
                top.wcp.notify.error(obj.error.message);
            } else {
                top.wcp.notify.success("数据导入成功!");
            }
            wcp.ui.clearBusy("body");
            $(".progress").hide();
            falg = false;
            $("#fileName").html("");
            //判断是否需要执行回调函数
            if (params.callBack) {
                params.callBack();
            }
            closeWindow();
 
        });
        uploader.on("uploadError", function (file, reason) { //上传失败
            wcp.message.error("上传失败:" + reason, "错误");
            wcp.ui.clearBusy("body");
            $(".progress").hide();
            falg = false;
            $("#fileName").html("");
        });
        uploader.on("beforeFileQueued", function (file) {
            var ext = file.ext;
            if (_mimeTypes.indexOf(ext.toLowerCase()) == -1) {
                wcp.message.error("请选择" + _mimeTypes + "文件!", "错误");
                return false;
            }
            var _regularTypeV = $("#regularType").html()
            if (_mountFileFlag && _regularTypeV == '') {
                wcp.message.error("当前模板未配置规则!", "错误");
                return false;
            }
        });
        uploader.on("fileQueued", function (file) {
            falg = true;
            $("#fileName").html(file.name);
        });
        uploader.on("uploadProgress", function (file, percentage) {
            var per = Math.trunc(percentage * 100);
            if (per != 100) {
                $(".progress .text").text(per + "%");
            } else {
                $(".progress .text").text("上传完成,正在处理数据...");
            }
 
            $(".progress .percentage").css('width', per + '%');
        });
        // 开始上传时添加显示
        uploader.on('startUpload', function () {
            $(".progress").show();
            wcp.ui.setBusy("body");
        });
    }
 
    function initData() {
        var date = new Date();
        var startData = initTime(date);
        $("#startData").datebox('setValue', startData);
 
        var futureDate = addWorkDays(date, 10); // 向当前日期添加10个工作日
        var endData = initTime(futureDate);
        $("#endData").datebox('setValue', endData);
 
    }
 
    function initTime(date) {
        var year = date.getFullYear();
        var month = date.getMonth() + 1; //月份+1
        var day = date.getDate();
        var parsedate = year + "-" + month + "-" + day;
        return parsedate;
    }
 
    function addWorkDays(date, days) {
        let currentDate = new Date(date);
        let addedDays = 0;
 
        while (addedDays < days) {
            // 增加一天
            currentDate.setDate(currentDate.getDate() + 1);
 
            // 检查是否为工作日
            const dayOfWeek = currentDate.getDay();
            if (dayOfWeek !== 0 && dayOfWeek !== 6) { // 0: Sunday, 6: Saturday
                addedDays++;
            }
        }
 
        return currentDate;
    }
 
    // 使用示例
</script>
</html>