albumCarousel.vue 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <template>
  2. <el-dialog
  3. v-model="dialogVisible"
  4. width="60%"
  5. height="80%"
  6. class="picture-preview-wrap v-dialog"
  7. :show-close="false"
  8. top="10vh"
  9. append-to-body
  10. >
  11. <album-carousel-item v-if="images" :farmId="farmId" :images="images" :lock="lock"></album-carousel-item>
  12. </el-dialog>
  13. </template>
  14. <script setup>
  15. import { ref, computed, onMounted, onUnmounted } from "vue";
  16. import "./cacheImg.js"
  17. import AlbumCarouselItem from "./albumCarouselItem";
  18. import {dateFormat} from "@/utils/date_util.js"
  19. import eventBus from "@/api/eventBus";
  20. const lock = ref(false);
  21. const farmId = ref(766);
  22. const images = ref(null);
  23. const dialogVisible = ref(false)
  24. // 获取当前日期
  25. const currentDate = new Date();
  26. // 获取当前日期的前一个月
  27. const startDate = new Date(currentDate);
  28. startDate.setMonth(currentDate.getMonth() - 1);
  29. // 格式化日期
  30. const formattedStartDate = dateFormat(startDate, 'YY-mm-dd');
  31. const formattedEndDate = dateFormat(currentDate, 'YY-mm-dd');
  32. eventBus.on("click:point",function({farmId,sampleId}){
  33. let params = {sampleId,farmId}
  34. VE_API.miniimage.list(params).then(res => {
  35. if(res.code === 0){
  36. images.value = res.data
  37. dialogVisible.value = true
  38. }
  39. })
  40. })
  41. </script>
  42. <style lang="scss" scoped>
  43. @import "src/styles/index";
  44. </style>