patrol.html 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232
  1. <!doctype html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
  6. <meta http-equiv="X-UA-Compatible" content="ie=edge">
  7. <title>{$mode_name['name']}统计</title>
  8. <link rel="stylesheet" href="/static/antv/f2.style.css" />
  9. <script type="text/javascript" src="/static/jquery-2.2.4.min.js"></script>
  10. <style>
  11. html,body,ul {
  12. margin: 0;
  13. padding: 0;
  14. }
  15. html,body {
  16. overflow-y: scroll;
  17. -webkit-overflow-scrolling: touch;
  18. background-color: #F1F1F1;
  19. }
  20. .select-tab {
  21. margin: 10px 10px 0;
  22. border-radius: 10px;
  23. background: #fff;
  24. }
  25. .nav {
  26. display: flex;
  27. display: -webkit-flex;
  28. justify-content: center;
  29. -webkit-justify-content: center;
  30. align-items: center;
  31. border:1px solid #148d8f;
  32. border-radius:5px;
  33. list-style: none;
  34. }
  35. .nav>li {
  36. width: 100%;
  37. flex: 1;
  38. text-align: center;
  39. display: block;
  40. }
  41. .nav-tabs>li.active>a {
  42. line-height: 2;
  43. font-size: 16px;
  44. color: #fff;
  45. font-weight: 500;
  46. cursor: default;
  47. background-color: #148d8f;
  48. }
  49. .nav-tabs>li>a {
  50. line-height: 2;
  51. font-size: 16px;
  52. color: #999999;
  53. font-weight: 500;
  54. }
  55. a {
  56. display: block;
  57. text-decoration: none;
  58. }
  59. .daily-record {
  60. margin: 10px;
  61. border-radius: 10px;
  62. background: #fff;
  63. }
  64. .chart-wrapper {
  65. margin: 10px;
  66. border-radius: 10px;
  67. background: #fff;
  68. }
  69. .record-data {
  70. display: flex;
  71. display: -webkit-flex;
  72. justify-content: space-between;
  73. -webkit-justify-content: space-between;
  74. align-items: center;
  75. -webkit-box-align: center;
  76. height: 7vh;
  77. }
  78. .line {
  79. margin: 0 15px;
  80. height: 1px;
  81. background-color: #CCCCCC;
  82. }
  83. .daily-title, .daily-nums {
  84. display: inline;
  85. font-size: 17px;
  86. font-weight: 500;
  87. }
  88. .daily-title {
  89. margin-left: 15px;
  90. }
  91. .daily-nums {
  92. margin-right: 15px;
  93. color:rgba(153,153,153,1);
  94. }
  95. </style>
  96. </head>
  97. <body>
  98. <div class="select-tab">
  99. <ul id="myTab" class="nav nav-tabs">
  100. <li {eq name="type" value="0"}class="active"{/eq}>
  101. <a href="{:url('patrol',['type'=>0,'orgId'=>$orgId,'mode'=>$mode])}" data-toggle="tab">日{$mode_name['name']}统计</a>
  102. </li>
  103. <li {eq name="type" value="1"}class="active"{/eq}>
  104. <a href="{:url('patrol',['type'=>1,'orgId'=>$orgId,'mode'=>$mode])}" data-toggle="tab">月{$mode_name['name']}统计</a>
  105. </li>
  106. <li {eq name="type" value="2"}class="active"{/eq}>
  107. <a href="{:url('patrol',['type'=>2,'orgId'=>$orgId,'mode'=>$mode])}" data-toggle="tab">总{$mode_name['name']}统计</a>
  108. </li>
  109. </ul>
  110. </div>
  111. <div class="chart-wrapper">
  112. <canvas id="mountNode" style="width: 100%;"></canvas>
  113. </div>
  114. <div class="daily-record">
  115. <div class="record-data first">
  116. {eq name="type" value="0"}
  117. <div onclick="patrol(this)" data-type="1" data-mode="{$mode}" data-day="{$type}" data-orgId="{$orgId}" style="width: 100%">
  118. <span class="daily-title">今日总次数</span>
  119. <span class="daily-nums" style="float: right">{$allcount}</span>
  120. </div>
  121. {/eq}
  122. {eq name="type" value="1"}
  123. <div onclick="patrol(this)" data-type="1" data-mode="{$mode}" data-day="{$type}" data-orgId="{$orgId}" style="width: 100%">
  124. <span class="daily-title" >本月总次数</span>
  125. <span class="daily-nums" style="float: right">{$allcount}</span>
  126. </div>
  127. {/eq}
  128. {eq name="type" value="2"}
  129. <div onclick="patrol(this)" data-type="1" data-mode="{$mode}" data-day="{$type}" data-orgId="{$orgId}" style="width: 100%">
  130. <span class="daily-title" >历史总次数</span>
  131. <span class="daily-nums" style="float: right">{$allcount}</span>
  132. </div>
  133. {/eq}
  134. </div>
  135. <div class="line"></div>
  136. <div class="record-data">
  137. <span class="daily-title">地点</span>
  138. <span class="daily-nums">{$bluetooth}</span>
  139. </div>
  140. <div class="line"></div>
  141. <div class="record-data" onclick="patrol(this)" data-type="2" data-mode="{$mode}" data-day="{$type}" data-orgId="{$orgId}">
  142. <span class="daily-title">已完成</span>
  143. <span class="daily-nums">{$complete}</span>
  144. </div>
  145. <div class="line"></div>
  146. <div class="record-data" onclick="patrol(this)" data-type="3" data-mode="{$mode}" data-day="{$type}" data-orgId="{$orgId}">
  147. <span class="daily-title">未完成</span>
  148. <span class="daily-nums">{$incomplete}</span>
  149. </div>
  150. <div class="line"></div>
  151. <div class="record-data">
  152. <span class="daily-title">完成比</span>
  153. <span class="daily-nums">{$ratio}%</span>
  154. </div>
  155. </div>
  156. <script src="/static/antv/f2.min.js"></script>
  157. <script>
  158. var fontSize = 24 * (window.innerWidth / 375); // 字体适配不同屏幕
  159. var data = [{
  160. x: '1',
  161. y: {$ratio}
  162. }];
  163. var chart = new F2.Chart({
  164. id: 'mountNode',
  165. pixelRatio: window.devicePixelRatio
  166. });
  167. chart.source(data, {
  168. y: {
  169. max: 100,
  170. min: 0
  171. }
  172. });
  173. chart.axis(false);
  174. chart.tooltip(false);
  175. chart.coord('polar', {
  176. transposed: true,
  177. innerRadius: 0.8,
  178. radius: 0.85
  179. });
  180. chart.guide().arc({
  181. start: [0, 0],
  182. end: [1, 99.98],
  183. top: false,
  184. style: {
  185. lineWidth: 20,
  186. stroke: '#ccc'
  187. }
  188. });
  189. chart.guide().html({
  190. position: ['50%', '50%'],
  191. html: '<div style="width: 250px;height: 40px;text-align: center;">' + '<div style="font-size: 28px;font-weight: 700;color: #089875;">{$ratio}%</div>' + '<div style="font-size: 16px;font-weight:bold;">完成进度</div>' + '</div>'
  192. });
  193. // chart.guide().text({
  194. // position: ['50%', '50%'],
  195. // content: '85%',
  196. // style: {
  197. // fontSize: fontSize,
  198. // fill: '#1890FF'
  199. // }
  200. // });
  201. chart.interval().position('x*y').color('y', '#089875').size(20).animate({
  202. appear: {
  203. duration: 1200,
  204. easing: 'cubicIn'
  205. }
  206. });
  207. chart.render();
  208. </script>
  209. </body>
  210. </html>
  211. <script>
  212. function patrol(obj) {
  213. var type = $(obj).attr('data-type');
  214. var day = $(obj).attr('data-day');
  215. var mode = $(obj).attr('data-mode');
  216. var org = $(obj).attr('data-orgId');
  217. var url = "{:url('Statistics/patrolList')}?type="+type+'&orgId='+org+'&day='+day+'&mode='+mode;
  218. window.location.href=url;
  219. }
  220. </script>