1
13693261870
2022-09-16 762f2fb45db004618ba099aa3c0bd89dba1eb843
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
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
<!DOCTYPE html>
<html lang="en">
 
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script type="text/javascript" src="../js/jquery.js"></script>
    <link href="../js/jqwidgets/styles/jqx.base.css" rel="stylesheet" />
    <script type="text/javascript" src="../js/jqwidgets/jqxcore.js"></script>
    <script type="text/javascript" src="../js/jqwidgets/jqxdata.js"></script>
    <script type="text/javascript" src="../js/jqwidgets/jqxloader.js"></script>
    <script type="text/javascript" src="../js/jqwidgets/jqxscrollbar.js"></script>
    <script type="text/javascript" src="../js/jqwidgets/jqxbuttons.js"></script>
    <script type="text/javascript" src="../js/jqwidgets/jqxgrid.js"></script>
    <script type="text/javascript" src="../js/jqwidgets/jqxgrid.filter.js"></script>
    <script type="text/javascript" src="../js/jqwidgets/jqxgrid.pager.js"></script>
    <script type="text/javascript" src="../js/jqwidgets/jqxgrid.sort.js"></script>
    <script type="text/javascript" src="../js/jqwidgets/jqxgrid.columnsresize.js"></script>
    <script type="text/javascript" src="../js/jqwidgets/jqxgrid.selection.js"></script>
    <script type="text/javascript" src="../js/jqwidgets/jqxmenu.js"></script>
    <script type="text/javascript" src="../js/jqwidgets/jqxpanel.js"></script>
    <script type="text/javascript" src="../js/jqwidgets/jqxdropdownlist.js"></script>
    <script type="text/javascript" src="../js/jqwidgets/jqxlistbox.js"></script>
    <script type="text/javascript" src="../js/jqwidgets/jqxcombobox.js"></script>
    <script type="text/javascript" src="../js/jqwidgets/jqxinput.js"></script>
    <script type="text/javascript" src="../js/jqwidgets/jqxtextarea.js"></script>
    <script type="text/javascript" src="../js/jqwidgets/jqxcalendar.js"></script>
    <script type="text/javascript" src="../js/jqwidgets/jqxdatetimeinput.js"></script>
    <script type="text/javascript" src="../js/jqwidgets/globalization/globalize.culture.cn-CN.js"></script>
    <script type="text/javascript" src="../js/JqxGridAPI.js"></script>
    <script type="text/javascript" src="../js/WebServiceAPI6.5.js"></script>
    <script type="text/javascript" src="../js/lodash.min.js"></script>
 
    <style type="text/css">
        html,
        body {
            width: 100%;
            height: 100%;
            margin: 0px;
            padding: 0px;
            font-size: 10px;
            overflow: hidden;
        }
 
        .jqx-fill-state-normal {
            -moz-box-sizing: content-box;
            box-sizing: content-box;
            -ms-touch-action: none;
            font-family: Verdana, Arial, sans-serif;
            font-style: normal;
            font-size: 11px;
            border-color: #aaa;
            color: black !important;
            background: transparent !important;
        }
 
        .jqx-fill-state-hover {
            font-size: 12px;
            border-color: #999;
            /* background: #1b2533; */
        }
 
        .jqx-fill-state-pressed {
            -moz-box-sizing: content-box;
            box-sizing: content-box;
            border-color: #999;
            background: transparent !important;
        }
 
        .jqx-grid-cell,
        .jqx-grid-group-cell {
            font-size: 12px;
            border-color: #aaa;
        }
 
        input[type="text"].jqx-input,
        input[type="password"].jqx-input {
            min-height: 16px;
            min-width: 16px;
            margin: 0px;
            border-width: 1px;
            border-style: solid;
            font-size: 12px;
            padding: 0px;
            padding-left: 3px;
            padding-right: 3px;
            color: black;
        }
        div[role="row"]:nth-child(2n) {
            background-color: #eee;
        }
        div[role="row"]:hover {
            background-color: #eee;
        }
        .jqx-widget-content {
            -moz-box-sizing: content-box;
            box-sizing: content-box;
            -ms-touch-action: none;
            -moz-background-clip: padding;
            -webkit-text-size-adjust: none;
            background-clip: padding-box;
            -webkit-background-clip: padding-box;
            -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
            font-family: Verdana, Arial, sans-serif;
            font-style: normal;
            font-size: 12px;
            border-color: #c7c7c7;
            background: transparent;
            color: black;
        }
 
        .jqx-widget-header {
            -moz-box-sizing: content-box;
            box-sizing: content-box;
            -ms-touch-action: none;
            -moz-background-clip: padding;
            -webkit-text-size-adjust: none;
            background-clip: padding-box;
            -webkit-background-clip: padding-box;
            -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
            border-color: #c5c5c5;
            background: transparent !important;
            color: black;
            background-color: #eee !important;
        }
 
        .jqx-grid-cell {
            border-style: solid;
            border-width: 0px 1px 1px 0px;
            margin-right: 1px;
            margin-bottom: 1px;
            border-color: transparent;
            background: transparent !important;
            white-space: nowrap;
            font-weight: normal;
            font-size: inherit;
            overflow: hidden;
            position: absolute !important;
            height: 100%;
            outline: none;
        }
 
        #txtwhere {
            width: 99%;
        }
 
        .jqx-grid-column-menubutton {
            display: none;
        }
 
        #gridmenugrid {
            display: none !important;
        }
 
        .jqx-scrollbar-state-normal {
            background: transparent;
            margin: 0px;
            padding: 0px;
            border: 1px solid transparent;
        }
 
        .jqx-listbox {
            -webkit-appearance: none;
            outline: none;
            border: 1px solid transparent;
            padding: 0px;
            margin: 0px;
            cursor: default;
            overflow: hidden;
            background: white !important;
        }
 
        /* 滚动条样式 */
 
        ::-webkit-scrollbar {
            /*滚动条的宽高*/
            width: 3px;
            height: 8px !important;
        }
 
        ::-webkit-scrollbar-thumb {
            /*滚动条里面小方块*/
            border-radius: 4px;
            background-color: #346ca7;
        }
 
        ::-webkit-scrollbar-track {
            /*滚动条里面轨道*/
            box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
            background: rgba(52, 108, 167, 0.5);
            border-radius: 4px;
        }
    </style>
    <script type="text/javascript">
 
        var color = window.localStorage.getItem('--bgcolor');
        // alert(color);
 
        var specialArr = ["经度", "周长", "面积", "长度", "东经", "北纬", "纬度"];
        var baseurl = "http://71.3.110.201/ISServices/WebServices/ZHJCService/H_GRID_Server.asmx";
        var H_Grid = {
            //关键字段
            gjzd: null,
            isInit: false,
            ///是否可查
            isSfkc: true,
            ///查询条件
            searchWhere: "",
            searchWhereText: "",
            searchWhereSyn: "",
            ///后台返回表格的内容
            Obj: null,
            ///初始化表格
            popupHeight: 470,
            popupWidth: 330,
            popupLeft: -1,
            popupTop: 135,
            popupRight: 60,
            popupBottom: -1,
            arcgiSserverurl: "",
            sjgd: 2000,
            InitGrid: function (container, where, defaultWhere) {
                
                //遮罩层初始化
                $('#jqxLoader').jqxLoader({ width: "100%", height: "100%", text: '' });
 
                ///以图层编号查寻
                var tcbh = GetQueryString("tcbh");
                var width = GetQueryString("width");
                var table = GetQueryString("table");
                ///查询条件工具栏高度
                var sqlWhereHeight = 70;
                ///计算表格高度
                var gridHeight = "calc(100% - " + sqlWhereHeight + "px)";
                $("#sqlWhere").height(sqlWhereHeight + "px");
                if (where == "" || defaultWhere != "") {
                    where = defaultWhere;
                    if (H_Grid.isInit) {
                        ///清空表格
                        JqxGridAPI.ClearnJqxGrid(container);
                        ///设置表格查询条件
                        JqxGridAPI.args = { tcbh: tcbh, where: H_Grid.searchWhere };
 
                        JqxGridAPI.UpdateBoundDataCells(container)
                        //选择使用排序重新加载表格
                        //JqxGridAPI.SortJqxGrid(container, H_Grid.Obj.columns[0].datafield, "asc");
                        return;
                    }
                    ///表格插件的查询条件设置  由于有搜索功能 根据api不好实现 在插件中添加了个条件属性
                    JqxGridAPI.args = { table: table, where: "" };
                    if (width) {
                        JqxGridAPI.args.width = width;
                    }
 
                    // JqxGridAPI.FillJqxGrid(container, baseurl, "GridAllColumn", gridHeight, function (obj) {
                    JqxGridAPI.FillJqxGrid(container, baseurl, "GridAllChineseColumn", gridHeight, function (obj) {
                        
                        if (obj.columns.length == 0) {
                            alert('尚未配置数据字段!')
                            return;
                        }
 
                        ///关闭遮罩层
                        $('#jqxLoader').jqxLoader('close');
                        if (obj.item) {
                            $("#sqlWhere").show();
                        }
 
                        if (!H_Grid.isInit) {
                            H_Grid.isInit = true;
                            $("#columndiv").empty();
                            $("#operatordiv").empty();
                            ///初始化表格查询字段
                            H_Grid.InitGridSelColum(obj);
                            ///初始化表格查询操作符
                            H_Grid.InitGridSelOperator(obj);
                            ///初始化value值
                            H_Grid.InitGridSelValue();
                            ///初始化表格查询操作按钮
                            H_Grid.InitGridSelBtn();
                            H_Grid.Obj = obj;
                            ///grid行点击事件
                            JqxGridAPI.RowClick(obj.item, function (data) {
                                
                                var wkt=data.data.wkt;
                                var type = "";
                                if(wkt.indexOf(" (("))
                                {
                                    type = wkt.substr(0,wkt.indexOf(" (("));
                                    type = type.toLowerCase();
                                }
                               window.parent.pointToByCoord(5000,type,wkt,'','','');
                               
                            });
                        }
                    });
                } else {
                    ///清空表格
                    JqxGridAPI.ClearnJqxGrid(container);
                    ///设置表格查询条件
                    JqxGridAPI.args = { tcbh: tcbh, where: H_Grid.searchWhere };
 
                    JqxGridAPI.UpdateBoundDataCells(container)
                    ///选择使用排序重新加载表格
                    //JqxGridAPI.SortJqxGrid(container, H_Grid.Obj.columns[0].datafield, "asc");
                }
            },
            ///初始化表格查询字段
            InitGridSelColum: function (obj) {
                
                ///加载查询字段下拉框
                $("#columndiv").append("<select id='column'></select>");
                $.each(obj.columns, function (key, value) {
                    if (!value.hidden)
                        $("#column").append("<option data-value='" + value.datafield + "' data-columntype='" + value.columntype + "'>" + value.text + "<opion>");
                })
                $("#column").jqxDropDownList({ width: 120, height: 25, dropDownHeight: 200 });
                $('#column').on('select', function (event) {
                    H_Grid.InitGridSelOperator();
                    ///初始化value值
                    H_Grid.InitGridSelValue();
                });
            },
            ///初始化表格查询操作符
            InitGridSelOperator: function () {
                var column = $("#column_jqxDropDownList").find("option:eq(" + $("#column").jqxDropDownList('getSelectedIndex') + ")");
                var columnText = column.text();
                var columntype = column.attr("data-columntype");
 
                $("#operatordiv").html("");
                $("#operatordiv").append("<select id='operator'></select>");
                switch (columntype) {
                    case "BLOB":
                    case "NVARCHAR2":
                    case "SDO_GEOMETRY":
                        if (specialArr.indexOf(columnText) > -1) {
                            $("#operator").append("<option value='like'>包含</option>");
 
                            $("#operator").append("<option value='>'>大于</option>");
                            $("#operator").append("<option value='<'>小于</option>");
                        } else {
                            $("#operator").append("<option value='='>等于</option>");
                            $("#operator").append("<option value='!='>不等于</option>");
                            $("#operator").append("<option value='like'>包含</option>");
                        }
                        break;
                    case "VARCHAR2":
                        if (specialArr.indexOf(columnText) > -1) {
                            $("#operator").append("<option value='like'>包含</option>");
 
                            $("#operator").append("<option value='>'>大于</option>");
                            $("#operator").append("<option value='<'>小于</option>");
                        } else {
                            $("#operator").append("<option value='='>等于</option>");
                            $("#operator").append("<option value='!='>不等于</option>");
                            $("#operator").append("<option value='like'>包含</option>");
                        }
                        //$("#operator").append("<option value='='>等于</option>");
                        //$("#operator").append("<option value='!='>不等于</option>");
                        //$("#operator").append("<option value='like'>包含</option>");
                        break;
                    case "NUMBER":
                        if (specialArr.indexOf(columnText) > -1) {
                            $("#operator").append("<option value='like'>包含</option>");
 
                        } else {
                            $("#operator").append("<option value='='>等于</option>");
                            $("#operator").append("<option value='!='>不等于</option>");
                        }
                        $("#operator").append("<option value='>'>大于</option>");
                        $("#operator").append("<option value='<'>小于</option>");
                        break;
                    case "DATE":
                        //$("#operator").append("<option value='='>等于</option>");
                        //$("#operator").append("<option value='!='>不等于</option>");
                        $("#operator").append("<option value='like'>包含</option>");
                        $("#operator").append("<option value='>'>大于</option>");
                        $("#operator").append("<option value='<'>小于</option>");
                        break;
                    default:
                        break;
                }
                $("#operator").jqxDropDownList({ width: 100, height: 25, autoDropDownHeight: true });
            },
            ///初始化value值
            InitGridSelValue: function () {
                ///查询字段类型
                var columntype = $("#column_jqxDropDownList").find("option:eq(" + $("#column").jqxDropDownList('getSelectedIndex') + ")").attr("data-columntype");
                $("#valuediv").empty();
                $("#valuediv").append("<input type='text' id='valueText' />");
                switch (columntype) {
                    case "BLOB":
                    case "SDO_GEOMETRY":
                    case "NVARCHAR2":
                        $("#valueText").jqxInput({ placeHolder: "请输入值", height: 27, width: 150, minLength: 1 });
                        //$("#valueText").jqxDateTimeInput({ placeHolder: "请输入日期", height: 27, width: 150 });
                        break;
                    case "VARCHAR2":
                        $("#valueText").jqxInput({ placeHolder: "请输入值", height: 27, width: 150, minLength: 1 });
                        //$("#valueText").jqxDateTimeInput({ placeHolder: "请输入日期", height: 27, width: 150 });
                        break;
                    case "NUMBER":
                        $("#valueText").jqxInput({ placeHolder: "请输入数值", height: 27, width: 150, minLength: 1 });
                        break;
                    case "DATE":
                        $("#valueText").jqxDateTimeInput({ placeHolder: "请输入日期", height: 27, width: 150, formatString: "yyyy/MM/dd" });
                        break;
                    default:
                        break;
                }
            },
            ///初始化表格查询操作按钮
            InitGridSelBtn: function () {
                $("#btnSubmit").jqxInput('destroy');
                $("#btnSubmit").jqxButton({ width: 90, height: 27 });
                $("#btnRest").jqxInput('destroy');
                $("#btnRest").jqxButton({ width: 80, height: 27 });
                $("#Andbtn").jqxInput('destroy');
                $("#Andbtn").jqxButton({ width: 60, height: 27 });
                $("#Orbtn").jqxInput('destroy');
                $("#Orbtn").jqxButton({ width: 60, height: 27 });
                $("#btnL").jqxInput('destroy');
                $("#btnL").jqxButton({ width: 30, height: 27 });
                $("#btnR").jqxInput('destroy');
                $("#btnR").jqxButton({ width: 30, height: 27 });
                ///查找函数
                $("#btnSubmit").on('click', function () {
                    /**
                    **默认执行并且按钮函数
                    **张恒2018-12-04
                    **/
                    if (H_Grid.searchWhere == "" && $('#txtwhere').jqxTextArea('val') == "") {
                        ///查询字段类型 根据类型获取value的值
                        var columntype = $("#column_jqxDropDownList").find("option:eq(" + $("#column").jqxDropDownList('getSelectedIndex') + ")").attr("data-columntype");
                        var value = "";
                        if (columntype == "DATE") {
                            value = $('#valueText').jqxDateTimeInput('val')
                        } else {
                            value = $('#valueText').jqxInput('val')
                        }
                        if (value != "") {
                            //if (columntype == "DATE")
                            //{ }
                            //else {
                            $("#Andbtn").click();
                            //}
                            $("#btnSubmit").click();
                            return;
                        }
                    }
 
                    H_Grid.InitGrid("grid", H_Grid.searchWhere);
 
                    ///判断是否是组合功能 根据选择条件刷新图表
                    try {
                        //alert(window.parent.window.document.title)
 
                        //H_Grid.searchWhereSyn = H_Grid.searchWhere;
                        window.parent.window.RefreshChart(H_Grid.searchWhere, $('#txtwhere').jqxTextArea('val'));
                    }
                    catch (ex) {
                        //alert(ex.message)
                    }
 
                });
                ///重置函数
                $("#btnRest").on('click', function () {
                    $('#txtwhere').jqxTextArea('val', '');
                    $('#valueText').jqxInput('val', '');
                    H_Grid.searchWhere = "";
                    H_Grid.searchWhereText = "";
                    getInitSearchWhere();
                    H_Grid.InitGrid("grid", H_Grid.searchWhere);
                    ///判断是否是组合功能 根据选择条件刷新图表
                    try {
                        //alert(window.parent.window.document.title)
                        window.parent.window.RefreshChart(H_Grid.searchWhere, $('#txtwhere').jqxTextArea('val'));
                    }
                    catch (ex) {
                        //alert(ex.message)
                    }
                });
                ///并且函数
                $("#Andbtn").on('click', function () {
                    ///查询字段类型 根据类型获取value的值
                    var columntype = $("#column_jqxDropDownList").find("option:eq(" + $("#column").jqxDropDownList('getSelectedIndex') + ")").attr("data-columntype");
                    var value = "";
                    if (columntype == "DATE") {
                        value = $('#valueText').jqxDateTimeInput('val')
                    } else {
                        value = $('#valueText').jqxInput('val')
                    }
                    var columnText = $("#column_jqxDropDownList").find("option:eq(" + $("#column").jqxDropDownList('getSelectedIndex') + ")").text();
                    var column = $("#column_jqxDropDownList").find("option:eq(" + $("#column").jqxDropDownList('getSelectedIndex') + ")").attr("data-value");
                    var operator = $("#operator_jqxDropDownList").find("option:eq(" + $("#operator").jqxDropDownList('getSelectedIndex') + ")").val();
                    ///查询操作符
                    var operatorText = $("#operator_jqxDropDownList").find("option:eq(" + $("#operator").jqxDropDownList('getSelectedIndex') + ")").text();
                    if (value == "") return;
                    ///拼接操作语句
                    var where = $('#txtwhere').jqxTextArea('val')
                    if (where == "") {
                        $('#txtwhere').jqxTextArea('val', " " + columnText + " " + operatorText + " " + value);
                        if (operator == "like") {
                            H_Grid.searchWhere += " and " + column + " " + operator + " '%" + value + "%'";
                        }
                        else {
                            H_Grid.searchWhere += " and " + column + " " + operator + " '" + value + "'";
                        }
                    }
                    else {
                        if (where == "(") {
                            $('#txtwhere').jqxTextArea('val', where + columnText + " " + operatorText + " " + value);
                            if (operator == "like") {
                                H_Grid.searchWhere += " " + column + " " + operator + " '%" + value + "%'";
                            }
                            else {
                                if (columntype == "DATE")
                                    H_Grid.searchWhere += " " + column + " " + operator + " to_date('" + value + "','yyyy/MM/dd')";
                                else
                                    H_Grid.searchWhere += " " + column + " " + operator + " '" + value + "'";
                            }
                        }
                        else {
                            $('#txtwhere').jqxTextArea('val', where + " 并且 " + columnText + " " + operatorText + " " + value);
                            if (operator == "like") {
                                H_Grid.searchWhere += " and " + column + " " + operator + " '%" + value + "%'";
                            }
                            else {
                                if (columntype == "DATE")
                                    H_Grid.searchWhere += " and " + column + " " + operator + " to_date('" + value + "','yyyy/MM/dd')";
                                else
                                    H_Grid.searchWhere += " and " + column + " " + operator + " '" + value + "'";
                            }
                        }
                    }
                });
                ///或者函数
                $("#Orbtn").on('click', function () {
                    ///显示查询条件
                    var where = $('#txtwhere').jqxTextArea('val')
                    ///字段类型 DATE NVCHAR2 NUMBER
                    var columntype = $("#column_jqxDropDownList").find("option:eq(" + $("#column").jqxDropDownList('getSelectedIndex') + ")").attr("data-columntype");
                    ///获取值根据类型
                    var value = "";
                    if (columntype == "DATE") {
                        value = $('#valueText').jqxDateTimeInput('val')
                    }
                    else {
                        value = $('#valueText').jqxInput('val')
                    }
                    ///查询字段的中文名称
                    var columnText = $("#column_jqxDropDownList").find("option:eq(" + $("#column").jqxDropDownList('getSelectedIndex') + ")").text();
                    ///查询字段的数据库字段
                    var column = $("#column_jqxDropDownList").find("option:eq(" + $("#column").jqxDropDownList('getSelectedIndex') + ")").attr("data-value");
                    ///查询操作符
                    var operator = $("#operator_jqxDropDownList").find("option:eq(" + $("#operator").jqxDropDownList('getSelectedIndex') + ")").val();
                    ///查询操作符
                    var operatorText = $("#operator_jqxDropDownList").find("option:eq(" + $("#operator").jqxDropDownList('getSelectedIndex') + ")").text();
                    if (value == "") return;
                    ///拼装查询条件
                    if (where == "") {
                        $('#txtwhere').jqxTextArea('val', " " + columnText + " " + operatorText + " " + value);
                        if (operator == "like") {
                            H_Grid.searchWhere += " or " + column + " " + operator + " '%" + value + "%'";
                        }
                        else {
                            H_Grid.searchWhere += " or " + column + " " + operator + " '" + value + "'";
                        }
                    }
                    else {
                        if (where == "(") {
                            $('#txtwhere').jqxTextArea('val', where + columnText + " " + operatorText + " " + value);
                            if (operator == "like") {
                                H_Grid.searchWhere += " " + column + " " + operator + " '%" + value + "%'";
                            }
                            else {
                                if (columntype == "DATE")
                                    H_Grid.searchWhere += " " + column + " " + operator + " to_date('" + value + "','yyyy/MM/dd')";
                                else
                                    H_Grid.searchWhere += " " + column + " " + operator + " '" + value + "'";
                            }
                        }
                        else {
                            $('#txtwhere').jqxTextArea('val', where + " 或者 " + columnText + " " + operatorText + " " + value);
                            if (operator == "like") {
                                H_Grid.searchWhere += " or " + column + " " + operator + " '%" + value + "%'";
                            }
                            else {
                                if (columntype == "DATE")
                                    H_Grid.searchWhere += " or " + column + " " + operator + " to_date('" + value + "','yyyy/MM/dd')";
                                else
                                    H_Grid.searchWhere += " or " + column + " " + operator + " '" + value + "'";
                            }
                        }
                    }
                });
                ///左括号
                $("#btnL").on('click', function () {
                    var where = $('#txtwhere').jqxTextArea('val')
                    if (where == "") {
                        $('#txtwhere').jqxTextArea('val', "(");
                    }
                    else {
                        $('#txtwhere').jqxTextArea('val', where + "(");
                    }
                    H_Grid.searchWhere += " ( ";
                });
                ///右括号
                $("#btnR").on('click', function () {
                    var where = $('#txtwhere').jqxTextArea('val')
                    if (where == "") {
                        $('#txtwhere').jqxTextArea('val', ")");
                    }
                    else {
                        $('#txtwhere').jqxTextArea('val', where + " ) ");
                    }
                    H_Grid.searchWhere += " ) ";
                });
                $('#txtwhere').jqxTextArea({ placeHolder: '', height: 30 });
                $('#txtwhere').jqxTextArea('val', H_Grid.searchWhereText);
            },
            ///正则验证输入值的有效性
            validateValue: function () {
 
            }
        };
        window.onload = function () {
 
            getInitSearchWhere();
            H_Grid.InitGrid("grid", "", H_Grid.searchWhere);
        }
        function getInitSearchWhere() {
            var searchWhere = GetQueryString("where");
            if (searchWhere == null || searchWhere == undefined) {
                searchWhere = "";
            }
            else {
                //where = where.replace("or", "");
                //where = where.replace("and", "");
            }
            var searchWhereText = GetQueryString("searchWhereText");
            if (searchWhereText == null || searchWhereText == undefined) {
                searchWhereText = "";
            }
 
            H_Grid.searchWhere += decodeURI(searchWhere);
            //$('#txtwhere').jqxTextArea('val', searchWhereText);
            H_Grid.searchWhereText = searchWhereText;
        }
        ///页面关闭清除创建的label
        function closeDia() {
            try {
                //skylineAPIObject.ProjectTree.clearTempGroup();
                //var H_MyMap = window.external.InvokeScript2D("GetArcgisAPI", "");
                //H_MyMap.RemoveMarker();
            }
            catch (esx) { }
        }
 
        function GetQueryString(name) {
            var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
            var r = window.location.search.substr(1).match(reg);
            if (r != null) return r[2];
            return null;
        }
    </script>
</head>
 
<body class='default' onunload="closeDia()">
    <!-- 遮罩层div -->
    <div id="jqxLoader"></div>
 
    <div id="sqlWhere" style="width: 100%; padding-top: 3px; display: none;">
        <div style="width: 100%; height: 30px; margin-bottom: 6px;">
            <textarea id="txtwhere" disabled></textarea>
        </div>
        <div id="columndiv" style="width: 110px; height: 30px; float: left; margin-left: 20px;"></div>
        <div id="operatordiv" style="width: 110px; height: 30px; float: left; margin-left: 20px"></div>
        <div id="valuediv" style="width: 160px; height: 30px; float: left;">
            <input type='text' id='valueText' />
        </div>
        <div id="Anddiv" style="width: 70px; height: 30px; float: left;">
            <input type="button" id="Andbtn" value="并且" />
        </div>
        <div id="Ordiv" style="width: 70px; height: 30px; float: left;">
            <input type="button" id="Orbtn" value="或者" />
        </div>
        <div id="divL" style="width: 40px; height: 30px; float: left; display: none">
            <input type="button" id="btnL" value="(" />
        </div>
        <div id="divR" style="width: 40px; height: 30px; float: left; display: none">
            <input type="button" id="btnR" value=")" />
        </div>
        <div id="divRest" style="width: 90px; height: 30px; float: left;">
            <input type="button" id="btnRest" value="重置" />
        </div>
        <div id="btndiv" style="width: 90px; height: 30px; float: left;">
            <input type="button" id="btnSubmit" value="查找" />
        </div>
    </div>
    <div id="grid"></div>
</body>
 
</html>