Sin descripción

riLiuLiang.html 8.2KB

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