<template>
    <div class="container">
        <!-- 顶部信息 -->
        <div class="containertop">
            <div class="topleft">
                <img src="../../../assets/images/detailsicon/1.png" alt="">
                <span>项目巡礼</span>
            </div>
            <div class="topright">
                <el-button type="primary" size="medium" plain
                    style="border: none;background-color: rgba(43,98,241,0.1);color: #2B62F1;" @click="">
                    <img src="../../../assets/images/detailsicon/icon-xz@2x.png" alt="编辑"
                        style="width: 0.6rem; height: 0.6rem; margin-right: 4px;">
                    新增
                </el-button>
            </div>
        </div>
        <!-- 图片盒子容器 -->
        <div class="image-container">
            <div v-for="(image, index) in images" :key="index" class="image-box">
                <img :src="image.src" alt="项目图片" class="image">
                <div class = "close-button" @click="removeImage(index)"> 
                    <img src="../../../assets/images/detailsicon/icon-关闭@2x.png" alt="">
                </div>
            </div>
        </div>
    </div>
</template>

<script>
export default {
    data() {
        return {
            images: [
                { src: '' },
                { src: '' },
                { src: '' },
                // 添加更多图片
            ]
        };
    },
    methods: {
        removeImage(index) {
            this.images.splice(index, 1);
        }
    }
};
</script>

<style scoped>
.container {
    display: flex;
    flex-direction: column;
    width: 100%;
    background-color: #FFFFFF;
    box-shadow: 0rem 0.13rem 0.63rem 0rem rgba(177, 177, 177, 0.1);
    border-radius: 0.5rem 0.5rem 0.5rem 0.5rem;
    padding: 1rem;
    gap: 1rem;
    overflow: auto;
}

.containertop {
    height: auto;
    display: flex;
    justify-content: space-between;
    padding: .5rem;
    border-bottom: 1px solid #E5E5E5;
}

.topleft {
    width: 8rem;
    display: flex;
    gap: 0.4rem;
    align-items: center;
}

.topleft img {
    width: 0.81rem;
    height: 0.81rem;
}

.topleft span {
    width: auto;
    height: 0.88rem;
    font-family: AlibabaPuHuiTi, AlibabaPuHuiTi;
    font-weight: 500;
    font-size: 0.88rem;
    color: #3D424C;
    line-height: 0.88rem;
    text-align: right;
    font-style: normal;
    text-transform: none;
}

.image-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.image-box {
    position: relative;
    width: 21.75rem;
    height: 12.44rem;
    background-color: #f0f0f0;
    border-radius: 0.5rem;
    overflow: hidden;
}

.image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.close-button {
    width: 1.25rem;
    height: 1.25rem;
    position: absolute;
    top: 0.2rem;
    right: 0.2rem;
}
.close-button img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
</style>