badRatingRanking.vue 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260
  1. <template>
  2. <moduleEnclosure title="差评排名">
  3. <div class="dvScrollBoardView">
  4. <dv-scroll-board
  5. :config="config"
  6. :ref="`scrollBoard_1`"
  7. style="width: 100%; height: 100%"
  8. />
  9. </div>
  10. </moduleEnclosure>
  11. </template>
  12. <script>
  13. import moduleEnclosure from '@/components/moduleEnclosure.vue';
  14. import img0 from '@/assets/xia.png';
  15. import img1 from '@/assets/shang.png';
  16. import img2 from '@/assets/y1.png';
  17. import img3 from '@/assets/y2.png';
  18. import img4 from '@/assets/y3.png';
  19. import { getQuery13, getQuery14 } from '@/api/bigView.js';
  20. var timeling = 5000;
  21. export default {
  22. components: {
  23. moduleEnclosure,
  24. },
  25. data() {
  26. return {
  27. config: {
  28. headerBGC: '#0B1C55',
  29. oddRowBGC: '#0B1C55',
  30. evenRowBGC: '#0B1C55',
  31. header: ['排名', '网点', '差评数', '同比'],
  32. data: [],
  33. waitTime: timeling,
  34. },
  35. };
  36. },
  37. mounted() {
  38. this.timeId = getQuery13((res) => {
  39. let list = res.data.map((item, index) => {
  40. return this.tmp(item, index, true);
  41. });
  42. this.config.data = list;
  43. this.$refs['scrollBoard_1'][0].updateRows(list);
  44. }, 60000 * 60 * 12);
  45. },
  46. beforeUnmount() {
  47. this.timeId();
  48. if (this.timed) {
  49. clearTimeout(this.timed);
  50. }
  51. },
  52. methods: {
  53. tmp(item, index, bool) {
  54. return [
  55. `<div class="aitem0"><img src="${
  56. index == 0 ? img2 : index == 1 ? img3 : img4
  57. }"/><span>${index + 1}</span></div>`,
  58. `<div class="aitem1"><div class="${
  59. bool ? 'slide' : 'juzhongxianshi'
  60. }" style="width:${item.name.length * 13}px!important;"><span>${
  61. item.name
  62. }</span>${
  63. bool ? ` <span>${item.name}</span> <span>${item.name}</span>` : ''
  64. }</div></div>`,
  65. `<div class="aitem2">${item.cut}</div>`,
  66. `<div class="aitem3">
  67. <div class="zhanbijs">
  68. <span class="${
  69. item.rate > 0 ? 'c3' : item.rate < 0 ? 'c2' : ''
  70. }">${item.rate}%</span>
  71. ${
  72. item.rate > 0 || item.rate < 0
  73. ? `<img
  74. src="${item.rate > 0 ? img1 : item.rate < 0 ? img0 : ''}"
  75. />`
  76. : ''
  77. }
  78. </div>
  79. </div>`,
  80. ];
  81. },
  82. },
  83. };
  84. </script>
  85. <style scoped lang="scss">
  86. ::v-deep .dv-scroll-board {
  87. .header-item {
  88. color: #699be3 !important;
  89. font-size: 18px;
  90. font-family: Source Han Sans CN, Source Han Sans CN-Regular;
  91. font-weight: 400;
  92. text-align: center;
  93. }
  94. .header,
  95. .row-item {
  96. cursor: pointer;
  97. height: 42px !important;
  98. &:hover {
  99. background: linear-gradient(to right, #156ccf, #082570) !important;
  100. }
  101. div:nth-child(1) {
  102. width: 60px !important;
  103. div {
  104. width: 100% !important;
  105. }
  106. }
  107. div:nth-child(2) {
  108. width: 52% !important;
  109. overflow: hidden;
  110. white-space: nowrap;
  111. div {
  112. min-width: 100% !important;
  113. }
  114. .juzhongxianshi {
  115. text-align: center;
  116. }
  117. }
  118. div:nth-child(3) {
  119. width: 16% !important;
  120. div {
  121. width: 100% !important;
  122. }
  123. }
  124. div:nth-child(4) {
  125. width: auto !important;
  126. }
  127. .slide {
  128. animation: slide 5s linear infinite;
  129. }
  130. @keyframes slide {
  131. 0% {
  132. transform: translateX(0);
  133. }
  134. 20% {
  135. transform: translateX(0);
  136. }
  137. 100% {
  138. transform: translateX(-100%);
  139. }
  140. }
  141. // }
  142. }
  143. }
  144. ::v-deep .aitem0 {
  145. width: 38px;
  146. height: 38px;
  147. position: relative;
  148. img {
  149. margin: 0;
  150. padding: 0;
  151. width: 35px;
  152. height: 35px;
  153. }
  154. img,
  155. span {
  156. position: absolute;
  157. top: 50%;
  158. left: 50%;
  159. transform: translate(-50%, -50%);
  160. }
  161. }
  162. ::v-deep .aitem1,
  163. ::v-deep .aitem2 {
  164. height: 38px;
  165. line-height: 38px;
  166. font-size: 16px;
  167. font-weight: 400;
  168. text-align: center;
  169. color: #c8ebff;
  170. // overflow: hidden;
  171. // white-space: nowrap;
  172. // text-overflow: ellipsis;
  173. }
  174. ::v-deep .aitem3 {
  175. .zhanbijs {
  176. width: 100%;
  177. height: 38px;
  178. display: flex;
  179. flex-direction: row;
  180. align-items: center;
  181. justify-content: center;
  182. & > span:nth-child(1) {
  183. font-size: 16px;
  184. font-family: Source Han Sans CN, Source Han Sans CN-Regular;
  185. font-weight: 400;
  186. text-align: left;
  187. }
  188. img {
  189. width: 16px;
  190. height: 16px;
  191. margin-left: 6px;
  192. }
  193. }
  194. }
  195. .dvScrollBoardView {
  196. width: 100%;
  197. height: 100%;
  198. box-sizing: border-box;
  199. padding-top: 16px;
  200. }
  201. .classbtns {
  202. width: 160px;
  203. height: 28px;
  204. display: flex;
  205. flex-direction: row;
  206. align-items: center;
  207. border: 2px solid #0e72e6;
  208. cursor: pointer;
  209. div {
  210. width: 50%;
  211. height: 100%;
  212. text-align: center;
  213. line-height: 28px;
  214. }
  215. div:nth-child(1) {
  216. border-right: 2px solid #0e72e6;
  217. }
  218. .select {
  219. background: #0e72e6;
  220. color: #bbd4ff;
  221. }
  222. }
  223. ::v-deep .el-carousel__arrow,
  224. ::v-deep .el-carousel__indicators {
  225. display: none;
  226. }
  227. ::v-deep .c2 {
  228. color: #3ce783;
  229. }
  230. ::v-deep .c3 {
  231. color: #e15960;
  232. }
  233. </style>