12345市长热线标准版-前端

ShuJuDuiBi.html 8.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6. <script src="../Script/Common/huayi.load.js"></script>
  7. <script src="../Script/Common/huayi.config.js"></script>
  8. <title>呼叫数据对比</title>
  9. <!--[if lt IE 9]>
  10. <meta http-equiv="refresh" content="0;ie.html" />
  11. <![endif]-->
  12. <link href="../css/bootstrap.min14ed.css?v=3.3.6" rel="stylesheet">
  13. <link href="../css/font-awesome.min93e3.css?v=4.4.0" rel="stylesheet">
  14. <link href="../css/animate.min.css" rel="stylesheet">
  15. <link href="../css/style.min862f.css?v=4.1.0" rel="stylesheet">
  16. <link rel="stylesheet" href="../css/laydate/need/laydate.css" />
  17. <link rel="stylesheet" href="../css/init.css" />
  18. <style type="text/css">
  19. .shuju-top{
  20. font-size: 12px;
  21. }
  22. .shuju-top {
  23. background: #f3f3f4;
  24. height: 60px;
  25. padding: 10px 20px;
  26. }
  27. .shuju-top .topCon select {
  28. padding: 2px;
  29. height: 28px;
  30. border: 1px solid #ebebeb;
  31. color: #1ab394;
  32. outline: none;
  33. vertical-align: middle;
  34. }
  35. .topCon {
  36. float: right;
  37. margin-right: 20px;
  38. }
  39. .shuju-con {
  40. width: 90%;
  41. height: 600px;
  42. margin: 20px auto;
  43. }
  44. </style>
  45. </head>
  46. <body class="gray-bg wrapper wrapper-content animated fadeInRight" style="background: #fefefe;">
  47. <div class="daoHang clearfix">
  48. <div class="dhLeft">
  49. <sapn><i class="syIcon"></i>位置:<a id="ReIndex" href="javaScript:;">首页</a>&gt;<a href="javaScript:;">报表管理</a>&gt;<a href="" class="nowPosition">总呼数据图形分析</a></sapn>
  50. </div>
  51. <div class="dhRight"><a href="" title="刷新"><i class="fa fa-refresh"></i></a></div>
  52. </div>
  53. <div class="toolBar clearfix">
  54. <div class="toolRight">
  55. 选择年份:
  56. <select name="" id="first" class="select_">
  57. <option value="0">请选择</option>
  58. <option value="2009">2009</option>
  59. <option value="2010">2010</option>
  60. <option value="2011">2011</option>
  61. <option value="2012">2012</option>
  62. <option value="2013">2013</option>
  63. <option value="2014">2014</option>
  64. <option value="2015">2015</option>
  65. <option value="2016" selected="selected">2016</option>
  66. <option value="2017">2017</option>
  67. <option value="2018">2018</option>
  68. <option value="2019">2019</option>
  69. <option value="2020">2020</option>
  70. <option value="2021">2021</option>
  71. <option value="2022">2022</option>
  72. <option value="2023">2023</option>
  73. <option value="2024">2024</option>
  74. <option value="2025">2025</option>
  75. <option value="2026">2026</option>
  76. <option value="2027">2027</option>
  77. <option value="2028">2028</option>
  78. <option value="2029">2029</option>
  79. <option value="2030">2030</option>
  80. </select>
  81. 对比:
  82. <select name="" id="last" class="select_">
  83. <option value="0">请选择</option>
  84. <option value="2009">2009</option>
  85. <option value="2010">2010</option>
  86. <option value="2011">2011</option>
  87. <option value="2012">2012</option>
  88. <option value="2013">2013</option>
  89. <option value="2014">2014</option>
  90. <option value="2015">2015</option>
  91. <option value="2016">2016</option>
  92. <option value="2017" selected="selected">2017</option>
  93. <option value="2018">2018</option>
  94. <option value="2019">2019</option>
  95. <option value="2020">2020</option>
  96. <option value="2021">2021</option>
  97. <option value="2022">2022</option>
  98. <option value="2023">2023</option>
  99. <option value="2024">2024</option>
  100. <option value="2025">2025</option>
  101. <option value="2026">2026</option>
  102. <option value="2027">2027</option>
  103. <option value="2028">2028</option>
  104. <option value="2029">2029</option>
  105. <option value="2030">2030</option>
  106. </select>
  107. <button class="btns sear">搜索</button>
  108. <a class="btns export">导出</a>
  109. </div>
  110. </div>
  111. <div class="shuju-con">
  112. <h2 style="text-align: center;font-size: 18px;">呼叫数据对比</h2>
  113. <div id="hjCompaer" style="height: 100%;width: 100%;"></div>
  114. </div>
  115. <script src="../js/jquery.min.js?v=2.1.4"></script>
  116. <script src="../js/bootstrap.min.js?v=3.3.6"></script>
  117. <script src="../js/jquery.cookie.js"></script>
  118. <script src="../css/laydate/laydate.js"></script>
  119. <script src="../js/echarts.common.min.js"></script>
  120. <script>
  121. $(function() {
  122. //返回首页
  123. $('#ReIndex').click(function(){
  124. top.home_index();
  125. })
  126. var token = $.cookie("token");
  127. var beginyear,//开始年份
  128. endyear,//结束年份
  129. hjCompaer,//图形
  130. legendCon;//图形legend
  131. $(document).ready(function(){
  132. hjCompaer = echarts.init(document.getElementById('hjCompaer'));
  133. option = {
  134. tooltip: {
  135. trigger: 'axis',
  136. },
  137. legend: {
  138. data: legendCon,
  139. bottom: 0
  140. },
  141. xAxis: [{
  142. type: 'category',
  143. data: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'],
  144. axisPointer: {
  145. type: ''
  146. }
  147. }],
  148. yAxis: [{
  149. type: 'value',
  150. name: '电话数量',
  151. nameLocation:'middle',
  152. nameGap:40,
  153. // min: 0,
  154. // max: 10000,
  155. // interval: 1000,
  156. axisLabel: {
  157. formatter: '{value} '
  158. }
  159. },
  160. {
  161. type: 'value',
  162. name: '百分比',
  163. nameLocation:'middle',
  164. nameGap:35,
  165. // min: 0,
  166. // max: 100,
  167. // interval: 10,
  168. axisLabel: {
  169. formatter: '{value} '
  170. }
  171. }
  172. ],
  173. series: [{
  174. name:'',
  175. type: 'bar',
  176. yAxisIndex: 0,
  177. data: []
  178. },
  179. {
  180. name: '',
  181. type: 'bar',
  182. yAxisIndex: 0,
  183. data: []
  184. },
  185. {
  186. name: '',
  187. type: 'line',
  188. yAxisIndex: 1,
  189. data: []
  190. },
  191. {
  192. name: '',
  193. type: 'bar',
  194. yAxisIndex: 0,
  195. data: []
  196. },
  197. {
  198. name: '',
  199. type: 'bar',
  200. yAxisIndex: 0,
  201. data: []
  202. },
  203. {
  204. name: '',
  205. type: 'line',
  206. yAxisIndex: 1,
  207. data: []
  208. }
  209. ],
  210. color: ['#1ab394', '#adcbfd', '#fbbe5b', '#f26ea2', '#88ebc4', '#fa957f']
  211. };
  212. hjCompaer.setOption(option);
  213. });
  214. //搜索事件
  215. $(".sear").click(function(){
  216. beginyear=$('#first').val();
  217. endyear=$('#last').val();
  218. // console.log(beginyear);
  219. // console.log(endyear);
  220. if(beginyear==''||endyear==''){
  221. layer.confirm('请选择对比时间!', {
  222. btn: ['确定']
  223. });
  224. return;
  225. }else if(beginyear==endyear){
  226. layer.confirm('请选择不同的对比年份!', {
  227. btn: ['确定']
  228. });
  229. return;
  230. }else{
  231. Ajax(beginyear,endyear);
  232. hjCompaer.setOption(option);
  233. }
  234. });
  235. function Ajax(beginyear,endyear){
  236. var arr=[];
  237. var allData=[];
  238. $.ajax({
  239. type:'get',
  240. url:huayi.config.callcenter_url+'YearContrast/GetDataList',
  241. dataType:'json',
  242. data:{
  243. token:token,
  244. beginyear:beginyear,
  245. endyear:endyear
  246. },
  247. async:false,
  248. success:function(res){
  249. var content=res.data;
  250. $.each(content, function(index,ele) {
  251. arr.push(content[index].key)
  252. allData.push(content[index].value)
  253. //console.log(allData);
  254. });
  255. }
  256. });
  257. legendCon=arr;
  258. seriesData=allData;
  259. //console.log(legendCon);
  260. option.legend.data=legendCon;//图例
  261. option.series[0].name=legendCon[0];//图例
  262. //添加数据name
  263. for(var i=0;i<legendCon.length;i++){
  264. option.series[i].name=legendCon[i];
  265. }
  266. //添加图形数据
  267. for(var j=0;j<seriesData.length;j++){
  268. option.series[j].data=seriesData[j];
  269. }
  270. }
  271. //导出功能
  272. $('.export').click(function() {
  273. dcexcel(this);
  274. })
  275. function dcexcel(obj) {
  276. var url = huayi.config.callcenter_url + "YearContrast/ExptList?token=" + $.cookie("token");
  277. url += "&beginyear=" + $("#first").val() + "&endyear=" + $("#last").val();
  278. obj.href = url;
  279. }
  280. });
  281. </script>
  282. </body>
  283. </html>