赣州市洪水风险预警系统二维版本
xiebin
2023-03-02 b39483c96ae572121d3c619c0b9d37634e682cc4
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
/**
 *@Author : TengZH
 *@CreateTime : 2018-11-28 10:34
 *@Description :
 */
define([
    'dojo/query',
    "dojo/_base/declare",
    "dojo/_base/lang",
    "base/AppEvent",
    "base/ConfigData",
    "iframe/jcyj/js/dataShow.js",
    "dojo/dom",
    "dojo/dom-construct",
    "dojo/dom-attr",
    "dojo/dom-class",
    "dojo/dom-style",
    "dojo/on",
    "dojo/fx",
    "jslibs/echarts.min",
    "widgets/myModules/config",
    "dojo/domReady!"
], function (dojoQuery,
             declare,
             lang,
             AppEvent,
             ConfigData,
             dataShow,
             dom,
             domConstruct,
             domAttr,
             domClass,
             domStyle,
             on,
             fx,
             echarts,
             config) {
    var modules = declare('monitorSpots', null, {
        _layui: null,
        _laydate: null,
        item: null,
        domIndex: null,
        constructor: function (options) {
            moniObj = this;
            //初始化layui弹窗
            layui.use('layer', lang.hitch(this, function () {
                this._layui = layui.layer;
            }));
            layui.use('laydate', lang.hitch(this, function () {
                this._laydate = layui.laydate;
            }));
            //动态添加CSS样式
            domConstruct.create("link", {
                    href: 'widgets/myModules/monitorSpots.css',
                    type: 'text/css',
                    rel: 'stylesheet'
                },
                document.getElementsByTagName('head')[0]);
        },
        popup: function (e) {
            moniObj.item = e.attributes;
            var title = this.item.name || '监控点(一)';
            if (this.domIndex) this._layui.close(this.domIndex);
            this.domIndex = this._layui.open({
                type: 1,
                // offset: ['center', 'center'],
                area: ['1000px', '80%'],
                resize: false,
                scrollbar: false,
                closeBtn: 2,
                shade: 0,
                title: [title, 'line-height: 40px;height: 40px;font-size:16px;font-weight:bolder;color:#108bab;letter-spacing: 1px;'],
                content: '<div class="monitorSpots-container">' +
                '<div class="monitorSpots-tab-control"></div>' +
                '<div class="monitorSpots-tab-container" id="monitorSpots-tab-container"></div></div>',
                success: this.onSuccess,
                cancel: this.onCancel
            });
        },
        onSuccess: function (layero, index) {
            if($("#tabcontainer").css("display") == "none"){
                $('.layui-layer').css({//自动居中无效--手动设置弹窗居中
                    position: 'absolute',
                    top: ($(window).height() - $('.layui-layer').height()) / 2,
                    left: ($(window).width() - $('.layui-layer').width()) / 2,
                });
            }else{
                if($(window).width() < 1410 ){
                    $('.layui-layer').css({//自动居中无效--手动设置弹窗居中
                        position: 'absolute',
                        top: ($(window).height() - $('.layui-layer').height()) / 2,
                        left: ($(window).width() - $('.layui-layer').width()) / 2,
                    });
                }else{
                    $('.layui-layer').css({//自动居中无效--手动设置弹窗居中
                        position: 'absolute',
                        top: ($(window).height() - $('.layui-layer').height()) / 2,
                        left: ($(window).width() - $('.layui-layer').width() + 400) / 2,
                    });    
                }
            }
            
            //添加tab按钮和生成第一个选中按钮的内容
            var tabControl = layero[0].children[1].children[0].children[0];
            var tabContainer = layero[0].children[1].children[0].children[1];
            var ul = domConstruct.create('ul', {}, tabControl);
            // 遍历属性生成tab标签
            for (var i in moniObj.item.itemList) {
                var li = domConstruct.create('li', {
                    data: i,
                    style: 'background:url(widgets/myModules/images/tab/' + i + '.png) 20px center no-repeat #F4F4F4;'
                }, ul);
                domConstruct.create('span', {
                    innerHTML: i,
                }, li);
                // 注册每一个tab标签的点击事件
                on(li, 'click', lang.hitch(layero[0].children[1].children[0], function (e) {
                    var target = e.target.nodeName.toUpperCase() == 'LI' ? e.target : e.target.parentNode;
                    if (!domClass.contains(target, 'monitorSpots-tab-control-actived')) {
                        dojoQuery('.monitorSpots-tab-control-actived').removeClass('monitorSpots-tab-control-actived');
                        domClass.add(target, 'monitorSpots-tab-control-actived');
                        //先销毁当前容器
                        domConstruct.destroy('monitorSpots-tab-container');
                        var domNode = domConstruct.create('div', {
                            id: 'monitorSpots-tab-container',
                            class: 'monitorSpots-tab-container'
                        }, this);
                        moniObj.domCreate(target.attributes.data.value, domNode);
                    }
                }));
            }
            //默认选中第一个tab标签,并填充内容
            dojoQuery('.monitorSpots-tab-control ul li').forEach(function (node, index) {
                if (index == 0) {
                    domClass.add(node, 'monitorSpots-tab-control-actived');
                    moniObj.domCreate(domAttr.get(node, 'data'), tabContainer);
                }
            });
        },
        onCancel: function (index, layero) {
        },
        destroy: function () {
            layui.closeAll('page');
        },
        domCreate: function (name, domNode) {//根据tab标签填充内容
            switch (name) {
                case '实时数据':
                    var leftdiv = domConstruct.create('div', {
                        class: 'monitorSpots-tab-container-left'
                    }, domNode);
                    var timebar = domConstruct.create('p', {
                        innerHTML: new Date().format("yyyy-MM-dd hh:mm:ss"),
                        id: 'data-time'
                    }, leftdiv);
                    var tableDiv = domConstruct.create('div', {
                        class: 'monitorSpots-table-container'
                    }, leftdiv);
                    var table = domConstruct.create('table', {
                        id: 'monitor-table',
                        innerHTML: '<tbody></tbody>'
                    }, tableDiv);
                    var rightdiv = domConstruct.create('div', {
                        class: 'monitorSpots-tab-container-right'
                    }, domNode);
                    var rightdiv1 = domConstruct.create('div', {
                        class: 'monitorSpots-tab-container-right-box'
                    }, rightdiv);
                    var pielist = domConstruct.create('div', {
                        class: 'pie-list'
                    }, rightdiv1);
                    moniObj.environmentalMonitor(document.getElementById('monitor-table').childNodes[0], pielist);
                    break;
                case '历史监测':
                case '历史数据':
                    var top = domConstruct.create('div', {
                        class: 'monitorSpots-tab-container-top'
                    }, domNode);
                    var bottom = domConstruct.create('div', {
                        class: 'monitorSpots-tab-container-bottom'
                    }, domNode);
                    moniObj.monitorHistory(top, bottom);
                    break;
                case '全景':
                    if (moniObj.item.quanjingUrl) {
                        var center = domConstruct.create('div', {
                            class: 'monitorSpots-tab-container-center'
                        }, domNode);
                        var iframe = domConstruct.create('iframe', {
                            src: moniObj.item.Url,
                            frameborder: '0'
                        }, center);
                    } else {
                        var center = domConstruct.create('div', {
                            class: 'monitorSpots-tab-container-center',
                            innerHTML: '<center style="top: 45%;position: relative;font-size: 16px;color: #a9a9a9;font-weight: bolder;">—_—!!~暂无全景信息</center>'
                        }, domNode);
                    }
                    break;
                case '视频监控':
                    if (moniObj.item.hasOwnProperty('videoUrl') && moniObj.item.videoUrl) {
                        var center = domConstruct.create('div', {
                            class: 'monitorSpots-tab-container-center'
                        }, domNode);
                        var iframe = domConstruct.create('iframe', {
                            src: moniObj.item.videoUrl,
                            frameborder: '0'
                        }, center);
                    } else {
                        var center = domConstruct.create('div', {
                            class: 'monitorSpots-tab-container-center',
                            innerHTML: '<center style="top: 45%;position: relative;font-size: 16px;color: #a9a9a9;font-weight: bolder;">—_—!!~暂无视频信息</center>'
                        }, domNode);
                    }
                    break;
                case '生态监测':
                    var topleftdiv = domConstruct.create('div', {
                        class: 'monitorSpots-tab-container-top-left'
                    }, domNode);
                    var table = domConstruct.create('table', {
                        id: 'ecological-table',
                        innerHTML: '<tbody></tbody>'
                    }, topleftdiv);
                    var toprightdiv = domConstruct.create('div', {
                        class: 'monitorSpots-tab-container-top-right'
                    }, domNode);
                    domConstruct.create('p', {
                        class: 'monitorSpots-tab-container-bottom-p',
                        innerHTML: 'EI=0.25x生物丰度指数+0.2x植被覆盖指数+0.2x水网密度指数+0.2x土地退化指数+0.15x环境质量指数'
                    }, domNode);
                    moniObj.ecologicalRegime(document.getElementById('ecological-table').childNodes[0], toprightdiv);
                    break;
                case '基本信息':
                    var center = domConstruct.create('div', {
                        class: 'monitorSpots-tab-container-center'
                    }, domNode);
                    var tableContainer = domConstruct.create('div', {class: 'monitorSpots-tab-container-center-table-container'}, center)
                    var table = domConstruct.create('table', {id: 'base-info-tale'}, tableContainer);
                    var tbody = domConstruct.create('tbody', {}, table);
                    moniObj.baseInfo(tbody);
                    break;
                default:
                    break;
            }
            $('.monitorSpots-tab-control ul>li').eq(2).find('span').css({'float':'left','margin-left':'70px'})
            $(".monitorSpots-tab-container-right").mCustomScrollbar("destroy");
            $(".monitorSpots-tab-container-right").mCustomScrollbar();
            
        },
        environmentalMonitor: function (tableBody, pieList) {
//             $.ajax({
// //              url: config.ajaxUrl['实时数据'],
//                 url: getNativePath() + 'naturalFactors/findElementRealTimeByStcd.do',
//                 type: 'get',
//                 data: {stcd: moniObj.item.id},
//                 dataType: 'json',
//                 async: true,
//                 success: function (e) {
//                     console.log(e.data);
//                     config.item = [];
//                     var tableData = {};//表格数据
//                     var pieData = {};//饼图数据
//                     var flag = 0;
//                     if(e.data != null && e.data.length>0 && flag == 0){
//                         flag++;
//                         if(e.data[0]['UPTIME']){
//                             for (var eKey in e.data) {//遍历结果
//                                 var filedList = e.data[eKey];
//                                 for (var filedListKey in filedList) {
//                                     if (filedListKey != 'UPTIME') {
//                                         var item = filedList[filedListKey];
//                                         config.item.push([filedListKey, filedList[filedListKey].fieldName, filedList[filedListKey].unit]);//存储当前所包括的监测指标
//                                         tableData[filedList[filedListKey].fieldName] = filedList[filedListKey].explain ? filedList[filedListKey].explain :
//                                             filedList[filedListKey].value ? (filedList[filedListKey].value).toFixed(2) + ' ' + filedList[filedListKey].unit : '0 ' + filedList[filedListKey].unit;
//                                         pieData[filedList[filedListKey].fieldName] = {
//                                             value: filedList[filedListKey].value ? parseFloat((filedList[filedListKey].value).toFixed(2)) : 0,
//                                             unit: filedList[filedListKey].unit
//                                         };
//                                     } else {
//                                         dojoQuery('#data-time').forEach(function (node) {
//                                             node.innerHTML = filedList[filedListKey];
//                                         });
//                                     }
//                                 }
//                             }
//                         }else{
//                             $('#monitorSpots-tab-container').html('<center style="top: 45%;position: relative;font-size: 16px;color: #a9a9a9;font-weight: bolder;">—_—!!~暂无实时数据</center>')
//                         }
//                     }else{
//                         $('#monitorSpots-tab-container').html('<center style="top: 45%;position: relative;font-size: 16px;color: #a9a9a9;font-weight: bolder;">—_—!!~暂无实时数据</center>')
//                     }
                                        
//                     var cow = 0, count = 0;
//                     for (var itemKey in tableData) {
//                         //填充表格,每行四列
//                         if (cow == 0) {
//                             var tr = domConstruct.create('tr', {}, tableBody);
//                         }
//                         cow++;
//                         domConstruct.create('td', {
//                             innerHTML: itemKey,
//                             style: 'background:url(widgets/myModules/images/monitorItem/' + itemKey + '.png) 20px center no-repeat;background-size: 25px;'
//                         }, tr);//指标名称
//                         domConstruct.create('td', {innerHTML: tableData[itemKey]}, tr);//指标监测值
//                         if (cow == 2) {
//                             cow = 0;
//                         }
 
//                         // 统计监测指标个数
//                         count++;
//                         //添加对应的实时数据仪表盘dom
//                         var piedom = domConstruct.create('div', {class: 'pie-div'}, pieList);
//                         //构造仪表盘
//                         config.pieoption.series[0].data[0].value = pieData[itemKey].value;
//                         config.pieoption.series[0].data[0].name = itemKey;
//                         config.pieoption.series[0].min = config.valueLimit.hasOwnProperty(itemKey) ? config.valueLimit[itemKey].min : 0;
//                         config.pieoption.series[0].max = config.valueLimit.hasOwnProperty(itemKey) ? config.valueLimit[itemKey].max : 100;
//                         config.pieoption.series[0].detail.formatter = function (value) {
//                             return value.toString() + pieData[itemKey].unit;
//                         };
//                         config.pieoption.tooltip.formatter = "{b}: {c}" + pieData[itemKey].unit;
//                         var pie = echarts.init(piedom);
//                         pie.setOption(config.pieoption, true);
//                         // setTimeout((function (e) {
//                         //     e.resize();
//                         // })(pie), 1000);
//                     }
//                     //根据监测指标个数设置容器宽度,并判断是否生成切换按钮
//                     if (count > 4) {
//                         var leftbutton = domConstruct.create('button', {
//                             class: 'pie-left'
//                         }, pieList.parentNode);
//                         var rightbutton = domConstruct.create('button', {
//                             class: 'pie-right'
//                         }, pieList.parentNode);
//                         var remainder = count % 2;
//                         if (remainder) {
//                             var width = 235 * (parseInt(count / 2) + 1);
//                         } else {
//                             var width = 235 * (parseInt(count / 2));
//                         }
//                         width = width.toString() + 'px';
//                         domStyle.set(pieList, 'width', width);
 
//                         //绑定左右切换按钮点击事件
//                         on(leftbutton, 'click', lang.hitch(pieList, function () {
//                             var left = domStyle.get(this, 'left');
//                             var domWidth = domStyle.get(this, 'width');
//                             var showWidth = domStyle.get(this.parentNode, 'width');
//                             if (left < 0 && (left % showWidth) == 0) {
//                                 left += showWidth;
//                                 fx.slideTo({node: this, left: left, units: "px"}).play();
//                             }
//                         }));
//                         on(rightbutton, 'click', lang.hitch(pieList, function () {
//                             var right = domStyle.get(this, 'left');
//                             var domWidth = domStyle.get(this, 'width');
//                             var showWidth = domStyle.get(this.parentNode, 'width');
//                             if (right <= 0 && domWidth > (showWidth - right) && (right % showWidth) == 0) {
//                                 right -= showWidth;
//                                 fx.slideTo({node: this, left: right, units: "px"}).play();
//                             }
//                         }));
//                     }
                    
//                     $(".monitorSpots-table-container").mCustomScrollbar("destroy");
//             $(".monitorSpots-table-container").mCustomScrollbar();
//                 }
//             });
        },
        monitorHistory: function (topDom, bottomDom) {
            //生成条件选择框,和按钮
            var optionstr = '';
            for (var i = 0; i < config.item.length; i++) {
                optionstr += '<option data="' + config.item[i][0] + '" unit="' + config.item[i][2] + '">' + config.item[i][1] + '</option>'
            }
            var itemSelect = domConstruct.create('select', {
                id: 'item-select',
                innerHTML: optionstr
            }, topDom);
            var yesterday = new Date().getTime() - 1000 * 60 * 60 * 8;
            var beginTimeSelect = domConstruct.create('input', {
                id: 'begin-time',
                readOnly: 'readOnly',
                value: new Date(yesterday).format('yyyy-MM-dd hh:mm:ss')
            }, topDom);
            var endTimeSelect = domConstruct.create('input', {
                id: 'end-time',
                readOnly: 'readOnly',
                value: new Date().format('yyyy-MM-dd hh:mm:ss')
            }, topDom);
            var submit = domConstruct.create('button', {
                id: 'item-select',
                innerHTML: '查询'
            }, topDom);
 
            //layer初始化时间选择
            moniObj._laydate.render({
                elem: '#begin-time', //指定元素
                type: 'datetime'
            });
            moniObj._laydate.render({
                elem: '#end-time', //指定元素
                type: 'datetime'
            });
 
            //生成折线图dom,并初始化第一项监测指标的折线图
            var lineDom = domConstruct.create('div', {
                class: 'line-div'
            }, bottomDom);
            var line = echarts.init(lineDom);
 
            function freshLine(item) {
//                 $.ajax({
// //                  url: config.ajaxUrl['历史数据'],
//                     url: getNativePath() +  'naturalFactors/findElementsByStcdAndElementId.do',
//                     type: 'post',
//                     data: {
//                         stcd: moniObj.item.id,
//                         startTime: domAttr.get('begin-time', 'value'),
//                         endTime: domAttr.get('end-time', 'value')
//                     },
//                     dataType: 'json',
//                     async: true,
//                     success: function (e) {
//                         if(e.data.length>0){
//                             for (var dataKey in e.data) {//遍历结果,筛选对应指标值
//                                 if (e.data[dataKey].filedsName == item) {
//                                     var data = e.data[dataKey].datas;
//                                     var unit = e.data[dataKey].units != '无' ? e.data[dataKey].units : '';
//                                 }
//                             }
//                             var seriesdata = [];
//                             var xAxisdata = [];
//                             for (var dataKey1 in data) {
//                                 seriesdata.push(parseFloat(data[dataKey1].value.toFixed(2)));
//                                 xAxisdata.push(data[dataKey1].update);
//                             }
//                             if (xAxisdata.length > 10) {
//                                 config.lineoption.dataZoom[0].show = true;
//                                 config.lineoption.dataZoom[0].endValue = xAxisdata.length - 1;
//                                 config.lineoption.dataZoom[0].startValue = xAxisdata.length - 11;
//                             }
//                             if (xAxisdata.length > 0) {
//                                 config.lineoption.series[0].name = item;
//                                 config.lineoption.yAxis.name = item + " " + unit;
//                                 config.lineoption.xAxis.data = xAxisdata;
//                                 config.lineoption.series[0].data = seriesdata;
//                                 config.lineoption.tooltip.formatter = "{b}<br>{a}: {c} " + unit;
//                                 line.setOption(config.lineoption, true);
//                             }
//                         }else{
//                             $('#monitorSpots-tab-container').html('<center style="top: 45%;position: relative;font-size: 16px;color: #a9a9a9;font-weight: bolder;">—_—!!~暂无历史数据</center>')
//                         }                       
//                     }
//                 });
            }
 
            freshLine(domAttr.get('item-select', 'value'));//默认加载第一项
 
            //绑定查询按钮点击事件
            on(submit, 'click', lang.hitch(line, function () {
                config.lineoption.series[0].name = itemSelect.options[itemSelect.options.selectedIndex].innerHTML;
                config.lineoption.yAxis.name = itemSelect.options[itemSelect.options.selectedIndex].innerHTML;
                // config.lineoption.series[0].data = ydata;
                // config.lineoption.xAxis.data = xdata;
                // config.lineoption.tooltip.formatter = "{a}: {c}"+config.item[0];
                this.setOption(config.lineoption, true);
 
                freshLine(domAttr.get('item-select', 'value'));
            }));
 
            on(itemSelect, 'change', function () {//指标切换自动刷新
                freshLine(domAttr.get('item-select', 'value'));
            });
        },
        ecologicalRegime: function (tableBody, rightDom) {
            var item = {
                '植被覆盖指数': 70,
                '生物丰度指数': 52,
                '环境质量指数': 85,
                '土地退化指数': 45,
                '水网密度指数': 30
            };
            config.item = [];
            var cow = 0,
                EI = item['植被覆盖指数'] * 0.2 + item['生物丰度指数'] * 0.25 + item['环境质量指数'] * 0.15 + item['土地退化指数'] * 0.2 + item['水网密度指数'] * 0.2;
            config.radaoption.radar.indicator = [];
            config.radaoption.series[0].data[0].value = [];
            for (var itemKey in item) {
                config.item.push(itemKey);
                //填充表格,每行两列
                if (cow == 0) {
                    var tr = domConstruct.create('tr', {}, tableBody);
                }
                cow++;
                domConstruct.create('td', {
                    innerHTML: itemKey,
                    style: 'background:url(widgets/myModules/images/ecologicalRegime/' + itemKey + '.png) 30px center no-repeat'
                }, tr);//指标名称
                domConstruct.create('td', {innerHTML: item[itemKey]}, tr);//指标监测值
                if (cow == 1) {
                    cow = 0;
                }
                //设置雷达图各项指标值
                config.radaoption.radar.indicator.push({name: itemKey, max: 100});
                config.radaoption.series[0].data[0].value.push(item[itemKey]);
            }
            //在列表底部添加生态状况指数
            var lasttr = domConstruct.create('tr', {}, tableBody);
            domConstruct.create('td', {
                innerHTML: '生态状况指数',
                style: 'background:url(widgets/myModules/images/ecologicalRegime/生态状况指数.png) 30px center no-repeat'
            }, lasttr);//指标名称
            domConstruct.create('td', {innerHTML: EI}, lasttr);//指标监测值
 
            //初始化雷达图
            var radadom = domConstruct.create('div', {
                class: 'rada-div'
            }, rightDom);
            var rada = echarts.init(radadom);
            rada.setOption(config.radaoption, true);
 
            //在雷达图右上角生成生态状况指数级别
            var ecoClass, backgroundColor, backgroundColor2;
            if (EI >= 80) {
                ecoClass = '优';
                backgroundColor = '#55a67e';
                backgroundColor2 = '#85cca9';
            } else if (EI >= 60) {
                ecoClass = '良';
                backgroundColor = '#F6AD46';
                backgroundColor2 = '#FAC57A';
            } else {
                ecoClass = '差';
                backgroundColor = '#fa4650';
                backgroundColor2 = '#ff87a5';
            }
            var coverdiv = domConstruct.create('div', {
                class: 'cover-div',
                innerHTML: '<div class="cover-div-top" style="background-color: ' + backgroundColor + '">' + ecoClass +
                '</div><div class="cover-div-bottom" style="background-color: ' + backgroundColor2 + '">生态状况</div>'
            }, rightDom);
        },
        baseInfo: function (dom) {
            var item = {
                "displayFieldName": "NAME",
                "fieldAliases": {
                    "OBJECTID": "OBJECTID",
                    "PILOT_YEAR": "试点年份",
                    "ACCEPTED": "是否通过验收",
                    "ACCEPTED_YEAR": "通过验收年份",
                    "LON_LAT": "经纬度",
                    "NAME": "湿地公园名称",
                    "TYPE": "湿地公园级别",
                    "TOTAL_AREA": "湿地公园总面积",
                    "WETLAND_AREA": "湿地面积",
                    "CONSERVATION_AREA": "保育区面积",
                    "REBUILD_AREA": "恢复重建区面积",
                    "COUNTY": "县区",
                    "CITY": "州市",
                    "SHAPE.STArea()": "SHAPE.STArea()",
                    "SHAPE.STLength()": "SHAPE.STLength()"
                },
                "features": [{
                    "attributes": {
                        "OBJECTID": 20,
                        "PILOT_YEAR": "2008年",
                        "ACCEPTED": "是",
                        "ACCEPTED_YEAR": "2011年",
                        "LON_LAT": "E116°23′39″\uFF5E116°44′38″N28°56′52″\uFF5E29°13′31″",
                        "NAME": "江西东鄱阳湖国家湿地公园",
                        "TYPE": "国家级",
                        "TOTAL_AREA": 36285,
                        "WETLAND_AREA": 35116.099999999999,
                        "CONSERVATION_AREA": 24612,
                        "REBUILD_AREA": 1853,
                        "COUNTY": "鄱阳县",
                        "CITY": "上饶市",
                        "SHAPE.STArea()": 0.033932051896044868,
                        "SHAPE.STLength()": 2.5932066792505917
                    },
                }]
            }
            var count = 0;//计数器
            for (var itemKey in item.features[0].attributes) {
                var alias = item.fieldAliases[itemKey];
                var test = new RegExp("[\\u4E00-\\u9FFF]+", "g");
                if (test.test(alias)) {//正则表达式过滤掉纯英文字符
                    if (count == 0) {
                        var tr = domConstruct.create('tr', {}, dom);
                    }
                    var td = domConstruct.create('td', {innerHTML: alias + ':'}, tr);
                    domConstruct.create('td', {innerHTML: item.features[0].attributes[itemKey]}, tr);
                    count++;
                    if (count == 2) {//每两项就换行
                        count = 0;
                    }
                }
            }
        }
    });
    return modules;
});