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
| /**
| * 日期格式化
| * @param fmt "YYYY-mm-dd HH:MM"
| * @param date
| * @returns {*}
| */
| function formatDate(fmt, date) {
| let ret;
| const opt = {
| "Y+": date.getFullYear().toString(), // 年
| "m+": (date.getMonth() + 1).toString(), // 月
| "d+": date.getDate().toString(), // 日
| "H+": date.getHours().toString(), // 时
| "M+": date.getMinutes().toString(), // 分
| "S+": date.getSeconds().toString() // 秒
| // 有其他格式化字符需求可以继续添加,必须转化成字符串
| };
|
| for (let k in opt) {
| ret = new RegExp("(" + k + ")").exec(fmt);
| if (ret) {
| fmt = fmt.replace(ret[1], (ret[1].length == 1) ? (opt[k]) : (opt[k].padStart(ret[1].length, "0")))
| }
| }
| return fmt;
| }
|
| /**
| * 饼图加载
| * @param obj
| */
| function pieChartLoad( obj ) {
| var pieChart = echarts.init( $( obj.id )[0]);
|
| var option = {
| series: [
| // 环
| {
| name: '',
| type: 'pie',
| radius: ['48%', '70%'],
| avoidLabelOverlap: false,
| zlevel:2,
| z: 3,
| label: {
| show: false,
| position: 'center'
| },
| emphasis: {
| label: {
| show: false,
| fontSize: '40',
| fontWeight: 'bold'
| }
| },
| itemStyle: {
| normal: {
| color: 'rgba(0,0,0,0.2)'
| }
| },
| labelLine: {
| show: false
| },
| silent: true,
| data: obj.data,
| },
| // 饼
| {
| name: '',
| type: 'pie',
| radius: [ '48%' , '100%'],
| avoidLabelOverlap: false,
| silent: true,
| label: {
| show: false,
| position: 'center',
| },
| itemStyle: {
| normal: {
| color: function(colors) {
| var colorList = obj.colors;
| return colorList[colors.dataIndex]
| },
| borderWidth: 6,
| borderColor: '#001f20'
| }
| },
| labelLine: {
| show: false
| },
| data: obj.data,
| },
| ]
| };
|
| pieChart.setOption( option );
| }
|
| /**
| * 饼图图例加载
| * @param obj
| */
| function pieChartLegendLoad( obj ) {
| var str = '';
| var colorList = obj.colors;
| var allVal = 0;
|
| for( let i=0; i<obj.data.length; i++ ) {
| allVal += obj.data[i].value;
| }
|
| for( let i=0; i<obj.data.length; i++ ) {
| str += `
| <div class="chart-legend-item">
| <span class="item-circle" style="background-color: ${ colorList[i] }"></span>
| <span class="item-label">${ obj.data[i].name }</span>
| <span class="item-stats">${ ( obj.data[i].value / allVal * 100 ).toFixed( 0 ) }%</span>
| </div>
| `;
| }
|
| $( obj.id ).html( str );
| }
|
| /**
| * 空气指数图表加载
| */
| function kqzsChartLoad( num, max ) {
| var chart = echarts.init( $( '#kqzsChart' )[0]);
|
| var option = {
| series: [
| {
| type: 'gauge',
| radius: '96%',
| center: ['50%', '55%'],
| splitNumber: 0, //刻度数量
| startAngle: 230,
| endAngle: -50,
| axisLine: {
| show: true,
| // roundCap: true,
| lineStyle: {
| width: 6,
| color: [
| [
| num/max, new echarts.graphic.LinearGradient(
| 0, 0, 1, 0, [{
| offset: 0,
| color: '#1f91a0'
| },
| {
| offset: 1,
| color: '#33d8cf'
| }
| ]
| )
| ],
| [
| 1, '#084267'
| ]
| ]
| }
| },
| //分隔线样式。
| splitLine: {
| show: false,
| },
| axisLabel: {
| show: false
| },
| axisTick: {
| show: false
| },
| pointer: {
| show: false
| },
| title: {
| show: true,
| offsetCenter: [0, '-23%'], // x, y,单位px
| textStyle: {
| color: '#fff',
| fontSize: 12
| }
| },
| //仪表盘详情,用于显示数据。
| detail: {
| show: true,
| offsetCenter: [0, '26%'],
| color: '#ffffff',
| formatter: function(params) {
| return params
| },
| textStyle: {
| fontSize: 24,
| fontFamily: 'DINCond-Bold',
| }
| },
| data: [
| {
| name: "空气指数",
| value: num
| },
| ]
| }
| ]
| };
|
| chart.setOption( option );
| }
|
| /**
| * 折线图加载
| */
| function lineChartLoad( obj ) {
| var chart = echarts.init( $(obj.id)[0] );
|
| var option = {
| grid: {
| left: '24px',
| right: '15px',
| bottom: '24px',
| top: '50px',
| containLabel: true,
| },
| legend: {
| orient: 'horizontal',
| right: '15px',
| top: 15,
| // icon: 'diamond',
| borderWidth: 0, // 图例边框线宽,单位px,默认为0(无边框)
| padding: 5, // 图例内边距,单位px,默认各方向内边距为5,
| itemGap: 25, // 各个item之间的间隔,单位px,默认为10,
| itemWidth: 17, // 图例图形宽度
| itemHeight: 10, // 图例图形高度
| textStyle: {
| color: '#ffffff', // 图例文字颜色
| fontSize: 12,
| }
| },
| tooltip: {
| trigger: 'axis',
| axisPointer : { // 坐标轴指示器,坐标轴触发有效
| type : 'line', // 默认为直线,可选为:'line' | 'shadow'
| lineStyle: {
| color: '#2CA09C',
| }
| },
| extraCssText: `padding:7px 10px;background:#00243b;color:#D9DEED;box-shadow:0px 0px 6px #86dbff inset;border-radius: 2px;font-size: 12px;`,
| formatter( params ) {
| var str = `<div style="font-size: 12px;color: #ffffff;line-height: 20px;">${ params[0] ? params[0].name : '' }</div>`;
|
| for( var i=0, lens=params.length; i<lens; i++ ) {
|
| if( params[i].value ) {
| str += `<div style="line-height: 22px">
| <span style="display: inline-block;
| width: 12px;
| height: 12px;
| border-radius: 50%;
| background-color: ${ params[i].color};
| margin-right: 4px;
| vertical-align: middle"
| ></span>
| <span style="display:inline-block;min-width: 70px;font-size: 12px;">${ params[i].seriesName }</span>
| <span style="font-size: 12px;">${ params[i].value }</span>
| `;
|
| }
| }
|
| return str;
| },
| },
| xAxis: {
| data: obj.xAxis,
| axisLine: { // 坐标轴线
| show: true, // 默认显示,属性show控制显示与否
| lineStyle: { // 属性lineStyle控制线条样式
| color: 'rgba(15,144,202,0.4)',
| width: 2,
| type: 'solid'
| },
| onZero: false,
| },
| axisTick: { // 坐标轴小标记
| show: false, // 属性show控制显示与否,默认不显示
| },
| axisLabel: { // 坐标轴文本标签,详见axis.axisLabel
| show: true,
| interval: 'auto',
| rotate: 0,
| margin: 14,
| // formatter: null,
| textStyle: { // 其余属性默认使用全局文本样式,详见TEXTSTYLE
| color: '#ffffff',
| fontSize: 14,
| }
| },
| splitLine: { // 分隔线
| show: false, // 默认显示,属性show控制显示与否
| },
| },
| yAxis: [
| {
| name: obj.unit,
| nameTextStyle: {
| color: '#10a5eb',
| fontSize: 14,
| },
| axisLine: { // 坐标轴线
| show: false, // 默认显示,属性show控制显示与否
| lineStyle: { // 属性lineStyle控制线条样式
| color: 'rgba(42,184,192,0.6)',
| width: 1,
| type: 'solid'
| },
| },
| axisTick: { // 坐标轴小标记
| show: false,
| },
| axisLabel: { // 坐标轴文本标签,详见axis.axisLabel
| show: true,
| interval: 0,
| rotate: 0,
| margin: 15,
| // formatter: null,
| textStyle: { // 其余属性默认使用全局文本样式,详见TEXTSTYLE
| color: '#ffffff',
| fontSize: 14,
| }
| },
| splitLine: { // 分隔线
| show: true, // 默认显示,属性show控制显示与否
| // onGap: null,
| lineStyle: { // 属性lineStyle(详见lineStyle)控制线条样式
| color: ['rgba(15,144,202,0.4)'],
| width: 1,
| type: 'solid'
| }
| },
| },
| ],
| series: [
| {
| name: '名称A',
| data: obj.data[0],
| type: 'line',
| smooth: true,
| symbol: 'none',
| color: ['#ffb335'],
| itemStyle: {
| normal: {
| lineStyle: {
| color: '#ffb335',
| lineStyle: {
| width: 1,
| },
| }
| }
| },
| areaStyle: {
| color: {
| type: 'linear',
| x: 0,
| y: 0,
| x2: 0,
| y2: 1,
| colorStops: [{
| offset: 0, color: 'rgba(255,179,53,0.31)' // 0% 处的颜色
| }, {
| offset: 1, color: 'rgba(255,179,53,0)' // 100% 处的颜色
| }],
| global: false // 缺省为 false
| },
| }
| },
| {
| name: '名称B',
| data: obj.data[1],
| type: 'line',
| smooth: true,
| symbol: 'none',
| color: ['#13b4f9'],
| itemStyle: {
| normal: {
| lineStyle: {
| color: '#13b4f9',
| lineStyle: {
| width: 1,
| },
| }
| }
| },
| areaStyle: {
| color: {
| type: 'linear',
| x: 0,
| y: 0,
| x2: 0,
| y2: 1,
| colorStops: [{
| offset: 0, color: 'rgba(19,180,249,0.3)' // 0% 处的颜色
| }, {
| offset: 1, color: 'rgba(19,180,249,0)' // 100% 处的颜色
| }],
| global: false // 缺省为 false
| },
| }
| },
| {
| name: '名称C',
| data: obj.data[2],
| type: 'line',
| smooth: true,
| symbol: 'none',
| color: ['#36b994'],
| itemStyle: {
| normal: {
| lineStyle: {
| color: '#36b994',
| lineStyle: {
| width: 1,
| },
| }
| }
| },
| areaStyle: {
| color: {
| type: 'linear',
| x: 0,
| y: 0,
| x2: 0,
| y2: 1,
| colorStops: [{
| offset: 0, color: 'rgba(54,185,148,0.31)' // 0% 处的颜色
| }, {
| offset: 1, color: 'rgba(54,185,148,0)' // 100% 处的颜色
| }],
| global: false // 缺省为 false
| },
| }
| },
| {
| name: '名称D',
| data: obj.data[3],
| type: 'line',
| smooth: true,
| symbol: 'none',
| color: ['#fc4351'],
| itemStyle: {
| normal: {
| lineStyle: {
| color: '#fc4351',
| lineStyle: {
| width: 1,
| },
| }
| }
| },
| areaStyle: {
| color: {
| type: 'linear',
| x: 0,
| y: 0,
| x2: 0,
| y2: 1,
| colorStops: [{
| offset: 0, color: 'rgba(252,67,81,0.31)' // 0% 处的颜色
| }, {
| offset: 1, color: 'rgba(252,67,81,0)' // 100% 处的颜色
| }],
| global: false // 缺省为 false
| },
| }
| },
| ],
| dataZoom: [
| {
| type: 'inside',
| xAxisIndex: [0],
| filterMode: 'none',
| start: 0,
| end: 100
| }
| ],
| };
|
| chart.setOption( option );
| }
|
| window.onload = function () {
| /*图表加载*/
| var jglxqkChartData = [
| {value: 60, name: '温湿度警告',},
| {value: 40, name: 'pm2.5警告',},
| ];
| pieChartLoad(
| {
| id: '#jglxqkChart',
| colors: ['#10a6ec', '#33d8cf'],
| data: jglxqkChartData,
| }
| );
| pieChartLegendLoad(
| {
| id: '#jglxqkChartLegend',
| colors: ['#10a6ec', '#33d8cf'],
| data: jglxqkChartData,
| }
| );
|
| var jgclqkChartData = [
| {value: 60, name: '已处理',},
| {value: 20, name: '未处理',},
| {value: 10, name: '超时',},
| {value: 10, name: '延期',},
| ];
| pieChartLoad(
| {
| id: '#jgclqkChart',
| colors: ['#00a0e9', '#33d8cf', '#ffb335', '#6369f2',],
| data: jgclqkChartData,
| }
| );
| pieChartLegendLoad(
| {
| id: '#jgclqkChartLegend',
| colors: ['#00a0e9', '#33d8cf', '#ffb335', '#6369f2',],
| data: jgclqkChartData,
| }
| );
| kqzsChartLoad( 32, 100 );
|
| lineChartLoad(
| {
| id: '#jksjsnChart',
| unit: '室内(单位)',
| xAxis: [
| '00:00', '00:15', '00:30', '00:45',
| '01:00', '01:15', '01:30', '01:45',
| '02:00', '02:15', '02:30', '02:45',
| '03:00', '03:15', '03:30', '03:45',
| '04:00', '04:15', '04:30', '04:45',
| '05:00', '05:15', '05:30', '05:45',
| '06:00', '06:15', '06:30', '06:45',
| '07:00', '07:15', '07:30', '07:45',
| '08:00', '08:15', '08:30', '08:45',
| '09:00', '09:15', '09:30', '09:45',
| '10:00', '10:15', '10:30', '10:45',
| '11:00', '11:15', '11:30', '11:45',
| '12:00', '12:15', '12:30', '12:45',
| '13:00', '13:15', '13:30', '13:45',
| '14:00', '14:15', '14:30', '14:45',
| '15:00', '15:15', '15:30', '15:45',
| '16:00', '16:15', '16:30', '16:45',
| '17:00', '17:15', '17:30', '17:45',
| '18:00', '18:15', '18:30', '18:45',
| '19:00', '19:15', '19:30', '19:45',
| '20:00', '20:15', '20:30', '20:45',
| '21:00', '21:15', '21:30', '21:45',
| '22:00', '22:15', '22:30', '22:45',
| '23:00', '23:15', '23:30', '23:45',
| ],
| data: [
| [
| 1820, 1932, 1901, 1934, 1290, 1330, 1320,1820, 1932, 1901, 1820, 1932, 1901, 1934, 1290, 1330, 1320,1820, 1932, 1901, 1820, 1932, 1901, 1934,
| 1820, 1932, 1901, 1934, 1290, 1330, 1320,1820, 1932, 1901, 1820, 1932, 1901, 1934, 1290, 1330, 1320,1820, 1932, 1901, 1820, 1932, 1901, 1934,
| 1820, 1932, 1901, 1934, 1290, 1330, 1320,1820, 1932, 1901, 1820, 1932, 1901, 1934, 1290, 1330, 1320,1820, 1932, 1901, 1820, 1932, 1901, 1934,
| 1820, 1932, 1901, 1934, 1290, 1330, 1320,1820, 1932, 1901, 1820, 1932, 1901, 1934, 1290, 1330, 1320,1820, 1932, 1901, 1820, 1932, 1901, 1934,
| ],
| [
| 2120, 2132, 2201, 1734, 1590, 1830, 1920,1220, 1432, 1701,2120, 2132, 2201, 1734, 1590, 1830, 1920,1220, 1432, 1701,2120, 2132, 2201, 1734,
| 2120, 2132, 2201, 1734, 1590, 1830, 1920,1220, 1432, 1701,2120, 2132, 2201, 1734, 1590, 1830, 1920,1220, 1432, 1701,2120, 2132, 2201, 1734,
| 2120, 2132, 2201, 1734, 1590, 1830, 1920,1220, 1432, 1701,2120, 2132, 2201, 1734, 1590, 1830, 1920,1220, 1432, 1701,2120, 2132, 2201, 1734,
| 2120, 2132, 2201, 1734, 1590, 1830, 1920,1220, 1432, 1701,2120, 2132, 2201, 1734, 1590, 1830, 1920,1220, 1432, 1701,2120, 2132, 2201, 1734,
| ],
| [
| 7, 8, 5, 3, 8, 10, 12, 16, 10, 13,7, 8, 5, 3, 8, 10, 12, 16, 10, 13,7, 8, 5, 3,
| 7, 8, 5, 3, 8, 10, 12, 16, 10, 13,7, 8, 5, 3, 8, 10, 12, 16, 10, 13,7, 8, 5, 3,
| 7, 8, 5, 3, 8, 10, 12, 16, 10, 13,7, 8, 5, 3, 8, 10, 12, 16, 10, 13,7, 8, 5, 3,
| 7, 8, 5, 3, 8, 10, 12, 16, 10, 13,7, 8, 5, 3, 8, 10, 12, 16, 10, 13,7, 8, 5, 3,
| ],
| [
| 1120, 1132, 1201, 1234, 590, 830, 920, 220, 432, 701,1120, 1132, 1201, 734, 590, 830, 920, 220, 432, 701, 1120, 1132, 1201, 734,
| 1120, 1132, 1201, 1234, 590, 830, 920, 220, 432, 701,1120, 1132, 1201, 734, 590, 830, 920, 220, 432, 701, 1120, 1132, 1201, 734,
| 1120, 1132, 1201, 1234, 590, 830, 920, 220, 432, 701,1120, 1132, 1201, 734, 590, 830, 920, 220, 432, 701, 1120, 1132, 1201, 734,
| 1120, 1132, 1201, 1234, 590, 830, 920, 220, 432, 701,1120, 1132, 1201, 734, 590, 830, 920, 220, 432, 701, 1120, 1132, 1201, 734,
| ],
| ]
| }
| );
|
| lineChartLoad(
| {
| id: '#jksjswChart',
| unit: '室外(单位)',
| xAxis: [
| '00:00', '00:15', '00:30', '00:45',
| '01:00', '01:15', '01:30', '01:45',
| '02:00', '02:15', '02:30', '02:45',
| '03:00', '03:15', '03:30', '03:45',
| '04:00', '04:15', '04:30', '04:45',
| '05:00', '05:15', '05:30', '05:45',
| '06:00', '06:15', '06:30', '06:45',
| '07:00', '07:15', '07:30', '07:45',
| '08:00', '08:15', '08:30', '08:45',
| '09:00', '09:15', '09:30', '09:45',
| '10:00', '10:15', '10:30', '10:45',
| '11:00', '11:15', '11:30', '11:45',
| '12:00', '12:15', '12:30', '12:45',
| '13:00', '13:15', '13:30', '13:45',
| '14:00', '14:15', '14:30', '14:45',
| '15:00', '15:15', '15:30', '15:45',
| '16:00', '16:15', '16:30', '16:45',
| '17:00', '17:15', '17:30', '17:45',
| '18:00', '18:15', '18:30', '18:45',
| '19:00', '19:15', '19:30', '19:45',
| '20:00', '20:15', '20:30', '20:45',
| '21:00', '21:15', '21:30', '21:45',
| '22:00', '22:15', '22:30', '22:45',
| '23:00', '23:15', '23:30', '23:45',
| ],
| data: [
| [
| 1820, 1932, 1901, 1934, 1290, 1330, 1320,1820, 1932, 1901, 1820, 1932, 1901, 1934, 1290, 1330, 1320,1820, 1932, 1901, 1820, 1932, 1901, 1934,
| 1820, 1932, 1901, 1934, 1290, 1330, 1320,1820, 1932, 1901, 1820, 1932, 1901, 1934, 1290, 1330, 1320,1820, 1932, 1901, 1820, 1932, 1901, 1934,
| 1820, 1932, 1901, 1934, 1290, 1330, 1320,1820, 1932, 1901, 1820, 1932, 1901, 1934, 1290, 1330, 1320,1820, 1932, 1901, 1820, 1932, 1901, 1934,
| 1820, 1932, 1901, 1934, 1290, 1330, 1320,1820, 1932, 1901, 1820, 1932, 1901, 1934, 1290, 1330, 1320,1820, 1932, 1901, 1820, 1932, 1901, 1934,
| ],
| [
| 2120, 2132, 2201, 1734, 1590, 1830, 1920,1220, 1432, 1701,2120, 2132, 2201, 1734, 1590, 1830, 1920,1220, 1432, 1701,2120, 2132, 2201, 1734,
| 2120, 2132, 2201, 1734, 1590, 1830, 1920,1220, 1432, 1701,2120, 2132, 2201, 1734, 1590, 1830, 1920,1220, 1432, 1701,2120, 2132, 2201, 1734,
| 2120, 2132, 2201, 1734, 1590, 1830, 1920,1220, 1432, 1701,2120, 2132, 2201, 1734, 1590, 1830, 1920,1220, 1432, 1701,2120, 2132, 2201, 1734,
| 2120, 2132, 2201, 1734, 1590, 1830, 1920,1220, 1432, 1701,2120, 2132, 2201, 1734, 1590, 1830, 1920,1220, 1432, 1701,2120, 2132, 2201, 1734,
| ],
| [
| 7, 8, 5, 3, 8, 10, 12, 16, 10, 13,7, 8, 5, 3, 8, 10, 12, 16, 10, 13,7, 8, 5, 3,
| 7, 8, 5, 3, 8, 10, 12, 16, 10, 13,7, 8, 5, 3, 8, 10, 12, 16, 10, 13,7, 8, 5, 3,
| 7, 8, 5, 3, 8, 10, 12, 16, 10, 13,7, 8, 5, 3, 8, 10, 12, 16, 10, 13,7, 8, 5, 3,
| 7, 8, 5, 3, 8, 10, 12, 16, 10, 13,7, 8, 5, 3, 8, 10, 12, 16, 10, 13,7, 8, 5, 3,
| ],
| [
| 1120, 1132, 1201, 1234, 590, 830, 920, 220, 432, 701,1120, 1132, 1201, 734, 590, 830, 920, 220, 432, 701, 1120, 1132, 1201, 734,
| 1120, 1132, 1201, 1234, 590, 830, 920, 220, 432, 701,1120, 1132, 1201, 734, 590, 830, 920, 220, 432, 701, 1120, 1132, 1201, 734,
| 1120, 1132, 1201, 1234, 590, 830, 920, 220, 432, 701,1120, 1132, 1201, 734, 590, 830, 920, 220, 432, 701, 1120, 1132, 1201, 734,
| 1120, 1132, 1201, 1234, 590, 830, 920, 220, 432, 701,1120, 1132, 1201, 734, 590, 830, 920, 220, 432, 701, 1120, 1132, 1201, 734,
| ],
| ]
| }
| );
|
| $('.tab-box-1 .tab-item').on('click', (e)=>{
| $('.tab-box-1 .tab-item').removeClass('is_act');
| $(e.target).addClass('is_act');
| var id = e.target.id;
| if(id == "box-1"){
| $("#stats-group-1 .stats-item").hide();
| $("#stats-group-1 #name1").text("温度");
| $("#stats-group-1 #name2").text("湿度");
| $("#stats-group-1 #name1").parent().show();
| $("#stats-group-1 #name2").parent().show();
| }
| if(id == "box-2"){
| $("#stats-group-1 .stats-item").hide();
| $("#stats-group-1 #name1").text("有毒气体");
| $("#stats-group-1 #name2").text("可燃气体");
| $("#stats-group-1 #name1").parent().show();
| $("#stats-group-1 #name2").parent().show();
| }
| if(id == "box-3"){
|
| $("#stats-group-1 #name1").text("温度");
| $("#stats-group-1 #name2").text("湿度");
| $("#stats-group-1 .stats-item").show();
| }
| });
| $('.tab-box-2 .tab-item').on('click', (e)=>{
| console.log(e.target);
| $('.tab-box-2 .tab-item').removeClass('is_act');
| $(e.target).addClass('is_act');
| });
|
| /*时间加载*/
| var dateTime = $('#dateTime');
|
| dateTime.html( formatDate( 'YYYY-mm-dd HH:MM:SS', new Date() ) );
|
| setInterval(()=> {
| dateTime.html( formatDate( 'YYYY-mm-dd HH:MM:SS', new Date() ) );
| }, 1000);
|
| // $('.item-info-panel-num').counterUp({
| // delay: 20,//每个数字动画的延迟时间,单位毫秒。
| // time: 1500//计数动画总的持续时间。
| // });
|
| };
|
|
|
|