商丘12345 前端

sourceChannel.js 10KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573
  1. Ajax1();
  2. //part 1 //投诉类别月统计 对接完毕
  3. var part_1 = echarts.init(document.getElementById('part_1'));
  4. part_1.setOption({
  5. color: ['#69e1a9', '#6a91e0', '#ceba5f', '#f06e84', '#569d4e', '#7d55ba', '#ce5aba', '#345cdd', '#569d4e'],
  6. tooltip: {
  7. trigger: 'axis',
  8. axisPointer: {
  9. type: 'cross',
  10. label: {
  11. show: true,
  12. backgroundColor: '#333'
  13. }
  14. }
  15. },
  16. grid: {
  17. left: '2%',
  18. right: '5%',
  19. bottom: '6%',
  20. containLabel: true
  21. },
  22. legend: {
  23. top: 'top',
  24. left: '180px',
  25. data: [],
  26. textStyle: {
  27. color: '#00e9ff'
  28. }
  29. },
  30. xAxis: {
  31. name: '月份',
  32. data: [],
  33. axisLine: {
  34. lineStyle: {
  35. color: '#3061a2'
  36. }
  37. },
  38. axisTick: {
  39. alignWithLabel: true,
  40. show: false
  41. },
  42. axisLabel: { //横轴字体颜色
  43. show: true,
  44. textStyle: {
  45. color: '#eff0f4'
  46. }
  47. }
  48. },
  49. yAxis: {
  50. name: '(数量)',
  51. splitLine: {
  52. show: false
  53. },
  54. axisLine: {
  55. lineStyle: {
  56. color: '#3061a2'
  57. }
  58. },
  59. axisLabel: { //横轴字体颜色
  60. show: true,
  61. textStyle: {
  62. color: '#eff0f4'
  63. }
  64. }
  65. },
  66. series: []
  67. });
  68. function partTwo() {
  69. // var index = layer.load(1, {
  70. // shade: [0.5, '#030303'] //0.1透明度的白色背景
  71. // });
  72. $.ajax({
  73. type: "get",
  74. url: huayi.config.callcenter_url + "info/GetTypeCountMonthByDate",
  75. async: true,
  76. dataType: 'json',
  77. data: {
  78. start: "",
  79. end: "",
  80. branchcode: ""
  81. },
  82. success: function(data) {
  83. if(data.state.toLowerCase() == 'success') {
  84. // layer.close(index);
  85. var con = data.data;
  86. var counts = con.counts;
  87. var sers = [];
  88. $(counts).each(function(i, n) {
  89. var obj = {};
  90. obj.name = con.cols[i];
  91. obj.type = "line";
  92. obj.smooth = true;
  93. obj.showAllSymbol = true;
  94. obj.symbol = "emptyCircle";
  95. obj.symbolSize = 10;
  96. obj.data = n;
  97. sers.push(obj)
  98. });
  99. part_1.setOption({
  100. xAxis: {
  101. data: con.months
  102. },
  103. legend: {
  104. data: con.cols
  105. },
  106. series: sers
  107. });
  108. }
  109. }
  110. });
  111. }
  112. //part 2
  113. var phoneTimeCount = echarts.init(document.getElementById('phoneTimeCount'));
  114. phoneTimeCount.setOption({
  115. color: ['#ceba5f', '#4da991', '#f06e84', '#6a91e0'],
  116. tooltip: {
  117. trigger: 'axis',
  118. axisPointer: {
  119. type: 'cross',
  120. label: {
  121. show: true,
  122. backgroundColor: '#333'
  123. }
  124. }
  125. },
  126. grid: {
  127. left: '2%',
  128. right: '5%',
  129. bottom: '6%',
  130. containLabel: true
  131. },
  132. legend: {
  133. top: 'top',
  134. left: '180px',
  135. data: ["来电数量", "接通数量", "放弃数量", "黑名单拒接数量"],
  136. textStyle: {
  137. color: '#00e9ff'
  138. }
  139. },
  140. xAxis: {
  141. name: '时',
  142. data: [],
  143. axisLine: {
  144. lineStyle: {
  145. color: '#3061a2'
  146. }
  147. },
  148. axisTick: {
  149. alignWithLabel: true,
  150. show: false
  151. },
  152. axisLabel: { //横轴字体颜色
  153. show: true,
  154. textStyle: {
  155. color: '#eff0f4'
  156. }
  157. }
  158. },
  159. yAxis: {
  160. name: '数量',
  161. splitLine: {
  162. show: false
  163. },
  164. axisLine: {
  165. lineStyle: {
  166. color: '#3061a2'
  167. }
  168. },
  169. axisLabel: { //横轴字体颜色
  170. show: true,
  171. textStyle: {
  172. color: '#eff0f4'
  173. }
  174. }
  175. },
  176. series: []
  177. });
  178. function partOne() {
  179. $.ajax({
  180. type: "get",
  181. url: huayi.config.callcenter_url + "info/GetTelCount24ByDate",
  182. async: true,
  183. dataType: "json",
  184. data: {
  185. date: "2019-07-23",
  186. branchcode: ""
  187. },
  188. success: function(data) {
  189. if(data.state.toLowerCase() == "success") {
  190. // layer.close(index);
  191. var con = data.data;
  192. phoneTimeCount.setOption({
  193. xAxis: {
  194. data: con.hours
  195. },
  196. series: [{
  197. name: "来电数量",
  198. type: "line",
  199. smooth: true,
  200. showAllSymbol: true,
  201. symbol: "emptyCircle",
  202. symbolSize: 10,
  203. data: con.rcounts
  204. }, {
  205. name: "接通数量",
  206. type: "line",
  207. smooth: true,
  208. showAllSymbol: true,
  209. symbol: "emptyCircle",
  210. symbolSize: 10,
  211. data: con.ccounts
  212. },
  213. {
  214. name: "放弃数量",
  215. type: "line",
  216. smooth: true,
  217. showAllSymbol: true,
  218. symbol: "emptyCircle",
  219. symbolSize: 10,
  220. data: con.gcounts
  221. },
  222. {
  223. name: "黑名单拒接数量",
  224. type: "line",
  225. smooth: true,
  226. showAllSymbol: true,
  227. symbol: "emptyCircle",
  228. symbolSize: 10,
  229. data: con.scounts
  230. }
  231. ]
  232. })
  233. }
  234. }
  235. });
  236. }
  237. // part3 受理区域统计
  238. var part3 = echarts.init(document.getElementById('part3'));
  239. part3.setOption({
  240. color: ['#6ce7ac', '#6a91e0', '#ceba5f', '#cb5f79', '#ae765a', '#569d4e', '#7d55ba', '#ce5aba', '#355cdd', '#44c1c6', '#ceba5e', '#c64444'],
  241. title: {
  242. text: '各区县占比',
  243. x: 'center',
  244. y: '45%',
  245. textStyle: {
  246. fontWeight: 'normal',
  247. fontSize: 16,
  248. color: '#fff'
  249. }
  250. },
  251. tooltip: {
  252. trigger: 'item',
  253. formatter: "{a} <br/>{b} : {c} ({d}%)",
  254. axisPointer: {
  255. crossStyle: {
  256. color: '#fff'
  257. }
  258. }
  259. },
  260. series: [{
  261. name: '数据',
  262. type: 'pie',
  263. radius: ['30%', '60%'],
  264. center: ['50%', '50%'],
  265. data: [],
  266. itemStyle: {
  267. emphasis: {
  268. shadowBlur: 10,
  269. shadowOffsetX: 0,
  270. shadowColor: 'rgba(0, 0, 0, 0.5)'
  271. },
  272. normal: {
  273. label: {
  274. show: true,
  275. // formatter: '{b} : {c} ({d}%)'
  276. formatter: '{d}%'
  277. },
  278. labelLine: {
  279. show: true
  280. }
  281. }
  282. },
  283. label: {
  284. normal: {
  285. textStyle: {
  286. color: '#fff'
  287. }
  288. }
  289. }
  290. }]
  291. });
  292. function partThree() {
  293. $.ajax({
  294. type: "get",
  295. url: huayi.config.callcenter_url + "info/GetAreaCountByDate",
  296. async: true,
  297. dataType: 'json',
  298. data: {
  299. start: "2019-07-01",
  300. end: "2019-07-31",
  301. branchcode: ""
  302. },
  303. success: function(data) {
  304. if(data.state.toLowerCase() == 'success') {
  305. // layer.close(index);
  306. $('.complaint_typeL').html('');
  307. $('.complaint_typeR').html('');
  308. var con = data.data;
  309. var part_1_legend = [];
  310. var part_1_ser = [];
  311. $(con).each(function(i, n) {
  312. part_1_legend.push(n.AreaName)
  313. var part_1_obj = {};
  314. part_1_obj.value = n.Count;
  315. part_1_obj.name = n.AreaName;
  316. part_1_ser.push(part_1_obj)
  317. if(n.AreaName.indexOf('城乡一体') != -1) {
  318. n.AreaName = "城乡示范"
  319. }
  320. var str = '<li>' +
  321. '<span class="type_name">' + n.AreaName + '</span> <span class="type_count">' + n.Count + '</span>' +
  322. '</li>'
  323. if(i <= 5) {
  324. $(str).appendTo('.complaint_typeL');
  325. } else if(i <= 11 && i > 5) {
  326. $(str).appendTo('.complaint_typeR');
  327. }
  328. })
  329. part3.setOption({
  330. series: [{
  331. data: part_1_ser
  332. }]
  333. })
  334. }
  335. }
  336. });
  337. }
  338. //part4
  339. //var todyPhoneCouny = echarts.init(document.getElementById('todyPhoneCouny'));
  340. //todyPhoneCouny.setOption({
  341. // tooltip: {
  342. // trigger: 'axis',
  343. // axisPointer: {
  344. // type: false,
  345. // label: {
  346. // show: true,
  347. // backgroundColor: '#030917'
  348. // }
  349. // },
  350. // },
  351. // xAxis: {
  352. // name: '类型',
  353. // data: ["话务量(通)", "来电(通)", "接通量(通)", "平均通话时长(秒)"],
  354. // axisLine: {
  355. // lineStyle: {
  356. // color: '#3061a2'
  357. // }
  358. // },
  359. // axisTick: {
  360. // alignWithLabel: true,
  361. // show: false
  362. // },
  363. // axisLabel: { //横轴字体颜色
  364. // show: true,
  365. // textStyle: {
  366. // color: '#eff0f4'
  367. // }
  368. // }
  369. // },
  370. // yAxis: {
  371. // name: '数量',
  372. // splitLine: {
  373. // show: false
  374. // },
  375. // axisLine: {
  376. // lineStyle: {
  377. // color: '#3061a2'
  378. // }
  379. // },
  380. // axisLabel: { //横轴字体颜色
  381. // show: true,
  382. // textStyle: {
  383. // color: '#eff0f4'
  384. // }
  385. // }
  386. //
  387. // },
  388. // series: [{
  389. // name: '数量',
  390. // type: 'bar',
  391. // barWidth: 18,
  392. // itemStyle: {
  393. // normal: {
  394. // color: function(params) {
  395. // // build a color map as your need.
  396. // var colorList = [
  397. // '#368cab', '#54b793', '#4b6ab0', '#2531a9'
  398. // ];
  399. // return colorList[params.dataIndex]
  400. // }
  401. // }
  402. // },
  403. // label: {
  404. // normal: {
  405. // show: true,
  406. // position: 'top', //顶部数据显示位置
  407. // textStyle: {
  408. // color: '#fff' //顶部数据颜色
  409. // },
  410. // formatter: '{c}' // 这里是数据展示的时候显示的数据
  411. // }
  412. // },
  413. // data: []
  414. // }]
  415. //
  416. //});
  417. //function partFour() {
  418. // $.ajax({
  419. // type: "get",
  420. // url: huayi.config.callcenter_url + "info/GetTelCountByDate",
  421. // async: true,
  422. // dataType: "json",
  423. // data: {
  424. // date: "",
  425. // branchcode: ""
  426. // },
  427. // success: function(data) {
  428. // if(data.state.toLowerCase() == "success") {
  429. // // layer.close(index);
  430. // var con = data.data;
  431. // todyPhoneCouny.setOption({
  432. // series: [{
  433. // data: [9, 8, 7, 6]
  434. // }]
  435. //
  436. // })
  437. //
  438. // }
  439. // }
  440. //
  441. // });
  442. //
  443. //}
  444. //part4
  445. //var todyPhoneCount = echarts.init(document.getElementById('todyPhoneCount'));
  446. //todyPhoneCount.setOption({
  447. // tooltip: {
  448. // trigger: 'axis',
  449. // axisPointer: {
  450. // type: false,
  451. // label: {
  452. // show: true,
  453. // backgroundColor: '#030917'
  454. // }
  455. // },
  456. // },
  457. // xAxis: {
  458. // name: '类型',
  459. // data: ["话务量(通)", "来电(通)", "接通量(通)", "平均通话时长(秒)"],
  460. // axisLine: {
  461. // lineStyle: {
  462. // color: '#3061a2'
  463. // }
  464. // },
  465. // axisTick: {
  466. // alignWithLabel: true,
  467. // show: false
  468. // },
  469. // axisLabel: { //横轴字体颜色
  470. // show: true,
  471. // textStyle: {
  472. // color: '#eff0f4'
  473. // }
  474. // }
  475. // },
  476. // yAxis: {
  477. // name: '数量',
  478. // splitLine: {
  479. // show: false
  480. // },
  481. // axisLine: {
  482. // lineStyle: {
  483. // color: '#3061a2'
  484. // }
  485. // },
  486. // axisLabel: { //横轴字体颜色
  487. // show: true,
  488. // textStyle: {
  489. // color: '#eff0f4'
  490. // }
  491. // }
  492. //
  493. // },
  494. // series: [{
  495. // name: '数量',
  496. // type: 'bar',
  497. // barWidth: 18,
  498. // itemStyle: {
  499. // normal: {
  500. // color: function(params) {
  501. // // build a color map as your need.
  502. // var colorList = [
  503. // '#368cab', '#54b793', '#4b6ab0', '#2531a9'
  504. // ];
  505. // return colorList[params.dataIndex]
  506. // }
  507. // }
  508. // },
  509. // label: {
  510. // normal: {
  511. // show: true,
  512. // position: 'top', //顶部数据显示位置
  513. // textStyle: {
  514. // color: '#fff' //顶部数据颜色
  515. // },
  516. // formatter: '{c}' // 这里是数据展示的时候显示的数据
  517. // }
  518. // },
  519. // data: []
  520. // }]
  521. //
  522. //});
  523. //function partFive() {
  524. // $.ajax({
  525. // type: "get",
  526. // url: huayi.config.callcenter_url + "info/GetTelCountByDate",
  527. // async: true,
  528. // dataType: "json",
  529. // data: {
  530. // date: "",
  531. // branchcode: ""
  532. // },
  533. // success: function(data) {
  534. // if(data.state.toLowerCase() == "success") {
  535. // // layer.close(index);
  536. // var con = data.data;
  537. // todyPhoneCount.setOption({
  538. // series: [{
  539. // data: [99, 88, 77, 66]
  540. // }]
  541. //
  542. // })
  543. //
  544. // }
  545. // }
  546. //
  547. // });
  548. //
  549. //}
  550. function Ajax1() {
  551. partTwo();
  552. partOne();
  553. partThree();
  554. //partFour();
  555. //partFive();
  556. }