永城市12345 (县级市)- 来源于虞城县12345 - 所有县级统一API

sourceChannel.js 8.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380
  1. $(function() {
  2. laydate.render({
  3. elem: '#time2',
  4. eventElem:'.data-input-icon1',
  5. trigger:'click',
  6. range: '~',
  7. format: 'yyyy-MM-dd',
  8. theme: '#114a97',
  9. done: function(value, date) {
  10. partOne(value && value.split(' ~ ')[0], value && value.split(' ~ ')[1]);
  11. partTwo(value && value.split(' ~ ')[0], value && value.split(' ~ ')[1]);
  12. partThree(value && value.split(' ~ ')[0], value && value.split(' ~ ')[1]);
  13. }
  14. });
  15. Ajax();
  16. })
  17. //part 1 //受理群众区域统计 对接完毕
  18. var part_1 = echarts.init(document.getElementById('part_1'));
  19. part_1.setOption({
  20. color: ['#69e1a9', '#6a91e0', '#ceba5f', '#f06e84', '#569d4e', '#7d55ba', '#ce5aba', '#345cdd', '#569d4e'],
  21. tooltip: {
  22. trigger: 'axis',
  23. axisPointer: {
  24. type: 'cross',
  25. label: {
  26. show: true,
  27. backgroundColor: '#333'
  28. }
  29. }
  30. },
  31. grid: {
  32. left: '2%',
  33. right: '5%',
  34. bottom: '6%',
  35. containLabel: true
  36. },
  37. legend: {
  38. top: 'top',
  39. left: '180px',
  40. data: [],
  41. textStyle: {
  42. color: '#00e9ff'
  43. }
  44. },
  45. xAxis: {
  46. name: '时',
  47. data: [],
  48. axisLine: {
  49. lineStyle: {
  50. color: '#3061a2'
  51. }
  52. },
  53. axisTick: {
  54. alignWithLabel: true,
  55. show: false
  56. },
  57. axisLabel: { //横轴字体颜色
  58. show: true,
  59. textStyle: {
  60. color: '#eff0f4'
  61. }
  62. }
  63. },
  64. yAxis: {
  65. name: '(数量)',
  66. splitLine: {
  67. show: false
  68. },
  69. axisLine: {
  70. lineStyle: {
  71. color: '#3061a2'
  72. }
  73. },
  74. axisLabel: { //横轴字体颜色
  75. show: true,
  76. textStyle: {
  77. color: '#eff0f4'
  78. }
  79. }
  80. },
  81. series: []
  82. });
  83. function partOne(start,end) {
  84. $.ajax({
  85. type: "get",
  86. url: huayi.config.callcenter_url + "info/GetCountByDate",
  87. async: true,
  88. dataType: "json",
  89. data: {
  90. start:start,
  91. end:end
  92. },
  93. success: function(data) {
  94. if(data.state.toLowerCase() == "success") {
  95. // layer.close(index);
  96. var con = data.data;
  97. var part1Axis = con.hours;
  98. var sers = []
  99. $(con.cols).each(function(i, n) {
  100. var obj = {};
  101. obj.name = n;
  102. obj.type = "line";
  103. obj.smooth = true;
  104. obj.showAllSymbol = true;
  105. obj.symbol = "emptyCircle";
  106. obj.symbolSize = 10;
  107. obj.data = con.counts[i];
  108. sers.push(obj);
  109. })
  110. part_1.setOption({
  111. xAxis: {
  112. data: part1Axis
  113. },
  114. legend: {
  115. data: con.cols
  116. },
  117. series: sers
  118. });
  119. }
  120. }
  121. });
  122. }
  123. //part2 //渠道来源
  124. var source = echarts.init(document.getElementById('source'));
  125. source.setOption({
  126. tooltip: {
  127. trigger: 'axis',
  128. axisPointer: {
  129. type: false,
  130. label: {
  131. show: true,
  132. backgroundColor: '#030917'
  133. }
  134. },
  135. },
  136. // legend: {
  137. // top: 'top',
  138. // left: '180px',
  139. // data: [],
  140. // textStyle: {
  141. // color: '#00e9ff'
  142. // }
  143. // },
  144. xAxis: {
  145. // name: '时',
  146. data: [],
  147. axisLine: {
  148. lineStyle: {
  149. color: '#3061a2'
  150. }
  151. },
  152. axisTick: {
  153. alignWithLabel: true,
  154. show: false
  155. },
  156. axisLabel: { //横轴字体颜色
  157. show: true,
  158. textStyle: {
  159. color: '#eff0f4'
  160. }
  161. }
  162. },
  163. yAxis: {
  164. name: '数量',
  165. splitLine: {
  166. show: false
  167. },
  168. axisLine: {
  169. lineStyle: {
  170. color: '#3061a2'
  171. }
  172. },
  173. axisLabel: { //横轴字体颜色
  174. show: true,
  175. textStyle: {
  176. color: '#eff0f4'
  177. }
  178. }
  179. },
  180. series: [{
  181. name: '数量',
  182. type: 'bar',
  183. barWidth: 18,
  184. itemStyle: {
  185. normal: {
  186. color: function(params) {
  187. // build a color map as your need.
  188. var colorList = ['#368cab','#54b793','#4b6ab0','#2531a9'];
  189. return colorList[params.dataIndex]
  190. }
  191. }
  192. },
  193. label: {
  194. normal: {
  195. show: true,
  196. position: 'top',//顶部数据显示位置
  197. textStyle: {
  198. color: '#fff' //顶部数据颜色
  199. },
  200. formatter: '{c}' // 这里是数据展示的时候显示的数据
  201. }
  202. },
  203. data: []
  204. }]
  205. });
  206. function partTwo(start,end) {
  207. $.ajax({
  208. type:"get",
  209. url: huayi.config.callcenter_url + "info/GetSourcePercentByDate",
  210. dataType: 'json',
  211. async: true,
  212. data:{
  213. start:start,
  214. end:end
  215. },
  216. success: function(data) {
  217. if(data.state.toLowerCase() == "success") {
  218. // layer.close(index);
  219. var con=data.data;
  220. var qd_legend = [];
  221. var ser_data = [];
  222. $(con).each(function(i, n) {
  223. ser_data.push(n.Count)
  224. qd_legend.push(n.Source);
  225. })
  226. source.setOption({
  227. // legend: {
  228. // data: qd_legend
  229. // },
  230. xAxis: {
  231. data: qd_legend
  232. },
  233. series: {
  234. data: ser_data
  235. }
  236. })
  237. }
  238. }
  239. });
  240. }
  241. // part3 受理区域统计
  242. var part3 = echarts.init(document.getElementById('part3'));
  243. part3.setOption({
  244. color: ['#6ce7ac', '#6a91e0', '#ceba5f', '#cb5f79', '#ae765a', '#569d4e','#7d55ba','#ce5aba','#355cdd','#44c1c6','#ceba5e','#c64444'],
  245. title: {
  246. text: '各乡镇街道占比',
  247. x: 'center',
  248. y: '45%',
  249. textStyle: {
  250. fontWeight: 'normal',
  251. fontSize: 14,
  252. color:'#fff'
  253. }
  254. },
  255. tooltip: {
  256. trigger: 'item',
  257. formatter: "{a} <br/>{b} : {c} ({d}%)",
  258. axisPointer: {
  259. crossStyle: {
  260. color: '#fff'
  261. }
  262. }
  263. },
  264. // legend: {
  265. // // orient: 'vertical',
  266. // bottom: 'bottom',
  267. // data: [],
  268. // textStyle: {
  269. // color: '#fff'
  270. // }
  271. // },
  272. series: [{
  273. name: '数据',
  274. type: 'pie',
  275. radius: ['30%', '60%'],
  276. center: ['50%', '50%'],
  277. data: [],
  278. itemStyle: {
  279. emphasis: {
  280. shadowBlur: 10,
  281. shadowOffsetX: 0,
  282. shadowColor: 'rgba(0, 0, 0, 0.5)'
  283. },
  284. normal: {
  285. label: {
  286. show: true,
  287. // formatter: '{b} : {c} ({d}%)'
  288. formatter: '{d}%'
  289. },
  290. labelLine: {
  291. show: true
  292. }
  293. }
  294. },
  295. label: {
  296. normal: {
  297. textStyle: {
  298. color: '#fff'
  299. }
  300. }
  301. }
  302. }]
  303. });
  304. function partThree(start, end) {
  305. // var index = layer.load(1, {
  306. // shade: [0.5, '#030303'] //0.1透明度的白色背景
  307. // });
  308. $.ajax({
  309. type: "get",
  310. url: huayi.config.callcenter_url + "info/GetAreaCountByDate",
  311. async: true,
  312. dataType: 'json',
  313. data: {
  314. start: start,
  315. end: end
  316. },
  317. success: function(data) {
  318. if(data.state.toLowerCase() == 'success') {
  319. // layer.close(index);
  320. $('.complaint_typeL').html('');
  321. $('.complaint_typeR').html('');
  322. var con = data.data;
  323. var part_1_legend = [];
  324. var part_1_ser = [];
  325. $(con).each(function(i, n) {
  326. if( n.AreaName.indexOf('当即办理') ==-1){
  327. part_1_legend.push(n.AreaName)
  328. var part_1_obj = {};
  329. part_1_obj.value = n.Count;
  330. part_1_obj.name = n.AreaName;
  331. part_1_ser.push(part_1_obj)
  332. if(n.AreaName.indexOf('城乡一体') != -1){
  333. n.AreaName="城乡示范"
  334. }
  335. var str='<li>' +
  336. '<span class="type_name">' + n.AreaName + '</span> <span class="type_count">' + n.Count + '</span>' +
  337. '</li>'
  338. if(i<=14){
  339. $(str).appendTo('.complaint_typeL');
  340. }else if(i<=29){
  341. $(str).appendTo('.complaint_typeR');
  342. }
  343. }
  344. })
  345. part3.setOption({
  346. // legend: {
  347. // selected: {
  348. // '当即办理': false
  349. // }
  350. // },
  351. series: [{
  352. data: part_1_ser
  353. }]
  354. })
  355. }
  356. }
  357. });
  358. }
  359. function Ajax(){
  360. partOne($('#time2').val()&& $('#time2').val().split(' ~ ')[0]),
  361. partTwo($('#time2').val()&& $('#time2').val().split(' ~ ')[0],$('#time2').val() && $('#time2').val().split(' ~ ')[1]);
  362. partThree($('#time2').val() && $('#time2').val().split(' ~ ')[0], $('#time2').val() && $('#time2').val().split(' ~ ')[1])
  363. }