鑫苑新版本前端代码

huawu.js 11KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576
  1. $(document).ready(function() {
  2. //part 1
  3. var main1 = echarts.init(document.getElementById('main1'));
  4. main1.setOption({
  5. tooltip: {
  6. trigger: 'axis',
  7. axisPointer: {
  8. type: 'cross',
  9. label: {
  10. show: true,
  11. backgroundColor: '#333'
  12. }
  13. }
  14. },
  15. legend: {
  16. bottom:'bottom',
  17. // data: ["来电数量", "接通数量", "放弃数量", "黑名单拒接数量"],
  18. data: ["来话量", "通话量"],
  19. textStyle: {
  20. color: '#fff'
  21. }
  22. },
  23. xAxis: {
  24. name: '时',
  25. data: [],
  26. axisLine: {
  27. lineStyle: {
  28. color: '#ccc'
  29. }
  30. }
  31. },
  32. yAxis: {
  33. name: '数量',
  34. splitLine: {
  35. show: false
  36. },
  37. axisLine: {
  38. lineStyle: {
  39. color: '#ccc'
  40. }
  41. }
  42. },
  43. series: []
  44. });
  45. function partOne() {
  46. var index = layer.load(1, {
  47. shade: [0.5, '#030303'] //0.1透明度的白色背景
  48. });
  49. // $('.list_one').html('');
  50. $.ajax({
  51. type: "get",
  52. url: huayi.config.callcenter_url + "CallManage/GetCallCount",
  53. async: true,
  54. dataType: "json",
  55. data: {
  56. // date: $('#time1').val()
  57. },
  58. success: function(data) {
  59. if(data.state.toLowerCase() == "success") {
  60. layer.close(index);
  61. var con = data.data;
  62. main1.setOption({
  63. xAxis: {
  64. data: con.hour
  65. },
  66. series: [{
  67. name: "来话量",
  68. type: "line",
  69. smooth: true,
  70. showAllSymbol: true,
  71. symbol: "emptyCircle",
  72. symbolSize: 10,
  73. data: con.callin
  74. }, {
  75. name: "通话量",
  76. type: "line",
  77. smooth: true,
  78. showAllSymbol: true,
  79. symbol: "emptyCircle",
  80. symbolSize: 10,
  81. data: con.callconn
  82. // },
  83. // {
  84. // name: "放弃数量",
  85. // type: "line",
  86. // smooth: true,
  87. // showAllSymbol: true,
  88. // symbol: "emptyCircle",
  89. // symbolSize: 10,
  90. // data: con.gcounts
  91. // },
  92. // {
  93. // name: "黑名单拒接数量",
  94. // type: "line",
  95. // smooth: true,
  96. // showAllSymbol: true,
  97. // symbol: "emptyCircle",
  98. // symbolSize: 10,
  99. // data: con.scounts
  100. }]
  101. })
  102. }
  103. }
  104. });
  105. }
  106. //part 2
  107. var phone_num = echarts.init(document.getElementById('phone_num'));
  108. phone_num.setOption({
  109. // color: ['#6ce7ac', '#6a91e0', '#ceba5f', '#cb5f79', '#ae765a', '#569d4e'],
  110. color: [ '#6a91e0', '#ceba5f', '#cb5f79', '#ae765a', '#569d4e'],
  111. tooltip: {
  112. trigger: 'item',
  113. formatter: "{a} <br/>{b} : {c} ({d}%)",
  114. axisPointer: {
  115. crossStyle: {
  116. color: '#fff'
  117. }
  118. }
  119. },
  120. legend: {
  121. // orient: 'vertical',
  122. bottom: 'bottom',
  123. data: ['来电量','呼出量'],
  124. textStyle: {
  125. color: '#fff'
  126. }
  127. },
  128. series: [{
  129. name: '数据',
  130. type: 'pie',
  131. radius: '50%',
  132. // radius: ['30%', '60%'],
  133. center: ['50%', '50%'],
  134. data: [],
  135. itemStyle: {
  136. emphasis: {
  137. shadowBlur: 10,
  138. shadowOffsetX: 0,
  139. shadowColor: 'rgba(0, 0, 0, 0.5)'
  140. },
  141. normal: {
  142. label: {
  143. show: true,
  144. // formatter: '{b} : {c} ({d}%)'
  145. formatter: '{c} ({d}%)'
  146. // formatter: '{d}%'
  147. },
  148. labelLine: {
  149. show: true
  150. }
  151. }
  152. },
  153. label: {
  154. normal: {
  155. textStyle: {
  156. color: '#fff'
  157. }
  158. }
  159. }
  160. }]
  161. });
  162. var phone_num2 = echarts.init(document.getElementById('phone_num2'));
  163. phone_num2.setOption({
  164. color: [ '#ae765a', '#569d4e'],
  165. tooltip: {
  166. trigger: 'item',
  167. formatter: "{a} <br/>{b} : {c} ({d}%)",
  168. axisPointer: {
  169. crossStyle: {
  170. color: '#fff'
  171. }
  172. }
  173. },
  174. legend: {
  175. // orient: 'vertical',
  176. bottom: 'bottom',
  177. data: ['接通量','未接通量'],
  178. textStyle: {
  179. color: '#fff'
  180. }
  181. },
  182. series: [{
  183. name: '数据',
  184. type: 'pie',
  185. radius: '50%',
  186. center: ['50%', '50%'],
  187. data: [],
  188. itemStyle: {
  189. emphasis: {
  190. shadowBlur: 10,
  191. shadowOffsetX: 0,
  192. shadowColor: 'rgba(0, 0, 0, 0.5)'
  193. },
  194. normal: {
  195. label: {
  196. show: true,
  197. // formatter: '{b} : {c} ({d}%)'
  198. formatter: '{c} ({d}%)'
  199. },
  200. labelLine: {
  201. show: true
  202. }
  203. }
  204. },
  205. label: {
  206. normal: {
  207. textStyle: {
  208. color: '#fff'
  209. }
  210. }
  211. }
  212. }]
  213. });
  214. function partTwo() {
  215. var index = layer.load(1, {
  216. shade: [0.5, '#030303'] //0.1透明度的白色背景
  217. });
  218. $.ajax({
  219. type: "get",
  220. url: huayi.config.callcenter_url + "CallManage/GetCallTotal",
  221. async: true,
  222. dataType: "json",
  223. data: {
  224. // date: $('#time2').val()
  225. },
  226. success: function(data) {
  227. if(data.state.toLowerCase() == "success") {
  228. layer.close(index);
  229. var con = data.data;
  230. var part_2_ser = [{'value':con.daycallin ,'name':'来电量'},{'value':con.daycallout ,'name':'呼出量'}];
  231. phone_num.setOption({
  232. series: [{
  233. data: part_2_ser
  234. }]
  235. })
  236. var part_2_ser2 = [{'value':con.daycallconnect ,'name':'接通量'},{'value':con.daycallwconnect ,'name':'未接通量'}];
  237. phone_num2.setOption({
  238. series: [{
  239. data: part_2_ser2
  240. }]
  241. })
  242. }
  243. }
  244. });
  245. }
  246. //pasrt 5
  247. // var main = echarts.init(document.getElementById('main'));
  248. // main.setOption({
  249. //
  250. // tooltip: {
  251. // trigger: 'axis',
  252. // axisPointer: {
  253. // type: 'cross',
  254. // label: {
  255. // show: true,
  256. // backgroundColor: '#333'
  257. // }
  258. // },
  259. // formatter: function(datas) {
  260. // var res = datas[0].name + '<br/>',
  261. // val;
  262. // for(var i = 0, length = datas.length; i < length; i++) {
  263. // val = (datas[i].value) + '%';
  264. // res += datas[i].seriesName + ':' + val + '<br/>';
  265. // }
  266. // return res;
  267. // }
  268. // },
  269. // legend: {
  270. //// data: ["空闲", "通话", "置忙"],
  271. // data: [],
  272. // textStyle: {
  273. // color: '#fff'
  274. // },
  275. // bottom:'bottom'
  276. // },
  277. // xAxis: {
  278. // name: '时',
  279. // data: [],
  280. // axisLine: {
  281. // lineStyle: {
  282. // color: '#ccc'
  283. // }
  284. // }
  285. // },
  286. // yAxis: {
  287. // name: '比率',
  288. // splitLine: {
  289. // show: false
  290. // },
  291. // axisLine: {
  292. // lineStyle: {
  293. // color: '#ccc'
  294. // }
  295. // }
  296. // },
  297. // series: []
  298. // });
  299. //
  300. function partThree(){
  301. var index = layer.load(1, {
  302. shade: [0.5, '#030303'] //0.1透明度的白色背景
  303. });
  304. $.ajax({
  305. type: "get",
  306. url: huayi.config.callcenter_url + "CallManage/FreeBusyRate",
  307. async: true,
  308. dataType: "json",
  309. data: {
  310. // start: $('#time3').val(),
  311. // end: $('#time4').val()
  312. },
  313. success: function(data) {
  314. if(data.state.toLowerCase() == "success") {
  315. layer.close(index);
  316. var con = data.data;
  317. // var part3 = result.data.b;
  318. main.setOption({
  319. xAxis: {
  320. data: con.hour
  321. },
  322. legend: {
  323. data: con.callstate
  324. },
  325. series: [{
  326. name: "空闲",
  327. type: "bar",
  328. data: con.freecount
  329. }, {
  330. name: "通话中",
  331. type: "bar",
  332. data: con.callincount
  333. }, {
  334. name: "小休",
  335. type: "bar",
  336. data: con.restcount
  337. }]
  338. })
  339. }
  340. }
  341. });
  342. }
  343. //接通率报表part3
  344. var jtv = echarts.init(document.getElementById('jtv_num'));
  345. jtv.setOption({
  346. color: ['#4ab7c7', '#FF9800'],
  347. // title: {
  348. // text: '接通率统计',
  349. // x: 'center',
  350. // textStyle: {
  351. // color: '#fff',
  352. // fontSize: 18,
  353. // fontWeight: 'normal'
  354. // }
  355. // },
  356. tooltip: {
  357. trigger: 'axis',
  358. axisPointer: {
  359. type: 'shadow',
  360. label: {
  361. show: true,
  362. backgroundColor: '#333'
  363. }
  364. },
  365. formatter: function(datas)
  366. {
  367. var res = datas[0].name + '<br/>', val;
  368. for(var i = 0, length = datas.length; i < length; i++) {
  369. val = (datas[i].value) + '%';
  370. res += datas[i].seriesName + ':' + val + '<br/>';
  371. }
  372. return res;
  373. }
  374. },
  375. legend: {
  376. // top: 30,
  377. bottom:'bottom',
  378. data: [],
  379. textStyle: {
  380. color: '#fff'
  381. }
  382. },
  383. xAxis: {
  384. name: '时',
  385. data: [],
  386. axisLine: {
  387. lineStyle: {
  388. color: '#ccc'
  389. }
  390. },
  391. },
  392. yAxis: {
  393. name: '比率',
  394. splitLine: {
  395. show: false
  396. },
  397. axisLine: {
  398. lineStyle: {
  399. color: '#ccc'
  400. }
  401. }
  402. },
  403. series: [{
  404. name: '接通量',
  405. type: 'bar',
  406. barWidth: 8,
  407. data: []
  408. },{
  409. name: '未接量',
  410. type: 'bar',
  411. barWidth: 8,
  412. data: []
  413. }]
  414. });
  415. function partFour(){
  416. var index = layer.load(1, { shade: [0.5,'#030303'] //0.1透明度的白色背景
  417. });
  418. $.ajax({
  419. type:"get",
  420. url:huayi.config.callcenter_url + "CallManage/GetCallState",
  421. async:true,
  422. dataType:'json',
  423. data:{
  424. // date:$('#time4').val()
  425. },
  426. success:function(data){
  427. if(data.state.toLowerCase()=='success'){
  428. layer.close(index);
  429. var con=data.data;
  430. // var part3=data.data.b;
  431. jtv.setOption({
  432. legend: {
  433. data: con.callstates,
  434. },
  435. xAxis: {
  436. data:con.hour
  437. },
  438. series: [{
  439. data:con.callconn
  440. },{
  441. data:con.callunconn
  442. }]
  443. })
  444. }
  445. }
  446. });
  447. }
  448. //通话时长part4
  449. var th_nums = echarts.init(document.getElementById('th_nums'));
  450. th_nums.setOption({
  451. // title: {
  452. // text: '通话时长统计',
  453. // x: 'center',
  454. // textStyle: {
  455. // color: '#fff',
  456. // fontSize: 18,
  457. // fontWeight: 'normal'
  458. // }
  459. // },
  460. tooltip: {
  461. trigger: 'axis',
  462. axisPointer: {
  463. type: 'shadow',
  464. label: {
  465. show: true,
  466. backgroundColor: '#333'
  467. }
  468. }
  469. },
  470. legend: {
  471. bottom:'bottom',
  472. data: ['平均通话时长'],
  473. textStyle: {
  474. color: '#fff'
  475. }
  476. },
  477. xAxis: {
  478. name: '时',
  479. data: [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23],
  480. axisLine: {
  481. lineStyle: {
  482. color: '#ccc'
  483. }
  484. },
  485. },
  486. yAxis: {
  487. name: '秒',
  488. splitLine: {
  489. show: false
  490. },
  491. axisLine: {
  492. lineStyle: {
  493. color: '#ccc'
  494. }
  495. }
  496. },
  497. series: [{
  498. name: '平均通话时长',
  499. type: 'line',
  500. smooth:true,
  501. showAllSymbol:true,
  502. symbol :"emptyCircle",
  503. symbolSize: 10,
  504. data: []
  505. }]
  506. });
  507. function partFive(){
  508. var index = layer.load(1, { shade: [0.5,'#030303'] //0.1透明度的白色背景
  509. });
  510. $.ajax({
  511. type:"get",
  512. url:huayi.config.callcenter_url + "CallManage/GetCallTime",
  513. async:true,
  514. dataType:'json',
  515. data:{
  516. // date:$('#time5').val()
  517. },
  518. success:function(data){
  519. if(data.state.toLowerCase()=='success'){
  520. layer.close(index);
  521. var con=data.data;
  522. th_nums.setOption({
  523. // xAxis: {
  524. // data:con.hours
  525. // },
  526. series: [{
  527. data:con.avgtime
  528. }]
  529. })
  530. }
  531. }
  532. });
  533. }
  534. Ajax();
  535. function Ajax(){
  536. partOne();
  537. partTwo()
  538. // partThree();
  539. partFour();
  540. partFive();
  541. }
  542. setInterval(Ajax, huayi.config.indextime); //Ajax调用函数
  543. })