鑫苑新版本前端代码

huawu.js 10KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582
  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. title: {
  110. // text: '投诉/举报汇总',
  111. x: 'center',
  112. textStyle: {
  113. color: '#fff',
  114. fontSize: 16
  115. },
  116. },
  117. tooltip: {
  118. trigger: 'axis',
  119. axisPointer: { // 坐标轴指示器,坐标轴触发有效
  120. type: 'line' // 默认为直线,可选为:'line' | 'shadow'
  121. }
  122. },
  123. toolbox: {
  124. show: true,
  125. },
  126. calculable: true,
  127. xAxis: [{
  128. type: 'category',
  129. // name: '月份',
  130. splitLine: {
  131. show: false
  132. }, //去除网格线
  133. data: ["来话量(通)", "接通量(通)", "接通率", "平均通话时长(秒)"],
  134. // axisTick: {
  135. // alignWithLabel: true
  136. // },
  137. axisLine: {
  138. show: false,
  139. lineStyle: {
  140. color: '#fff'
  141. }
  142. },
  143. // axisLine: {},
  144. axisTick: {
  145. show: false
  146. }
  147. }],
  148. yAxis: [{
  149. show: false
  150. }],
  151. series: [{
  152. name: '数量',
  153. type: 'bar',
  154. barWidth: '30%', //图形宽度
  155. data: [],
  156. itemStyle: {
  157. normal: {
  158. label: {
  159. show: true,
  160. textStyle: {
  161. color: '#fff' //顶部数据颜色
  162. }
  163. }
  164. }
  165. },
  166. label: {
  167. normal: {
  168. show: true,
  169. position: 'top' //顶部数据显示位置
  170. }
  171. }
  172. }
  173. ]
  174. // color: ['#ff9800','#61a0a8','#1ab394']
  175. });
  176. function partTwo() {
  177. var index = layer.load(1, {
  178. shade: [0.5, '#030303'] //0.1透明度的白色背景
  179. });
  180. $.ajax({
  181. type: "get",
  182. url: huayi.config.callcenter_url + "CallManage/GetCallTotal",
  183. async: true,
  184. dataType: "json",
  185. data: {
  186. // date: $('#time2').val()
  187. },
  188. success: function(data) {
  189. if(data.state.toLowerCase() == "success") {
  190. layer.close(index);
  191. var con = data.data;
  192. phone_num.setOption({
  193. series: [{
  194. data: [con.daycallin, con.daycallconn, con.daycallrate, con.avgtime]
  195. // data: [20, 100, 5, 80]
  196. }]
  197. })
  198. }
  199. }
  200. });
  201. }
  202. //pasrt 5
  203. // var main = echarts.init(document.getElementById('main'));
  204. // main.setOption({
  205. //
  206. // tooltip: {
  207. // trigger: 'axis',
  208. // axisPointer: {
  209. // type: 'cross',
  210. // label: {
  211. // show: true,
  212. // backgroundColor: '#333'
  213. // }
  214. // },
  215. // formatter: function(datas) {
  216. // var res = datas[0].name + '<br/>',
  217. // val;
  218. // for(var i = 0, length = datas.length; i < length; i++) {
  219. // val = (datas[i].value) + '%';
  220. // res += datas[i].seriesName + ':' + val + '<br/>';
  221. // }
  222. // return res;
  223. // }
  224. // },
  225. // legend: {
  226. //// data: ["空闲", "通话", "置忙"],
  227. // data: [],
  228. // textStyle: {
  229. // color: '#fff'
  230. // },
  231. // bottom:'bottom'
  232. // },
  233. // xAxis: {
  234. // name: '时',
  235. // data: [],
  236. // axisLine: {
  237. // lineStyle: {
  238. // color: '#ccc'
  239. // }
  240. // }
  241. // },
  242. // yAxis: {
  243. // name: '比率',
  244. // splitLine: {
  245. // show: false
  246. // },
  247. // axisLine: {
  248. // lineStyle: {
  249. // color: '#ccc'
  250. // }
  251. // }
  252. // },
  253. // series: []
  254. // });
  255. //
  256. function partThree(){
  257. var index = layer.load(1, {
  258. shade: [0.5, '#030303'] //0.1透明度的白色背景
  259. });
  260. $.ajax({
  261. type: "get",
  262. url: huayi.config.callcenter_url + "CallManage/FreeBusyRate",
  263. async: true,
  264. dataType: "json",
  265. data: {
  266. // start: $('#time3').val(),
  267. // end: $('#time4').val()
  268. },
  269. success: function(data) {
  270. if(data.state.toLowerCase() == "success") {
  271. layer.close(index);
  272. var con = data.data;
  273. // var part3 = result.data.b;
  274. main.setOption({
  275. xAxis: {
  276. data: con.hour
  277. },
  278. legend: {
  279. data: con.callstate
  280. },
  281. series: [{
  282. name: "空闲",
  283. type: "bar",
  284. data: con.freecount
  285. }, {
  286. name: "通话中",
  287. type: "bar",
  288. data: con.callincount
  289. }, {
  290. name: "小休",
  291. type: "bar",
  292. data: con.restcount
  293. }]
  294. })
  295. }
  296. }
  297. });
  298. }
  299. //接通率报表part3
  300. var jtv = echarts.init(document.getElementById('jtv_num'));
  301. jtv.setOption({
  302. // title: {
  303. // text: '接通率统计',
  304. // x: 'center',
  305. // textStyle: {
  306. // color: '#fff',
  307. // fontSize: 18,
  308. // fontWeight: 'normal'
  309. // }
  310. // },
  311. tooltip: {
  312. trigger: 'axis',
  313. axisPointer: {
  314. type: 'shadow',
  315. label: {
  316. show: true,
  317. backgroundColor: '#333'
  318. }
  319. },
  320. formatter: function(datas)
  321. {
  322. var res = datas[0].name + '<br/>', val;
  323. for(var i = 0, length = datas.length; i < length; i++) {
  324. val = (datas[i].value) + '%';
  325. res += datas[i].seriesName + ':' + val + '<br/>';
  326. }
  327. return res;
  328. }
  329. },
  330. legend: {
  331. // top: 30,
  332. bottom:'bottom',
  333. data: [],
  334. textStyle: {
  335. color: '#fff'
  336. }
  337. },
  338. xAxis: {
  339. name: '时',
  340. data: [],
  341. axisLine: {
  342. lineStyle: {
  343. color: '#ccc'
  344. }
  345. },
  346. },
  347. yAxis: {
  348. name: '比率',
  349. splitLine: {
  350. show: false
  351. },
  352. axisLine: {
  353. lineStyle: {
  354. color: '#ccc'
  355. }
  356. }
  357. },
  358. series: [{
  359. name: '接通量',
  360. type: 'bar',
  361. barWidth: 8,
  362. itemStyle: {
  363. normal: {
  364. color: new echarts.graphic.LinearGradient(
  365. 0, 0, 0, 1, [{
  366. offset: 0,
  367. color: '#14c8d4'
  368. },
  369. {
  370. offset: 1,
  371. color: '#43eec6'
  372. }
  373. ]
  374. )
  375. }
  376. },
  377. data: []
  378. },{
  379. name: '未接量',
  380. type: 'bar',
  381. barWidth: 8,
  382. itemStyle: {
  383. normal: {
  384. color: new echarts.graphic.LinearGradient(
  385. 0, 0, 0, 1, [{
  386. offset: 0,
  387. color: '#14c8d4'
  388. },
  389. {
  390. offset: 1,
  391. color: '#43eec6'
  392. }
  393. ]
  394. )
  395. }
  396. },
  397. data: []
  398. },{
  399. name: '未接量',
  400. type: 'bar',
  401. barWidth: 8,
  402. itemStyle: {
  403. normal: {
  404. color: new echarts.graphic.LinearGradient(
  405. 0, 0, 0, 1, [{
  406. offset: 0,
  407. color: '#14c8d4'
  408. },
  409. {
  410. offset: 1,
  411. color: '#43eec6'
  412. }
  413. ]
  414. )
  415. }
  416. },
  417. data: []
  418. }]
  419. });
  420. function partFour(){
  421. var index = layer.load(1, { shade: [0.5,'#030303'] //0.1透明度的白色背景
  422. });
  423. $.ajax({
  424. type:"get",
  425. url:huayi.config.callcenter_url + "CallManage/GetCallState",
  426. async:true,
  427. dataType:'json',
  428. data:{
  429. // date:$('#time4').val()
  430. },
  431. success:function(data){
  432. if(data.state.toLowerCase()=='success'){
  433. layer.close(index);
  434. var con=data.data;
  435. // var part3=data.data.b;
  436. jtv.setOption({
  437. legend: {
  438. data: con.callstates,
  439. },
  440. xAxis: {
  441. data:con.hour
  442. },
  443. series: [{
  444. data:con.callconn
  445. },{
  446. data:con.callunconn
  447. }]
  448. })
  449. }
  450. }
  451. });
  452. }
  453. //通话时长part4
  454. var th_nums = echarts.init(document.getElementById('th_nums'));
  455. th_nums.setOption({
  456. // title: {
  457. // text: '通话时长统计',
  458. // x: 'center',
  459. // textStyle: {
  460. // color: '#fff',
  461. // fontSize: 18,
  462. // fontWeight: 'normal'
  463. // }
  464. // },
  465. tooltip: {
  466. trigger: 'axis',
  467. axisPointer: {
  468. type: 'shadow',
  469. label: {
  470. show: true,
  471. backgroundColor: '#333'
  472. }
  473. }
  474. },
  475. legend: {
  476. bottom:'bottom',
  477. data: ['平均通话时长'],
  478. textStyle: {
  479. color: '#fff'
  480. }
  481. },
  482. xAxis: {
  483. name: '时',
  484. 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],
  485. axisLine: {
  486. lineStyle: {
  487. color: '#ccc'
  488. }
  489. },
  490. },
  491. yAxis: {
  492. name: '秒',
  493. splitLine: {
  494. show: false
  495. },
  496. axisLine: {
  497. lineStyle: {
  498. color: '#ccc'
  499. }
  500. }
  501. },
  502. series: [{
  503. name: '平均通话时长',
  504. type: 'line',
  505. smooth:true,
  506. showAllSymbol:true,
  507. symbol :"emptyCircle",
  508. symbolSize: 10,
  509. data: []
  510. }]
  511. });
  512. function partFive(){
  513. var index = layer.load(1, { shade: [0.5,'#030303'] //0.1透明度的白色背景
  514. });
  515. $.ajax({
  516. type:"get",
  517. url:huayi.config.callcenter_url + "CallManage/GetCallTime",
  518. async:true,
  519. dataType:'json',
  520. data:{
  521. // date:$('#time5').val()
  522. },
  523. success:function(data){
  524. if(data.state.toLowerCase()=='success'){
  525. layer.close(index);
  526. var con=data.data;
  527. th_nums.setOption({
  528. // xAxis: {
  529. // data:con.hours
  530. // },
  531. series: [{
  532. data:con.avgtime
  533. }]
  534. })
  535. }
  536. }
  537. });
  538. }
  539. Ajax();
  540. function Ajax(){
  541. partOne();
  542. partTwo()
  543. // partThree();
  544. partFour();
  545. partFive();
  546. }
  547. setInterval(Ajax, huayi.config.indextime); //Ajax调用函数
  548. })