Brak opisu

trafficDataTable.js 15KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568
  1. var bigdataList = null;
  2. var sd = "";
  3. var ed = "";
  4. gettraffic(sd, ed);
  5. getAgentData(sd, ed);
  6. //轮播
  7. banner1()
  8. //轮播
  9. function banner1(){
  10. var i=0;
  11. var Timer;
  12. $(function(){
  13. $(".trafficImg").eq(0).show().siblings().hide(); //默认第一个div片显示,其他的隐藏
  14. //自动轮播
  15. TimerBanner();
  16. //点击红圈
  17. $(".trafficImg").hover(function(){ //鼠标移动上去
  18. clearInterval(Timer); //让计时器暂时停止 清除计时器
  19. i=$(this).index(); //获取该圈的索引
  20. showPic(); //调用显示图片的方法,显示该索引对应的图片
  21. },function(){ //鼠标离开
  22. TimerBanner(); //继续轮播 计时器开始
  23. });
  24. $(".trafficTabs .aaa").hover(function(){ //鼠标移动上去
  25. clearInterval(Timer); //让计时器暂时停止 清除计时器
  26. i=$(this).index(); //获取该圈的索引
  27. showPic(); //调用显示图片的方法,显示该索引对应的图片
  28. },function(){ //鼠标离开
  29. TimerBanner(); //继续轮播 计时器开始
  30. });
  31. //点击左右按钮
  32. $(".btn1").click(function(){
  33. clearInterval(Timer);
  34. i--; //往左
  35. if(i==-1){
  36. i=4;
  37. }
  38. showPic();
  39. TimerBanner();
  40. });
  41. $(".btn2").click(function(){
  42. clearInterval(Timer);
  43. i++; //往右
  44. if(i==4){
  45. i=0;
  46. }
  47. showPic();
  48. TimerBanner();
  49. });
  50. });
  51. //轮播部分
  52. function TimerBanner(){
  53. Timer = setInterval(function(){
  54. i++;
  55. if(i==4){
  56. i=0;
  57. }
  58. showPic()
  59. },5000);
  60. }
  61. //显示div
  62. function showPic() {
  63. $(".trafficImg").eq(i).show().siblings().hide();
  64. $(".trafficBg").hide();
  65. $(".trafficTabs .aaa").eq(i).children(".trafficBg").show();
  66. }
  67. }
  68. function gettraffic(sd,ed) {
  69. var myChartaaa = echarts.init(document.getElementById('smallAppealTotal'));
  70. var myChartbbb = echarts.init(document.getElementById('smallCallConnected'));
  71. var myChartppp = echarts.init(document.getElementById('smallAppeal'));
  72. var myChreti = echarts.init(document.getElementById('trafficAppeal'));
  73. var myKouc = echarts.init(document.getElementById('trafficCallConnected'));
  74. var myKucot = echarts.init(document.getElementById('trafficAppealTotal'));
  75. $.ajax({
  76. type: "get",
  77. url: huayi.config.callcenter_url + "Business/GetTelephoneList",
  78. async: true,
  79. dataType: "json",
  80. data: {
  81. stime:sd,
  82. endtime:ed,
  83. },
  84. success: function(data) {
  85. if (data.state.toLowerCase() == "success") {
  86. var con = data.data;
  87. var type = con.type;
  88. var conversations = con.conversations;
  89. var dates = con.dates;
  90. //诉求占比统计
  91. var type_data_type = [];
  92. $(type).each(function(i, n){
  93. var type_data_type_name_total = {};
  94. type_data_type_name_total.value = n.total;
  95. type_data_type_name_total.name = n.name;
  96. type_data_type.push(type_data_type_name_total);
  97. })
  98. //24小时来电量/接通量统计
  99. var type_data_conversations_time = [];
  100. var type_data_conversations_Incomingcall = [];
  101. var type_data_conversations_Connect = [];
  102. $(conversations).each(function(i, n) {
  103. type_data_conversations_time.push(n.time);
  104. type_data_conversations_Incomingcall.push(n.Incomingcall);
  105. type_data_conversations_Connect.push(n.Connect);
  106. })
  107. //话务总体数据统计展示
  108. var type_data_dates_total= [];
  109. $(dates).each(function(i, n) {
  110. type_data_dates_total.push(n.average);
  111. type_data_dates_total.push(n.connection);
  112. type_data_dates_total.push(n.traffic);
  113. })
  114. myChreti.setOption({
  115. title : {
  116. text: '诉求占比统计',
  117. x: 'center',
  118. textStyle: {
  119. "color": "#FFFFFF"
  120. }
  121. },
  122. tooltip : {
  123. trigger: 'item',
  124. formatter: "{a} <br/>{b} : {c} ({d}%)"
  125. },
  126. series : [
  127. {
  128. name: '诉求占比',
  129. type: 'pie',
  130. radius : '55%',
  131. data: type_data_type,
  132. itemStyle: {
  133. normal: {
  134. color: function(params) {
  135. //自定义颜色
  136. var colorList = [
  137. '#1890FF', '#2EC25B', '#FACC14', '#04D9FF', '#8543E0', '#13C2C2',
  138. '#00C0FF', '#05EB78', '#D141D9', '#05EB61', '#2FCDCD', '#BEEB30',
  139. '#EB9005', '#FFFF00', '#FF7F50', '#3CB371', '#00BFFF', '#9932CC',
  140. ];
  141. return colorList[params.dataIndex]
  142. }
  143. }
  144. }
  145. }
  146. ]
  147. })
  148. myChartppp.setOption({
  149. tooltip : {
  150. trigger: 'item',
  151. formatter: "{a} <br/>{b} : {c} ({d}%)"
  152. },
  153. series : [
  154. {
  155. name: '诉求占比',
  156. type: 'pie',
  157. radius : '55%',
  158. data: type_data_type,
  159. label: {
  160. normal: {
  161. show: false
  162. }
  163. },
  164. itemStyle: {
  165. normal: {
  166. color: function(params) {
  167. //自定义颜色
  168. var colorList = [
  169. '#1890FF', '#2EC25B', '#FACC14', '#04D9FF', '#8543E0', '#13C2C2',
  170. '#00C0FF', '#05EB78', '#D141D9', '#05EB61', '#2FCDCD', '#BEEB30',
  171. '#EB9005', '#FFFF00', '#FF7F50', '#3CB371', '#00BFFF', '#9932CC',
  172. ];
  173. return colorList[params.dataIndex]
  174. }
  175. }
  176. }
  177. }
  178. ]
  179. })
  180. myKouc.setOption({
  181. title: {
  182. text: '24小时来电量/接通量统计',
  183. x: 'center',
  184. textStyle: {
  185. "color": "#FFFFFF"
  186. }
  187. },
  188. tooltip: {
  189. trigger: 'axis'
  190. },
  191. legend: {
  192. data: ['来电量', '接通量'],
  193. bottom: 5,
  194. textStyle: {
  195. color: "#FFFAF0"
  196. }
  197. },
  198. xAxis: {
  199. type: 'category',
  200. data: type_data_conversations_time,
  201. axisLine: {
  202. lineStyle: {
  203. color: '#FFFFFF',//坐标线的颜色
  204. }
  205. },
  206. },
  207. yAxis: {
  208. type: 'value',
  209. axisLine: {
  210. lineStyle: {
  211. color: '#FFFFFF',//坐标线的颜色
  212. }
  213. },
  214. splitLine :{ //网格线
  215. lineStyle:{
  216. type:'dashed' //设置网格线类型 dotted:虚线 solid:实线
  217. },
  218. show:true //隐藏或显示
  219. }
  220. },
  221. series: [
  222. {
  223. name: '来电量',
  224. data: type_data_conversations_Incomingcall,
  225. type: 'line',
  226. itemStyle: {
  227. normal: {
  228. color: '#1890FF',
  229. }
  230. },
  231. },
  232. {
  233. name: '接通量',
  234. data: type_data_conversations_Connect,
  235. type: 'line',
  236. itemStyle: {
  237. normal: {
  238. color: '#13C2C2',
  239. }
  240. },
  241. },
  242. ]
  243. });
  244. myChartbbb.setOption({
  245. tooltip: {
  246. trigger: 'axis'
  247. },
  248. xAxis: {
  249. type: 'category',
  250. data: type_data_conversations_time,
  251. axisLine: {
  252. lineStyle: {
  253. color: '#FFFFFF',//坐标线的颜色
  254. }
  255. },
  256. },
  257. yAxis: {
  258. show: false,
  259. },
  260. series: [
  261. {
  262. name: '来电量',
  263. data: type_data_conversations_Incomingcall,
  264. type: 'line',
  265. itemStyle: {
  266. normal: {
  267. color: '#1890FF',
  268. }
  269. },
  270. },
  271. {
  272. name: '接通量',
  273. data: type_data_conversations_Connect,
  274. type: 'line',
  275. itemStyle: {
  276. normal: {
  277. color: '#13C2C2',
  278. }
  279. },
  280. },
  281. ]
  282. });
  283. myKucot.setOption({
  284. title: {
  285. text: '话务总体数据统计展示',
  286. x: 'center',
  287. textStyle: {
  288. "color": "#FFFFFF"
  289. }
  290. },
  291. tooltip: {
  292. trigger: 'axis',
  293. axisPointer: {
  294. type: 'shadow'
  295. }
  296. },
  297. xAxis: {
  298. type: 'category',
  299. data: ['平均通话时长(秒)', '接通量', '话务数'],
  300. axisLine: {
  301. lineStyle: {
  302. color: '#FFFFFF',//坐标线的颜色
  303. }
  304. },
  305. },
  306. yAxis: {
  307. type: 'value',
  308. boundaryGap: [0, 0.01],
  309. axisLine: {
  310. lineStyle: {
  311. color: '#FFFFFF',//坐标线的颜色
  312. }
  313. },
  314. splitLine: { //网格线
  315. show: false //隐藏或显示
  316. },
  317. },
  318. series: [
  319. {
  320. name: '数量',
  321. type: 'bar',
  322. barWidth: 30,
  323. itemStyle: {
  324. normal: {
  325. color: function(params) {
  326. //自定义颜色
  327. var colorList = [
  328. '#1890FF', '#2EC25B', '#FACC14', '#04D9FF', '#8543E0', '#13C2C2',
  329. '#00C0FF', '#05EB78', '#D141D9', '#05EB61', '#2FCDCD', '#BEEB30',
  330. '#EB9005', '#FFFF00', '#FF7F50', '#3CB371', '#00BFFF', '#9932CC',
  331. ];
  332. return colorList[params.dataIndex]
  333. },
  334. }
  335. },
  336. data: type_data_dates_total,
  337. },
  338. ]
  339. })
  340. myChartaaa.setOption({
  341. tooltip: {
  342. trigger: 'axis',
  343. axisPointer: {
  344. type: 'shadow'
  345. }
  346. },
  347. xAxis: {
  348. type: 'category',
  349. data: ['平均通话时长', '接通量', '话务数'],
  350. axisLine: {
  351. lineStyle: {
  352. color: '#FFFFFF',//坐标线的颜色
  353. },
  354. },
  355. },
  356. yAxis: {
  357. show: false,
  358. },
  359. series: [
  360. {
  361. name: '数量',
  362. type: 'bar',
  363. barWidth: 20,
  364. itemStyle: {
  365. normal: {
  366. color: function(params) {
  367. //自定义颜色
  368. var colorList = [
  369. '#1890FF', '#2EC25B', '#FACC14', '#04D9FF', '#8543E0', '#13C2C2',
  370. '#00C0FF', '#05EB78', '#D141D9', '#05EB61', '#2FCDCD', '#BEEB30',
  371. '#EB9005', '#FFFF00', '#FF7F50', '#3CB371', '#00BFFF', '#9932CC',
  372. ];
  373. return colorList[params.dataIndex]
  374. },
  375. },
  376. },
  377. data: type_data_dates_total,
  378. },
  379. ]
  380. })
  381. }
  382. }
  383. });
  384. }
  385. // 坐席实时数据
  386. function getAgentData(sd,ed) {
  387. var myTou = echarts.init(document.getElementById('trafficAgentBusy'));
  388. var myChart = echarts.init(document.getElementById('smallAgentBusy'));
  389. $.ajax({
  390. type: "get",
  391. url: huayi.config.callcenter_url + "Business/GetAgentTelCount",
  392. async: true,
  393. dataType: "json",
  394. data: {
  395. stime:sd,
  396. endtime:ed,
  397. },
  398. success: function(data){
  399. if (data.state.toLowerCase() == "success") {
  400. var con = data.data;
  401. var inconnectcount = con.inconnectcount; //呼入接通
  402. var incount = con.incount; //呼入
  403. var outconnectcount = con.outconnectcount; //呼出接通
  404. var outcount = con.outcount; //呼出
  405. var users = con.users; //坐席
  406. myTou.setOption({
  407. title: {
  408. text: '坐席实时数据',
  409. x: 'center',
  410. textStyle: {
  411. "color": "#FFFFFF"
  412. }
  413. },
  414. tooltip: {
  415. trigger: 'axis'
  416. },
  417. legend: {
  418. data: ['呼入', '呼入接通', '呼出', '呼出接通'],
  419. bottom: 5,
  420. textStyle: {
  421. color: "#FFFAF0"
  422. }
  423. },
  424. xAxis: {
  425. type: 'category',
  426. data: users,
  427. axisLine: {
  428. lineStyle: {
  429. color: '#FFFFFF',//坐标线的颜色
  430. }
  431. },
  432. },
  433. yAxis: {
  434. type: 'value',
  435. axisLine: {
  436. lineStyle: {
  437. color: '#FFFFFF',//坐标线的颜色
  438. }
  439. },
  440. splitLine :{ //网格线
  441. lineStyle:{
  442. type:'dashed' //设置网格线类型 dotted:虚线 solid:实线
  443. },
  444. show:true //隐藏或显示
  445. }
  446. },
  447. series: [
  448. {
  449. name: '呼入',
  450. data: incount,
  451. type: 'line',
  452. itemStyle: {
  453. normal: {
  454. color: '#1890FF',
  455. }
  456. },
  457. },
  458. {
  459. name: '呼入接通',
  460. data: inconnectcount,
  461. type: 'line',
  462. itemStyle: {
  463. normal: {
  464. color: '#8543E0',
  465. }
  466. },
  467. },
  468. {
  469. name: '呼出',
  470. data: outcount,
  471. type: 'line',
  472. itemStyle: {
  473. normal: {
  474. color: '#2EC25B',
  475. }
  476. },
  477. },
  478. {
  479. name: '呼出接通',
  480. data: outconnectcount,
  481. type: 'line',
  482. itemStyle: {
  483. normal: {
  484. color: '#FACC14',
  485. }
  486. },
  487. },
  488. ]
  489. });
  490. myChart.setOption({
  491. tooltip: {
  492. trigger: 'axis'
  493. },
  494. xAxis: {
  495. type: 'category',
  496. data: users,
  497. axisLine: {
  498. lineStyle: {
  499. color: '#FFFFFF',//坐标线的颜色
  500. }
  501. },
  502. },
  503. yAxis: {
  504. show: false,
  505. },
  506. series: [
  507. {
  508. name: '呼入',
  509. data: incount,
  510. type: 'line',
  511. itemStyle: {
  512. normal: {
  513. color: '#1890FF',
  514. }
  515. },
  516. },
  517. {
  518. name: '呼入接通',
  519. data: inconnectcount,
  520. type: 'line',
  521. itemStyle: {
  522. normal: {
  523. color: '#8543E0',
  524. }
  525. },
  526. },
  527. {
  528. name: '呼出',
  529. data: outcount,
  530. type: 'line',
  531. itemStyle: {
  532. normal: {
  533. color: '#2EC25B',
  534. }
  535. },
  536. },
  537. {
  538. name: '呼出接通',
  539. data: outconnectcount,
  540. type: 'line',
  541. itemStyle: {
  542. normal: {
  543. color: '#FACC14',
  544. }
  545. },
  546. },
  547. ]
  548. });
  549. }
  550. }
  551. })
  552. }