<template>
  <a-carousel arrows style="margin-bottom: 20px;">
    <template #prevArrow>
      <div class="custom-slick-arrow" style="left: 10px; z-index: 1">
        <left-circle-outlined />
      </div>
    </template>
    <template #nextArrow>
      <div class="custom-slick-arrow" style="right: 10px">
        <right-circle-outlined />
      </div>
    </template>
    <div v-for="(image, index) in showData.images" :key="index" >
      <div style="position: relative;">
      <a-image
        :height="300"
        :src="image.url"
      />
      <div class="showImageInfo">
        <div>任务名称：{{ image.title }}</div>
        <div style="display:flex">
          <div style="flex: 1;">拍摄时间：{{ image.time }}</div>
          <div style="flex: 1;">拍摄角度：{{ image.angle }}</div>
          <div style="flex: 1;">拍摄人员：{{ image.user }}</div>
        </div>
      </div>
    </div>
    </div>
  </a-carousel>
  <a-steps
    v-model:current="current"
    :progressDot="true"
    :items="items"
    @change="changeTime"
  >
  </a-steps>
</template>

<script setup lang="ts">
import { LeftCircleOutlined, RightCircleOutlined } from "@ant-design/icons-vue"
import { computed, ref } from "vue"

const data = ref([
  {
    time: '202301',
    images: [
      {
        time: '2023-01-11',
        title: '2022年全国国土变更调查举证模块',
        angle: '北偏东',
        user: '孙宗翠',
        url: 'https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png',
      },
      {
        time: '2023-01-12',
        title: '2022年全国国土变更调查举证模块',
        angle: '北偏东',
        user: '孙宗翠',
        url: 'https://aliyuncdn.antdv.com/vue.png',
      },
      {
        time: '2023-01-14',
        title: '2022年全国国土变更调查举证模块',
        angle: '北偏东',
        user: '孙宗翠',
        url: 'https://aliyuncdn.antdv.com/logo.png',
      }
    ]
  },
  {
    time: '202302',
    images: [
      {
        time: '2023-02-11',
        title: '2022年全国国土变更调查举证模块',
        angle: '北偏东',
        user: '孙宗翠',
        url: 'https://gw.alipayobjects.com/zos/antfincdn/LlvErxo8H9/photo-1503185912284-5271ff81b9a8.webp',
      },
      {
        time: '2023-02-12',
        title: '2022年全国国土变更调查举证模块',
        angle: '北偏东',
        user: '孙宗翠',
        url: 'https://gw.alipayobjects.com/zos/antfincdn/LlvErxo8H9/photo-1503185912284-5271ff81b9a8.webp',
      },
      {
        time: '2023-02-13',
        title: '2022年全国国土变更调查举证模块',
        angle: '北偏东',
        user: '孙宗翠',
        url: 'https://gw.alipayobjects.com/zos/antfincdn/cV16ZqzMjW/photo-1473091540282-9b846e7965e3.webp',
      }
    ]
  },
])
const showData = ref(data.value[0])
const current = ref<number>(0);
const items = computed(() => {
  let result: any[] = []
  data.value.forEach(item => {
    result.push({
      title: item.time,
      description: `(${item.images.length})`
    })
  })
  return result
})
const changeTime = (value) => {
  console.log('value',value)
  showData.value = data.value[value]
}
</script>

<style lang="scss" scoped>
.showImageInfo{
  position:absolute;
  top:250px;
  width: 100%;
  height:50px;
  line-height: 25px;
  background-color: rgba(0,0,0,0.5);
  color: #fff;
  text-align: left;
}
:deep(.ant-steps-item-active) {
  .ant-steps-icon-dot{
    background: #faa !important;
  }
}
:deep(.slick-slide) {
  text-align: center;
  height: 300px;
  line-height: 160px;
  background: #364d79;
  overflow: hidden;
}

:deep(.slick-arrow.custom-slick-arrow) {
  width: 25px;
  height: 25px;
  font-size: 25px;
  color: #fff;
  background-color: rgba(31, 45, 61, 0.11);
  transition: ease all 0.3s;
  opacity: 0.3;
  z-index: 1;
  user-select: none
}
:deep(.slick-arrow.custom-slick-arrow:before) {
  display: none;
}
:deep(.slick-arrow.custom-slick-arrow:hover) {
  color: #fff;
  opacity: 0.5;
}

:deep(.slick-slide h3) {
  color: #fff;
}
</style>
