<template>
  <div class="wrapper">
    <span class="dot-left"></span>
    <div class="top display-default">
      <div class="left text ddd" :title="data.deviceName">
        {{ data.nickName }}
      </div>
      <div class="right text">
        <img src="../../assets/images/closeBtn.png" alt="" @click="close" />
      </div>
    </div>
    <div class="table-top">
      <div>
        联系人: <span v-un-content>{{ data.linkMan }}</span>
      </div>
      <div>
        联系电话：<span v-un-content>{{ data.phone }}</span>
      </div>
      <div :title="data.address" class="ddd">
        联系地址：<span v-un-content>{{ data.address }}</span>
      </div>
    </div>

    <div class="content-wrapper">
      {{ data.remarks ? data.remarks : "暂无介绍" }}
    </div>
    <div class="table-list">
      <div class="thead">
        <div class="theadtop">用户类型</div>
        <div>设备数量</div>
        <div>在线设备</div>
        <div>离线设备</div>
        <div>历史报警</div>
        <div>已处理报警</div>
        <div class="last">报警中</div>
      </div>
      <div class="tbody">
        <div class="theadtop">{{ this.userTypeName[data.userType] }}</div>
        <div>{{ data.detectorCount }}</div>
        <div>{{ data.onLineNum }}</div>
        <div>{{ data.offLineNum }}</div>
        <div>{{ data.historyAlarmNum }}</div>
        <div>{{ data.cancelAlarmNum }}</div>
        <div class="last">{{ data.processingAlarmNum }}</div>
      </div>
    </div>

    <div class="btn">
      <span @click="centerShow" >
        <el-button class="elbtn"  type="primary">感知设备</el-button>
      </span>
    </div>
  </div>
</template>

<script>
import moment from "moment";
//line移入时的的infowindow
export default {
  props: {
    obj: { typs: Object },
    title: "",
    data: {},
    map: null,
  },
  data() {
    return {
      userTypeName: ['',"家用报警器", "商用报警器", "工业报警器"],
    };
  },
  mounted() {
    console.log(this.data);
  },
  methods: {
    moment,
    close() {
      this.map.clearInfoWindow();
      this.data.class.view.domAllShow();
    },
    centerShow() {
      this.data.class.view.getDetectorInfoList({ userId: this.data.userId });
    },
  },
};
</script>

<style lang="scss" scoped>
.wrapper {
  width: 750px;
  max-height: 430px;
  // background: #fff;
  border-radius: 4px;
  background: rgba(7, 29, 51, 0.9);
  box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.16);
  color: #fff;
  // overflow: hidden;
  .top {
    width: 100%;
    height: 51px;
    background-color: #053b6a;
    background-image: url(../../assets/images/blueTopBg.png);
    background-size: 100% 100%;
    background-position: center;
    &:before {
      content: "";
      position: absolute;
      left: -20px;
      top: 5px;
      z-index: -1;
      width: 33px;
      height: 33px;
      background-image: url(../../assets/images/blueLeftTriangle.png);
    }
    .text {
      font-weight: 600;
      font-size: 16px;
      color: #ffffff;
      line-height: 51px;
    }
    .left {
      padding-left: 22px;
    }
    .right {
      padding-right: 22px;
      img {
        cursor: pointer;
      }
    }
  }
  .table-top {
    display: flex;
    justify-content: space-between;
    & > div {
      width: 33%;
      text-align: center;
    }
  }
  .content-wrapper {
    padding: 10px 5px 10px 10px;
  }
  .table-list {
    padding-left: 3px;
    padding-right: 3px;
    .thead {
      display: flex;
      justify-content: space-between;
      & > div {
        box-sizing: border-box;
        border-top: 1px solid #fff;
        border-right: 1px solid #fff;
        border-bottom: 1px solid #fff;
        padding-left: 5px;
        padding-top: 3px;
        padding-bottom: 3px;
        font-size: 14px;
        width: 100px;
        &.theadtop {
          width: 150px;
          border-left: 1px solid #fff;
        }
      }
    }
    .tbody {
      display: flex;
      justify-content: space-between;
      & > div {
        box-sizing: border-box;
        border-right: 1px solid #fff;
        border-bottom: 1px solid #fff;
        padding-left: 5px;
        padding-top: 3px;
        padding-bottom: 3px;
        font-size: 14px;
        width: 100px;
        &.theadtop {
          width: 150px;
          border-left: 1px solid #fff;
        }
      }
    }
  }
}
.btn {
  text-align: right;
  padding-top: 10px;
  padding-right: 5px;
  padding-bottom: 10px;

  .elbtn {
    background-color: #053b6a;
    box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.16);
    width: 95px;
    height: 33px;

    // border: none;
  }
}

.display-default {
  display: flex;
  justify-content: space-between;
}
</style>
