| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416 |
-
- function showTools(a){
- if($(a).find(".tooltips").css("display") == 'none') {
- $(a).find(".tooltips").show();
- $(a).parents('tr').siblings().find(".tooltips").hide();
- }else{
- $(a).find(".tooltips").hide();
- }
-
- }
- $(document).ready(function(){
-
- laydate.render({
- elem: '#time1',
- theme: '#00a1cb'
- });
- laydate.render({
- elem: '#time2',
- theme: '#00a1cb'
- });
- laydate.render({
- elem: '#time3',
- theme: '#00a1cb'
- });
- laydate.render({
- elem: '#time4',
- theme: '#00a1cb'
- });
- laydate.render({
- elem: '#time5',
- theme: '#00a1cb'
- });
-
- laydate.render({
- elem: '#time6',
- theme: '#00a1cb'
- });
-
- //投诉举报汇总 part1
- var quantity = echarts.init(document.getElementById('quantity'));
- quantity.setOption({
- // title: {
- // text: '投诉/举报汇总',
- // x: 'center',
- // textStyle: {
- // color: '#fff',
- // fontSize: 18
- // },
- // },
- tooltip: {
- trigger: 'item',
- formatter: "{a} <br/>{b} : {c} ({d}%)",
- axisPointer: {
- crossStyle: {
- color: '#fff'
- }
- }
- },
- legend: {
- // orient: 'vertical',
- bottom: 'bottom',
- data: [],
- textStyle: {
- color: '#fff'
- }
- },
- series: [{
- name: '数据',
- type: 'pie',
- radius: '55%',
- center: ['50%', '50%'],
- data: [],
- itemStyle: {
- emphasis: {
- shadowBlur: 10,
- shadowOffsetX: 0,
- shadowColor: 'rgba(0, 0, 0, 0.5)'
- },
- normal:{
- label:{
- show: true,
- formatter: '{b} : {c} ({d}%)'
- },
- labelLine :{show:true}
- }
- },
- label: {
- normal: {
- textStyle: {
- color: '#fff'
- }
- }
- }
- }]
- });
-
- function partOne(){
- var index = layer.load(1, {
- shade: [0.5, '#030303'] //0.1透明度的白色背景
- });
- $.ajax({
- type:"get",
- url:huayi.config.callcenter_url + "info/GetTypeCountByDate",
- async:true,
- dataType:'json',
- data:{
- start:$('#time1').val(),
- end:$('#time2').val()
- },
- success:function(data){
- if(data.state.toLowerCase()=='success'){
- layer.close(index);
- var con=data.data;
- var part_1_legend =[];
- var part_1_ser = [];
- $(con).each(function(i, n) {
- part_1_legend.push(n.TypeName)
- var part_1_obj = {};
- part_1_obj.value = n.Count;
- part_1_obj.name = n.TypeName;
- part_1_ser.push(part_1_obj)
- })
- quantity.setOption({
- legend: {
- data: part_1_legend
- },
- series: [{
- data: part_1_ser
- }]
- })
-
- }
- }
- });
- }
- $('.part1Btn').click(function(){
- partOne()
- })
-
- //举报单位/个人统计 part2
- var tsdwgr = echarts.init(document.getElementById('tsdwgr'));
- tsdwgr.setOption({
- tooltip: {
- trigger: 'axis',
- axisPointer: {
- type: 'cross',
- label: {
- show: true,
- backgroundColor: '#333'
- }
- }
- },
- legend: {
- data: [],
- bottom:'bottom',
- textStyle: {
- color: '#ccc'
- }
- },
- xAxis: {
- name: '月份',
- data: [],
- axisLine: {
- lineStyle: {
- color: '#ccc'
- }
- }
- },
- yAxis: {
- name: '数量',
- splitLine: {
- show: false
- },
- axisLine: {
- lineStyle: {
- color: '#ccc'
- }
- }
- },
- series: []
- });
-
- function partTwo(){
- var index = layer.load(1, {
- shade: [0.5, '#030303'] //0.1透明度的白色背景
- });
- $.ajax({
- type:"get",
- url:huayi.config.callcenter_url + "info/GetTypeCountMonthByDate",
- async:true,
- dataType:'json',
- success:function(data){
- if(data.state.toLowerCase()=='success'){
- layer.close(index);
- var con=data.data;
- var counts = con.counts;
- var sers = [];
- $(counts).each(function(i, n) {
- var obj = {};
- obj.name = con.cols[i];
- obj.type = "line";
- obj.smooth = true;
- obj.showAllSymbol = true;
- obj.symbol = "emptyCircle";
- obj.symbolSize = 10;
- obj.data = n;
- sers.push(obj)
- });
- tsdwgr.setOption({
- xAxis: {
- data: con.months
- },
- legend: {
- data: con.cols
- },
- series: sers
- });
-
-
-
- }
- }
- });
- }
- //投诉关键字 part3
-
- function partThree(){
- $('.table1 tbody').html('');
- var index = layer.load(1, {
- shade: [0.5, '#030303'] //0.1透明度的白色背景
- });
- $.ajax({
- type:"get",
- url:huayi.config.callcenter_url + "info/GetKeyCountByDate",
- async:true,
- dataType:'json',
- data:{
- start:$('#time3').val(),
- end:$('#time4').val()
- },
- success:function(data){
- if(data.state.toLowerCase()=='success'){
- layer.close(index);
- var con=data.data;
- $(con).each(function(i,n){
- if(i<10){
-
-
- var html="";
- // $('<tr>'+
- // '<td>1</td>'+
- // '<td>' + n.AreaName + '</td>'+
- // '<td>' + n.Count + '</td>'+
- // '</tr>').appendTo('.table1 tbody');
- html = '<tr>'+
- '<td>'+ parseInt(i+1)+'</td>'+
- '<td>' +
- '<div class="tool_count" onClick="showTools(this)">' + n.TypeName + '<div class="tooltips clearfix">'+
- '<div class="toolsTitle">'+ n.TypeName +'</div>'
- $(n.Item).each(function(j, m) {
- html += '<p>' + m.TypeName + ':' + m.Count + '</p>'
- })
- html += '</div>' +
- '</div>' +
- '</td>' +
- '<td>' + n.Count + '</td>' +
- '</tr>';
- $('.table1 tbody').append(html);
- }
- })
- }
- }
- });
- }
-
- $('.part3Btn').click(function() {
- partThree();
- })
-
- //承办单位统计 part4
- var tsdw_dw = echarts.init(document.getElementById('tsdw_dw'));
- tsdw_dw.setOption({
- // title: {
- // text: '投诉单位统计',
- // x: 'center',
- // textStyle: {
- // color: '#fff',
- // fontSize: 18
- // }
- // },
- tooltip : {
- trigger: 'item',
- formatter: "{a} <br/>{b} : {c} ({d}%)"
- },
- legend: {
- show: false,
- // type:true,
- // orient: 'vertical',
- right:'15%',
- top:'10%',
- orient: 'vertical',
- data: [],
- textStyle: {
- color: '#ccc'
- }
- },
- series: [{
- name: '部门',
- type: 'pie',
- // left: 0,
- radius: ['40%', '70%'],
- center: ['50%', '50%'],
- avoidLabelOverlap: false,
- label: {
- normal: {
- show: false,
- position: 'center'
- },
- emphasis: {
- show: true,
- textStyle: {
- fontSize: '18',
- // fontWeight: 'bold'
- }
- }
- },
- labelLine: {
- normal: {
- show: false
- }
- },
- data: [],
-
- }]
- });
- //
-
- function partFour(){
- var index = layer.load(1, {
- shade: [0.5, '#030303'] //0.1透明度的白色背景
- });
- $('.part4_list').html('');
- $.ajax({
- type: "get",
- url: huayi.config.callcenter_url + "info/GetDeptCountByDate",
- async: true,
- dataType: 'json',
- data:{
- start:$('#time5').val(),
- end:$('#time6').val()
- },
-
- success: function(data) {
- if(data.state.toLowerCase()=='success'){
- layer.close(index);
- var con=data.data;
- var part_4_legend = [];
- var part_4_ser = [];
- $(con).each(function(i, n) {
- var html="";
- part_4_legend.push(n.AreaName);
- var part_4_obj = {};
- part_4_obj.value = n.Count;
- part_4_obj.name = n.AreaName;
- part_4_ser.push(part_4_obj);
- htmls = '<li>' +
- '<span class="iconfont icon-tubiao2 color'+ i+'"></span>'+
- '<div class="depName" title="'+ n.AreaName +'">'+ n.AreaName + '</div>'+
- '<div class="tool_count"><div class="tooltips clearfix">'+
- '<div class="toolsTitle">'+ n.AreaName +':'+ n.Count +'</div>'
-
- $(n.Item).each(function(j, m) {
- htmls += '<p>' + m.TypeName + ':' + m.Count + '</p>'
- })
- htmls += '</div>' +
- '</div>' +
- '</li>';
- $('.part4_list').append(htmls);
- })
- tsdw_dw.setOption({
- legend: {
- data: part_4_legend
- },
- series: [{
- data: part_4_ser
- }]
- })
- //
- }
- }
- })
-
- }
-
- $('.part4Btn').click(function(){
- partFour();
- })
- $('.part4_list').on('click', 'li', function() {
- if($(this).find(".tooltips").css("display") == 'none') {
- $(this).find(".tooltips").show();
- $(this).siblings().find(".tooltips").hide();
- } else {
- $(this).find(".tooltips").hide()
- }
- })
- Ajax();
- function Ajax(){
- partOne();
- partTwo();
- partThree()
- partFour();
- }
-
- setInterval(Ajax, huayi.config.indextime);//Ajax调用函数
- })
|