多单位版国产化地质资料管理系统
zhai
2025-12-18 3c6f6c1e3016e38146a4c46be6e7b625c35591f2
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
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8" %>
<%@ taglib uri="http://shiro.apache.org/tags" prefix="shiro" %>
<%
    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>
    <link href="static/plugins/font-awesome/css/font-awesome.css" rel="stylesheet" type="text/css">
    <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">
    <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/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;
        }
    </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-bars"></i></span>
            <div class="pt-title">
                <div>
                    <h4>编码块信息</h4>
                </div>
            </div>
        </div>
    </div>
    <div class="pt-form">
        <form id="formCoding" method="post">
            <div class="ptbody">
 
                <table style="width: 100%;">
                    <tr>
                        <td class="tbtitle" style="width: 140px;">
                            <em class="pt-color-danger">*</em> 编码类型:
                        </td>
                        <td>
                            <input id="sectionType" name="sectionType" class="easyui-combobox" type="text"
                                   data-options="required:true,panelHeight:'auto',editable:false" style="width:100%"
                            />
                            <input type="hidden" id="sectionId" name="sectionId" value="${ codingSection.sectionId}">
                            <input type="hidden" id="codingId" name="codingId" value="${ codingId}">
                        </td>
                    </tr>
                    <!-- 数据字典  -->
                    <tr name = "sectionType1_element" >
                        <td class="tbtitle" style="width: 140px;">
                            <em class="pt-color-danger">*</em> 字典:</td>
                        <td>
                            <input type="hidden" id="sectionRuleKeywordId1"  value="${codingSection.sectionRuleKeywordId}">
                            <input id="sectionRule1" value="${codingSection.sectionRule }"
                                   class="easyui-textbox" style="width:100%"
                                   data-options="editable:false,required:true,buttonText:'选择',prompt:'',onClickButton:function(){selectSectionRule();}"/>
                        </td>
                    </tr>
                    <tr name = "sectionType1_element" >
                        <td class="tbtitle">
                            默认值:
                        </td>
                        <td>
                            <input id="defaultValue1"   class="easyui-textbox" style="width:100%;" data-options="panelHeight:'auto'"
                                   value="${codingSection.defaultValue}"/>
                        </td>
                    </tr>
                    <tr name = "sectionType1_element" >
                        <td class="tbtitle" style="width: 140px;"> 数据字段:</td>
                        <td>
                            <input id="tableColumnName1"  value="${codingSection.tableColumnName }"
                                   class="easyui-textbox" style="width:100%"
                                   data-options="editable:false,buttonText:'选择',prompt:'',onClickButton:function(){selectTableColumn();}"/>
                        </td>
                    </tr>
                    <tr name = "sectionType1_element" >
                        <td class="tbtitle" style="width: 140px;">前缀:</td>
                        <td>
                            <input id="splitPre1"  class="easyui-textbox" type="text"  style="width:100%" value="${codingSection.splitPre }"/>
                        </td>
                    </tr>
                    <tr name = "sectionType1_element" >
                        <td class="tbtitle" style="width: 140px;">分隔符:</td>
                        <td>
                            <input id="splitSign1"  class="easyui-textbox" type="text"  style="width:100%" value="${codingSection.splitSign }"/>
                        </td>
                    </tr>
                    <!-- 数据字典 end -->
 
                    <!-- 日期  -->
                    <tr name = "sectionType2_element" >
                        <td class="tbtitle" style="width: 140px;">
                            <em class="pt-color-danger">*</em> 日期格式:</td>
                        <td>
                            <select id="sectionRule2"  style="width:100%" class="easyui-combobox" data-options="panelHeight: 'auto',editable:false" value="${codingSection.sectionRule }"  >
                                <option value="yy"  ${codingSection.sectionRule == 'yy'?'selected':''}  >年【yy】</option>
                                <option value="yyyy" ${codingSection.sectionRule == 'yyyy'?'selected':''} >年【yyyy】</option>
                                <option value="yyyyMM" ${codingSection.sectionRule == 'yyyyMM'?'selected':''} >年月【yyyyMM】</option>
                                <option value="yyyyMMdd" ${codingSection.sectionRule == 'yyyyMMdd'?'selected':''}   >年月日【yyyyMMdd】</option>
                            </select>
                        </td>
                    </tr>
 
                    <tr name = "sectionType2_element" >
                        <td class="tbtitle" style="width: 140px;"> 数据字段:</td>
                        <td>
                            <input id="tableColumnName2"   value="${codingSection.tableColumnName }"
                                   class="easyui-textbox" style="width:100%"
                                   data-options="editable:false,buttonText:'选择',prompt:'',onClickButton:function(){selectTableColumn();}"/>
                        </td>
                    </tr>
                    <tr name = "sectionType2_element" >
                        <td class="tbtitle" style="width: 140px;">前缀:</td>
                        <td>
                            <input id="splitPre2" name="splitPre2" class="easyui-textbox" type="text"  style="width:100%" value="${codingSection.splitPre }"/>
                        </td>
                    </tr>
                    <tr name = "sectionType2_element" >
                        <td class="tbtitle" style="width: 140px;">后缀(分隔符):</td>
                        <td>
                            <input id="splitSign2"  class="easyui-textbox" type="text"  style="width:100%" value="${codingSection.splitSign }"/>
                        </td>
                    </tr>
                    <!-- 日期 end -->
 
                    <!-- 流水号  -->
                    <tr name = "sectionType3_element" >
                        <td class="tbtitle" style="width: 140px;">
                            <em class="pt-color-danger">*</em> 流水号长度:</td>
                        <td>
                            <input id="sectionRule3"  value="${codingSection.sectionRule }"
                                   class="easyui-numberspinner" style="width:100%"
                                   data-options="increment:1,min:2"/>
                        </td>
                    </tr>
                    <tr name = "sectionType3_element" >
                        <td class="tbtitle">
                            <em class="pt-color-danger">*</em> 最小值:
                        </td>
                        <td>
                            <input id="minValue3"   class="easyui-textbox" type="text"  style="width:100%" data-options="validType:'number'" value="${codingSection.minValue }"/>
                        </td>
                    </tr>
                    <tr name = "sectionType3_element" >
                        <td class="tbtitle">
                            <em class="pt-color-danger">*</em> 最大值:
                        </td>
                        <td>
                            <input id="maxValue3"   class="easyui-textbox" type="text"  style="width:100%" data-options="validType:'number'" value="${codingSection.maxValue }"/>
                        </td>
                    </tr>
                    <tr name = "sectionType3_element" >
                        <td class="tbtitle" style="width: 140px;">前缀:</td>
                        <td>
                            <input id="splitPre3"  class="easyui-textbox" type="text"  style="width:100%" value="${codingSection.splitPre }"/>
                        </td>
                    </tr>
                    <tr name = "sectionType3_element" >
                        <td class="tbtitle" style="width: 140px;">后缀(分隔符):</td>
                        <td>
                            <input id="splitSign3"  class="easyui-textbox" type="text"  style="width:100%" value="${codingSection.splitSign }"/>
                        </td>
                    </tr>
                    <!-- 流水号 end -->
 
                    <!-- 取值范围  -->
                    <tr name = "sectionType4_element" >
                        <td class="tbtitle" style="width: 140px;"> <em class="pt-color-danger">*</em> 默认值:</td>
                        <td>
                            <input id="sectionRule4"  value="${codingSection.sectionRule }"
                                   class="easyui-textbox" style="width:100%"/>
                        </td>
                    </tr>
 
                    <tr name = "sectionType4_element" >
                        <td class="tbtitle" style="width: 140px;"> 数据字段:</td>
                        <td>
                            <input id="tableColumnName4"  value="${codingSection.tableColumnName }"
                                   class="easyui-textbox" style="width:100%"
                                   data-options="editable:false,buttonText:'选择',prompt:'',onClickButton:function(){selectTableColumn();}"/>
                        </td>
                    </tr>
                    <tr name = "sectionType4_element" >
                        <td class="tbtitle" style="width: 140px;">前缀:</td>
                        <td>
                            <input id="splitPre4"  class="easyui-textbox" type="text"  style="width:100%" value="${codingSection.splitPre }"/>
                        </td>
                    </tr>
                    <tr name = "sectionType4_element" >
                        <td class="tbtitle" style="width: 140px;">后缀(分隔符):</td>
                        <td>
                            <input id="splitSign4"  class="easyui-textbox" type="text"  style="width:100%" value="${codingSection.splitSign }"/>
                        </td>
                    </tr>
                    <!-- 取值范围 end -->
 
                    <!-- 系统参数  -->
                    <tr name = "sectionType5_element" >
                        <td class="tbtitle" style="width: 140px;"><em class="pt-color-danger">*</em> 编码值:</td>
                        <td>
                            <select id="sectionRule5"  style="width: 200px" class="easyui-combobox" data-options="panelHeight: 'auto',editable:false" value="${codingSection.sectionRule }"  >
                                <option value="userid"  ${codingSection.sectionRule == 'userid'?'selected':''} >登录用户ID</option>
                                <option value="username" ${codingSection.sectionRule == 'username'?'selected':''} >登录用户工号</option>
                                <option value="truename" ${codingSection.sectionRule == 'truename'?'selected':''} >登录用户姓名</option>
                                <option value="deptid" ${codingSection.sectionRule == 'deptid'?'selected':''} >登录用户部门ID</option>
                                <option value="deptname" ${codingSection.sectionRule == 'deptname'?'selected':''} >登录用户部门名称</option>
                            </select>
 
                        </td>
                    </tr>
 
                    <tr name = "sectionType5_element" >
                        <td class="tbtitle" style="width: 140px;">前缀:</td>
                        <td>
                            <input id="splitPre5"  class="easyui-textbox" type="text"  style="width:100%" value="${codingSection.splitPre }"/>
                        </td>
                    </tr>
                    <tr name = "sectionType5_element" >
                        <td class="tbtitle" style="width: 140px;">后缀(分隔符):</td>
                        <td>
                            <input id="splitSign5"  class="easyui-textbox" type="text"  style="width:100%" value="${codingSection.splitSign }"/>
                        </td>
                    </tr>
                    <!-- 系统参数 end -->
 
                </table>
 
            </div>
        </form>
        <div class="pt-form-btn">
            <div class="form-group">
                <button id="btnSave" class="pt-btn pt-btn-primary">保存</button>
                <button id="btnClose" class="pt-btn pt-btn-default">关闭</button>
            </div>
        </div>
    </div>
</div>
</body>
<script type="text/javascript" src="static/scripts/ResizeScroll.js"></script>
<script>
    //窗口参数,用于弹窗传递
    var params = {
        callBack: null
    };
 
    var _moduleId = '${moduleId}';
    var sectionTypeList = [
        {
            csid : 1,
            csmc : '数据字典'
        },
        {
            csid : 2,
            csmc : '日期'
        },
        {
            csid : 3,
            csmc : '流水号'
        },
        {
            csid : 4,
            csmc : '取值范围'
        }
        ,
        {
            csid : 5,
            csmc : '系统参数'
        }
    ];
    //默认1
    var _sectionType='${codingSection.sectionType }';
 
    $(function () {
        new ResizeScroll({
            "id": ".ptbody",
            fun: function () {
                var wh = $(window).height();
                return (wh - 69 - 62);
 
            }
        });
 
        $("#btnSave").click(function () {
            //验证表单信息
            // var isValid = $('#formCoding').form('validate');
            // if (!isValid) {
            //     wcp.notify.warn('表单验证有误,请检查表单输入项!');
            //     return false;
            // }
            if ($('#sectionRule'+_sectionType).val() == '') {
                wcp.notify.warn('编码值不能为空!');
                return false;
            }
            var obj ={}; //$("#formCoding").serializeObject();
            obj.sectionId = $('#sectionId').val();
            obj.codingId = $('#codingId').val();
            obj.sectionType = $('#sectionType').combobox('getValue');
            if(_sectionType == 1){
                obj.sectionRuleKeywordId = $('#sectionRuleKeywordId'+_sectionType).val();
                obj.sectionRule = $('#sectionRule'+_sectionType).val();
                obj.defaultValue = $('#defaultValue'+_sectionType).val();
                obj.tableColumnName = $('#tableColumnName'+_sectionType).val();
                obj.splitPre = $('#splitPre'+_sectionType).val();
                obj.splitSign = $('#splitSign'+_sectionType).val();
            }
            else if(_sectionType == 2){
                obj.sectionRule = $('#sectionRule'+_sectionType).val();
                obj.tableColumnName = $('#tableColumnName'+_sectionType).val();
                obj.splitPre = $('#splitPre'+_sectionType).val();
                obj.splitSign = $('#splitSign'+_sectionType).val();
            }
            else if(_sectionType == 3){
                if ($('#minValue'+_sectionType).val() == '') {
                    wcp.notify.warn('请输入最小值!');
                    return false;
                }
                if ($('#maxValue'+_sectionType).val() == '') {
                    wcp.notify.warn('请输入最小值!');
                    return false;
                }
                obj.sectionRule = $('#sectionRule'+_sectionType).val();
                obj.minValue = $('#minValue'+_sectionType).val();
                obj.maxValue = $('#maxValue'+_sectionType).val();
                obj.splitPre = $('#splitPre'+_sectionType).val();
                obj.splitSign = $('#splitSign'+_sectionType).val();
            }
            else if(_sectionType == 4){
                obj.sectionRule = $('#sectionRule'+_sectionType).val();
                obj.tableColumnName = $('#tableColumnName'+_sectionType).val();
                obj.splitPre = $('#splitPre'+_sectionType).val();
                obj.splitSign = $('#splitSign'+_sectionType).val();
            }
            else if(_sectionType == 5){
                obj.sectionRule = $('#sectionRule'+_sectionType).val();
                obj.splitPre = $('#splitPre'+_sectionType).val();
                obj.splitSign = $('#splitSign'+_sectionType).val();
            }
            console.log(JSON.stringify(obj));
            wcp.ui.setBusy("body", wcp.ajax({
                url: "config/coding/saveCodingSection",
                data: JSON.stringify(obj),
            }).done(function (result) {
                //判断是否需要执行回调函数
                if (params.callBack) {
                    params.callBack();
                }
 
                //关闭窗口
                closeWindow();
 
                top.wcp.notify.success("保存成功!");
            }));
        });
 
        $("#btnClose").click(function () {
            closeWindow();
        });
 
        $('#sectionType').combobox({
            data:sectionTypeList,
            valueField:'csid',
            textField:'csmc',
            value:'${codingSection.sectionType }',
            onChange: function(newV,oldV){
                _sectionType=newV;
                for (var i = 1; i <= sectionTypeList.length; i++) {
                    $("tr[name=sectionType"+i+"_element]").hide();
                }
                // $("tr[name=sectionType"+oldV+"_element]").hide();
                $("tr[name=sectionType"+newV+"_element]").show();
            },
            onLoadSuccess:function (){
                if(_sectionType == ''){
                    $('#sectionType').combobox('setValue', 1);
                }
                for (var i = 1; i <= sectionTypeList.length; i++) {
                    $("tr[name=sectionType"+i+"_element]").hide();
                }
                $("tr[name=sectionType"+_sectionType+"_element]").show();
            }
 
        });
 
        // bindDefaultValue();
 
    });
 
 
 
 
    //选择编码值
    function selectSectionRule() {
        if(_sectionType=="1"){
            wcp.picker.selectKeyword({
                title : "编码值不能为空",
                idElement : "sectionRuleKeywordId"+_sectionType,
                nameElement : "sectionRule"+_sectionType,
                keywordType:1,
                layerOpener : window
            });
        }
    }
 
    function  selectTableColumn(){
        wcp.picker.selectTableColumn({
            title: "选择字段",
            multiSelect: false,
            moduleId: "${moduleId}",
            separator: ",",
            layerOpener: window
        }, function (rows) {
            var idFromField = "";
            var nameFromField = "";
            if (rows != null && rows.length > 0) {
                for (var i = 0; i < rows.length; i++) {
                    idFromField += rows[i].columnName + ",";
                    nameFromField += rows[i].displayName + ",";
                }
                idFromField = idFromField.slice(0, -1);
                nameFromField = nameFromField.slice(0, -1);
            }
            $("#tableColumnName"+_sectionType).textbox("setValue",idFromField);
        });
    }
 
    //绑定默认值
    // function bindDefaultValue(){
    //     var  keywordId=$('#sectionRuleKeywordId').val();
    //     if(keywordId!=0){
    //         var  url= 'config/coding/getDefaultValueList?keywordId='+keywordId+'&rnd='+Math.random();
    //         $('#defaultValue').combobox({
    //             url:url,
    //             valueField:'keywordId',
    //             textField:'keywordName',
    //         });
    //     }
    // }
 
    // function bindSectionRule(csmc){
    //     $('#sectionRule').combobox('clear');
    //     var  url= 'config/coding/getSectionRuleList?sectionType='+csmc+'&rnd='+Math.random();
    //     $('#sectionRule').combobox({
    //         url:url,
    //         valueField:'keywordId',
    //         textField:'keywordName',
    //         onSelect: function(rec){
    //         }
    //     });
    // }
 
    function closeWindow() {
        var index = top.layer.getFrameIndex(window.name); //获取窗口索引
        top.layer.close(index);
    }
</script>
</html>