商丘宁陵县12345_前端

huawu.js 4.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260
  1. //part 1
  2. var main1 = echarts.init(document.getElementById('main1'));
  3. main1.setOption({
  4. tooltip: {
  5. trigger: 'axis',
  6. axisPointer: {
  7. type: 'cross',
  8. label: {
  9. show: true,
  10. backgroundColor: '#333'
  11. }
  12. }
  13. },
  14. legend: {
  15. data: ["来电数量", "接通数量", "留言数量", "放弃数量", "骚扰数量"],
  16. textStyle: {
  17. color: '#fff'
  18. }
  19. },
  20. xAxis: {
  21. name: '时',
  22. data: [],
  23. axisLine: {
  24. lineStyle: {
  25. color: '#ccc'
  26. }
  27. }
  28. },
  29. yAxis: {
  30. name: '数量',
  31. splitLine: {
  32. show: false
  33. },
  34. axisLine: {
  35. lineStyle: {
  36. color: '#ccc'
  37. }
  38. }
  39. },
  40. series: []
  41. });
  42. //pasrt 3
  43. var main = echarts.init(document.getElementById('main'));
  44. main.setOption({
  45. tooltip: {
  46. trigger: 'axis',
  47. axisPointer: {
  48. type: 'cross',
  49. label: {
  50. show: true,
  51. backgroundColor: '#333'
  52. }
  53. },
  54. formatter: function(datas) {
  55. var res = datas[0].name + '<br/>',
  56. val;
  57. for(var i = 0, length = datas.length; i < length; i++) {
  58. val = (datas[i].value) + '%';
  59. res += datas[i].seriesName + ':' + val + '<br/>';
  60. }
  61. return res;
  62. }
  63. },
  64. legend: {
  65. data: ["空闲", "通话", "置忙"],
  66. textStyle: {
  67. color: '#fff'
  68. }
  69. },
  70. xAxis: {
  71. name: '时',
  72. data: [],
  73. axisLine: {
  74. lineStyle: {
  75. color: '#ccc'
  76. }
  77. }
  78. },
  79. yAxis: {
  80. name: '数量',
  81. splitLine: {
  82. show: false
  83. },
  84. axisLine: {
  85. lineStyle: {
  86. color: '#ccc'
  87. }
  88. }
  89. },
  90. series: []
  91. });
  92. //part 2
  93. var phone_num = echarts.init(document.getElementById('phone_num'));
  94. phone_num.setOption({
  95. title: {
  96. // text: '投诉/举报汇总',
  97. x: 'center',
  98. textStyle: {
  99. color: '#fff',
  100. fontSize: 16
  101. },
  102. },
  103. tooltip: {
  104. trigger: 'axis',
  105. axisPointer: { // 坐标轴指示器,坐标轴触发有效
  106. type: 'line' // 默认为直线,可选为:'line' | 'shadow'
  107. }
  108. },
  109. toolbox: {
  110. show: true,
  111. },
  112. calculable: true,
  113. xAxis: [{
  114. type: 'category',
  115. // name: '月份',
  116. splitLine: {
  117. show: false
  118. }, //去除网格线
  119. data: ["话务量(通)", "来电(通)", "接通量(通)", "平均通话时长(秒)"],
  120. // axisTick: {
  121. // alignWithLabel: true
  122. // },
  123. axisLine: {show: false,
  124. lineStyle: {
  125. color: '#fff'
  126. }
  127. },
  128. // axisLine: {},
  129. axisTick: {
  130. show: false
  131. }
  132. }],
  133. yAxis: [{
  134. show:false
  135. }],
  136. series: [{
  137. name: '数量',
  138. type: 'bar',
  139. barWidth: '30%', //图形宽度
  140. data: [],
  141. itemStyle: {
  142. normal: {
  143. label: {
  144. show: true,
  145. textStyle: {
  146. color: '#fff' //顶部数据颜色
  147. }
  148. }
  149. }
  150. },
  151. label: {
  152. normal: {
  153. show: true,
  154. position: 'top' //顶部数据显示位置
  155. }
  156. }
  157. }
  158. ]
  159. // color: ['#ff9800','#61a0a8','#1ab394']
  160. });
  161. Ajax();
  162. function Ajax() {
  163. var index = layer.load(1, {
  164. shade: [0.5, '#030303'] //0.1透明度的白色背景
  165. });
  166. $.ajax({
  167. type: "get",
  168. url: huayi.config.callcenter_url + "Info/GetTelInfo",
  169. async: true,
  170. dataType: 'json',
  171. // data:{
  172. // token:token
  173. // },
  174. success: function(result) {
  175. if(result.state.toLowerCase() == 'success') {
  176. layer.close(index);
  177. var part1 = result.data.a;
  178. main1.setOption({
  179. xAxis: {
  180. data: part1.hours
  181. },
  182. series: [{
  183. name: "来电数量",
  184. type: "line",
  185. smooth: true,
  186. showAllSymbol: true,
  187. symbol: "emptyCircle",
  188. symbolSize: 10,
  189. data: part1.rcounts
  190. }, {
  191. name: "接通数量",
  192. type: "line",
  193. smooth: true,
  194. showAllSymbol: true,
  195. symbol: "emptyCircle",
  196. symbolSize: 10,
  197. data: part1.ccounts
  198. }, {
  199. name: "留言数量",
  200. type: "line",
  201. smooth: true,
  202. showAllSymbol: true,
  203. symbol: "emptyCircle",
  204. symbolSize: 10,
  205. data: part1.lcounts
  206. }, {
  207. name: "骚扰数量",
  208. type: "line",
  209. smooth: true,
  210. showAllSymbol: true,
  211. symbol: "emptyCircle",
  212. symbolSize: 10,
  213. data: part1.scounts
  214. }]
  215. })
  216. //part 3
  217. var part3 = result.data.b;
  218. main.setOption({
  219. xAxis: {
  220. data: part3.hours
  221. },
  222. series: [{
  223. name: "空闲",
  224. type: "bar",
  225. data: part3.kxpercents
  226. }, {
  227. name: "通话",
  228. type: "bar",
  229. data: part3.thpercents
  230. }, {
  231. name: "置忙",
  232. type: "bar",
  233. data: part3.zmpercents
  234. }]
  235. })
  236. //part4
  237. var part4 = result.data.c;
  238. phone_num.setOption({
  239. series: [{
  240. data: [part4.hwcon, part4.lhcon, part4.jtcon, part4.pjthtimes]
  241. // data: [20, 100, 5, 80]
  242. }]
  243. })
  244. }
  245. }
  246. });
  247. }
  248. setInterval(Ajax, huayi.config.indextime); //Ajax调用函数