<template> <div class="JianSheDuiBi"> <div class="projectMb"> <img :src="Component23" alt="" /> <span class="title">{{ `建设前(${preConstructionFileList.length}张)` }}</span> </div> <div class="xmmb"> <el-carousel :interval="4000" type="card" height="200px"> <el-carousel-item v-for="item in preConstructionFileList" :key="item"> <img class="img_age" :src="item.url" alt=""> </el-carousel-item> </el-carousel> </div> <div class="projectMb"> <img :src="Component23" alt="" /> <span class="title">{{ `建设中${underConstructionFileList.length}(张)` }}</span> </div> <div class="xmgk"> <el-carousel :interval="4000" type="card" height="200px"> <el-carousel-item v-for="item in underConstructionFileList" :key="item"> <img class="img_age" :src="item.url" alt=""> </el-carousel-item> </el-carousel> </div> <div class="projectMb"> <span class="title">{{ `建设后(${postConstructionFileList.length}张)` }}</span> <el-carousel :interval="4000" type="card" height="200px"> <el-carousel-item v-for="item in postConstructionFileList" :key="item"> <img class="img_age" :src="item.url" alt=""> </el-carousel-item> </el-carousel> </div> </div> </template> <script setup name="JianSheDuiBi"> import { inject } from 'vue'; import {selectProjectImageList} from '@/api/gcpjApi' import Component23 from '@/assets/images/gcpjimg/Component23.png'; // const getProjectInfo = inject('getProjectInfo') // const projectInfo = getProjectInfo() const getProjectInfo = sessionStorage.getItem('getProjectInfo') const preConstructionFileList=ref([]) const underConstructionFileList=ref([]) const postConstructionFileList=ref([]) async function selectProjectImageListD(P) { let {data}=await selectProjectImageList(P) preConstructionFileList.value=data[0].preConstructionFileList underConstructionFileList.value=data[0].underConstructionFileList postConstructionFileList.value=data[0].postConstructionFileList } selectProjectImageListD({projectNo: getProjectInfo }) </script> <style lang="scss" scoped> .el-carousel__item h3 { color: #475669; opacity: 0.75; line-height: 200px; margin: 0; text-align: center; } .el-carousel__item:nth-child(2n) { background-color: #99a9bf; } .el-carousel__item:nth-child(2n + 1) { background-color: #d3dce6; } .img_age{ width: 100%; height: 100%; } </style>