<template>
  <div class="infoBox">
    <div class="infoBox-head">
      <div class="item">
        {{ value.deviceId }}
      </div>
      <div class="item" style="cursor: pointer" @click="emit('close')">
        <svg t="1744273365398" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="8493" width="24" height="24">
          <path
            d="M576 512l277.333333 277.333333-64 64-277.333333-277.333333L234.666667 853.333333 170.666667 789.333333l277.333333-277.333333L170.666667 234.666667 234.666667 170.666667l277.333333 277.333333L789.333333 170.666667 853.333333 234.666667 576 512z"
            fill="#444444"
            p-id="8494"
          ></path>
        </svg>
        <!-- <i class="el-icon-close" style="font-size: 24px; cursor: pointer" @click="emit('close')" /> -->
      </div>
    </div>
    <div class="infoBox-content">
      <div class="item">
        <div class="item-left">定位时间</div>
        <div class="item-right">{{ value.locationTime }}</div>
      </div>
      <div class="item">
        <div class="item-left">位置</div>
        <div class="item-right">{{ value.address }}</div>
      </div>
    </div>
    <div class="triangle"></div>
  </div>
</template>

<script lang="ts" setup>
defineProps({
  value: {
    type: Object,
    default: () => ({}),
  },
});

const emit = defineEmits(["close"]);

enum locateEnum {
  "WIFI" = 0,
  "LBS",
  "GPS",
  "未知",
}
</script>

<style lang="less" scoped>
.infoBox {
  width: 400px;
  background: #fff;
  margin: 10px;
  padding: 10px;
  border-radius: 8px;
  position: relative;

  .triangle {
    width: 0;
    height: 0;
    border-top: 20px solid #fff;
    border-left: 15px solid transparent;
    border-right: 15px solid transparent;
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
  }

  .infoBox-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #eef1f3;
    padding-bottom: 10px;

    .item {
      display: flex;
      align-items: center;
      font-size: 16px;
      color: #333;
      font-weight: 400;
      flex-shrink: 0;
      font-weight: 700;
      .battery {
        width: 34px;
        height: 16px;
        display: flex;
        justify-content: flex-start;
        align-items: center;
        margin-right: 10px;

        .battery-left {
          height: 100%;
          flex: 1;
          border-radius: 1px;
          display: flex;
          align-items: center;
          padding: 1px;
          font-size: 10px;
          border-style: solid;
          border-width: 2px;
        }

        .battery-right {
          border-width: 2px;
          border-style: solid;
          height: 50%;
          background: red;
        }
      }
    }
  }

  .infoBox-content {
    border-bottom: 1px solid #eef1f3;
    padding-bottom: 10px;

    .item {
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-top: 10px;
      font-size: 14px;
      font-weight: 500;
      color: #333;

      .item-left {
        flex-shrink: 0;
        margin-right: 50px;
      }

      .item-right {
        flex: 1;
        text-align: right;
      }
    }
  }

  .infoBox-foot {
    display: flex;
    justify-content: space-around;

    .item {
      margin-top: 10px;
      font-size: 12px;
      font-weight: 300;
      color: #0091ff;
      cursor: pointer;
      text-align: center;

      i {
        font-size: 18px;
        margin-bottom: 5px;
      }
    }
  }
}
</style>
