12345市长热线标准版-前端

yueLiuLiang.html 5.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226
  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. <link href="../css/init.css" rel="stylesheet" />
  9. <script src="../js/laydate/laydate.js"></script>
  10. <link rel="stylesheet" href="../css/init.css" />
  11. <title>月流量统计</title>
  12. </head>
  13. <style>
  14. @font-face {
  15. font-family: 'iconfont';
  16. src: url('fonts/iconfont.eot');
  17. /* IE9*/
  18. src: url('fonts/iconfont.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
  19. url('fonts/iconfont.woff') format('woff'), /* chrome、firefox */
  20. url('fonts/iconfont.ttf') format('truetype'), /* chrome、firefox、opera、Safari, Android, iOS 4.2+*/
  21. url('fonts/iconfont.svg#iconfont') format('svg');
  22. /* iOS 4.1- */
  23. }
  24. .iconfont {
  25. font-family: "iconfont";
  26. font-style: normal;
  27. }
  28. ul,
  29. li,
  30. ol {
  31. list-style: none;
  32. }
  33. a {
  34. text-decoration: none
  35. }
  36. .clearfix:after {
  37. content: "";
  38. display: block;
  39. clear: both;
  40. }
  41. .hut-top{
  42. background: #f3f3f4;
  43. /*height: 60px;*/
  44. padding: 10px 20px;
  45. }
  46. .hut-tcon{
  47. float: right;
  48. }
  49. .dhLeft a{
  50. color: #999;
  51. }
  52. .time-box{
  53. display: inline-block;
  54. position: relative;
  55. }
  56. .toolRight input{
  57. padding-right: 30px;
  58. }
  59. .tub{
  60. position: absolute;
  61. right: 8px;
  62. top: 5px;
  63. font-size: 18px;
  64. color: #00a0ca;
  65. }
  66. </style>
  67. <body class="gray-bg" style="background: #fefefe;">
  68. <div class="hu-total wrapper wrapper-content animated fadeInRight">
  69. <div class="daoHang clearfix">
  70. <div class="dhLeft">
  71. <sapn><i class="syIcon"></i>位置:<a id="ReIndex" href="javaScript:;">首页</a>&gt;<a href="javaScript:;">报表管理</a>&gt;<a href="" class="nowPosition">月流量统计</a></sapn>
  72. </div>
  73. <div class="dhRight"><a href="" title="刷新"><i class="fa fa-refresh"></i></a></div>
  74. </div>
  75. <div class="toolBar clearfix">
  76. <div class="toolRight" style="float: right;">
  77. <span>开始日期:</span>
  78. <span class="time-box"><i class="tub fa fa-calendar"></i><input type="text" id="chooseTime" /></span>
  79. <span>结束日期:</span>
  80. <span class="time-box"><i class="tub fa fa-calendar"></i><input type="text" id="chooseTime2" /></span>
  81. <button class="btns sear">搜索</button>
  82. <!--<a class="btns export">导出</a>-->
  83. </div>
  84. </div>
  85. <div class="hu-content">
  86. <div class="hu-con-right">
  87. <div id="huData" style="width:100%; height: 500px;">
  88. </div>
  89. </div>
  90. </div>
  91. </div>
  92. <script src="../js/echarts.common.min.js"></script>
  93. <script>
  94. var myChart;
  95. var token = $.cookie("token");
  96. $(document).ready(function(){
  97. //返回首页
  98. $('#ReIndex').click(function(){
  99. top.home_index();
  100. })
  101. // laydate.skin('blue');
  102. laydate.render({
  103. elem: '#chooseTime'
  104. ,format: 'yyyy-MM',
  105. type: 'month',
  106. theme: '#00a1cb',
  107. value: new Date()
  108. });
  109. laydate.render({
  110. elem: '#chooseTime2'
  111. ,format: 'yyyy-MM',
  112. type: 'month',
  113. theme: '#00a1cb',
  114. value: new Date()
  115. });
  116. // laydate.render({
  117. // elem: '#chooseTime2'
  118. // ,type: 'month'
  119. // });
  120. //图形
  121. myChart = echarts.init(document.getElementById('huData'));
  122. myChart.setOption({
  123. color: ['#00a1cb'],
  124. tooltip: {
  125. trigger: 'axis',
  126. axisPointer: { // 坐标轴指示器,坐标轴触发有效
  127. type: 'line' // 默认为直线,可选为:'line' | 'shadow'
  128. }
  129. },
  130. toolbox: {
  131. show: true,
  132. },
  133. calculable: true,
  134. xAxis: [{
  135. type: 'category',
  136. name: '月份',
  137. splitLine: {
  138. show: false
  139. }, //去除网格线
  140. data: [],
  141. axisTick: {
  142. alignWithLabel: true
  143. }
  144. }],
  145. yAxis: [{
  146. type: 'value',
  147. name: '数量',
  148. nameLocation: 'end',
  149. splitLine: {
  150. show: false
  151. } //去除网格线
  152. }],
  153. series: [{
  154. name: '流量',
  155. type: 'bar',
  156. barWidth: 20, //图形宽度
  157. data:[],
  158. itemStyle: {
  159. normal: {
  160. label: {
  161. show: true,
  162. textStyle: {
  163. color: '#FF9800' //顶部数据颜色
  164. }
  165. }
  166. }
  167. },
  168. label: {
  169. normal: {
  170. show: true,
  171. position: 'top' //顶部数据显示位置
  172. }
  173. }
  174. }
  175. ]
  176. })
  177. Ajax();
  178. function Ajax(){
  179. $.ajax({
  180. type:"get",
  181. url: huayi.config.callcenter_url + "FlowAnalysis/GetMonthCount",
  182. async:true,
  183. dataType:'json',
  184. data:{
  185. token:token,
  186. sdate:$('#chooseTime').val(),
  187. edate:$('#chooseTime2').val()
  188. },
  189. success:function(data){
  190. if(data.state.toLowerCase()=="success"){
  191. myChart.setOption({
  192. xAxis:[{
  193. data: data.data.months
  194. }],
  195. series:[{
  196. data:data.data.counts
  197. }]
  198. });
  199. }
  200. }
  201. });
  202. }
  203. //搜索事件
  204. $('.sear').click(function(){
  205. Ajax();
  206. })
  207. })
  208. </script>
  209. </body>
  210. </html>