Nenhuma Descrição

trafficData.js 5.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256
  1. //trafficDataChart('timeTraffic', daySeatName, callDate, callDate[0])
  2. getworkOrder()
  3. $('.btn_time').click(function(e) {
  4. if(e.target.tagName == 'SPAN') {
  5. if($(e.target).attr('data-state') == '1') {
  6. $(".hwsjtj").hide()
  7. $('.daySeat').css('display', 'none')
  8. $('.timeTraffic').css('display', 'inline-block')
  9. $('#traffic').css('display', 'none')
  10. $('#timeTraffic').css('display', 'block')
  11. $(this).siblings(".act").children("label").attr("indexTitle", "日话务数据统计1")
  12. // $(".act").attr("indexTitle","日话务数据统计1")
  13. $('.call_situation h2').text('话务数据统计')
  14. getworkOrder()
  15. trafficState = 0
  16. }
  17. }
  18. e.stopPropagation();
  19. })
  20. function getworkOrder() {
  21. let workOrderData = [];
  22. let workOrderName = []
  23. new doAjax({
  24. url: huayi.config.callcenter_url + "/InfoNew/GetTelCountByNow",
  25. data: {
  26. timetype:telCountByNowType
  27. },
  28. callBack: function (res) {
  29. var data = res.data.hw[0]
  30. console.log(data)
  31. trafficDataChart(data)
  32. }
  33. });
  34. }
  35. function trafficDataChart(getdata) {
  36. let hotThings = echarts.init(document.getElementById("timeTraffic"));
  37. console.log(hotThings)
  38. window.onresize = function() {
  39. hotThings.resize()
  40. }
  41. const labelOption = {
  42. show: true,
  43. rotate: 0,
  44. align: 'center',
  45. verticalAlign: 'middle',
  46. position: 'inside',
  47. //distance: 15,
  48. formatter: function(params) {
  49. if (params.value > 0) {
  50. return params.value;
  51. } else {
  52. return ' ';
  53. }
  54. },
  55. fontSize: 12,
  56. rich: {
  57. name: {}
  58. }
  59. };
  60. option = {
  61. tooltip: {
  62. trigger: 'item',
  63. show: true,
  64. // 进行数据处理
  65. formatter: function(params) {
  66. console.log(params, 'params')
  67. var html = '';
  68. if(params.value > 0) {
  69. html += params.marker;
  70. if(params.name.indexOf('率') >= 0) {
  71. html += params.seriesName + ': ' + params.value + '%<br/>';
  72. } else {
  73. html += params.seriesName + ': ' + params.value + '<br/>';
  74. }
  75. }
  76. return html;
  77. }
  78. },
  79. grid: {
  80. left: '3%',
  81. right: '4%',
  82. bottom: '15%',
  83. containLabel: true
  84. },
  85. xAxis: [{
  86. type: 'category',
  87. axisLine: {
  88. lineStyle: {
  89. color: '#ffffff'
  90. }
  91. },
  92. axisLabel: {
  93. show: true,
  94. rotate: -30, // 角度值:Number
  95. fontSize: 11, // 顺便调小一点字体大小
  96. padding: [0, 0, 0, -15],
  97. textStyle: {
  98. color: '#ffffff'
  99. },
  100. // formatter: function (value) {
  101. // //x轴的文字改为竖版显示
  102. // var str = value.split("");
  103. // return str.join("\n");
  104. // }
  105. },
  106. data: [' 接通量 \n\n呼入量', '\n呼入接通率', ' 呼出接通量\n\n呼出量', '\n呼出接通率']
  107. }],
  108. yAxis: [{
  109. type: 'value',
  110. axisLine: {
  111. lineStyle: {
  112. color: '#ffffff'
  113. }
  114. },
  115. // interval: 5,
  116. // splitLine:{ show:false} ,
  117. // axisLine: {show: false},
  118. // axisTick: {show: false}
  119. },
  120. {
  121. type: 'value',
  122. axisLine: {
  123. lineStyle: {
  124. color: '#ffffff'
  125. }
  126. },
  127. splitLine: {
  128. show: false
  129. },
  130. min: 0,
  131. max: 100,
  132. axisLabel: {
  133. formatter: '{value} %'
  134. }
  135. }
  136. ],
  137. series: [{
  138. name: '呼入量',
  139. type: 'bar',
  140. barGap: 0,
  141. label: labelOption,
  142. barWidth : 15,
  143. emphasis: {
  144. focus: 'series'
  145. },
  146. data: [getdata.hwcount, 0, 0, 0]
  147. },
  148. {
  149. name: '人工接通',
  150. type: 'bar',
  151. stack: 'Ad',
  152. barWidth : 15,
  153. label: labelOption,
  154. emphasis: {
  155. focus: 'series'
  156. },
  157. data: [getdata.jtcount, 0, 0, 0]
  158. },
  159. {
  160. name: '自助接通量',
  161. type: 'bar',
  162. stack: 'Ad',
  163. barWidth : 15,
  164. label: labelOption,
  165. emphasis: {
  166. focus: 'series'
  167. },
  168. data: [getdata.zzcount, 0, 0, 0]
  169. },
  170. {
  171. name: '未接通回拨量',
  172. type: 'bar',
  173. stack: 'Ad',
  174. barWidth : 15,
  175. label: labelOption,
  176. emphasis: {
  177. focus: 'series'
  178. },
  179. data: [getdata.hbcount, 0, 0, 0]
  180. },
  181. {
  182. name: '回拨率',
  183. type: 'bar',
  184. stack: 'B',
  185. barWidth : 15,
  186. yAxisIndex: 1,
  187. label: labelOption,
  188. emphasis: {
  189. focus: 'series'
  190. },
  191. data: [0, getdata.hbbili, 0, 0]
  192. },
  193. {
  194. name: '自助率',
  195. type: 'bar',
  196. stack: 'B',
  197. barWidth : 15,
  198. yAxisIndex: 1,
  199. label: labelOption,
  200. emphasis: {
  201. focus: 'series'
  202. },
  203. data: [0, getdata.zzbili, 0, 0]
  204. },
  205. {
  206. name: '接通率',
  207. type: 'bar',
  208. stack: 'B',
  209. barWidth : 15,
  210. yAxisIndex: 1,
  211. label: labelOption,
  212. emphasis: {
  213. focus: 'series'
  214. },
  215. data: [0, getdata.jtbili, 0, 0]
  216. },
  217. {
  218. name: '呼出数量',
  219. type: 'bar',
  220. barWidth : 15,
  221. label: labelOption,
  222. emphasis: {
  223. focus: 'series'
  224. },
  225. data: [0, 0, getdata.hccount, 0]
  226. },
  227. {
  228. name: '呼出接通量',
  229. type: 'bar',
  230. barWidth : 15,
  231. label: labelOption,
  232. emphasis: {
  233. focus: 'series'
  234. },
  235. data: [0, 0, getdata.hcjtcount,0]
  236. },
  237. {
  238. name: '呼出接通率',
  239. type: 'bar',
  240. barWidth : 15,
  241. yAxisIndex: 1,
  242. label: labelOption,
  243. emphasis: {
  244. focus: 'series'
  245. },
  246. data: [0, 0, 0, getdata.jtbili]
  247. }
  248. ]
  249. };
  250. hotThings.setOption(option);
  251. }