Няма описание

ShuJuDuiBi.html 8.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298
  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. var token = $.cookie("token");
  123. var beginyear,//开始年份
  124. endyear,//结束年份
  125. hjCompaer,//图形
  126. legendCon;//图形legend
  127. $(document).ready(function(){
  128. hjCompaer = echarts.init(document.getElementById('hjCompaer'));
  129. option = {
  130. tooltip: {
  131. trigger: 'axis',
  132. },
  133. legend: {
  134. data: legendCon,
  135. bottom: 0
  136. },
  137. xAxis: [{
  138. type: 'category',
  139. data: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'],
  140. axisPointer: {
  141. type: ''
  142. }
  143. }],
  144. yAxis: [{
  145. type: 'value',
  146. name: '电话数量',
  147. nameLocation:'middle',
  148. nameGap:40,
  149. // min: 0,
  150. // max: 10000,
  151. // interval: 1000,
  152. axisLabel: {
  153. formatter: '{value} '
  154. }
  155. },
  156. {
  157. type: 'value',
  158. name: '百分比',
  159. nameLocation:'middle',
  160. nameGap:35,
  161. // min: 0,
  162. // max: 100,
  163. // interval: 10,
  164. axisLabel: {
  165. formatter: '{value} '
  166. }
  167. }
  168. ],
  169. series: [{
  170. name:'',
  171. type: 'bar',
  172. yAxisIndex: 0,
  173. data: []
  174. },
  175. {
  176. name: '',
  177. type: 'bar',
  178. yAxisIndex: 0,
  179. data: []
  180. },
  181. {
  182. name: '',
  183. type: 'line',
  184. yAxisIndex: 1,
  185. data: []
  186. },
  187. {
  188. name: '',
  189. type: 'bar',
  190. yAxisIndex: 0,
  191. data: []
  192. },
  193. {
  194. name: '',
  195. type: 'bar',
  196. yAxisIndex: 0,
  197. data: []
  198. },
  199. {
  200. name: '',
  201. type: 'line',
  202. yAxisIndex: 1,
  203. data: []
  204. }
  205. ],
  206. color: ['#1ab394', '#adcbfd', '#fbbe5b', '#f26ea2', '#88ebc4', '#fa957f']
  207. };
  208. hjCompaer.setOption(option);
  209. });
  210. //搜索事件
  211. $(".sear").click(function(){
  212. beginyear=$('#first').val();
  213. endyear=$('#last').val();
  214. // console.log(beginyear);
  215. // console.log(endyear);
  216. if(beginyear==''||endyear==''){
  217. layer.confirm('请选择对比时间!', {
  218. btn: ['确定']
  219. });
  220. return;
  221. }else if(beginyear==endyear){
  222. layer.confirm('请选择不同的对比年份!', {
  223. btn: ['确定']
  224. });
  225. return;
  226. }else{
  227. Ajax(beginyear,endyear);
  228. hjCompaer.setOption(option);
  229. }
  230. });
  231. function Ajax(beginyear,endyear){
  232. var arr=[];
  233. var allData=[];
  234. $.ajax({
  235. type:'get',
  236. url:huayi.config.callcenter_url+'YearContrast/GetDataList',
  237. dataType:'json',
  238. data:{
  239. token:token,
  240. beginyear:beginyear,
  241. endyear:endyear
  242. },
  243. async:false,
  244. success:function(res){
  245. var content=res.data;
  246. $.each(content, function(index,ele) {
  247. arr.push(content[index].key)
  248. allData.push(content[index].value)
  249. //console.log(allData);
  250. });
  251. }
  252. });
  253. legendCon=arr;
  254. seriesData=allData;
  255. //console.log(legendCon);
  256. option.legend.data=legendCon;//图例
  257. option.series[0].name=legendCon[0];//图例
  258. //添加数据name
  259. for(var i=0;i<legendCon.length;i++){
  260. option.series[i].name=legendCon[i];
  261. }
  262. //添加图形数据
  263. for(var j=0;j<seriesData.length;j++){
  264. option.series[j].data=seriesData[j];
  265. }
  266. }
  267. //导出功能
  268. $('.export').click(function() {
  269. dcexcel(this);
  270. })
  271. function dcexcel(obj) {
  272. var url = huayi.config.callcenter_url + "YearContrast/ExptList?token=" + $.cookie("token");
  273. url += "&beginyear=" + $("#first").val() + "&endyear=" + $("#last").val();
  274. obj.href = url;
  275. }
  276. });
  277. </script>
  278. </body>
  279. </html>