safetyJc.vue 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194
  1. <template>
  2. <div class="safetyJc">
  3. <div class="safety-head">
  4. <div class="safety-head-item" v-for="(item, index) in safetyHeadList" :key="index">{{
  5. item.label
  6. }}</div>
  7. </div>
  8. <div class="safety-content">
  9. <vue3-seamless-scroll hover-stop="true" :list="safetyList" :hover="true" :step="0.15" class="seamless-warp">
  10. <div class="safety-content-box" v-for="(ite, ind) in safetyList" :key="ind">
  11. <span v-if="ite.address">{{ ite.address }}</span>
  12. <span v-if="ite.nd">{{ ite.nd }}</span>
  13. <span v-if="ite.temp">{{ ite.temp }}</span>
  14. <span v-if="ite.grade">{{ ite.grade }}</span>
  15. <span v-if="ite.time">{{ ite.time }}</span>
  16. </div>
  17. </vue3-seamless-scroll>
  18. </div>
  19. </div>
  20. </template>
  21. <script setup lang="ts">
  22. import { reactive, ref, defineProps, watch } from 'vue';
  23. import { Vue3SeamlessScroll } from 'vue3-seamless-scroll'
  24. let props = defineProps({
  25. safetyHead: {
  26. type: Array,
  27. default: () => {
  28. return []
  29. }
  30. },
  31. safetyList: {
  32. type: Array,
  33. default: () => {
  34. return []
  35. }
  36. }
  37. })
  38. let safetyHeadList = ref<any[]>([]);
  39. let safetyList = ref<any[]>([]);
  40. watch(() => props.safetyHead, (newH, oldH) => {
  41. if (newH.length != 0) {
  42. safetyHeadList.value = newH
  43. }
  44. }, {
  45. immediate: true,
  46. deep: true
  47. })
  48. watch(() => props.safetyList, (newL, oldL) => {
  49. if (newL.length != 0) {
  50. safetyList.value = newL
  51. }
  52. }, {
  53. immediate: true,
  54. deep: true
  55. })
  56. </script>
  57. <style lang="less" scoped>
  58. .safetyJc {
  59. position: relative;
  60. width: 100%;
  61. height: 100%;
  62. .safety-head {
  63. display: flex;
  64. box-sizing: border-box;
  65. align-items: center;
  66. justify-content: space-between;
  67. height: 30px;
  68. padding: 0 7px;
  69. .safety-head-item {
  70. color: #1fb3f7;
  71. font-weight: bold;
  72. &:first-child {
  73. display: flex;
  74. flex: 2.5;
  75. align-items: center;
  76. justify-content: center;
  77. }
  78. &:nth-child(2) {
  79. display: flex;
  80. flex: 1;
  81. align-items: center;
  82. justify-content: center;
  83. }
  84. &:nth-child(3) {
  85. display: flex;
  86. flex: 1;
  87. align-items: center;
  88. justify-content: center;
  89. }
  90. &:nth-child(4) {
  91. display: flex;
  92. flex: 1;
  93. align-items: center;
  94. justify-content: center;
  95. }
  96. &:last-child {
  97. display: flex;
  98. flex: 2;
  99. align-items: center;
  100. justify-content: center;
  101. }
  102. }
  103. }
  104. .safety-content {
  105. display: flex;
  106. position: relative;
  107. flex-direction: column;
  108. align-items: center;
  109. justify-content: space-between;
  110. height: calc(100% - 30px);
  111. overflow: hidden;
  112. .seamless-warp{
  113. width: 100%;
  114. .safety-content-box {
  115. display: flex;
  116. box-sizing: border-box;
  117. align-items: center;
  118. justify-content: space-between;
  119. width: 100%;
  120. height: 24px;
  121. margin-bottom: 10px;
  122. padding: 0 7px;
  123. background: url('../../../../../assets/images/fire/firehome/safety1.png') no-repeat center;
  124. background-size: 100% 100%;
  125. span {
  126. color: #fff;
  127. &:first-child {
  128. display: flex;
  129. flex: 2.5;
  130. align-items: center;
  131. justify-content: center;
  132. height: 100%;
  133. background: url('../../../../../assets/images/fire/firehome/safety2.png') no-repeat center;
  134. background-size: 100% 100%;
  135. }
  136. &:nth-child(2) {
  137. display: flex;
  138. flex: 1;
  139. align-items: center;
  140. justify-content: center;
  141. height: 100%;
  142. }
  143. &:nth-child(3) {
  144. display: flex;
  145. flex: 1;
  146. align-items: center;
  147. justify-content: center;
  148. height: 100%;
  149. }
  150. &:nth-child(4) {
  151. display: flex;
  152. flex: 1;
  153. align-items: center;
  154. justify-content: center;
  155. height: 100%;
  156. }
  157. &:last-child {
  158. display: flex;
  159. flex: 2;
  160. align-items: center;
  161. justify-content: center;
  162. height: 100%;
  163. }
  164. }
  165. }
  166. }
  167. }
  168. }
  169. </style>