statis.html 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. <{include file="./admin/header.html"}>
  2. <{include file="./admin/left.html"}>
  3. <{include file="./admin/nav.html"}>
  4. <style>
  5. .input-group-addon {
  6. padding: 5px 7px;
  7. border-radius: 1px;
  8. }
  9. </style>
  10. <script src="<{$web_cfg.cdn}>/public/echarts/build/dist/echarts.js"></script>
  11. <div id="activity_container">
  12. <div class="activity_center">
  13. <{include file="./admin/activity/common_nav.html"}>
  14. <form class="form-inline" method="get" action="<{$web_cfg.domain}>/?c=Admin_Activity_Log&a=PageList&events_id=<{$events_Data.events.id}>">
  15. <input name="events_id" type="hidden" value="<{$events_Data.events.id}>">
  16. <input name="c" type="hidden" value="Admin_Activity_Log">
  17. <input name="a" type="hidden" value="PageList">
  18. <div class="form-group"><label>时间选择:</label></div>
  19. <div class="form-group"><label><a href="<{$web_cfg.domain}>/?c=Admin_Activity_Log&a=PageList&events_id=<{$events_Data.events.id}>&select=7" class="button button-tiny">最近7天</a></label></div>
  20. <div class="form-group"><label><a href="<{$web_cfg.domain}>/?c=Admin_Activity_Log&a=PageList&events_id=<{$events_Data.events.id}>&select=30" class="button button-tiny">最近30天</a></label></div>
  21. <div class="form-group"><label>
  22. <input name="b_time" type="text" class="form-control" placeholder="开始时间" value="<{$b_time|date_format:'%Y-%m-%d'}>">
  23. </label></div>
  24. <div class="form-group"><label>
  25. <input name="e_time" type="text" class="form-control" placeholder="结束时间" value="<{$e_time|date_format:'%Y-%m-%d'}>">
  26. </label></div>
  27. <div class="form-group"><label><input type="submit" class="button button-inverse button-tiny" value="查看"></label></div>
  28. </form>
  29. <div class="panel panel-default">
  30. <div class="panel-body">
  31. <div id="chart" style="height:400px"></div>
  32. </div>
  33. </div>
  34. <div class="panel panel-default">
  35. <div class="panel-body">
  36. <table class="table">
  37. <thead>
  38. <tr>
  39. <th>概况统计</th>
  40. <th>浏览量(pv)</th>
  41. <th>访问数量(uv)</th>
  42. </tr>
  43. </thead>
  44. <tbody>
  45. <{foreach from=$logData item=item}>
  46. <tr>
  47. <td><{$item.date|date_format:'%Y-%m-%d'}></td>
  48. <td><{$item.pv_num}></td>
  49. <td><{$item.uv_num}></td>
  50. </tr>
  51. <{/foreach}>
  52. </tbody>
  53. </table>
  54. </div>
  55. </div>
  56. </div>
  57. <{include file="./admin/activity/common_right.html"}>
  58. </div>
  59. <script type="text/javascript">
  60. //路径配置
  61. require.config({
  62. paths: {
  63. echarts: VG.conf.cdn_domain + '/public/echarts/build/dist'
  64. }
  65. });
  66. //使用
  67. require(
  68. [
  69. 'echarts',
  70. 'echarts/chart/line' // 使用柱状图就加载bar模块,按需加载
  71. ],
  72. function (ec) {
  73. // 基于准备好的dom,初始化echarts图表
  74. var myChart = ec.init(document.getElementById('chart'));
  75. var option = {
  76. title : {
  77. text: '流量统计图',
  78. subtext: '<{$b_time|date_format:'%Y-%m-%d'}> 至 <{$e_time|date_format:'%Y-%m-%d'}>'
  79. },
  80. tooltip : {
  81. trigger: 'axis'
  82. },
  83. legend: {
  84. data:['浏览量(pv)','访问数量(uv)']
  85. },
  86. toolbox: {
  87. show : true,
  88. feature : {
  89. mark : {show: true},
  90. saveAsImage : {show: true}
  91. }
  92. },
  93. calculable : true,
  94. xAxis : [
  95. {
  96. type : 'category',
  97. boundaryGap : false,
  98. data : [<{$xAxis}>]
  99. }
  100. ],
  101. yAxis : [
  102. {
  103. type : 'value',
  104. axisLabel : {
  105. formatter: '{value}'
  106. }
  107. }
  108. ],
  109. series : [
  110. {
  111. name:'浏览量(pv)',
  112. type:'line',
  113. data:[<{$pvs}>],
  114. markLine : {
  115. data : [
  116. {type : 'average', name: '平均值'}
  117. ]
  118. }
  119. },
  120. {
  121. name:'访问数量(uv)',
  122. type:'line',
  123. data:[<{$uvs}>],
  124. markLine : {
  125. data : [
  126. {type : 'average', name: '平均值'}
  127. ]
  128. }
  129. }
  130. ]
  131. };
  132. // 为echarts对象加载数据
  133. myChart.setTheme('macarons');
  134. myChart.setOption(option);
  135. }
  136. );
  137. KISSY.use('node, io, gallery/datetimepicker/2.0.0/index', function (S, Node, IO, Datetimepicker) {
  138. var $ = S.all;
  139. //日期
  140. new Datetimepicker({
  141. start : 'input[name=b_time]',
  142. timepicker : false,
  143. closeOnDateSelect : true
  144. });
  145. //日期
  146. new Datetimepicker({
  147. start : 'input[name=e_time]',
  148. timepicker : false,
  149. closeOnDateSelect : true
  150. });
  151. });
  152. </script>
  153. <{include file="./admin/bottom.html"}>