<template>
  <div class="yjItm" :class="props.isDetail?'':'yjItmline'">
    <div class="time" v-if="!props.isDetail">{{ props.data.yjSj }}</div>
    <div class="card">
      <div class="card-cnt">
        <div class="leftImg">
          <el-image
            style="width: 100%"
            :src="props.data.yjTp"
            :preview-src-list="[props.data.yjTp,props.data.yjXtp]"
            :hide-on-click-modal="true"
            close-on-press-escape
            fit="cover"
            lazy
          >
            <template #error>
              <div class="image-slot">
                <el-image
                  v-if="props.data.yjLx == 1"
                  :src="people"
                  :preview-src-list="[people,props.data.yjXtp]"
                  fit="cover"
                ></el-image>
                <el-image v-else :src="car" :preview-src-list="[car,props.data.yjXtp]" fit="cover"></el-image>
              </div>
            </template>
          </el-image>
        </div>
        <div class="rightInfo"  @click="getDetaill(props.data)">
          <div class="title">
            <span>
              <span class="xinxi">{{ props.data.yjRyxm }}</span>
              <span class="xinxi" v-if="props.data.yjRysfzh">{{ IdCard(props.data.yjRysfzh,2) }}</span>
            </span>
            <span class="status">{{ props.data.yjbq }}</span>
          </div>
          <div>
            <span class="zjhm" v-if="props.data.yjRysfzh">{{ IdCard(props.data.yjRysfzh,3) }} 岁</span>
            <span class="zjhm">{{ props.data.yjRysfzh }}</span>
          </div>
          <div class="text textflex" v-if="!props.isDetail">
            <span>车牌号码：<span class="info">{{ props.data.yjClcph }}</span></span >
            <span>车牌类型：<span class="info">{{ props.data.yjHplx }}</span></span>
          </div>
          <div class="text">
            抓拍时间：<span class="info">{{ props.data.yjFssj }}</span>
          </div>
          <div class="text">
            抓拍地点：<span class="info">{{ props.data.yjGzymc }}</span>
          </div>
          <div class="text">
            预警时间：<span class="info">{{ props.data.yjSj }}</span>
          </div>
          <div style="color:yellow ;" v-if="props.isDetail">
            研判结果：<span class="info">相似度{{ props.data.xsd }}%</span>
          </div>
        </div>
      </div>
      <!-- <div class="phtos">
        <el-carousel indicator-position="outside" :autoplay="isAutoplay">
          <el-carousel-item v-for="v in 1" :key="v">
            <div v-for="it in 4" :key="it" class="imgList">
              <img :src="people" alt="" />
            </div>
          </el-carousel-item>
        </el-carousel>
      </div> -->
      <div class="address">
        <img
          class="addImg"
          src="@/assets/images/situationPresentation/dingwei.png"
        />
        <span>{{ props.data.yjDz }}</span>
      </div>
    </div>
  </div>
</template>

<script setup>
import { IdCard } from '@/utils/validate.js'
import people from "@/assets/images/peo.png";
import car from "@/assets/images/car.png";
import { reactive, ref, defineProps ,defineEmits} from "vue";
const emit = defineEmits(['lookDetail'])
const isAutoplay = ref(false);
const props = defineProps({
  data: Object,
  isDetail:Boolean
});
// 查看详情
function getDetaill(item){
  emit('lookDetail',item)
}
</script>

<style lang="scss" scoped>
.yjItm {
  position: relative;
  padding: 0 10px 10px 14px;
  box-sizing: border-box;
  .time {
    margin-bottom: 10px;
    padding-left: 10px;
  }
  .card {
    padding: 10px 10px 4px 10px;
    box-sizing: border-box;
    border-top: 2px solid #00bfff;
    line-height: 20px;
    font-size: 14px;
    background: #052955;
    .card-cnt {
      display: flex;
      .leftImg {
        width: 60px;
        margin-right: 10px;
        .el-image{
          width: 100%;
          max-height: 90px;
        }
      }
      .rightInfo {
        flex: 1;
        .title {
          width: 100%;
          .xinxi {
            color: #01e9ed;
            margin-right: 10px;
          }
          .status {
            padding: 1px 6px;
            border-radius: 4px;
            background: #ab0f0a;
          }
        }
        .zjhm {
          color: #25c9ff;
          margin-right: 10px;
        }
        .textflex {
          display: flex;
          justify-content: space-between;
        }
        .text {
          font-size: 12px;
          color: #6585af;
          .info {
            color: #fff;
          }
        }
        .newinfo {
          color: yellow;
        }
      }
    }
    .address {
      justify-content: space-between;
      margin-top: 4px;
      padding-top: 6px;
      box-sizing: border-box;
      border-top: 1px solid #3b3737;
      .addImg {
        margin-right: 4px;
        vertical-align: text-top;
      }
    }
    .phtos {
      height: 110px;
      padding-top: 10px;
      box-sizing: border-box;
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      justify-content: center;
      width: 100%;
      border-top: 1px dashed #3d3d3d;
      margin-top: 6px;
      box-sizing: border-box;
      ::v-deep .el-carousel {
        width: 100%;
        height: 100%;
        .el-carousel__container {
          height: 72%;
        }
        .el-carousel__item {
          height: 100%;
          display: flex;
          justify-content: space-between;
        }
      }
      img {
        width: 60px;
        height: 70px;
      }
    }
  }
  .time::before {
    position: absolute;
    content: "";
    width: 26px;
    height: 26px;
    background: url("~@/assets/my/icon.png") no-repeat;
    top: -7px;
    left: -14px;
    z-index: 22;
  }
}
.yjItmline{
  border-left: 1px solid rgb(151, 147, 147);
  margin-left: 10px;
}
</style>