<!--
 * @Author: your name
 * @Date: 2022-01-27 14:25:45
 * @LastEditTime: 2022-02-17 10:12:02
 * @LastEditors: Please set LastEditors
 * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 * @FilePath: /hello-world/src/views/components/User.vue
-->
<template>
  <div class="user-wrapper">
    <div class="title">{{ deviceData.usrName }}</div>
    <div class="close" @click="close">
      <img src="@/assets/mapImages/closeBtn.png" alt="" />
    </div>

    <div class="group flex first">
      <div class="left">用户姓名：</div>
      <div :title="deviceData.usrName" class="right zzz">{{ deviceData.usrName }}</div>
    </div>

    <div class="group flex">
      <div class="left">联系方式：</div>
      <div class="right">{{ deviceData.phone }}</div>
    </div>

    <div class="group flex">
      <div class="left">用户地址：</div>
      <div :title="deviceData.address" class="right zzz">
        {{ deviceData.address }}
      </div>
    </div>

    <div class="group flex">
      <div class="left">所属公司：</div>
      <div class="right">{{ companyType[deviceData.companyType] }}</div>
    </div>
  </div>
</template>

<script>
import { companyType } from "@/utils/mapClass/config.js";

export default {
  data() {
    return {
      companyType,
    };
  },
  methods: {
    close() {
      this.mapClass.infowindowClose();
    },
  },
};
</script>

<style lang="scss" scoped>
.user-wrapper {
  background-color: rgba(9, 18, 32, 0.6);
  padding: 10px;
  position: relative;
  width: 300px;
  .title {
    font-size: 14px;
    line-height: 14px;
    color: #ffffff;
  }
  .close {
    position: absolute;
    right: 10px;
    top: 5px;
    cursor: pointer;
  }
  .group {
    border: 1px solid #cccccc;
    border-top:none;
    height: 28px;
    font-size: 14px;
    line-height: 28px;
    color: #ffffff;
    &.first {
      border-top:1px solid #cccccc;
      margin-top: 10px;
    }
    div {
      flex: 1;
      
    }
    .left {
      border-right: 1px solid #cccccc;
      background-color: rgba(255, 255, 255, 0.1);
      text-align: right;
    }
    .right {
      box-sizing: border-box;
      text-align: left;
      padding:0 1em;
    }
  }
  .flex {
    display: flex;
    justify-content: space-between;
  }
}
</style>