Brak opisu

laiyuanqudao.js 9.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431
  1. $(document).ready(function() {
  2. laydate.render({
  3. elem: '#time1',
  4. theme: '#00a1cb'
  5. });
  6. laydate.render({
  7. elem: '#time2',
  8. theme: '#00a1cb'
  9. });
  10. laydate.render({
  11. elem: '#time3',
  12. theme: '#00a1cb'
  13. });
  14. laydate.render({
  15. elem: '#time4',
  16. theme: '#00a1cb'
  17. });
  18. laydate.render({
  19. elem: '#time5',
  20. theme: '#00a1cb'
  21. });
  22. var container1 = echarts.init(document.getElementById('container1'));
  23. container1.setOption({
  24. tooltip: {
  25. trigger: 'axis',
  26. axisPointer: {
  27. type: 'cross',
  28. label: {
  29. show: true,
  30. backgroundColor: '#030917'
  31. }
  32. }
  33. },
  34. legend: {
  35. // x : '20%',
  36. // y : '25%',
  37. // width:"90%",
  38. // bottom:0,
  39. // data: [],
  40. // textStyle: {
  41. // color: '#ccc'
  42. // },
  43. show: false
  44. },
  45. xAxis: {
  46. name: '时间',
  47. data: [],
  48. axisLine: {
  49. lineStyle: {
  50. color: '#ccc'
  51. }
  52. }
  53. },
  54. yAxis: {
  55. name: '数量',
  56. // min: 0,
  57. // max: 100,
  58. // interval: 20,
  59. splitLine: {
  60. show: false
  61. },
  62. axisLine: {
  63. lineStyle: {
  64. color: '#fff'
  65. }
  66. }
  67. },
  68. series: [],
  69. color: ['#61a0a9', '#cb885d', '#c4352d', '#314452', '#a88c1e', '#2f5675', '#94c8b1', '#babc2f', '#e86617', '#afe817', '#e8178d']
  70. });
  71. function partOne() {
  72. var index = layer.load(1, {
  73. shade: [0.5, '#030303'] //0.1透明度的白色背景
  74. });
  75. $('.list_one').html('');
  76. $.ajax({
  77. type: "get",
  78. url: huayi.config.callcenter_url + "info/GetAreaCount24ByDate",
  79. async: true,
  80. dataType: "json",
  81. data: {
  82. date: $('#time1').val()
  83. },
  84. success: function(data) {
  85. if(data.state.toLowerCase() == "success") {
  86. layer.close(index);
  87. var con = data.data;
  88. var part1Axis = con.hours;
  89. var sers = []
  90. $(con.cols).each(function(i, n) {
  91. var html = "";
  92. var obj = {};
  93. obj.name = n;
  94. obj.type = "line";
  95. obj.smooth = true;
  96. obj.showAllSymbol = true;
  97. obj.symbol = "emptyCircle";
  98. obj.symbolSize = 10;
  99. obj.data = con.counts[i];
  100. sers.push(obj);
  101. // qunZhongArea.push(n.AreaName);
  102. // $('<tr>'+
  103. // '<td>'+ n.AreaName +'</td>'+
  104. // '<td><a>'+ n.Count +'</a></td>'+
  105. // '</tr>').appendTo('.table1 tbody');
  106. html = '<li>' +
  107. '<div class="tool_count">' +
  108. '<span class="iconfont icon-tubiao4 color' + i + ' tbr"></span>' + con.cols[i] + ':'+con.tcounts[i]+'<div class="tooltips clearfix">'+
  109. '<div class="toolsTitle">'+ con.cols[i] +':'+con.tcounts[i]+'</div>'
  110. $(con.items[i]).each(function(i, n) {
  111. html += '<p>' + n.TypeName + ':' + n.Count + '</p>'
  112. })
  113. html += '</div>' +
  114. '</div>' +
  115. '</li>';
  116. $('.list_one').append(html);
  117. })
  118. container1.setOption({
  119. xAxis: {
  120. data: part1Axis
  121. },
  122. // legend: {
  123. // data: qunZhongArea.cols
  124. // },
  125. series: sers
  126. });
  127. }
  128. }
  129. });
  130. }
  131. $('.list').on('click', 'li', function() {
  132. if($(this).find(".tooltips").css("display") == 'none') {
  133. $(this).find(".tooltips").show();
  134. $(this).siblings().find(".tooltips").hide();
  135. } else {
  136. $(this).find(".tooltips").hide()
  137. }
  138. })
  139. $('.part1Btn').click(function() {
  140. partOne();
  141. })
  142. //受理区域统计 part2
  143. var shouLiArea = echarts.init(document.getElementById('shouLiArea'));
  144. shouLiArea.setOption({
  145. // title: {
  146. // text: '投诉/举报汇总',
  147. // x: 'center',
  148. // textStyle: {
  149. // color: '#fff',
  150. // fontSize: 18
  151. // },
  152. // },
  153. tooltip: {
  154. trigger: 'item',
  155. formatter: "{a} <br/>{b} : {c} ({d}%)",
  156. axisPointer: {
  157. crossStyle: {
  158. color: '#fff'
  159. }
  160. }
  161. },
  162. legend: {
  163. orient: 'vertical',
  164. bottom: '20%',
  165. right:'right',
  166. data: [],
  167. textStyle: {
  168. color: '#fff'
  169. }
  170. },
  171. series: [{
  172. name: '数量统计',
  173. type: 'pie',
  174. radius: '55%',
  175. center: ['35%', '50%'],
  176. data: [],
  177. itemStyle: {
  178. emphasis: {
  179. shadowBlur: 10,
  180. shadowOffsetX: 0,
  181. shadowColor: 'rgba(0, 0, 0, 0.5)'
  182. },
  183. normal: {
  184. label: {
  185. show: true,
  186. formatter: '{b} : {c} ({d}%)'
  187. // formatter: '{c} ({d}%)'
  188. },
  189. labelLine: {
  190. show: true
  191. }
  192. }
  193. },
  194. label: {
  195. normal: {
  196. textStyle: {
  197. color: '#fff'
  198. }
  199. }
  200. }
  201. }]
  202. });
  203. function partTwo(){
  204. $('.list_two').html('');
  205. var index = layer.load(1, {
  206. shade: [0.5, '#030303'] //0.1透明度的白色背景
  207. });
  208. $.ajax({
  209. type:"get",
  210. url:huayi.config.callcenter_url + "info/GetAreaCountByDate",
  211. async:true,
  212. dataType:'json',
  213. data:{
  214. start:$('#time2').val(),
  215. end:$('#time3').val()
  216. },
  217. success:function(data){
  218. if(data.state.toLowerCase()=='success'){
  219. layer.close(index);
  220. var con=data.data;
  221. var hsouLiArea_lengend = [];
  222. var hsouLiArea_ser = [];
  223. $(con).each(function(i, n) {
  224. var html = "";
  225. var hsouLiArea_obj = {};
  226. if(n.AreaName.indexOf('商丘') != -1) {
  227. n.AreaName = "市直单位"
  228. }
  229. hsouLiArea_lengend.push(n.AreaName);
  230. hsouLiArea_obj.value = n.Count;
  231. hsouLiArea_obj.name = n.AreaName;
  232. hsouLiArea_ser.push(hsouLiArea_obj);
  233. html = '<li>' +
  234. '<div class="tool_count">' +
  235. '<span class="iconfont icon-tubiao3 color' + i + ' tbr"></span>' + n.AreaName + ':' + n.Count + '<div class="tooltips clearfix">'+
  236. '<div class="toolsTitle">' + n.AreaName + ':' + n.Count + '</div>'
  237. $(n.Item).each(function(j, m) {
  238. html += '<p>' + m.TypeName + ':' + m.Count + '</p>'
  239. })
  240. html += '</div>' +
  241. '</div>' +
  242. '</li>';
  243. $('.list_two').append(html);
  244. })
  245. shouLiArea.setOption({
  246. legend: {
  247. data: hsouLiArea_lengend,
  248. selected: {
  249. '当即办理': false
  250. }
  251. },
  252. series: [{
  253. data: hsouLiArea_ser
  254. }]
  255. });
  256. }
  257. }
  258. });
  259. }
  260. $('.part2Btn').click(function() {
  261. partTwo();
  262. })
  263. //受理渠道24小时统计 part3
  264. var qd_box = echarts.init(document.getElementById('qd_box'));
  265. qd_box.setOption({
  266. tooltip: {
  267. trigger: 'axis',
  268. axisPointer: {
  269. type: false,
  270. label: {
  271. show: true,
  272. backgroundColor: '#030917'
  273. }
  274. },
  275. // formatter: function(datas)
  276. // {
  277. // var res = datas[0].name + '<br/>', val;
  278. // for(var i = 0, length = datas.length; i < length; i++) {
  279. // val = (datas[i].value) + '%';
  280. // res += datas[i].seriesName + ':' + val + '<br/>';
  281. // }
  282. // return res;
  283. // }
  284. },
  285. legend: {
  286. top: 30,
  287. data: [],
  288. textStyle: {
  289. color: '#fff'
  290. }
  291. },
  292. xAxis: {
  293. // name: '时',
  294. data: [],
  295. axisLine: {
  296. lineStyle: {
  297. color: '#ccc'
  298. }
  299. },
  300. },
  301. yAxis: {
  302. name: '数量',
  303. splitLine: {
  304. show: false
  305. },
  306. axisLine: {
  307. lineStyle: {
  308. color: '#ccc'
  309. }
  310. }
  311. },
  312. series: [{
  313. name: '渠道占比',
  314. type: 'bar',
  315. barWidth: 18,
  316. itemStyle: {
  317. normal: {
  318. color: new echarts.graphic.LinearGradient(
  319. 0, 0, 0, 1, [{
  320. offset: 0,
  321. color: '#14c8d4'
  322. },
  323. {
  324. offset: 1,
  325. color: '#43eec6'
  326. }
  327. ]
  328. )
  329. }
  330. },
  331. label: {
  332. normal: {
  333. show: true,
  334. position: 'top', //顶部数据显示位置
  335. formatter: '{c}' // 这里是数据展示的时候显示的数据
  336. }
  337. },
  338. data: []
  339. }]
  340. });
  341. function part_three(){
  342. $('.list_three').html('');
  343. var index = layer.load(1, {
  344. shade: [0.5, '#030303'] //0.1透明度的白色背景
  345. });
  346. $.ajax({
  347. type:"get",
  348. url: huayi.config.callcenter_url + "info/GetSourcePercentByDate",
  349. dataType: 'json',
  350. async: true,
  351. data:{
  352. start:$('#time4').val(),
  353. end:$('#time5').val()
  354. },
  355. success:function(data){
  356. if(data.state.toLowerCase()=='success'){
  357. layer.close(index);
  358. var con=data.data;
  359. var qd_legend = [];
  360. var qd_sers = [];
  361. var ser_data = [];
  362. var qd_label = {
  363. normal: {
  364. show: true,
  365. position: 'inside',
  366. formatter: '{c}%'
  367. }
  368. };
  369. $(con).each(function(i, n) {
  370. var htmls="";
  371. ser_data.push(n.Count)
  372. qd_legend.push(n.Source);
  373. htmls = '<li>' +
  374. '<div class="tool_count">' +
  375. '<span class="iconfont icon-tubiaozhuzhuangtu color11 tbr"></span>' + n.Source + ':' + n.Count + '<div class="tooltips clearfix">'
  376. $(n.Item).each(function(j, m) {
  377. htmls += '<p>' + m.TypeName + ':' + m.Count + '</p>'
  378. })
  379. htmls += '</div>' +
  380. '</div>' +
  381. '</li>';
  382. $('.list_three').append(htmls);
  383. })
  384. qd_box.setOption({
  385. legend: {
  386. data: qd_legend
  387. },
  388. xAxis: {
  389. data: qd_legend
  390. },
  391. series: {
  392. data: ser_data
  393. }
  394. });
  395. }
  396. }
  397. });
  398. }
  399. $('.part3Btn').click(function() {
  400. part_three();
  401. })
  402. Ajax();
  403. function Ajax() {
  404. partOne();
  405. partTwo();
  406. part_three();
  407. }
  408. setInterval(Ajax, huayi.config.indextime);//Ajax调用函数
  409. //
  410. })