|
@@ -22,6 +22,7 @@ layui.define(['table', 'form', 'admin', 'layer', 'common','sessions', 'xmSelect' |
|
@@ -22,6 +22,7 @@ layui.define(['table', 'form', 'admin', 'layer', 'common','sessions', 'xmSelect' |
22
|
var accessToken = sessions.getToken()['access_token'];
|
22
|
var accessToken = sessions.getToken()['access_token'];
|
23
|
var noticeUserChart = echarts.init(document.getElementById('notice_chart_user'));
|
23
|
var noticeUserChart = echarts.init(document.getElementById('notice_chart_user'));
|
24
|
var noticeTypeChart = echarts.init(document.getElementById('notice_chart_type'));
|
24
|
var noticeTypeChart = echarts.init(document.getElementById('notice_chart_type'));
|
|
|
25
|
+ // var noticeUserChartNew = echarts.init(document.getElementById('notice_chart_user_new'));
|
25
|
|
26
|
|
26
|
//回车搜索
|
27
|
//回车搜索
|
27
|
$('#notice_search_keyword').keydown(function (e) {
|
28
|
$('#notice_search_keyword').keydown(function (e) {
|
|
@@ -39,6 +40,9 @@ layui.define(['table', 'form', 'admin', 'layer', 'common','sessions', 'xmSelect' |
|
@@ -39,6 +40,9 @@ layui.define(['table', 'form', 'admin', 'layer', 'common','sessions', 'xmSelect' |
39
|
reloadData();
|
40
|
reloadData();
|
40
|
});
|
41
|
});
|
41
|
|
42
|
|
|
|
43
|
+ $('#queryMore').on('click',function(){
|
|
|
44
|
+ queryData();
|
|
|
45
|
+ });
|
42
|
form.render();
|
46
|
form.render();
|
43
|
|
47
|
|
44
|
getChartData();
|
48
|
getChartData();
|
|
@@ -350,6 +354,15 @@ layui.define(['table', 'form', 'admin', 'layer', 'common','sessions', 'xmSelect' |
|
@@ -350,6 +354,15 @@ layui.define(['table', 'form', 'admin', 'layer', 'common','sessions', 'xmSelect' |
350
|
}
|
354
|
}
|
351
|
}
|
355
|
}
|
352
|
},
|
356
|
},
|
|
|
357
|
+ emphasis: {
|
|
|
358
|
+ itemStyle: {
|
|
|
359
|
+ color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
|
|
360
|
+ { offset: 0, color: '#2378f7' },
|
|
|
361
|
+ { offset: 0.7, color: '#2378f7' },
|
|
|
362
|
+ { offset: 1, color: '#83bff6' }
|
|
|
363
|
+ ])
|
|
|
364
|
+ }
|
|
|
365
|
+ },
|
353
|
}]
|
366
|
}]
|
354
|
|
367
|
|
355
|
var option = {
|
368
|
var option = {
|
|
@@ -408,9 +421,23 @@ layui.define(['table', 'form', 'admin', 'layer', 'common','sessions', 'xmSelect' |
|
@@ -408,9 +421,23 @@ layui.define(['table', 'form', 'admin', 'layer', 'common','sessions', 'xmSelect' |
408
|
}
|
421
|
}
|
409
|
}
|
422
|
}
|
410
|
}],
|
423
|
}],
|
411
|
- series: series
|
424
|
+ series: series,
|
|
|
425
|
+ dataZoom: [
|
|
|
426
|
+ {
|
|
|
427
|
+ type: 'inside'
|
|
|
428
|
+ }
|
|
|
429
|
+ ],
|
412
|
}
|
430
|
}
|
413
|
echartObject.setOption(option)
|
431
|
echartObject.setOption(option)
|
|
|
432
|
+ const zoomSize = 6;
|
|
|
433
|
+ echartObject.on('click', function (params) {
|
|
|
434
|
+ echartObject.dispatchAction({
|
|
|
435
|
+ type: 'dataZoom',
|
|
|
436
|
+ startValue: xData[Math.max(params.dataIndex - zoomSize / 2, 0)],
|
|
|
437
|
+ endValue:
|
|
|
438
|
+ xData[Math.min(params.dataIndex + zoomSize / 2, yData.length - 1)]
|
|
|
439
|
+ });
|
|
|
440
|
+ });
|
414
|
}
|
441
|
}
|
415
|
|
442
|
|
416
|
//获取图表数据
|
443
|
//获取图表数据
|
|
@@ -448,6 +475,7 @@ layui.define(['table', 'form', 'admin', 'layer', 'common','sessions', 'xmSelect' |
|
@@ -448,6 +475,7 @@ layui.define(['table', 'form', 'admin', 'layer', 'common','sessions', 'xmSelect' |
448
|
loadNoticeChart(noticeTypeChart,xData,yData)
|
475
|
loadNoticeChart(noticeTypeChart,xData,yData)
|
449
|
}
|
476
|
}
|
450
|
})
|
477
|
})
|
|
|
478
|
+
|
451
|
$.ajax({
|
479
|
$.ajax({
|
452
|
url: `${common.domainName}/api-web/notice/groupByUser`,
|
480
|
url: `${common.domainName}/api-web/notice/groupByUser`,
|
453
|
method: 'GET',
|
481
|
method: 'GET',
|
|
@@ -456,7 +484,8 @@ layui.define(['table', 'form', 'admin', 'layer', 'common','sessions', 'xmSelect' |
|
@@ -456,7 +484,8 @@ layui.define(['table', 'form', 'admin', 'layer', 'common','sessions', 'xmSelect' |
456
|
if (res && res.map) {
|
484
|
if (res && res.map) {
|
457
|
var yData = res.map.countList;
|
485
|
var yData = res.map.countList;
|
458
|
var xData = res.map.userList;
|
486
|
var xData = res.map.userList;
|
459
|
- loadNoticeChart(noticeUserChart,xData,yData)
|
487
|
+ //展示前20条数据 @Editor LH
|
|
|
488
|
+ loadNoticeChart(noticeUserChart,xData.slice(0, 20), yData.slice(0, 20));
|
460
|
}
|
489
|
}
|
461
|
}
|
490
|
}
|
462
|
})
|
491
|
})
|
|
@@ -466,5 +495,46 @@ layui.define(['table', 'form', 'admin', 'layer', 'common','sessions', 'xmSelect' |
|
@@ -466,5 +495,46 @@ layui.define(['table', 'form', 'admin', 'layer', 'common','sessions', 'xmSelect' |
466
|
getChartData();
|
495
|
getChartData();
|
467
|
reloadTable();
|
496
|
reloadTable();
|
468
|
}
|
497
|
}
|
|
|
498
|
+ function queryData(){
|
|
|
499
|
+ var $content = $('#more_info');
|
|
|
500
|
+ layer.open({
|
|
|
501
|
+ type: 1
|
|
|
502
|
+ , title: '人员分组统计' //不显示标题栏
|
|
|
503
|
+ , area: ["91%", "500px"]
|
|
|
504
|
+ , id: 'aaa' //设定一个id,防止重复弹出
|
|
|
505
|
+ , btn:['取消']
|
|
|
506
|
+ , content: $content.html()
|
|
|
507
|
+ , success: function (layero, index) {
|
|
|
508
|
+ var where = {
|
|
|
509
|
+ access_token:accessToken,
|
|
|
510
|
+ keyword: $('#notice_search_keyword').val(),
|
|
|
511
|
+ busId: busId,
|
|
|
512
|
+ resType: resType,
|
|
|
513
|
+ isSend: $('#notice_search_isSend').val()
|
|
|
514
|
+ };
|
|
|
515
|
+ var noticeTypeChartNew = echarts.init(document.getElementById('notice_chart_type_new'));
|
|
|
516
|
+ $.ajax({
|
|
|
517
|
+ url: `${common.domainName}/api-web/notice/groupByUser`,
|
|
|
518
|
+ method: 'GET',
|
|
|
519
|
+ data: where,
|
|
|
520
|
+ success: function (res) {
|
|
|
521
|
+ if (res && res.map) {
|
|
|
522
|
+ var yData = res.map.countList;
|
|
|
523
|
+ var xData = res.map.userList;
|
|
|
524
|
+ //展示前20条数据 @Editor LH
|
|
|
525
|
+ loadNoticeChart(noticeTypeChartNew,xData, yData);
|
|
|
526
|
+ }
|
|
|
527
|
+ }
|
|
|
528
|
+ })
|
|
|
529
|
+ }
|
|
|
530
|
+ , yes: function (index, layero) {
|
|
|
531
|
+ layer.close(index); //执行关闭
|
|
|
532
|
+ // if (fn && fn()) {
|
|
|
533
|
+ // fn()
|
|
|
534
|
+ // layer.close(index); //如果设定了yes回调,需进行手工关闭
|
|
|
535
|
+ // }
|
|
|
536
|
+ }
|
|
|
537
|
+ });
|
|
|
538
|
+ }
|
469
|
});
|
539
|
});
|
470
|
}); |
540
|
}); |