index.vue 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221
  1. <template>
  2. <div class="screen-container">
  3. <common-header title="产品下线情况" />
  4. <div class="screen-content">
  5. <div class="chartsCarouselBox itemBackgroud">
  6. <div class="carouselHeader tableStyle">
  7. <div class="a1 center1Text">产品名称</div>
  8. <div class="a2 center1Text">今日下线</div>
  9. <div class="a2 center1Text">总下线</div>
  10. <div class="a2 center1Text">总需求数</div>
  11. <div class="a2 center1Text">当前良率</div>
  12. <div class="a2 center1Text">单批划分</div>
  13. <div class="a2 center1Text">完成批数</div>
  14. <div class="a2 center1Text">试验预约数</div>
  15. </div>
  16. <div class="carouselBody">
  17. <TransitionGroup name="list" tag="ul">
  18. <li
  19. class="carouselItem tableStyle"
  20. :key="item"
  21. style="height: 9.6vh"
  22. v-for="item in showDatas"
  23. >
  24. <div class="a1 infoBackgroud centerText textComent">
  25. {{ item.materialName }}
  26. </div>
  27. <div class="a2 infoBackgroud centerText textComent">
  28. {{ item.todayNum }}
  29. </div>
  30. <div
  31. class="a2 infoBackgroud centerText textComent"
  32. style="font-weight: bolder"
  33. >
  34. {{ item.allOffNum }}
  35. </div>
  36. <div
  37. class="a2 infoBackgroud centerText textComent"
  38. style="font-weight: bolder"
  39. >
  40. {{ item.orderNum }}
  41. </div>
  42. <div
  43. class="a2 infoBackgroud centerText textComent"
  44. style="font-weight: bolder"
  45. >
  46. {{ item.rate }}
  47. </div>
  48. <div
  49. class="a2 infoBackgroud centerText textComent"
  50. style="font-weight: bolder"
  51. >
  52. {{ item.batchNum }}
  53. </div>
  54. <div
  55. class="a2 infoBackgroud centerText textComent"
  56. style="font-weight: bolder"
  57. >
  58. {{ item.completeBatch }}
  59. </div>
  60. <div
  61. class="a2 infoBackgroud centerText textComent"
  62. style="font-weight: bolder"
  63. >
  64. {{ item.testNum }}
  65. </div>
  66. </li>
  67. </TransitionGroup>
  68. </div>
  69. </div>
  70. </div>
  71. </div>
  72. </template>
  73. <script setup>
  74. import CommonHeader from "@/views/report/statistics/screens/common-header.vue";
  75. import { getOffLineInfo } from "@/api/bigScreen";
  76. const datas = ref([]);
  77. const borderRef = ref(null);
  78. const showDatas = ref([]);
  79. const interval1 = ref(null);
  80. const sum1 = ref(1);
  81. const setShowData1 = (num, time) => {
  82. sum1.value = num;
  83. if (datas.value.length > num) {
  84. const dataA = JSON.parse(JSON.stringify(datas.value));
  85. showDatas.value = dataA.splice(0, num);
  86. interval1.value = setInterval(async () => {
  87. await showDatas.value.push(datas.value[sum1.value % datas.value.length]);
  88. showDatas.value.splice(0, 1);
  89. sum1.value = sum1.value + 1;
  90. }, time);
  91. } else {
  92. showDatas.value = datas.value;
  93. }
  94. };
  95. const getListData = async () => {
  96. const { data } = await getOffLineInfo();
  97. datas.value = [...data, ...data, ...data];
  98. };
  99. onMounted(async () => {
  100. borderRef.value?.initWH();
  101. await getListData();
  102. setShowData1(8, 3000);
  103. });
  104. onUnmounted(() => {
  105. if (interval1.value) {
  106. clearInterval(interval1.value);
  107. }
  108. });
  109. </script>
  110. <style lang="scss" scoped>
  111. .list-move,
  112. .list-enter-active,
  113. .list-leave-active {
  114. transition: all 0.5s ease;
  115. }
  116. .list-enter-from,
  117. .list-leave-to {
  118. opacity: 0;
  119. transform: translateY(-4.6vh);
  120. }
  121. .list-leave-active {
  122. position: absolute;
  123. }
  124. .screen-container {
  125. width: 100vw;
  126. height: 100vh;
  127. background-image: url("@/assets/images/screen_bg_task.png");
  128. background-size: cover;
  129. background-position: center;
  130. }
  131. .itemBackgroud {
  132. background-color: rgba(0, 0, 0, 0.6);
  133. }
  134. .screen-content {
  135. width: 100vw;
  136. height: 88vh;
  137. margin-top: 2vh;
  138. padding: 0 2vh;
  139. display: flex;
  140. justify-content: space-between;
  141. flex-wrap: wrap;
  142. position: relative;
  143. }
  144. .tableStyle {
  145. display: flex;
  146. justify-content: space-between;
  147. width: 100%;
  148. .left {
  149. width: 66%;
  150. }
  151. .middle {
  152. width: 19%;
  153. }
  154. .right {
  155. width: 13%;
  156. }
  157. }
  158. .centerText {
  159. color: rgba(255, 255, 255, 0.8);
  160. font-size: 3vh;
  161. display: flex;
  162. align-items: center;
  163. justify-content: center;
  164. line-height: 9.6vh;
  165. text-align: center;
  166. padding: 0 1vh;
  167. }
  168. .center1Text {
  169. color: rgba(255, 255, 255, 0.8);
  170. font-size: 2vh;
  171. display: flex;
  172. align-items: center;
  173. justify-content: center;
  174. padding: 0 0.3vh;
  175. }
  176. .infoBackgroud {
  177. background-color: rgba(255, 255, 255, 0.05);
  178. }
  179. .textComent {
  180. white-space: nowrap; /* 不允许换行 */
  181. overflow: hidden; /* 超出长度时隐藏 */
  182. text-overflow: ellipsis; /* 超出部分显示省略号 */
  183. }
  184. .chartsCarouselBox {
  185. flex: 1;
  186. display: flex;
  187. flex-direction: column;
  188. padding: 2vh;
  189. .carouselHeader {
  190. height: calc(3vh);
  191. line-height: 3vh;
  192. margin-bottom: 0.5vh;
  193. .a1 {
  194. width: 25vw;
  195. }
  196. .a2 {
  197. width: 9.9vw;
  198. }
  199. }
  200. .carouselBody {
  201. flex: 1;
  202. display: flex;
  203. flex-direction: column;
  204. overflow: hidden;
  205. .carouselItem {
  206. margin-bottom: 0.5vh;
  207. width: 96vw;
  208. .a1 {
  209. width: 25vw;
  210. display: inline-block;
  211. }
  212. .a2 {
  213. width: 9.9vw;
  214. }
  215. }
  216. }
  217. }
  218. </style>