<template>
  <a-descriptions bordered :column="2" size="small" :labelStyle="labelStyle">
    <a-descriptions-item label="办理人">{{
      caseHandleInfo.info.transactor_name
    }}</a-descriptions-item>
    <a-descriptions-item label="办理时间">
      {{ caseHandleInfo.info.transact_time }}
    </a-descriptions-item>
    <a-descriptions-item label="拟拆除后照片">
      <div>
        <ImagePreview :imageList="imgList" />
      </div>
    </a-descriptions-item>
    <a-descriptions-item label="视频">
      <div v-if="videoOptions.length > 0">
        <video-player
          class="video-player vjs-custom-skin"
          v-for="(item, index) in videoOptions"
          :key="index"
          ref="videoPlayer"
          :playsinline="true"
          :options="item"
          style="width: 200px"
        ></video-player>
      </div>
    </a-descriptions-item>
  </a-descriptions>
</template>
<script lang="ts" setup>
  import { reactive, watch, ref } from 'vue';
  import { ImagePreview } from '@/components/Preview';
  import { caseHandleInfoObj } from '../model';
  const labelStyle = ref({
    width: '100px',
  });
  const caseHandleInfo = ref<caseHandleInfoObj>({
    info: {},
  });
  const videoOptions: any = ref([]);
  const threadAfterImageList: any = ref([]);
  const props = defineProps({
    data: {
      type: Object,
      default: () => {
        return {};
      },
    },
    videoOptions: {
      type: Object,
      default: () => {
        return {};
      },
    },
    threadAfterImageList: {
      type: Object,
      default: () => {
        return {};
      },
    },
  });
  caseHandleInfo.value = props.data;
  videoOptions.value = props.videoOptions;
  threadAfterImageList.value = props.threadImageList;
  const imgList = ref([
    'https://picsum.photos/id/66/346/216',
    'https://picsum.photos/id/67/346/216',
    'https://picsum.photos/id/68/346/216',
  ]);

 
  watch(
    () => props.data,
    (newVal, oldVal) => {
      caseHandleInfo.value = newVal;
      videoOptions.value = props.videoOptions;
      threadImageList.value = props.threadImageList;
    },
  );
</script>
<style lang="less" scoped>
  ::v-deep .ant-image .ant-image-img {
    width: 85px;
    margin-bottom: 10px;
  }
</style>
