12345市长热线标准版-前端

yueLiuLiang.html 7.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310
  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. .th-table{
  67. display: none;
  68. }
  69. .tab-content{
  70. width: 90%;
  71. margin: 0 auto;
  72. }
  73. #thead thead th{
  74. background: #00a0cd;
  75. color: #fff;
  76. }
  77. table thead, tbody tr {
  78. display:table;
  79. width:100%;
  80. table-layout:fixed;
  81. }
  82. .table{
  83. margin-bottom: 0;
  84. }
  85. </style>
  86. <body class="gray-bg" style="background: #fefefe;">
  87. <div class="hu-total wrapper wrapper-content animated fadeInRight">
  88. <div class="daoHang clearfix">
  89. <div class="dhLeft">
  90. <sapn><i class="syIcon"></i>位置:<a id="ReIndex" href="javaScript:;">首页</a>&gt;<a href="javaScript:;">报表管理</a>&gt;<a href="" class="nowPosition">月流量统计</a></sapn>
  91. </div>
  92. <div class="dhRight"><a href="" title="刷新"><i class="fa fa-refresh"></i></a></div>
  93. </div>
  94. <div class="toolBar clearfix">
  95. <div class="toolRight" style="float: right;">
  96. <span>开始日期:</span>
  97. <span class="time-box"><i class="tub fa fa-calendar"></i><input type="text" id="chooseTime" /></span>
  98. <span>结束日期:</span>
  99. <span class="time-box"><i class="tub fa fa-calendar"></i><input type="text" id="chooseTime2" /></span>
  100. <button class="btns sear">搜索</button>
  101. <!--<a class="btns export">导出</a>-->
  102. </div>
  103. </div>
  104. <div class="hu-content">
  105. <ul class="nav nav-tabs th-tab">
  106. <li role="presentation" class="active"><a href="javascript:;">图表</a></li>
  107. <li role="presentation"><a href="javascript:;">表格</a></li>
  108. </ul>
  109. <div class="tab-content">
  110. <div class="hu-con-right">
  111. <div id="huData" style="width:100%; height: 500px;">
  112. </div>
  113. </div>
  114. <div class="th-table">
  115. <div style="width: 100%;padding: 10px;">
  116. <div class="table-head">
  117. <table id="thead" class="table table-hover table-striped table-bordered table-condensed">
  118. <colgroup>
  119. <col style="width: 80px;"/>
  120. <col/>
  121. </colgroup>
  122. <thead>
  123. <tr>
  124. <th>月份</th>
  125. <th>流量数</th>
  126. </tr>
  127. </thead>
  128. </table>
  129. </div>
  130. <div class="table-body">
  131. <table class="thTable table table-hover table-striped table-bordered table-condensed">
  132. <colgroup>
  133. <col style="width: 80px;"/>
  134. <col/>
  135. </colgroup>
  136. <tbody>
  137. </tbody>
  138. </table>
  139. </div>
  140. </div>
  141. </div>
  142. </div>
  143. </div>
  144. </div>
  145. <script src="../js/echarts.common.min.js"></script>
  146. <script>
  147. var myChart;
  148. var token = $.cookie("token");
  149. $(document).ready(function(){
  150. $('.th-tab li').click(function(){
  151. $(this).addClass('active')
  152. .siblings().removeClass('active');
  153. var index=$(this).index();
  154. $('.tab-content >div').eq(index).show()
  155. .siblings().hide();
  156. })
  157. //返回首页
  158. $('#ReIndex').click(function(){
  159. top.home_index();
  160. })
  161. // laydate.skin('blue');
  162. laydate.render({
  163. elem: '#chooseTime'
  164. ,format: 'yyyy-MM',
  165. type: 'month',
  166. theme: '#00a1cb',
  167. value: new Date()
  168. });
  169. laydate.render({
  170. elem: '#chooseTime2'
  171. ,format: 'yyyy-MM',
  172. type: 'month',
  173. theme: '#00a1cb',
  174. value: new Date()
  175. });
  176. // laydate.render({
  177. // elem: '#chooseTime2'
  178. // ,type: 'month'
  179. // });
  180. //图形
  181. myChart = echarts.init(document.getElementById('huData'));
  182. myChart.setOption({
  183. color: ['#00a1cb'],
  184. tooltip: {
  185. trigger: 'axis',
  186. axisPointer: { // 坐标轴指示器,坐标轴触发有效
  187. type: 'line' // 默认为直线,可选为:'line' | 'shadow'
  188. }
  189. },
  190. toolbox: {
  191. show: true,
  192. },
  193. calculable: true,
  194. xAxis: [{
  195. type: 'category',
  196. name: '月份',
  197. splitLine: {
  198. show: false
  199. }, //去除网格线
  200. data: [],
  201. axisTick: {
  202. alignWithLabel: true
  203. }
  204. }],
  205. yAxis: [{
  206. type: 'value',
  207. name: '数量',
  208. nameLocation: 'end',
  209. splitLine: {
  210. show: false
  211. } //去除网格线
  212. }],
  213. series: [{
  214. name: '流量',
  215. type: 'bar',
  216. barWidth: 20, //图形宽度
  217. data:[],
  218. itemStyle: {
  219. normal: {
  220. label: {
  221. show: true,
  222. textStyle: {
  223. color: '#FF9800' //顶部数据颜色
  224. }
  225. }
  226. }
  227. },
  228. label: {
  229. normal: {
  230. show: true,
  231. position: 'top' //顶部数据显示位置
  232. }
  233. }
  234. }
  235. ]
  236. })
  237. Ajax();
  238. function Ajax(){
  239. $('.thTable tbody').html('');
  240. $.ajax({
  241. type:"get",
  242. url: huayi.config.callcenter_url + "FlowAnalysis/GetMonthCount",
  243. async:true,
  244. dataType:'json',
  245. data:{
  246. token:token,
  247. sdate:$('#chooseTime').val(),
  248. edate:$('#chooseTime2').val()
  249. },
  250. success:function(data){
  251. if(data.state.toLowerCase()=="success"){
  252. $(data.data.months).each(function(i,n){
  253. $('<tr>'+
  254. '<td>' +n+ '</td>'+
  255. '<td>' + data.data.counts[i] + '</td>'+
  256. '</tr>').appendTo('.thTable tbody')
  257. })
  258. myChart.setOption({
  259. xAxis:[{
  260. data: data.data.months
  261. }],
  262. series:[{
  263. data:data.data.counts
  264. }]
  265. });
  266. }
  267. }
  268. });
  269. }
  270. //搜索事件
  271. $('.sear').click(function(){
  272. Ajax();
  273. })
  274. })
  275. </script>
  276. </body>
  277. </html>