Bez popisu

tousujubao.js 8.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416
  1. function showTools(a){
  2. if($(a).find(".tooltips").css("display") == 'none') {
  3. $(a).find(".tooltips").show();
  4. $(a).parents('tr').siblings().find(".tooltips").hide();
  5. }else{
  6. $(a).find(".tooltips").hide();
  7. }
  8. }
  9. $(document).ready(function(){
  10. laydate.render({
  11. elem: '#time1',
  12. theme: '#00a1cb'
  13. });
  14. laydate.render({
  15. elem: '#time2',
  16. theme: '#00a1cb'
  17. });
  18. laydate.render({
  19. elem: '#time3',
  20. theme: '#00a1cb'
  21. });
  22. laydate.render({
  23. elem: '#time4',
  24. theme: '#00a1cb'
  25. });
  26. laydate.render({
  27. elem: '#time5',
  28. theme: '#00a1cb'
  29. });
  30. laydate.render({
  31. elem: '#time6',
  32. theme: '#00a1cb'
  33. });
  34. //投诉举报汇总 part1
  35. var quantity = echarts.init(document.getElementById('quantity'));
  36. quantity.setOption({
  37. // title: {
  38. // text: '投诉/举报汇总',
  39. // x: 'center',
  40. // textStyle: {
  41. // color: '#fff',
  42. // fontSize: 18
  43. // },
  44. // },
  45. tooltip: {
  46. trigger: 'item',
  47. formatter: "{a} <br/>{b} : {c} ({d}%)",
  48. axisPointer: {
  49. crossStyle: {
  50. color: '#fff'
  51. }
  52. }
  53. },
  54. legend: {
  55. // orient: 'vertical',
  56. bottom: 'bottom',
  57. data: [],
  58. textStyle: {
  59. color: '#fff'
  60. }
  61. },
  62. series: [{
  63. name: '数据',
  64. type: 'pie',
  65. radius: '55%',
  66. center: ['50%', '50%'],
  67. data: [],
  68. itemStyle: {
  69. emphasis: {
  70. shadowBlur: 10,
  71. shadowOffsetX: 0,
  72. shadowColor: 'rgba(0, 0, 0, 0.5)'
  73. },
  74. normal:{
  75. label:{
  76. show: true,
  77. formatter: '{b} : {c} ({d}%)'
  78. },
  79. labelLine :{show:true}
  80. }
  81. },
  82. label: {
  83. normal: {
  84. textStyle: {
  85. color: '#fff'
  86. }
  87. }
  88. }
  89. }]
  90. });
  91. function partOne(){
  92. var index = layer.load(1, {
  93. shade: [0.5, '#030303'] //0.1透明度的白色背景
  94. });
  95. $.ajax({
  96. type:"get",
  97. url:huayi.config.callcenter_url + "info/GetTypeCountByDate",
  98. async:true,
  99. dataType:'json',
  100. data:{
  101. start:$('#time1').val(),
  102. end:$('#time2').val()
  103. },
  104. success:function(data){
  105. if(data.state.toLowerCase()=='success'){
  106. layer.close(index);
  107. var con=data.data;
  108. var part_1_legend =[];
  109. var part_1_ser = [];
  110. $(con).each(function(i, n) {
  111. part_1_legend.push(n.TypeName)
  112. var part_1_obj = {};
  113. part_1_obj.value = n.Count;
  114. part_1_obj.name = n.TypeName;
  115. part_1_ser.push(part_1_obj)
  116. })
  117. quantity.setOption({
  118. legend: {
  119. data: part_1_legend
  120. },
  121. series: [{
  122. data: part_1_ser
  123. }]
  124. })
  125. }
  126. }
  127. });
  128. }
  129. $('.part1Btn').click(function(){
  130. partOne()
  131. })
  132. //举报单位/个人统计 part2
  133. var tsdwgr = echarts.init(document.getElementById('tsdwgr'));
  134. tsdwgr.setOption({
  135. tooltip: {
  136. trigger: 'axis',
  137. axisPointer: {
  138. type: 'cross',
  139. label: {
  140. show: true,
  141. backgroundColor: '#333'
  142. }
  143. }
  144. },
  145. legend: {
  146. data: [],
  147. bottom:'bottom',
  148. textStyle: {
  149. color: '#ccc'
  150. }
  151. },
  152. xAxis: {
  153. name: '月份',
  154. data: [],
  155. axisLine: {
  156. lineStyle: {
  157. color: '#ccc'
  158. }
  159. }
  160. },
  161. yAxis: {
  162. name: '数量',
  163. splitLine: {
  164. show: false
  165. },
  166. axisLine: {
  167. lineStyle: {
  168. color: '#ccc'
  169. }
  170. }
  171. },
  172. series: []
  173. });
  174. function partTwo(){
  175. var index = layer.load(1, {
  176. shade: [0.5, '#030303'] //0.1透明度的白色背景
  177. });
  178. $.ajax({
  179. type:"get",
  180. url:huayi.config.callcenter_url + "info/GetTypeCountMonthByDate",
  181. async:true,
  182. dataType:'json',
  183. success:function(data){
  184. if(data.state.toLowerCase()=='success'){
  185. layer.close(index);
  186. var con=data.data;
  187. var counts = con.counts;
  188. var sers = [];
  189. $(counts).each(function(i, n) {
  190. var obj = {};
  191. obj.name = con.cols[i];
  192. obj.type = "line";
  193. obj.smooth = true;
  194. obj.showAllSymbol = true;
  195. obj.symbol = "emptyCircle";
  196. obj.symbolSize = 10;
  197. obj.data = n;
  198. sers.push(obj)
  199. });
  200. tsdwgr.setOption({
  201. xAxis: {
  202. data: con.months
  203. },
  204. legend: {
  205. data: con.cols
  206. },
  207. series: sers
  208. });
  209. }
  210. }
  211. });
  212. }
  213. //投诉关键字 part3
  214. function partThree(){
  215. $('.table1 tbody').html('');
  216. var index = layer.load(1, {
  217. shade: [0.5, '#030303'] //0.1透明度的白色背景
  218. });
  219. $.ajax({
  220. type:"get",
  221. url:huayi.config.callcenter_url + "info/GetKeyCountByDate",
  222. async:true,
  223. dataType:'json',
  224. data:{
  225. start:$('#time3').val(),
  226. end:$('#time4').val()
  227. },
  228. success:function(data){
  229. if(data.state.toLowerCase()=='success'){
  230. layer.close(index);
  231. var con=data.data;
  232. $(con).each(function(i,n){
  233. if(i<10){
  234. var html="";
  235. // $('<tr>'+
  236. // '<td>1</td>'+
  237. // '<td>' + n.AreaName + '</td>'+
  238. // '<td>' + n.Count + '</td>'+
  239. // '</tr>').appendTo('.table1 tbody');
  240. html = '<tr>'+
  241. '<td>'+ parseInt(i+1)+'</td>'+
  242. '<td>' +
  243. '<div class="tool_count" onClick="showTools(this)">' + n.TypeName + '<div class="tooltips clearfix">'+
  244. '<div class="toolsTitle">'+ n.TypeName +'</div>'
  245. $(n.Item).each(function(j, m) {
  246. html += '<p>' + m.TypeName + ':' + m.Count + '</p>'
  247. })
  248. html += '</div>' +
  249. '</div>' +
  250. '</td>' +
  251. '<td>' + n.Count + '</td>' +
  252. '</tr>';
  253. $('.table1 tbody').append(html);
  254. }
  255. })
  256. }
  257. }
  258. });
  259. }
  260. $('.part3Btn').click(function() {
  261. partThree();
  262. })
  263. //承办单位统计 part4
  264. var tsdw_dw = echarts.init(document.getElementById('tsdw_dw'));
  265. tsdw_dw.setOption({
  266. // title: {
  267. // text: '投诉单位统计',
  268. // x: 'center',
  269. // textStyle: {
  270. // color: '#fff',
  271. // fontSize: 18
  272. // }
  273. // },
  274. tooltip : {
  275. trigger: 'item',
  276. formatter: "{a} <br/>{b} : {c} ({d}%)"
  277. },
  278. legend: {
  279. show: false,
  280. // type:true,
  281. // orient: 'vertical',
  282. right:'15%',
  283. top:'10%',
  284. orient: 'vertical',
  285. data: [],
  286. textStyle: {
  287. color: '#ccc'
  288. }
  289. },
  290. series: [{
  291. name: '部门',
  292. type: 'pie',
  293. // left: 0,
  294. radius: ['40%', '70%'],
  295. center: ['50%', '50%'],
  296. avoidLabelOverlap: false,
  297. label: {
  298. normal: {
  299. show: false,
  300. position: 'center'
  301. },
  302. emphasis: {
  303. show: true,
  304. textStyle: {
  305. fontSize: '18',
  306. // fontWeight: 'bold'
  307. }
  308. }
  309. },
  310. labelLine: {
  311. normal: {
  312. show: false
  313. }
  314. },
  315. data: [],
  316. }]
  317. });
  318. //
  319. function partFour(){
  320. var index = layer.load(1, {
  321. shade: [0.5, '#030303'] //0.1透明度的白色背景
  322. });
  323. $('.part4_list').html('');
  324. $.ajax({
  325. type: "get",
  326. url: huayi.config.callcenter_url + "info/GetDeptCountByDate",
  327. async: true,
  328. dataType: 'json',
  329. data:{
  330. start:$('#time5').val(),
  331. end:$('#time6').val()
  332. },
  333. success: function(data) {
  334. if(data.state.toLowerCase()=='success'){
  335. layer.close(index);
  336. var con=data.data;
  337. var part_4_legend = [];
  338. var part_4_ser = [];
  339. $(con).each(function(i, n) {
  340. var html="";
  341. part_4_legend.push(n.AreaName);
  342. var part_4_obj = {};
  343. part_4_obj.value = n.Count;
  344. part_4_obj.name = n.AreaName;
  345. part_4_ser.push(part_4_obj);
  346. htmls = '<li>' +
  347. '<span class="iconfont icon-tubiao2 color'+ i+'"></span>'+
  348. '<div class="depName" title="'+ n.AreaName +'">'+ n.AreaName + '</div>'+
  349. '<div class="tool_count"><div class="tooltips clearfix">'+
  350. '<div class="toolsTitle">'+ n.AreaName +':'+ n.Count +'</div>'
  351. $(n.Item).each(function(j, m) {
  352. htmls += '<p>' + m.TypeName + ':' + m.Count + '</p>'
  353. })
  354. htmls += '</div>' +
  355. '</div>' +
  356. '</li>';
  357. $('.part4_list').append(htmls);
  358. })
  359. tsdw_dw.setOption({
  360. legend: {
  361. data: part_4_legend
  362. },
  363. series: [{
  364. data: part_4_ser
  365. }]
  366. })
  367. //
  368. }
  369. }
  370. })
  371. }
  372. $('.part4Btn').click(function(){
  373. partFour();
  374. })
  375. $('.part4_list').on('click', 'li', function() {
  376. if($(this).find(".tooltips").css("display") == 'none') {
  377. $(this).find(".tooltips").show();
  378. $(this).siblings().find(".tooltips").hide();
  379. } else {
  380. $(this).find(".tooltips").hide()
  381. }
  382. })
  383. Ajax();
  384. function Ajax(){
  385. partOne();
  386. partTwo();
  387. partThree()
  388. partFour();
  389. }
  390. setInterval(Ajax, huayi.config.indextime);//Ajax调用函数
  391. })