comment.html 5.7 KB

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