多单位版国产化地质资料管理系统
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
496
497
498
499
500
501
502
503
504
505
506
507
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
    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">  
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
    <title>表单字段配置</title> 
    <link rel="stylesheet" href="static/plugins/font-awesome/css/font-awesome.min.css">
    <link rel="stylesheet" href="static/plugins/ueditor-formdesign/js/ueditor/formdesign/bootstrap/css/bootstrap.css">
    <!--[if lte IE 6]>
    <link rel="stylesheet" type="text/css" href="bootstrap/css/bootstrap-ie6.css">
    <![endif]-->
    <!--[if lte IE 7]>
    <link rel="stylesheet" type="text/css" href="bootstrap/css/ie.css">
    <![endif]-->
    <link rel="stylesheet" href="static/plugins/ueditor-formdesign/js/ueditor/formdesign/leipi.style.css">
    <script type="text/javascript" src="static/plugins/ueditor-formdesign/js/ueditor/dialogs/internal.js"></script>
 
<link rel="stylesheet" href="static/plugins/jquery-steps/css/main.css" type="text/css">
    <link rel="stylesheet" href="static/plugins/jquery-steps/css/jquery.steps.css" type="text/css">
    <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/scripts/ResizeScroll.js"></script>    
    <script type="text/javascript" src="static/plugins/jquery-easyui-edatagrid/jquery.edatagrid.js"></script>
    <script type="text/javascript" src="static/plugins/jquery-easyui-datagrid-dnd/datagrid-dnd.js"></script>
    <script src="static/plugins/ace/src-noconflict/ace.js" type="text/javascript"></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>
 
    
    <script type="text/javascript">
 
        function createElement(type, name) {
            var element = null;
            try {
                element = document.createElement('<' + type + ' name="' + name + '">');
            } catch (e) { }
            if (element == null) {
                element = document.createElement(type);
                element.name = name;
            }
            return element;
        }
    </script>
 
 
</head>
 
<body>
    <div class="content">
        <table class="table table-bordered table-striped table-hover">
            <tr>
                <th>
                    <span>所属表名</span>
                </th>
                <th width="50%">
                    <span>字段名称</span>
                    <span class="label label-important">*</span>
                </th>
            </tr>
            <tr>
                 <td>
                    <div class="input-group">
                        <input type="text" id="orgtablename" class="form-control" value="${formColumn.tableName}">
                        <span class="input-group-btn">
                            <button class="btn btn-default" onclick="selectTable()">选表</button>
                        </span>
                    </div>
                </td>
                <td>
                    <div class="input-group">
                        <input type="text" id="orgname" class="form-control" placeholder="必填项">
                        <span class="input-group-btn">
                            <button class="btn btn-default" id="selectField" onclick="selectColumn()">选字段</button>
                        </span>
                    </div>
                </td>
            </tr>
            <tr>
                <th>
                    <span>显示名称</span>
                </th>
                <th>
                    <span>默认值</span>
                </th>
            </tr>
            <tr>
                <td>
                    <input type="text" id="orgdisplayname" class="form-control">
                </td>
                <td>
                    <div class="input-group">
                        <input type="text" id="orgvalue" class="form-control" placeholder="无则不填">
                        <span class="input-group-btn">
                            <button class="btn btn-default">选公式</button>
                        </span>
                    </div>
                </td>
            </tr>
            <tr>
                <th>
                    <span>日期时间类型</span>
                </th>
 
                <th>
                    <span>验证</span>
                </th>
            </tr>
            <tr>
                <td>
                    <select id="orgtype" class="form-control">
                        <option value="yyyy-MM-dd" selected>年月日</option>
                        <option value="yyyy-MM">年月</option>
                        <option value="MM-dd">月日</option>
                        <option value="yyyy">年</option>
                        <option value="MM">月</option>
                        <option value="dd">日</option>
                        <option value="hh:mm:ss">时分秒</option>
                        <option value="hh:mm">时分</option>
                        <option value="mm:ss">分秒</option>
                        <option value="hh">时</option>
                        <option value="mm">分</option>
                        <option value="ss">秒</option>
                        <option value="yyyy-MM-dd hh:mm:ss">年月日时分秒</option>
                        <option value="yyyy-MM-dd hh:mm">年月日时分</option>
                        
                    </select>
                </td>
                <td>
                    <input id="orgzz" type="text" value="" class="form-control" placeholder="参看easyui的validType" />
                </td>
            </tr>
            <tr>
                <th>
                    <span>&nbsp;&nbsp;&nbsp;&nbsp;宽&nbsp;&nbsp;X&nbsp;&nbsp;高&nbsp;&nbsp;&nbsp;&&nbsp;&nbsp;&nbsp;字体大小&nbsp;&nbsp;&nbsp;</span>
                </th>
                <th>
                    <span>必填性&nbsp;&nbsp;&nbsp;&&nbsp;&nbsp;&nbsp;可编辑性</span>
                </th>
            </tr>
            <tr>
                <td>
                    <input id="orgwidth" type="text" value="98%" style="width:50px" class="input-small span1" placeholder="auto" /> X
                    <input id="orgheight" type="text" value="" style="width:50px" class="input-small span1" placeholder="auto" /> &
                    <input id="orgfontsize" type="text" value="" style="width:50px" class="input-small span1" placeholder="auto" /> px 
                   
 
                </td>
                <td>
  
                    <label class="checkbox-inline">
                        <input id="orgrequired" type="checkbox" /> 必填 </label>
                        <label class="checkbox-inline">
                            <input id="orgedit" type="checkbox" checked /> 编辑 </label>
                </td>
            </tr>
            <tr>
                
                
            </tr>
          
            
        </table>
    </div>
    <script type="text/javascript">
        var oNode = null, thePlugins = 'datetime';
        window.onload = function () {
            if (UE.plugins[thePlugins].editdom) {
                oNode = UE.plugins[thePlugins].editdom;
                var gValue = '';
                if (oNode.getAttribute('value'))
                    gValue = oNode.getAttribute('value').replace(/&quot;/g, "\"");
                var gName = oNode.getAttribute('name').replace(/&quot;/g, "\""), gFontSize = oNode.getAttribute('orgfontsize'), gWidth = oNode.getAttribute('orgwidth'), 
                gHeight = oNode.getAttribute('orgheight'), gType = oNode.getAttribute('orgtype'), gZZ = oNode.getAttribute('orgzz'), gRequired = oNode.getAttribute('orgrequired'), 
                gEdit = oNode.getAttribute('orgedit'),gTableName=oNode.getAttribute('orgtablename'),gDisplayName=oNode.getAttribute('placeholder');
                gValue = gValue == null ? '' : gValue;
                gName = gName == null ? '' : gName;
                gDisplayName=gDisplayName==null?'':gDisplayName;
                $G('orgvalue').value = gValue;
                $G('orgname').value = gName;
                $G('orgdisplayname').value=gDisplayName;
                 
                $G('orgfontsize').value = gFontSize;
                $G('orgwidth').value = gWidth;
                $G('orgheight').value = gHeight;
               
                $G('orgtype').value = gType;
                $G('orgzz').value = gZZ;
                $G('orgtablename').value=gTableName;
               
                if (gRequired == "1") {
                    $G('orgrequired').checked = true;
                }else{
                    $G('orgrequired').checked = false;
                }
                if(gEdit=="1"){
                    $G('orgedit').checked = true;
                }else{
                    $G('orgedit').checked = false;
                }
 
 
            }
             
        }
        dialog.oncancel = function () {
            if (UE.plugins[thePlugins].editdom) {
                delete UE.plugins[thePlugins].editdom;
            }
        };
        dialog.onok = function () {
            if ($G('orgname').value == '') {
               wcp.notify.warn('请输入字段名称!');
                return false;
            }
            var gValue = $G('orgvalue').value.replace(/\"/g, "&quot;"), gName = $G('orgname').value.replace(/\"/g, "&quot;"), gFontSize = $G('orgfontsize').value,  gWidth = $G('orgwidth').value, gHeight = $G('orgheight').value, gType = $G('orgtype').value, gEdit = $G('orgedit'), gRequired = $G("orgrequired"), gZZ = $G('orgzz').value,gTableName=$G('orgtablename').value,gDisplayName=$G("orgdisplayname").value;
            if (!oNode) {
                try {
                    oNode = createElement('input', 'leipiNewField');
                    oNode.setAttribute('type', 'text');
                  
                    oNode.setAttribute('title', gDisplayName);
                    oNode.setAttribute('value', gValue);
                   
                    oNode.setAttribute('name', gName);
                    oNode.setAttribute('id',gName);
                   
                    oNode.setAttribute('placeholder',gDisplayName);
                    oNode.setAttribute('leipiPlugins', thePlugins);
                    //if(!gEdit.checked){
                    //    oNode.setAttribute('disabled','disabled');
                    //}
                    if(gTableName){
                        oNode.setAttribute('orgtablename',gTableName);
                    }
                    if(gName){
                        oNode.setAttribute('orgname',gName);
                    }
                    if(gDisplayName){
                        oNode.setAttribute('orgdisplayname',gDisplayName);
                    }
                    if(gValue){
                        oNode.setAttribute('orgvalue',gValue);
                    } 
                    if (gFontSize != '') {
                        oNode.style.fontSize = gFontSize + 'px';
                        //style += 'font-size:' + gFontSize + 'px;';
                        oNode.setAttribute('orgfontsize', gFontSize);
                    } 
                    if(gWidth.indexOf('%')>-1)
                    {
                        oNode.style.width = gWidth ;
                    }else{
                        oNode.style.width = gWidth + 'px';
                    } 
                    if (gHeight != '') {
                        oNode.style.height = gHeight + 'px';
                        //style += 'height:' + gHeight + 'px;';
                        oNode.setAttribute('orgheight', gHeight);
                    }
                    if (gType != '') {
                        oNode.setAttribute('orgtype', gType);
                        var className=getDateClass(gType);
                        oNode.setAttribute('class',className);
                    }
                    if (gEdit.checked) {
                        oNode.setAttribute('orgedit', "1");
                    }else{
                        oNode.setAttribute('orgedit', "0");
                    } 
                    if (gRequired.checked) {
                        oNode.setAttribute('orgrequired', "1");
                    }else{
                        oNode.setAttribute('orgrequired', "0");
                    }
                    if (gZZ != "") {
                        oNode.setAttribute('orgzz', gZZ);
                    }
                     
                    //oNode.setAttribute('style',style );
                    //oNode.style.cssText=style;//ie7
                    editor.execCommand('insertHtml', oNode.outerHTML);
                } catch (e) {
                    try {
                        editor.execCommand('error');
                    } catch (e) {
                        alert('控件异常,请联系管理员!');
                    }
                    return false;
                }
            } else {
                //oNode.setAttribute('title', gTitle);
                oNode.setAttribute('title',gDisplayName);
                oNode.setAttribute('value', $G('orgvalue').value);
                oNode.setAttribute('name', gName);
                oNode.setAttribute('id',gName);
               
                oNode.setAttribute('placeholder',gDisplayName);
 
                if(gTableName){
                    oNode.setAttribute('orgtablename',gTableName);
                }else{
                    oNode.setAttribute('orgtablename',"");
                }
                if(gName){
                    oNode.setAttribute('orgname',gName);
                }else{
                    oNode.setAttribute('orgname',"");
                }
                if(gDisplayName){
                    oNode.setAttribute('orgdisplayname',gDisplayName);
                }else{
                    oNode.setAttribute('orgdisplayname',"");
                }
                if(gValue){
                    oNode.setAttribute('orgvalue',gValue);
                }else{
                    oNode.setAttribute('orgvalue',"");
                }
 
                //if(!gEdit.checked){
                //    oNode.setAttribute('disabled',"disabled");
                //}
  
                if (gFontSize != '') {
                    oNode.style.fontSize = gFontSize + 'px';
                    oNode.setAttribute('orgfontsize', gFontSize);
                } else {
                    oNode.style.fontSize = '';
                    oNode.setAttribute('orgfontsize', '');
                } 
                if(gWidth.indexOf('%')>-1)
                   {
                       oNode.style.width = gWidth ;
                   }else{
                       oNode.style.width = gWidth + 'px';
                   } 
                oNode.setAttribute('orgwidth', gWidth);
                if (gHeight != '') {
                    oNode.style.height = gHeight + 'px';
                    oNode.setAttribute('orgheight', gHeight);
                } else {
                    oNode.style.height = '';
                    oNode.setAttribute('orgheight', '');
                }
                if (gType != '') {
                    oNode.setAttribute('orgtype', gType);
                    var className=getDateClass(gType);
                    oNode.setAttribute('class',className);
                } else {
                    oNode.setAttribute('orgtype', '');
                } 
                if (gEdit.checked) {
                    oNode.setAttribute('orgedit', "1"); 
                } else { 
                    oNode.setAttribute('orgedit', "0");
                } 
                  if (gRequired.checked) {
                    oNode.setAttribute('orgrequired', "1");
                }else{
                    oNode.setAttribute('orgrequired', "0");
                }
                 
                delete UE.plugins[thePlugins].editdom;
            }
        };
 
 
function openSelectField(){
    top.layer.open({
        title:"选择表字段",
        type: 2,
        area: ['1000px', '600px'],
        fixed: false, //不固定
        content: '/select/selectField.html'
    });
 
}
 
function getDateClass(stype){ 
    var ret="easyui-datebox";
    switch(stype){
        case "yyyy-MM-dd":
        ret="easyui-datebox";
        break;
        case "yyyy-MM":
        ret="easyui-datebox";
        break;
        case "MM-dd":
        ret="easyui-datebox";
        break;
        case "yyyy":
        ret="easyui-datebox";
        break;
        case "MM":
        ret="easyui-datebox";
        break;
        case "dd":
        ret="easyui-datebox";
        break;
        case "hh:mm:ss":
        ret="easyui-timespinner";
        break;
        case "hh:mm":
        ret="easyui-timespinner";
        break;
        case "mm:ss":
        ret="easyui-timespinner";
        break;
        case "hh":
        ret="easyui-timespinner";
        break;
        case "mm":
        ret="easyui-timespinner";
        break;
        case "ss":
        ret="easyui-timespinner";
        break;
        case "yyyy-MM-dd hh:mm:ss":
        ret="easyui-datetimebox";
        break;
        case "yyyy-MM-dd hh:mm":
        ret="easyui-datetimebox";
        break;
 
    }
    return ret;
 
}
 
    //选择表 
     function selectTable() {
         var multiSelect=false; 
        wcp.picker.selectTable({
            title : "请选择表",
            multiSelect : multiSelect, 
            layerOpener : window
        },function(rows){            
            var selectedTables ="";
            $.each(rows, function(index, value) {
                selectedTables+=value.tableName+',';
            });      
            selectedTables=selectedTables.substr(0,selectedTables.length-1); 
            $('#orgtablename').val(selectedTables); 
        });
    }
    //选择字段
    function selectColumn() { 
        var tableNames=$('#orgtablename').val();    
        var multiSelect=false; 
        wcp.picker.selectTableColumn({
            title : "请选择字段",
            tableName :tableNames,
            multiSelect : multiSelect,
            layerOpener : window
        },function(rows){            
            var selectedColumns ="";        
            var selectedDisplayName="";
            $.each(rows, function(index, value) {
                    selectedColumns+=value.columnName+',';
                    selectedDisplayName+=value.displayName+',';
            });      
            selectedColumns=selectedColumns.substr(0,selectedColumns.length-1);
            selectedDisplayName=selectedDisplayName.substr(0,selectedDisplayName.length-1);
            $('#orgname').val(selectedColumns); 
            $('#orgdisplayname').val(selectedDisplayName); 
        });
    }
 
    </script>
</body>
 
</html>