Bez popisu

riLiuLiang.html 7.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316
  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. var myDate=new Date();
  157. function turn(aa){
  158. if(aa<10){
  159. aa = "0" + aa;
  160. }
  161. return aa
  162. }
  163. $('#chooseTime1').val(myDate.getFullYear()+"-"+turn(myDate.getMonth()+1)+"-"+turn(myDate.getDate()))
  164. $('#chooseTime2').val(myDate.getFullYear()+"-"+turn(myDate.getMonth()+1)+"-"+turn(myDate.getDate()))
  165. //图形
  166. myChart = echarts.init(document.getElementById('huData'));
  167. myChart.setOption({
  168. color: ['#00a1cb'],
  169. tooltip: {
  170. trigger: 'axis',
  171. axisPointer: { // 坐标轴指示器,坐标轴触发有效
  172. type: 'line' // 默认为直线,可选为:'line' | 'shadow'
  173. }
  174. },
  175. toolbox: {
  176. show: true,
  177. },
  178. calculable: true,
  179. xAxis: [{
  180. type: 'category',
  181. name: '时',
  182. splitLine: {
  183. show: false
  184. }, //去除网格线
  185. data: [],
  186. axisTick: {
  187. alignWithLabel: true
  188. }
  189. }],
  190. yAxis: [{
  191. type: 'value',
  192. name: '数量',
  193. nameLocation: 'end',
  194. splitLine: {
  195. show: false
  196. } //去除网格线
  197. }],
  198. series: [{
  199. name: '流量',
  200. type: 'bar',
  201. barWidth: 20, //图形宽度
  202. data:[],
  203. itemStyle: {
  204. normal: {
  205. label: {
  206. show: true,
  207. textStyle: {
  208. color: '#FF9800' //顶部数据颜色
  209. }
  210. }
  211. }
  212. },
  213. label: {
  214. normal: {
  215. show: true,
  216. position: 'top' //顶部数据显示位置
  217. }
  218. }
  219. }
  220. ]
  221. })
  222. Ajax();
  223. function Ajax(){
  224. $.ajax({
  225. type:"get",
  226. url: huayi.config.callcenter_url + "FlowAnalysis/GetDayCount",
  227. async:true,
  228. dataType:'json',
  229. data:{
  230. token:token,
  231. sdate:$('#chooseTime1').val(),
  232. edate:$('#chooseTime2').val()
  233. },
  234. success:function(data){
  235. if(data.state.toLowerCase()=="success"){
  236. myChart.setOption({
  237. xAxis:[{
  238. data: data.data.hours
  239. }],
  240. series:[{
  241. data:data.data.counts
  242. }]
  243. });
  244. }
  245. }
  246. });
  247. $.ajax({
  248. type:"get",
  249. url: huayi.config.callcenter_url + "FlowAnalysis/GetDayCountTable",
  250. async:true,
  251. dataType:'json',
  252. data:{
  253. token:token,
  254. sdate:$('#chooseTime1').val(),
  255. edate:$('#chooseTime2').val()
  256. },
  257. success:function(data){
  258. if(data.state.toLowerCase()=="success"){
  259. $('.thTable tbody').html('');
  260. $(data.data).each(function(j,m){
  261. $('<tr>'+
  262. '<td>' +m.时刻+ '</td>'+
  263. '<td>' + m.数量 + '</td>'+
  264. '</tr>').appendTo('.thTable tbody')
  265. })
  266. }
  267. }
  268. });
  269. }
  270. //搜索事件
  271. $('.sear').click(function(){
  272. Ajax();
  273. })
  274. //导出功能
  275. $('.export').click(function() {
  276. dcexcel(this);
  277. })
  278. function dcexcel(obj) {
  279. var url = huayi.config.callcenter_url + "FlowAnalysis/ExptDayList?token=" + $.cookie("token");
  280. url += "&sdate=" + $("#chooseTime1").val() + "&edate=" + $("#chooseTime2").val();
  281. obj.href = url;
  282. }
  283. })
  284. </script>
  285. </body>
  286. </html>