dustFallDevice.vue 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278
  1. <template>
  2. <div class="dustFallDevice">
  3. <div class="fall-left-box">
  4. <div class="box-c"></div>
  5. <div class="box-left-t">
  6. <div class="item-label">设备总数</div>
  7. <div class="item-val">{{ deviceTotal }}</div>
  8. </div>
  9. <div class="box-left-b">
  10. <div class="item-label">喷雾开启数</div>
  11. <div class="item-val">{{ pwTotal }}</div>
  12. </div>
  13. <div class="box-right-t">
  14. <div class="item-label">联网数量</div>
  15. <div class="item-val">{{ interTotal }}</div>
  16. </div>
  17. <div class="box-right-b">
  18. <div class="item-label">断网数量</div>
  19. <div class="item-val">{{ unInterTotal }}</div>
  20. </div>
  21. </div>
  22. <div class="fall-right-box">
  23. <div class="fall-table-head">
  24. <div class="fall-head-item" v-for="(item, index) in tabHeadList" :key="index">{{ item.title }}</div>
  25. </div>
  26. <div class="fall-table-content">
  27. <vue3-seamless-scroll hover-stop="true" :list="tabContentList" :hover="true" :step="0.15"
  28. class="seamless-warp">
  29. <div class="fall-content-item" v-for="(item, ind) in tabContentList" :key="ind">
  30. <span class="content-item-val">{{ `${ind + 1}` }}</span>
  31. <span class="content-item-val">{{ item.deviceName }}</span>
  32. <span class="content-item-val">{{ item.stateConn }}</span>
  33. <span class="content-item-val">{{ item.stateSpray }}</span>
  34. </div>
  35. </vue3-seamless-scroll>
  36. </div>
  37. </div>
  38. </div>
  39. </template>
  40. <script setup lang="ts">
  41. import { ref, reactive, defineProps, watch } from 'vue'
  42. import { Vue3SeamlessScroll } from 'vue3-seamless-scroll'
  43. let props = defineProps({
  44. deviceTotal: {
  45. type: Number,
  46. default: 0
  47. },
  48. pwTotal: {
  49. type: Number,
  50. default: 0
  51. },
  52. interTotal: {
  53. type: Number,
  54. default: 0
  55. },
  56. unInterTotal: {
  57. type: Number,
  58. default: 0
  59. },
  60. pwData: {
  61. type: Array,
  62. default: () => {
  63. return []
  64. }
  65. }
  66. })
  67. //table头
  68. let tabHeadList = reactive([
  69. { title: '编号' },
  70. { title: '名称' },
  71. { title: '连接状态' },
  72. { title: '喷雾状态' },
  73. ])
  74. //table content
  75. let tabContentList = ref<any[]>([])
  76. watch(() => props.pwData, (newP, oldP) => {
  77. console.log(newP, 'newP------')
  78. if (newP.length != 0) {
  79. tabContentList.value = newP
  80. }
  81. }, {
  82. immediate: true,
  83. deep: true
  84. })
  85. </script>
  86. <style lang="less" scoped>
  87. .dustFallDevice {
  88. display: flex;
  89. position: relative;
  90. justify-content: space-between;
  91. width: 100%;
  92. height: 100%;
  93. .fall-left-box {
  94. position: relative;
  95. width: calc(50% - 15px);
  96. height: 100%;
  97. margin-right: 15px;
  98. .box-c {
  99. position: absolute;
  100. top: 50%;
  101. left: 50%;
  102. width: 224px;
  103. height: 203px;
  104. transform: translate(-50%, -45%);
  105. background: url('../../../../../assets/images/dust/dusthome/left-box1.png') no-repeat center;
  106. background-size: 100% 100%;
  107. }
  108. .box-left-t {
  109. position: absolute;
  110. top: 0;
  111. left: 0;
  112. align-items: center;
  113. width: 80px;
  114. height: 81px;
  115. background: url('../../../../../assets/images/dust/dusthome/left-box2.png') no-repeat center;
  116. background-size: 100% 100%;
  117. }
  118. .box-left-b {
  119. position: absolute;
  120. top: 0;
  121. right: 0;
  122. width: 80px;
  123. height: 81px;
  124. background: url('../../../../../assets/images/dust/dusthome/left-box3.png') no-repeat center;
  125. background-size: 100% 100%;
  126. }
  127. .box-right-t {
  128. position: absolute;
  129. bottom: 0;
  130. left: 0;
  131. width: 80px;
  132. height: 81px;
  133. background: url('../../../../../assets/images/dust/dusthome/left-box4.png') no-repeat center;
  134. background-size: 100% 100%;
  135. }
  136. .box-right-b {
  137. position: absolute;
  138. right: 0;
  139. bottom: 0;
  140. width: 80px;
  141. height: 81px;
  142. background: url('../../../../../assets/images/dust/dusthome/left-box5.png') no-repeat center;
  143. background-size: 100% 100%;
  144. }
  145. .item-label {
  146. position: absolute;
  147. top: 2px;
  148. width: 100%;
  149. color: #9da5aa;
  150. font-size: 12px;
  151. text-align: center;
  152. }
  153. .item-val {
  154. position: absolute;
  155. top: 21px;
  156. width: 100%;
  157. color: #1fb3f7;
  158. font-family: douyuFont;
  159. font-size: 12px;
  160. text-align: center;
  161. }
  162. }
  163. .fall-right-box {
  164. width: 50%;
  165. height: 100%;
  166. .fall-table-head {
  167. display: flex;
  168. align-items: center;
  169. justify-content: space-between;
  170. width: 100%;
  171. height: 32px;
  172. border-bottom: 2px solid #1f8bb2;
  173. background: linear-gradient(to bottom, rgb(12 40 55 / 30%), rgb(19 90 124 / 90%));
  174. .fall-head-item {
  175. display: flex;
  176. justify-content: center;
  177. color: #1fb3f7;
  178. &:nth-child(1) {
  179. flex: 1;
  180. }
  181. &:nth-child(2) {
  182. flex: 3;
  183. }
  184. &:nth-child(3) {
  185. flex: 2;
  186. }
  187. &:nth-child(4) {
  188. flex: 2;
  189. }
  190. }
  191. }
  192. .fall-table-content {
  193. position: relative;
  194. width: 100%;
  195. height: calc(100% - 32px);
  196. overflow: hidden;
  197. .seamless-warp {
  198. width: 100%;
  199. .fall-content-item {
  200. display: flex;
  201. align-items: center;
  202. justify-content: space-between;
  203. height: 34px;
  204. &:nth-child(odd) {
  205. background-color: #0b202e;
  206. }
  207. &:nth-child(even) {
  208. background-color: #0d3144;
  209. }
  210. .content-item-val {
  211. display: flex;
  212. justify-content: center;
  213. color: #fff;
  214. &:nth-child(1) {
  215. flex: 1;
  216. }
  217. &:nth-child(2) {
  218. flex: 3;
  219. }
  220. &:nth-child(3) {
  221. flex: 2;
  222. color: #00ff91;
  223. }
  224. &:nth-child(4) {
  225. flex: 2;
  226. }
  227. }
  228. }
  229. }
  230. }
  231. }
  232. }
  233. </style>