<template>
  <div class="personCard relative flex mb10 pointer">
    <div class="cxbq f14 lh50 tc absolute">已完成</div>
    <el-button color="#0072ff" size="small" class="btn_qs f14 tc absolute">签收</el-button>
    <div class="avatarBox relative">
      <div class="marks f12 absolute" :class="changeBg(props.item.yjjb)">处置</div>
      <div>
        <el-image :preview-teleported="true" style="width: 80px; height: 110px" :src="pro" :preview-src-list="[pro]"/>
      </div>
      <span class="smallbtn">全息档案</span>
    </div>
    <div class="infoBox">
      <div class="items">
        <div class="infoItem flex nowrap mb10">{{ props.item.name }} <span class="bqbox ml6">{{ props.item.yjbq }}</span></div>
        <div class="infoItem ellipsis">性别：<span class="value">{{ props.item.gender }}</span></div>
        <div class="infoItem ellipsis">籍贯：<span class="value">{{ props.item.gender }}</span></div>
        <div class="infoItem ellipsis">身份证号：<span class="value">{{ props.item.idCard }}</span></div>
        <div class="infoItem ellipsis">出生日期：<span class="value">{{ props.item.csrq }}</span></div>
        <div class="infoItem ellipsis">民族：<span class="value">{{ props.item.mz }}</span></div>
      </div>
      <div class="items">
        <div class="infoItem ellipsis">户籍地区划：<span class="value">{{ props.item.hjdqh }}</span></div>
        <div class="infoItem ellipsis">户籍地派出所：<span class="value">{{ props.item.sspcs }}</span></div>
        <div class="infoItem ellipsis">户籍地详址：<span class="value">{{ props.item.address }}</span></div>
        <div class="infoItem ellipsis">现住地区划：<span class="value">{{ props.item.xzdqh }}</span></div>
        <div class="infoItem ellipsis">现住地派出所：<span class="value">{{ props.item.xzdpcs }}</span></div>
        <div class="infoItem ellipsis">现住地详址：<span class="value">{{ props.item.xzdxz }}</span></div>
      </div>
      <div class="items">
        <div class="infoItem ellipsis">管辖单位：<span class="value">{{ props.item.gxdw }}</span></div>
        <div class="infoItem ellipsis">人员类别：<span class="value">{{ props.item.rylb }}</span></div>
        <div class="infoItem ellipsis">人员级别：<span class="value">{{ props.item.ryjb }}</span></div>
        <div class="infoItem ellipsis">列控原因：<span class="value">{{ props.item.lkyy }}</span></div>
        <div class="infoItem ellipsis">布控状态：<span class="value">{{ props.item.bkzt }}</span></div>
        <div class="infoItem ellipsis">预警等级：<span class="value">{{ props.item.yjdj }}</span></div>
        <div class="infoItem ellipsis">预警次数：<span class="value"><span class="num">{{ props.item.yjcs }}</span> 次</span></div>
      </div>
    </div>
  </div>
</template>

<script setup>
import pro from "@/assets/images/icon100.png";
import { defineProps } from "vue";
const props = defineProps({
  item: {
    type: Object,
    default: () => ({})
  },
  type: {
    type: String,
    default: ""
  }
});
// 切换背景
const changeBg = (type) => {
  switch (type) {
    case "10":
      return "marks_red";
    case "20":
      return "marks_orange";
    case "30":
      return "marks_yellow";
    case "40":
      return "marks_blue";
    default:
      return "marks_red";
  }
};
</script>

<style lang="scss" scoped>
.personCard {
  background: rgba(10, 49, 88, 0.6);
  box-shadow: inset 0px 0px 10px 0px rgba(56, 119, 242, 0.5);
  border-radius: 0px 0px 0px 0px;
  border: 1px solid #0072ff;
  padding: 10px;
  box-sizing: border-box;
  transition: all 0.3s;

  &:hover {
    background: rgba(17, 66, 96, 0.8);
  }

  .cxbq {
    right: 5px;
    top: 5px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(0, 255, 255, 0.3);
    border: 1px solid #00ffff;
    color: #00ffff;
    transform: rotate(-48deg);
  }

  .btn_qs {
    left: 94px;
    bottom: 11px;
  }
  ::v-deep .el-button{
    span{
      color: #fff;
    }
  }

  .avatarBox {
    margin-right: 5px;
    overflow: hidden;
    width: 80px;
    .marks {
      width: 70px;
      height: 32px;
      line-height: 40px;
      text-align: center;
      background: rgba(255, 62, 62, 0.75);
      top: -4px;
      left: -24px;
      transform: rotate(-45deg);
      z-index: 1;
    }

    .marks_red {
      background: rgba(255, 62, 62, 0.75);
    }

    .marks_orange {
      background: rgba(255, 155, 62, 0.75);
    }

    .marks_yellow {
      background: rgba(255, 239, 62, 0.75);
    }

    .marks_blue {
      background: rgba(0, 114, 255, 0.75);
    }
  }

  .bqbox {
    color: #ff0000;
    padding: 0px 6px;
    background: rgba(255, 0, 0, 0.3);
    border-radius: 1px 1px 1px 1px;
    border: 1px solid #ff0000;
    border-radius: 4px;
  }

  .infoBox {
    width: calc(100% - 90px);
    display: flex;
    justify-content: space-between;
    .items{
      width: 30%;
    }
    .infoItem {
        font-size: 13px;
        margin-bottom: 2px;
        color: #fff;
        .value {
          color: #89afcf;
        }
      }
  }
}

.smallbtn {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 4px;
  background: #0072ff;
  border-radius: 5px 5px 5px 5px;
  margin-top: 6px;
}
.num{
  color: #00ffff;
}
</style>