<template> <!-- 项目建设完成图片 --> <div class="XiangXiXinXi"> <div class="xiangxinfo jszp"> <el-carousel trigger="click" type="card" height="447px" v-if="allFileList.length > 0"> <el-carousel-item v-for="item in allFileList" :key="item"> <el-image class="img_age" preview-teleported :src="item.url" :zoom-rate="1.2" :max-scale="7" :min-scale="0.2" :preview-src-list="[item.url]" :initial-index="4" /> </el-carousel-item> </el-carousel> <el-empty :image-size="30" v-else /> </div> </div> </template> <script setup name="XiangXiXinXi"> import { selectProjectImageList } from '@/api/sponeScreen/gcpjApi'; import bus from '@/bus'; const projectDate = ref({}); // const xmxtgcl = ref([{ label: '道路长度公里', props: 'projectName' }]); // const xmmbList = ref([{ label: '径流总量控制目标(%)', props: 'annualRunoffTotalControlRate' }]); const allImages = ref({}); const allFileList = computed(() => { return [...(allImages.value?.preConstructionFileList || []), ...(allImages.value?.postConstructionFileList || [])]; }); async function selectProjectImage(p) { let { data } = await selectProjectImageList(p); allImages.value = data[0]; } onMounted(() => { bus.on('getProjectDate', v => { // debugger projectDate.value = v; selectProjectImage({ projectNo: v.projectNo }); }); }); </script> <style lang="scss" scoped> .XiangXiXinXi { display: flex; flex-direction: column; overflow: auto; overflow-x: hidden; height: 100%; color: #fff; .xiangxinfo { margin-top: 20px; .img_age { width: 580px; height: 447px; } } } </style>