民权县12345_前端

riLiuLiang.html 7.6KB

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