鑫苑新版本前端代码

zhongxin.js1 4.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270
  1. //类型工单统计
  2. var slhw = echarts.init(document.getElementById('slhw'));
  3. slhw.setOption({
  4. title: {
  5. text: '工单类型统计',
  6. x: 'center',
  7. textStyle: {
  8. color: '#fff',
  9. fontSize: 16,
  10. fontWeight: 'normal'
  11. }
  12. },
  13. legend: {
  14. // orient: 'vertical',
  15. bottom: 'bottom',
  16. data: [],
  17. textStyle: {
  18. color: '#fff'
  19. }
  20. },
  21. tooltip: {
  22. trigger: 'item',
  23. formatter: "{a} <br/>{b} : {c} ({d}%)"
  24. },
  25. series: [{
  26. name: '工单类型',
  27. type: 'pie',
  28. radius: '60%',
  29. center: ['50%', '55%'],
  30. data: [],
  31. itemStyle: {
  32. emphasis: {
  33. shadowBlur: 10,
  34. shadowOffsetX: 0,
  35. shadowColor: 'rgba(0, 0, 0, 0.5)'
  36. }
  37. }
  38. }]
  39. });
  40. //接通率报表
  41. var jtv = echarts.init(document.getElementById('jtv_num'));
  42. jtv.setOption({
  43. title: {
  44. text: '接通率统计',
  45. x: 'center',
  46. textStyle: {
  47. color: '#fff',
  48. fontSize: 16,
  49. fontWeight: 'normal'
  50. }
  51. },
  52. tooltip: {
  53. trigger: 'axis',
  54. axisPointer: {
  55. type: 'shadow',
  56. label: {
  57. show: true,
  58. backgroundColor: '#333'
  59. }
  60. },
  61. formatter: function(datas)
  62. {
  63. var res = datas[0].name + '<br/>', val;
  64. for(var i = 0, length = datas.length; i < length; i++) {
  65. val = (datas[i].value) + '%';
  66. res += datas[i].seriesName + ':' + val + '<br/>';
  67. }
  68. return res;
  69. }
  70. },
  71. legend: {
  72. top: 30,
  73. data: ['接通量', '挂断量', '未接量'],
  74. textStyle: {
  75. color: '#ccc'
  76. }
  77. },
  78. xAxis: {
  79. name: '时',
  80. data: [],
  81. axisLine: {
  82. lineStyle: {
  83. color: '#ccc'
  84. }
  85. },
  86. },
  87. yAxis: {
  88. name: '比率',
  89. splitLine: {
  90. show: false
  91. },
  92. axisLine: {
  93. lineStyle: {
  94. color: '#ccc'
  95. }
  96. }
  97. },
  98. series: [{
  99. name: '接通量',
  100. type: 'bar',
  101. barWidth: 8,
  102. itemStyle: {
  103. normal: {
  104. color: new echarts.graphic.LinearGradient(
  105. 0, 0, 0, 1, [{
  106. offset: 0,
  107. color: '#14c8d4'
  108. },
  109. {
  110. offset: 1,
  111. color: '#43eec6'
  112. }
  113. ]
  114. )
  115. }
  116. },
  117. data: [20, 33, 80, 14, 60, 42, 99, 22, 36, 19, 25, 30, 45, 80, 65, 55, 42, 50, 55, 66, 36, 23, 20, 21]
  118. }]
  119. });
  120. //通话时长
  121. var th_nums = echarts.init(document.getElementById('th_nums'));
  122. th_nums.setOption({
  123. title: {
  124. text: '接通率统计',
  125. x: 'center',
  126. textStyle: {
  127. color: '#fff',
  128. fontSize: 16,
  129. fontWeight: 'normal'
  130. }
  131. },
  132. tooltip: {
  133. trigger: 'axis',
  134. axisPointer: {
  135. type: 'shadow',
  136. label: {
  137. show: true,
  138. backgroundColor: '#333'
  139. }
  140. }
  141. },
  142. legend: {
  143. top: 30,
  144. data: ['平均通话时长统计'],
  145. textStyle: {
  146. color: '#ccc'
  147. }
  148. },
  149. xAxis: {
  150. name: '时',
  151. data: [],
  152. axisLine: {
  153. lineStyle: {
  154. color: '#ccc'
  155. }
  156. },
  157. },
  158. yAxis: {
  159. name: '时长',
  160. splitLine: {
  161. show: false
  162. },
  163. axisLine: {
  164. lineStyle: {
  165. color: '#ccc'
  166. }
  167. }
  168. },
  169. series: [{
  170. name: '平均通话时长',
  171. type: 'line',
  172. smooth:true,
  173. showAllSymbol:true,
  174. symbol :"emptyCircle",
  175. symbolSize: 10,
  176. data: []
  177. }]
  178. });
  179. Ajax();
  180. function Ajax(){
  181. $('.gdmap-r ul').html('');
  182. $('.gdmap-l ul').html('');
  183. var index = layer.load(1, { shade: [0.5,'#f5f5f5'] //0.1透明度的白色背景
  184. });
  185. $.ajax({
  186. type: "get",
  187. url: huayi.config.callcenter_url + "Info/GetCenterInfo",
  188. async: true,
  189. dataType: 'json',
  190. data: {
  191. },
  192. success: function(data) {
  193. if(data.message.toLowerCase()=='加载成功'){
  194. layer.close(index);
  195. var part1=data.data.d;
  196. var color=["z","l","a","t","y","g","w","b","1","2","3"];
  197. var dindex=Math.floor(Math.random()*10+1);
  198. $(part1).each(function(i,n){
  199. var dindex=Math.floor(Math.random()*10+1);
  200. $('<li>'+
  201. '<i class="xe-'+ color[dindex] +'"></i>'+
  202. '<span>'+n.AreaName+'</span>'+
  203. '<span>'+ n.Count+'</span>'+
  204. '</li>').appendTo('.gdmap-r ul')
  205. })
  206. var part2=data.data.a;
  207. var part2_legend = [];
  208. var part2_ser = [];
  209. $(part2).each(function(i,n){
  210. var obj={};
  211. if(i==1){
  212. obj.value=n.count;
  213. obj.name=n.teptname;
  214. obj.selected=true;
  215. }else{
  216. obj.value=n.count;
  217. obj.name=n.teptname;
  218. }
  219. part2_legend.push(n.teptname);
  220. part2_ser.push(obj);
  221. $('<li>'+
  222. '<div>'+n.teptname +'</div>'+
  223. '<span>'+n.count +'</span>'+
  224. '</li>').appendTo('.gdmap-l ul');
  225. })
  226. slhw.setOption({
  227. legend: {
  228. data: part2_legend
  229. },
  230. series: [{
  231. data: part2_ser
  232. }]
  233. })
  234. var part3=data.data.b;
  235. jtv.setOption({
  236. xAxis: {
  237. data:part3.hours
  238. },
  239. series: [{
  240. data:part3.rates
  241. }]
  242. })
  243. var part4=data.data.c;
  244. th_nums.setOption({
  245. xAxis: {
  246. data:part4.hours
  247. },
  248. series: [{
  249. data:part4.avgtimes
  250. }]
  251. })
  252. }
  253. }
  254. });
  255. setInterval(Ajax, huayi.config.indextime);//Ajax调用函数
  256. }