暫無描述

widgets.js 4.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217
  1. var inval;
  2. $(document).ready(function() {
  3. teltotal();
  4. getQuesType()
  5. getHotWorkOrder()
  6. // telhour();
  7. telday();
  8. // worktotal();
  9. if (inval) {
  10. clearInterval(inval);
  11. }
  12. inval = setInterval(function() {
  13. teltotal();
  14. getQuesType()
  15. getHotWorkOrder()
  16. // telhour();
  17. telday();
  18. // worktotal();
  19. }, huayi.config.indextime);
  20. })
  21. function teltotal() {
  22. $.getJSON(huayi.config.callcenter_url + 'Index/GetTelRecordsTotal', {
  23. "token": $.cookie("token")
  24. }, function(result) {
  25. if (result.state.toLowerCase() == "success") {
  26. $(".style1").eq(0).find("h2").eq(1).text(result.data.dayin.count);
  27. $(".style1").eq(0).find("h3").text("总时长:" + result.data.dayin.totaltime);
  28. $(".style1").eq(1).find("h2").eq(1).text(result.data.dayout.count);
  29. $(".style1").eq(1).find("h3").text("总时长:" + result.data.dayout.totaltime);
  30. $(".style1").eq(2).find("h2").eq(1).text(result.data.monin.count);
  31. $(".style1").eq(2).find("h3").text("总时长:" + result.data.monin.totaltime);
  32. $(".style1").eq(3).find("h2").eq(1).text(result.data.monout.count);
  33. $(".style1").eq(3).find("h3").text("总时长:" + result.data.monout.totaltime);
  34. $(".style1").eq(4).find("h2").eq(1).text(result.data.daynocon);
  35. }
  36. })
  37. }
  38. //图一
  39. function getHotWorkOrder() {
  40. $.getJSON(huayi.config.callcenter_url + 'Notice/GetListTop', {
  41. "token": $.cookie("token"),
  42. top: 10
  43. }, function(res) {
  44. if (res.rows.length > 7) {
  45. res.rows.splice(7)
  46. }
  47. let str = ''
  48. res.rows.forEach(function(v, n) {
  49. // str += '<li><span>' + v.F_Title + ':</span><span>' + v.F_Content + '</span><span>' + v
  50. // .F_CreateOn + '</span></li>'
  51. str += '<li><span>' + v.F_Content + '</span><span>' + v
  52. .F_CreateOn + '</span></li>'
  53. })
  54. $('.TG').html(str);
  55. })
  56. }
  57. //myChart.setOption(option);
  58. //图3
  59. var myChart3 = echarts.init(document.getElementById('flot-line-chart'));
  60. var option3 = {
  61. grid: {
  62. top: '15%',
  63. right: '3%',
  64. left: '5%',
  65. bottom: '12%'
  66. },
  67. xAxis: [{
  68. type: 'category',
  69. data: ['呼入量', '呼出量'],
  70. axisLine: {
  71. lineStyle: {
  72. color: 'rgb(204,204,204)'
  73. }
  74. },
  75. axisLabel: {
  76. margin: 10,
  77. color: 'rgb(25,160,244)',
  78. textStyle: {
  79. fontSize: 14
  80. },
  81. },
  82. }],
  83. yAxis: [{
  84. name: '单位',
  85. nameTextStyle: {
  86. color: 'rgb(25,160,244)'
  87. },
  88. axisLabel: {
  89. formatter: '{value}',
  90. color: 'rgb(25,160,244)',
  91. },
  92. axisLine: {
  93. show: true,
  94. lineStyle: {
  95. color: 'rgb(204,204,204)'
  96. }
  97. },
  98. splitLine: {
  99. show: false,
  100. lineStyle: {
  101. color: 'rgb(204,204,204)'
  102. }
  103. }
  104. }],
  105. series: [{
  106. type: 'bar',
  107. data: [],
  108. barWidth: '30px',
  109. itemStyle: {
  110. normal: {
  111. color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
  112. offset: 0,
  113. color: 'rgba(0,244,255,1)' // 0% 处的颜色
  114. }, {
  115. offset: 1,
  116. color: 'rgba(0,77,167,1)' // 100% 处的颜色
  117. }], false),
  118. barBorderRadius: [30, 30, 30, 30],
  119. shadowColor: 'rgba(0,160,221,1)',
  120. shadowBlur: 4,
  121. }
  122. },
  123. label: {
  124. normal: {
  125. show: true,
  126. lineHeight: 30,
  127. width: 80,
  128. height: 30,
  129. backgroundColor: 'rgba(0,160,221,0.1)',
  130. borderRadius: 200,
  131. position: ['-4', '-60'],
  132. distance: 1,
  133. formatter: [
  134. ' {d|●}',
  135. ' {a|{c}} \n',
  136. ' {b|}'
  137. ].join(','),
  138. rich: {
  139. d: {
  140. color: '#3CDDCF',
  141. },
  142. a: {
  143. color: '#222',
  144. align: 'center',
  145. },
  146. b: {
  147. width: 1,
  148. height: 30,
  149. borderWidth: 1,
  150. borderColor: '#234e6c',
  151. align: 'left'
  152. },
  153. }
  154. }
  155. }
  156. }]
  157. };
  158. function telday() {
  159. $.getJSON(huayi.config.callcenter_url + 'Index/GetCallTypecCount', {
  160. "token": $.cookie("token")
  161. }, function(result) {
  162. if (result.state.toLowerCase() == "success") {
  163. let xData2 = ['呼出量', '呼入量'];
  164. let data1 = [];
  165. result.data.forEach(function(v, n) {
  166. data1.push(v.num)
  167. })
  168. option3.series[0].data = data1
  169. myChart3.setOption(option3)
  170. }
  171. })
  172. }
  173. //图2
  174. function getQuesType(){
  175. $.getJSON(huayi.config.callcenter_url + 'Index/getWTFL', {
  176. "token": $.cookie("token")
  177. }, function(res) {
  178. let str='';
  179. let tName = ['移网质量', '渠道服务', '光网质量', '装维服务', '套餐资费'];
  180. let data = [];
  181. let oName = []
  182. let otherName = [];
  183. res.data.forEach(function(v, n) {
  184. if(v&&v.dicname){
  185. data.push({
  186. name:v.dicname,
  187. value:v.num,
  188. bili:v.per
  189. })
  190. oName.push(v.dicname)
  191. }
  192. })
  193. const _arr = tName.filter(item1 => !oName.includes(item1));
  194. const _arr3 = oName.filter(item2 => !tName.includes(item2));
  195. otherName = _arr.concat(_arr3);
  196. otherName.forEach(function(v, n) {
  197. if (v) {
  198. data.push({
  199. name:v,
  200. value:0,
  201. bili:'0'
  202. })
  203. }
  204. })
  205. data.forEach(function(v,n){
  206. str+='<li><div><span>'+v.name+'</span></div><div><p><label class="db">'+v.value+'</label><label>数量</label>'+
  207. '</p><p><label class="bdrate">'+v.bili+'</label><label>百分比</label></p></div></li>'
  208. })
  209. $('.questype').html(str)
  210. })
  211. }