13693261870
2024-04-02 2a1b873b4b78b508d5d53c57992e734c56619df8
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
<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="../../html/layuiupdate/css/layui.css" />
    <link rel="stylesheet" href="../css/roll.css" />
    <script type="text/javascript" src="../../Commonjs/jquery-1.8.2.min.js"></script>
    <script type="text/javascript" src="../../Commonjs/scrollBar.js"></script>
    <link rel="stylesheet" href="../../html/css/coomom.css" />
    <script type="text/javascript" src="../layuiupdate/layui.js"></script>
    <script type="text/javascript" src="../../Commonjs/GetParm.js"></script>
    <title></title>
    <style>
       .ttop {
            margin-top: 6px;
            height: 24px;
            width: 100%;
            display: flex;
            flex-direction: row;
            justify-content: space-between;
            line-height: 32px;
        }
 
        .tcenter {
            height: 90%;
            width: 99%;
            margin-bottom: 10px;
            margin-left: 10px;
            margin: 0px auto;
        }
         .content {
            height: 97%;
            width: 100%;
        }
            .tcenter table {
                height: 95%;
                width: 100%;
                color: #ffffff;
                border-collapse: collapse;
                border-left: solid 1px #ffffff;
                border-bottom: solid 1px #ffffff;
                text-align: center;
            }
 
                .tcenter table tr {
                    height: 10%;
                }
 
                    .tcenter table tr td {
                        border-right: solid 1px #ffffff;
                        border-top: solid 1px #ffffff;
                        border-bottom: solid 1px #ffffff;
                        font-size: 15px;
                    }
 
        .content > .tcenter > tr > td {
            padding: 0px;
        }
        .tcenter table tr td {
            padding: 4px 5px;
            border-right: solid 1px #ffffff;
            border-top: solid 1px #ffffff;
            font-size: 15px;
        }
        .layui-form-item .layui-input-inline {
        width:60px !important;
        }
        .layui-form-label {
        width:60px !important;
        }
    </style>
</head>
<body>
    <div class="border">
        <div class="FourBorder">
            <div class="topleft"></div>
            <div class="topright"></div>
            <div class="bottomleft"></div>
            <div class="bottomright"></div>
        </div>
        <div class="content">
            <div class="ttop">
                <div class="name" style="color:white;padding-left:40px;">属性查询</div>
                <div class="timg" style="padding-right:30px;margin-top:10px;"><img class="imgx" src="../img/关闭.png" /></div>
            </div>
            <hr />
            <div class="layui-form">
                <div class="layui-form-item">
                    <label class="layui-form-label" style="padding-left:0px;">区县</label>
                    <div class="layui-input-inline">
                        <input type="text" name="county" autocomplete="off" list="xjlist" class="layui-input" style="width:80px;height:20px;margin-top:9px;">
                        <datalist id="xjlist">
                            <option value="大通"></option>
                            <option value="互助"></option>
                            <option value="湟源"></option>
                            <option value="湟中"></option>
                            <option value="乐都"></option>
                            <option value="平安"></option>
                            <option value="西宁"></option>
                            <option value="民和"></option>
                        </datalist>
                    </div>
                    <label class="layui-form-label">危害性</label>
                    <div class="layui-input-inline">
                        <input type="text" name="whx" autocomplete="off" list="whxlist" class="layui-input" style="width:80px;height:20px;margin-top:9px;">
                        <datalist id="whxlist">
                            <option value="无">无</option>
                            <option value="小">小</option>
                            <option value="小型">小型</option>
                            <option value="中">中</option>
                            <option value="中型">中型</option>
                            <option value="重大">重大</option>
                            <option value="大">大</option>
                        </datalist>
                    </div>
 
                    <label class="layui-form-label">规模</label>
                    <div class="layui-input-inline">
                        <input type="text" name="guimo" autocomplete="off" list="gmlist" class="layui-input" style="width:80px;height:20px;margin-top:9px;">
                        <datalist id="gmlist">
                            <option value="小型">小型</option>
                            <option value="中型">中型</option>
                            <option value="大型">大型</option>
                            <option value="巨型">巨型</option>
                        </datalist>
                    </div>
                    <label class="layui-form-label">隐患点</label>
                    <div class="layui-input-inline">
                        <input type="text" name="yhd" list="yhdlist" autocomplete="off" class="layui-input" style="width:80px;height:20px;margin-top:9px;">
                        <datalist id="yhdlist">
                            <option value="是">是</option>
                            <option value="否">否</option>
                        </datalist>
                    </div>
                    <div class="layui-input-inline">
                        <button class="layui-btn" lay-submit lay-filter="formDemo" style="margin-left:30px;margin-top:8px;height:24px;line-height:0px;">查询</button>
                    </div>
                    <label class="layui-form-label" style="margin-left:40px;">查询结果:</label>
                    <div class="layui-input-inline">
                        <div id="resultNum" class="layui-form-mid layui-word-aux"></div>
                    </div>
                </div>
                <!--<div class="layui-form-item">
                    <label class="layui-form-label">查询结果:</label>
                    <div class="layui-input-inline">
                        <div id="resultNum" class="layui-form-mid layui-word-aux">1123条</div>
                    </div>
                </div>-->
            </div>
            <div class="scroll_main1">
                <div class="scroll_wrap1">
                    <div class="scroll_cont1">
                        <div id="dataTable" class="tcenter">
 
                        </div>
                        <div class="scroll_bar1">
                            <div class="scroll_slider1"></div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
 
    <script>
        sgworld = window.external.createSgworld();
        var fid = getUrlParam("hshFID");
        new CusScrollBar({
            contentSelector: '.scroll_cont1', //滚动内容区
            barSelector: '.scroll_bar1', //滚动条
            sliderSelector: '.scroll_slider1' //滚动滑块
        });
        layui.use('form', function () {
            var form = layui.form;
            //监听提交
            form.on('submit(formDemo)', function (data) {
                var county = data.field.county;
                var whx = data.field.whx;
                var guimo = data.field.guimo;
                var yhd = data.field.yhd;
                var childID = sgworld.ProjectTree.GetNextItem(fid, 11);
                var childs = [];
                var queryStr;
                if (whx != "" && guimo != "" && county != "" && yhd != "") {
                    queryStr = "'县区' = '" + county + "' AND '是否隐患点' = '" + yhd + "' AND '规模' = '" + guimo + "' AND '危害性' = '" + whx + "'";
                } else if (whx == "" && guimo != "" && county != "" && yhd != "") {
                    queryStr = "'县区' = '" + county + "' AND '是否隐患点' = '" + yhd + "' AND '规模' = '" + guimo + "'";
                }
                else if (whx != "" && guimo == "" && county != "" && yhd != "") {
                    queryStr = "'县区' = '" + county + "' AND '是否隐患点' = '" + yhd + "' AND '危害性' = '" + whx + "'";
                }
                else if (whx != "" && guimo != "" && county == "" && yhd != "") {
                    queryStr = "'是否隐患点' = '" + yhd + "' AND '规模' = '" + guimo + "' AND '危害性' = '" + whx + "'";
                }
                else if (whx != "" && guimo != "" && county != "" && yhd == "") {
                    queryStr = "'县区' = '" + county + "' AND '规模' = '" + guimo + "' AND '危害性' = '" + whx + "'";
                } else if (whx == "" && guimo == "" && county != "" && yhd != "") {
                    queryStr = "'县区' = '" + county + "' AND '是否隐患点' = '" + yhd + "'";
                } else if (whx == "" && guimo != "" && county == "" && yhd != "") {
                    queryStr = "'是否隐患点' = '" + yhd + "' AND '规模' = '" + guimo + "'";
                } else if (whx == "" && guimo != "" && county != "" && yhd == "") {
                    queryStr = "'县区' = '" + county + "' AND '规模' = '" + guimo + "'";
                } else if (whx != "" && guimo == "" && county == "" && yhd != "") {
                    queryStr = "'是否隐患点' = '" + yhd + "' AND '危害性' = '" + whx + "'";
                }
                else if (whx != "" && guimo == "" && county != "" && yhd == "") {
                    queryStr = "'县区' = '" + county + "' AND '危害性' = '" + whx + "'";
                } else if (whx != "" && guimo != "" && county == "" && yhd == "") {
                    queryStr = "'规模' = '" + guimo + "' AND '危害性' = '" + whx + "'";
                } else if (whx == "" && guimo == "" && county == "" && yhd != "") {
                    queryStr = "'是否隐患点' = '" + yhd + "'";
                } else if (whx == "" && guimo == "" && county != "" && yhd == "") {
                    queryStr = "'县区' = '" + county + "'";
                } else if (whx != "" && guimo == "" && county == "" && yhd == "") {
                    queryStr = "'危害性' = '" + whx + "'";
                }
                else if (whx == "" && guimo != "" && county == "" && yhd == "") {
                    queryStr = "'规模' = '" + guimo + "'";
                } else {
                    queryStr = "";
                }
                while (childID) {
                    childs.push({
                        "name": sgworld.ProjectTree.GetItemName(childID),
                        "id": childID
                    });
                    childID = sgworld.ProjectTree.GetNextItem(childID, 13);
                }
                var html = '<table><tr><td>统一编号</td><td>县区</td><td>是否隐患点</td><td>规模</td><td>危害性</td><td>类型</td><td>经度</td><td>纬度</td></tr>';
                var result = 0;
                for (var i = 0; i < childs.length; i++) {
                    var obj = sgworld.ProjectTree.GetObject(childs[i].id);
                    obj.Streaming = false;
                    obj.Refresh();
                    obj.Filter = queryStr;
                    obj.Refresh();
                    var features = obj.FeatureGroups.Item(0).GetCurrentFeatures();
                    var d = features.Count;
                    for (var j = 0; j < features.Count; j++) {
                        result++;
                        html += '<tr id="' + features.Item(j).ID + '" class="pointres"><td>' + features.Item(j).FeatureAttributes.GetFeatureAttribute("统一编号").Value + '</td><td>' + features.Item(j).FeatureAttributes.GetFeatureAttribute("县区").Value + '</td><td>' + features.Item(j).FeatureAttributes.GetFeatureAttribute("是否隐患点").Value + '</td><td>' + features.Item(j).FeatureAttributes.GetFeatureAttribute("规模").Value + '</td><td>' + features.Item(j).FeatureAttributes.GetFeatureAttribute("危害性").Value + '</td><td>' + childs[i].name + '</td><td>' + features.Item(j).FeatureAttributes.GetFeatureAttribute("经度").Value + '</td><td>' + features.Item(j).FeatureAttributes.GetFeatureAttribute("纬度").Value + '</td></tr>';
                    }
                }
                html += "</table>";
                $("#dataTable").empty();
                $("#dataTable").append(html);
                $("#resultNum").empty();
                $("#resultNum").append(result + "条");
                setDbclick();
                return false;
            });
            $(".imgx").click(function () {
                window.external.closeDialog("queryHSH");
            });
            function setDbclick() {
                $('.pointres').hover(function () {
                    $(this).css("backgroundColor", "cadetblue");
                }, function () {
                    if ($(this).attr("data-sel") != "t") {
                        $(this).css("backgroundColor", "#000");
                    }
                });
                $(".pointres").dblclick(function () {
                    $('.pointres').each(function () {
                        $(this).attr("data-sel", "f");
                        $(this).css("backgroundColor", "#000");
                    });
                    $(this).attr("data-sel", "t");
                    $(this).css("backgroundColor", "cadetblue");
                    var id = $(this).attr("id");
                    sgworld.Navigate.FlyTo(id);
                });
            }
            form.render();
        });
    </script>
</body>
</html>