<template>
  <div class="photoAlbum">
    <div class="photoAlbumDiv" v-for="(list, listIndex) in resultData" :key="listIndex">
      <div class="year">{{list.year}}年</div>
      <el-row :gutter="20">
        <el-col :span="8" v-for="(item, index) in list.children" :key="index">
          <el-card class="resultCard">
            <el-image class="pointer" :src="getFullUrl(item.umz_img)" :preview-src-list="item.srcList" :initial-index="0" fit="cover" />
            <div class="production">
              <div class="name">{{item.umz_name}}</div>
              <div class="flex pro">
                <div>{{item.create_time}}</div>
                <div class="operate">
                  <el-icon class="pointer" @click.stop="handleEdit(item.umz_id)">
                    <EditPen />
                  </el-icon>
                  <el-icon class="pointer" @click.stop="handleDelete(item.umz_id)" style="margin-left: 20px;">
                    <Delete />
                  </el-icon>
                </div>
              </div>
            </div>
          </el-card>
        </el-col>
      </el-row>
    </div>
  </div>
</template>

<script>
import { getFullUrl } from '@/utils/helper';
export default {
  data() {
    return {

    }
  },
  props: ["resultData"],
  methods: {
    handleEdit(umz_id) {
      this.$emit("edit", umz_id);
    },
    handleDelete(umz_id) {
      this.$emit("delete", umz_id);
    }
  }
}
</script>

<style lang="scss" scoped>
.photoAlbum {
  margin-top: 30px;
  .pointer {
    cursor: pointer;
  }
  .flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  .photoAlbumDiv {
    margin-bottom: 20px;
    .year {
      font-size: 24px;
      margin-bottom: 10px;
    }
  }
  .el-card::v-deep {
    border-radius: 12px;
    margin-bottom: 15px;
    .el-card__body {
      padding: 0 !important;
      .el-image {
        width: 100%;
        height: 185px;
      }
      .production {
        padding: 5px 15px;
        .name {
          font-size: 16px;
          line-height: 24px;
        }
        .pro {
          margin-top: 5px;
          font-size: 14px;
          color: #050026;
          line-height: 20px;
        }
      }
    }
  }
}
</style>