patrol.html 7.2 KB

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