recheckBox2.vue 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247
  1. <template>
  2. <div class="work-item last-enter">
  3. <div class="work-line">
  4. <div class="line-box">
  5. <div class="line-dotted">
  6. <div class="dotted-inset"></div>
  7. </div>
  8. </div>
  9. </div>
  10. <div class="work-info">
  11. <div class="card-item-title" style="color: #ffffff;"><span class="dotted"></span>本次农事复核成效优异,作物产量潜力实现大幅增长,杀小叶情况优秀,小叶率在5%以内</div>
  12. <div class="recheck-content">
  13. <div class="over-img">
  14. <!-- 图片列表 -->
  15. <div class="carousel-wrapper" :style="carouselStyle">
  16. <photo-provider :photo-closable="true">
  17. <template v-for="(photo, index) in treeImgList"
  18. :key="index">
  19. <photo-consumer
  20. class="carousel-item"
  21. :src="photo.filename"
  22. >
  23. <div class="img-two">
  24. <img :id="'img1' + index" :src="photo.filename" />
  25. <div class="tag tag-l">2025年2月19日
  26. </div>
  27. <div class="tag tag-l" style="bottom: 20px;">执行前花带叶率15%
  28. </div>
  29. </div>
  30. </photo-consumer>
  31. <photo-consumer
  32. class="carousel-item"
  33. :src="photo.filename2">
  34. <div class="img-two">
  35. <img :id="'img2' + index" :src="photo.filename2" />
  36. <div class="tag tag-r">2025年2月22日
  37. </div>
  38. <div class="tag tag-r" style="bottom: 20px;">执行后花带叶率5%
  39. </div>
  40. </div>
  41. </photo-consumer>
  42. </template>
  43. </photo-provider>
  44. </div>
  45. <!-- 左右箭头 -->
  46. <div @click="prev" class="arrow left-arrow">
  47. <el-icon color="#F0D09C" size="20"><ArrowLeftBold /></el-icon>
  48. </div>
  49. <div @click="next" class="arrow right-arrow">
  50. <el-icon color="#F0D09C" size="20"><ArrowRightBold /></el-icon>
  51. </div>
  52. </div>
  53. </div>
  54. </div>
  55. </div>
  56. </template>
  57. <script setup>
  58. import { ref, computed } from "vue";
  59. import { base_img_url2, resize } from "@/api/config";
  60. const treeImgList = ref([
  61. {
  62. filename:
  63. "https://birdseye-img.sysuimars.com/birdseye-look-vue/zj/%E5%9B%BE%E7%89%872.png",
  64. filename2:
  65. "https://birdseye-img.sysuimars.com/birdseye-look-vue/zj/%E5%9B%BE%E7%89%871.png",
  66. }
  67. ]);
  68. const updateImagePosition = () => {
  69. carouselStyle.value.transform = `translateX(-${currentIndex.value * 100}%)`;
  70. };
  71. const currentIndex = ref(0);
  72. // 计算轮播图样式
  73. const carouselStyle = computed(() => {
  74. return {
  75. transform: `translateX(-${currentIndex.value * 100}%)`,
  76. };
  77. });
  78. // 下一张图片
  79. const next = () => {
  80. // 图片总数
  81. const totalImages = treeImgList.value.length;
  82. currentIndex.value = (currentIndex.value + 1) % totalImages;
  83. updateImagePosition();
  84. };
  85. // 上一张图片
  86. const prev = () => {
  87. // 图片总数
  88. const totalImages = treeImgList.value.length;
  89. currentIndex.value = (currentIndex.value - 1 + totalImages) % totalImages;
  90. updateImagePosition();
  91. };
  92. </script>
  93. <style lang="scss" scoped>
  94. @import "./boxClass.scss";
  95. .recheck-content {
  96. padding-right: 10px;
  97. .sub-title {
  98. color: #2199f8;
  99. }
  100. .over-img {
  101. margin-top: 8px;
  102. width: 100%;
  103. overflow: hidden;
  104. transition: transform 0.5s ease;
  105. display: flex;
  106. position: relative;
  107. .carousel-container {
  108. flex: none;
  109. // transform: translateX(-100%);
  110. transition: transform 0.5s ease;
  111. &.hideMap {
  112. flex: none;
  113. transform: translateX(0);
  114. // transform: translateX(-100%);
  115. }
  116. position: relative;
  117. width: 100%;
  118. overflow: hidden;
  119. margin: 0 auto;
  120. }
  121. .carousel-wrapper {
  122. display: flex;
  123. flex-direction: row;
  124. justify-content: left;
  125. transition: transform 0.5s ease;
  126. width: 100%;
  127. height: 100%;
  128. }
  129. .carousel-item {
  130. flex-shrink: 0;
  131. pointer-events: auto;
  132. position: relative;
  133. width: 50%;
  134. .img-two {
  135. display: flex;
  136. position: relative;
  137. .tag {
  138. position: absolute;
  139. bottom: 0;
  140. background: rgba(0, 0, 0, 0.6);
  141. color: #fff;
  142. font-size: 10px;
  143. padding: 2px 10px;
  144. }
  145. .tag-l {
  146. left: 0;
  147. border-radius: 0 5px 0 5px;
  148. }
  149. .tag-r {
  150. right: 0;
  151. border-radius: 5px 0 0 5px;
  152. }
  153. }
  154. }
  155. .carousel-item img {
  156. width: 100%;
  157. display: block;
  158. }
  159. .overlay {
  160. position: absolute;
  161. top: 0;
  162. right: 0;
  163. background: rgba(255, 255, 255, 0.3);
  164. width: 100%;
  165. height: 100%;
  166. transition: width 0.5s ease-in-out;
  167. }
  168. .percentage {
  169. position: absolute;
  170. bottom: 0;
  171. width: 100%;
  172. }
  173. .arrow {
  174. position: absolute;
  175. top: 50%;
  176. transform: translateY(-50%);
  177. background: rgba(0, 0, 0, 0.5);
  178. width: 36px;
  179. height: 36px;
  180. border-radius: 50%;
  181. display: inline-flex;
  182. align-items: center;
  183. justify-content: center;
  184. cursor: pointer;
  185. }
  186. .left-arrow {
  187. left: 16px;
  188. }
  189. .right-arrow {
  190. right: 16px;
  191. }
  192. ::v-deep {
  193. .el-carousel__arrow {
  194. background: rgba(0, 0, 0, 0.5);
  195. }
  196. .PhotoConsumer {
  197. width: 50%;
  198. height: 100%;
  199. img {
  200. width: calc(100%);
  201. height: 100%;
  202. max-height: 200px;
  203. // height: 300px;
  204. // max-height: 500px;
  205. object-fit: scale-down;
  206. border-radius: 5px;
  207. }
  208. img + img {
  209. padding-left: 8px;
  210. }
  211. }
  212. }
  213. }
  214. .compare-b {
  215. padding: 12px 0 8px 0;
  216. .compare-chart {
  217. margin-top: 8px;
  218. background: #eaf4ff;
  219. border-radius: 5px;
  220. padding: 4px 0 8px 0;
  221. ::v-deep {
  222. .card-chart {
  223. height: 160px;
  224. }
  225. }
  226. }
  227. }
  228. }
  229. </style>