民权县12345_前端

tousujubao.js 3.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. //投诉举报汇总
  2. var quantity = echarts.init(document.getElementById('quantity'));
  3. quantity.setOption({
  4. // title: {
  5. // text: '投诉/举报汇总',
  6. // x: 'center',
  7. // textStyle: {
  8. // color: '#fff',
  9. // fontSize: 18
  10. // },
  11. // },
  12. tooltip: {
  13. trigger: 'item',
  14. formatter: "{a} <br/>{b} : {c} ({d}%)",
  15. axisPointer: {
  16. crossStyle: {
  17. color: '#fff'
  18. }
  19. }
  20. },
  21. legend: {
  22. // orient: 'vertical',
  23. bottom: 'bottom',
  24. data: [],
  25. textStyle: {
  26. color: '#fff'
  27. }
  28. },
  29. series: [{
  30. name: '数据',
  31. type: 'pie',
  32. radius: '55%',
  33. center: ['50%', '50%'],
  34. data: [],
  35. itemStyle: {
  36. emphasis: {
  37. shadowBlur: 10,
  38. shadowOffsetX: 0,
  39. shadowColor: 'rgba(0, 0, 0, 0.5)'
  40. },
  41. normal:{
  42. label:{
  43. show: true,
  44. formatter: '{b} : {c} ({d}%)'
  45. },
  46. labelLine :{show:true}
  47. }
  48. },
  49. label: {
  50. normal: {
  51. textStyle: {
  52. color: '#fff'
  53. }
  54. }
  55. }
  56. }]
  57. });
  58. Ajax()
  59. function Ajax(){
  60. $('.table1 tbody').html('');
  61. var index = layer.load(1, { shade: [0.5,'#030303'] //0.1透明度的白色背景
  62. });
  63. $('.tsjb-bm ul').html('');
  64. $.ajax({
  65. type: "get",
  66. url: huayi.config.callcenter_url + "Info/GetTypeInfo",
  67. async: true,
  68. dataType: 'json',
  69. data:{
  70. },
  71. success: function(result) {
  72. if(result.state.toLowerCase() == 'success') {
  73. layer.close(index);
  74. //part 1
  75. var part1 = result.data.a;
  76. var part_1_legend = part1.cols;
  77. var part_1_ser = [];
  78. $(part1.cols).each(function(i, n) {
  79. // part_1_legend.push(n.teptname);
  80. var part_1_obj = {};
  81. part_1_obj.value = part1.counts[i];
  82. part_1_obj.name = n;
  83. part_1_ser.push(part_1_obj)
  84. })
  85. quantity.setOption({
  86. legend: {
  87. data: part_1_legend
  88. },
  89. series: [{
  90. data: part_1_ser
  91. }]
  92. })
  93. //part 3
  94. var part3 = result.data.b;
  95. var colorArr = [];
  96. $(part3).each(function(i, n) {
  97. if(i<10){
  98. var html="";
  99. html = '<tr>'+
  100. '<td>'+ parseInt(i+1)+'</td>'+
  101. '<td>' + n.TypeName +'</td>' +
  102. '<td>' + n.Count + '</td>' +
  103. '</tr>';
  104. $('.table1 tbody').append(html);
  105. //
  106. // $('<li class="clearfix">' +
  107. // '<div class="tsgjz-left">' +
  108. // '<div class="progress" title="' + n.Count+ '个">' +
  109. // '<div class="progress-bar bar' + i + '" title="' + n.Count + '" style="width: ' + n.Count + 'px;background:' + getColor() + '">' +
  110. // '</div>' +
  111. // '</div>' +
  112. // '</div>' +
  113. // '<div class="tsgjz-right">' + n.TypeName + '<span class="count' + i + '" style="color:' + $('.bar' + i).css("background-color") + '">' + n.Count + '</span></div>' +
  114. // '</li>').appendTo('.tsjb-bm ul');
  115. // colorArr.push($('.bar' + i).css("background-color"));
  116. }
  117. })
  118. // $(colorArr).each(function(i, n) {
  119. // $('.count' + i).css("color", n)
  120. //
  121. // })
  122. }
  123. }
  124. })
  125. }
  126. setInterval(Ajax, huayi.config.indextime);//Ajax调用函数