Açıklama Yok

trafficData0625-3.js 3.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. getworkOrder()
  2. var telCountData
  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. $('.call_situation h2').text('话务数据统计')
  13. getworkOrder()
  14. trafficState = 0
  15. }
  16. }
  17. e.stopPropagation();
  18. })
  19. function getworkOrder() {
  20. let workOrderData = [];
  21. let workOrderName = []
  22. new doAjax({
  23. url: huayi.config.callcenter_url + "/InfoNew/GetTelCountByNow",
  24. data: {
  25. timetype: telCountByNowType
  26. },
  27. callBack: function(res) {
  28. var data = res.data.hw[0]
  29. telCountData = data
  30. trafficDataChart(data)
  31. }
  32. });
  33. }
  34. function getLabelOption(positionObj, numberType) {
  35. var labelOption = {
  36. show: true,
  37. rotate: 0,
  38. align: 'left',
  39. color: '#fff',
  40. verticalAlign: 'middle',
  41. position: positionObj,
  42. formatter: function(params) {
  43. if(params.value > 0) {
  44. dataValue = params.seriesName + ': ' + params.value
  45. if(params.seriesName === "回拨") {
  46. dataValue = dataValue + '(' + telCountData.hbbili + '%)'
  47. } else if(params.seriesName === "自助") {
  48. dataValue = dataValue + '(' + telCountData.zzbili + '%)'
  49. } else if(params.seriesName === "人工") {
  50. dataValue = dataValue + '(' + telCountData.jtbili + '%)'
  51. }
  52. return dataValue;
  53. } else {
  54. return ' ';
  55. }
  56. },
  57. fontSize: 12,
  58. };
  59. return labelOption
  60. }
  61. function trafficDataChart(getdata) {
  62. let hotThingsLeft = echarts.init(document.getElementById("timeTrafficLeft"));
  63. let hotThingsRight = echarts.init(document.getElementById("timeTrafficRight"));
  64. window.onresize = function() {
  65. hotThingsLeft.resize()
  66. hotThingsRight.resize()
  67. }
  68. hotThingsLeft.setOption(getOption(getdata));
  69. // hotThingsRight.setOption(getOption(getdata));
  70. }
  71. function getOption(getdata) {
  72. return option = {
  73. tooltip: {
  74. trigger: 'item',
  75. formatter: '{a} <br/>{b}: {c} ({d}%)'
  76. },
  77. grid: {
  78. bottom: '20%',
  79. left: '50%',
  80. right: '20%',
  81. bottom: '20%',
  82. containLabel: true
  83. },
  84. // color:['#cd5c5c','#87cefa','#da70d6','#32cd32', '#6495ed'], //cd5c5c 32cd32 87cefa
  85. series: [{
  86. name: 'Access From',
  87. type: 'pie',
  88. selectedMode: 'single',
  89. radius: [0, '30%'],
  90. label: {
  91. position: 'inner',
  92. fontSize: 14
  93. },
  94. labelLine: {
  95. show: false
  96. },
  97. data: [{
  98. value: 101,
  99. name: '无效来电'
  100. },
  101. {
  102. value: 477,
  103. name: '有效来电',
  104. selected: true
  105. },
  106. ]
  107. },
  108. {
  109. name: 'Access From',
  110. type: 'pie',
  111. position:'outer',
  112. alignTo:'edge',
  113. margin:10,
  114. radius: ['45%', '60%'],
  115. label: {
  116. formatter: '{b}:{c} {per|{d}%}',
  117. //backgroundColor: '#F6F8FC',
  118. //borderColor: '#8C8D8E',
  119. //borderWidth: 1,
  120. borderRadius: 4,
  121. rich: {
  122. a: {
  123. color: '#6E7079',
  124. lineHeight: 22,
  125. align: 'center'
  126. },
  127. hr: {
  128. borderColor: '#8C8D8E',
  129. width: '100%',
  130. borderWidth: 1,
  131. height: 0
  132. },
  133. b: {
  134. color: '#4C5058',
  135. fontSize: 14,
  136. fontWeight: 'bold',
  137. lineHeight: 33
  138. },
  139. per: {
  140. color: '#fff',
  141. // backgroundColor: '#4C5058',
  142. padding: [3, 4],
  143. borderRadius: 4
  144. }
  145. }
  146. },
  147. labelLine:{
  148. show:true,
  149. normal:{
  150. length:15,
  151. length2: 0,
  152. }
  153. },
  154. data: [{
  155. value: 5,
  156. name: '回拨'
  157. },
  158. {
  159. value: 6,
  160. name: '自助'
  161. },
  162. {
  163. value: 435,
  164. name: '人工'
  165. },
  166. ]
  167. }
  168. ]
  169. }
  170. }