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}
{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=""; // $(''+ // '1'+ // '' + n.AreaName + ''+ // '' + n.Count + ''+ // '').appendTo('.table1 tbody'); html = ''+ ''+ parseInt(i+1)+''+ '' + '
' + n.TypeName + '
'+ '
'+ n.TypeName +'
' $(n.Item).each(function(j, m) { html += '

' + m.TypeName + ':' + m.Count + '

' }) html += '
' + '
' + '' + '' + n.Count + '' + ''; $('.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}
{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 = '
  • ' + ''+ '
    '+ n.AreaName + '
    '+ '
    '+ '
    '+ n.AreaName +':'+ n.Count +'
    ' $(n.Item).each(function(j, m) { htmls += '

    ' + m.TypeName + ':' + m.Count + '

    ' }) htmls += '
    ' + '
    ' + '
  • '; $('.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调用函数 })