<template>
  <div class="zlItm" :class="!isDetail ? 'zlItmLine' : ''">
    <div class="time" v-if="!isDetail">{{ props.data.zlfqsj }}</div>
    <div class="card">
      <div class="card-cnt">
        <div class="leftImg">
          <el-image style="width: 100%" :src="props.data.zltp" :preview-src-list="[props.data.zltp]"
            :hide-on-click-modal="true" close-on-press-escape fit="cover" lazy>
            <template #error>
              <div class="image-slot">
                <el-image :src="people" 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.zlfqr }}</span>
              <span class="xinxi" v-if="props.data.zlfqrSfzh">{{
                IdCard(props.data.zlfqrSfzh, 2)
              }}</span>
            </span>
            <span class="status">{{ handelZt(props.data.zlzxzt) }}</span>
          </div>
          <div>
            <!-- <span class="zjhm">{{ IdCard(props.data.zlfqrSfzh, 3) }}岁</span>
            <span class="zjhm">{{ props.data.zlfqrSfzh }}</span> -->
          </div>
          <div class="text text_detail">
            内容：
            <el-tooltip :placement="isDetail ? 'right' : 'left'">
              <template #content>
                <div style="max-width:400px;">{{ props.data.zlnr }}</div>
              </template>
              {{ props.data.zlnr }}
            </el-tooltip>
          </div>
          <div class="newinfo">
            <div class="text_detail"> 最新动态：
              <el-tooltip :placement="isDetail ? 'right' : 'left'">
                <template #content>
                  <div style="max-width:400px;">{{ props.data.zlzxqk }}</div>
                </template>
                {{ props.data.zlzxqk }}
              </el-tooltip>
            </div>
          </div>
        </div>
      </div>
      <div class="address">
        <img class="addImg" src="@/assets/images/situationPresentation/dingwei.png" />
        <span>{{ props.data.zlfsdd }}</span>
      </div>
    </div>
  </div>
</template>

<script setup>
import { IdCard } from "@/utils/validate.js";
import people from "@/assets/images/peo.png";
import { reactive, ref, defineProps, defineEmits, onMounted } from "vue";
const emit = defineEmits(["lookDetail"]);
const props = defineProps({
  data: Object,
  dic: Object,
  isDetail: Boolean
});
// 获取指令状态
function handelZt(val) {
  let obj = props.dic.zlzt.find((item) => {
    return item.value == val;
  });
  return obj ? obj.label : "";
}
// 查看详情
function getDetaill(item) {
  emit("lookDetail", item);
}
</script>

<style lang="scss" scoped>
.zlItm {
  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 {
          display: flex;
          justify-content: space-between;
          width: 100%;

          .xinxi {
            color: #01e9ed;
            margin-right: 10px;
          }

          .status {
            padding: 1px 6px;
            border: 1px solid #347fe9;
            border-radius: 4px;
            color: #25c9ff;
          }
        }

        .zjhm {
          color: #25c9ff;
          margin-right: 10px;
          font-size: 13px;
        }

        .text {
          font-size: 13px;
          color: #6585af;
          line-height: 22px;

          span {
            color: #0093ed;
          }
        }

        .newinfo {
          font-size: 13px;
          line-height: 22px;
          color: yellow;
        }
      }
    }

    .address {
      justify-content: space-between;
      margin-top: 4px;
      padding-top: 6px;
      box-sizing: border-box;
      border-top: 1px solid #3b3737;
      color: #6486ae;

      .addImg {
        margin-right: 4px;
        vertical-align: text-top;
      }
    }
  }

  .time::before {
    position: absolute;
    content: "";
    width: 26px;
    height: 26px;
    background: url("~@/assets/my/icon.png") no-repeat;
    top: -7px;
    left: -14px;
    z-index: 22;
  }
}

.zlItmLine {
  border-left: 1px solid rgb(151, 147, 147);
  margin-left: 10px;
}

.ss-content:hover {
  .toolTips::after {
    @include ShowToolTips;
  }
}

.newinfo:hover {
  .toolTips::after {
    @include ShowToolTips;
  }
}

// </style>