comment.html 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209
  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>评价统计</title>
  8. <link rel="stylesheet" href="/static/antv/f2.style.css" />
  9. <script src="/static/antv/f2.min.js"></script>
  10. <script type="text/javascript" src="/static/jquery-2.2.4.min.js"></script>
  11. <link rel="stylesheet" href="/static/h5/css/common.css">
  12. <style>
  13. html,body {
  14. overflow-y: scroll;
  15. -webkit-overflow-scrolling: touch;
  16. background: #f1f1f1;
  17. }
  18. html,body,ul {
  19. margin: 0;
  20. padding: 0;
  21. }
  22. .select-tab {
  23. border-radius:10px;
  24. margin: 10px 10px 0;
  25. background: #fff;
  26. }
  27. .nav {
  28. display: flex;
  29. display: -webkit-flex;
  30. 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. background-color: #fff;
  63. border-radius: 10px;
  64. }
  65. .record-data {
  66. display: flex;
  67. display: -webkit-flex;
  68. justify-content: center;
  69. align-items: center;
  70. height: 7vh;
  71. }
  72. .first span {
  73. color: var(--themeColor);
  74. font-size: 18px;
  75. font-weight: bold;
  76. }
  77. .line:not(:last-child) {
  78. margin: 0 15px;
  79. height: 1px;
  80. background-color: #CCCCCC;
  81. }
  82. .daily-title, .daily-nums, .daily-count {
  83. flex: 1;
  84. text-align: center;
  85. display: inline-block;
  86. font-size: 17px;
  87. font-weight: 500;
  88. }
  89. .daily-title {
  90. margin-left: 5px;
  91. }
  92. .daily-nums {
  93. margin-right: 5px;
  94. /*color:rgba(153,153,153,1);*/
  95. }
  96. .text {
  97. color:rgba(153,153,153,1);
  98. }
  99. .chart-wrapper {
  100. margin: 10px;
  101. background: linear-gradient(288deg,#8ce4f3,var(--themeColor));
  102. border-radius:10px;
  103. -webkit-text-fill-color: transparent;
  104. }
  105. </style>
  106. </head>
  107. <body>
  108. <div class="select-tab">
  109. <ul id="myTab" class="nav nav-tabs">
  110. <li {eq name="type" value="1"}class="active"{/eq}>
  111. <a href="{:url('comment',['type'=>1,'orgId'=>$orgId])}">日评价统计</a>
  112. </li>
  113. <li {eq name="type" value="2"}class="active"{/eq}>
  114. <a href="{:url('comment',['type'=>2,'orgId'=>$orgId])}">月评价统计</a>
  115. </li>
  116. <li {eq name="type" value="3"}class="active"{/eq}>
  117. <a href="{:url('comment',['type'=>3,'orgId'=>$orgId])}">总评价统计</a>
  118. </li>
  119. </ul>
  120. </div>
  121. <div class="chart-wrapper">
  122. <canvas id="mountNode" style="width: 100%;"></canvas>
  123. </div>
  124. <div class="daily-record">
  125. <div class="record-data first">
  126. <span class="daily-title">业务类型</span>
  127. <span class="daily-count">评价总数</span>
  128. <span class="daily-nums">平均得分</span>
  129. </div>
  130. <div class="line"></div>
  131. {volist name="list" id="v"}
  132. <div class="record-data" onclick="comment(this)" data-orgId="{$orgId}" data-day="{$type}" data-mode="{$v['work_type_mode']}">
  133. <span class="daily-title text">{$v['year']}</span>
  134. <span class="daily-count text">{$v['count']}</span>
  135. <span class="daily-nums text">{$v['sales']}</span>
  136. </div>
  137. <div class="line"></div>
  138. {/volist}
  139. </div>
  140. <script>
  141. function comment(obj) {
  142. var orgId = $(obj).attr('data-orgId');
  143. var day = $(obj).attr('data-day');
  144. var mode = $(obj).attr('data-mode');
  145. var url = "{:url('Statistics/commentList')}?mode="+mode+'&orgId='+orgId+'&day='+day;
  146. window.location.href=url;
  147. }
  148. </script>
  149. <script>
  150. var data = {:json_encode($list)};
  151. var chart = new F2.Chart({
  152. id: 'mountNode',
  153. pixelRatio: window.devicePixelRatio
  154. });
  155. var defs = {
  156. year: {
  157. type: 'cat'
  158. },
  159. sales: {
  160. min: 0,
  161. max: 5
  162. }
  163. };
  164. chart.source(data,defs);
  165. chart.tooltip({
  166. showItemMarker: false,
  167. onShow: function onShow(ev) {
  168. var items = ev.items;
  169. items[0].name = null;
  170. items[0].name = items[0].title;
  171. items[0].value = items[0].value + '分';
  172. }
  173. });
  174. chart.axis('year', {
  175. label: function label() {
  176. return {
  177. fontSize: 12,
  178. fill: '#fff'
  179. };
  180. }
  181. });
  182. chart.axis('sales', {
  183. label: function label() {
  184. return {
  185. fontSize: 12,
  186. fill: '#fff'
  187. };
  188. }
  189. });
  190. chart.guide().text({
  191. position: ['45%', '1%'],
  192. content: '各业务平均得分',
  193. style: {
  194. fontSize: 14,
  195. textBaseline: 'middle',
  196. textAlign: 'center',
  197. fill: '#fff'
  198. },
  199. offsetY: -23
  200. });
  201. chart.interval().position('year*sales');
  202. chart.render();
  203. </script>
  204. </body>
  205. </html>