<template>
  <div class="wrapper">
    <span class="dot-left"></span>
    <div class="top display-default">
      <div class="left text">{{data.deviceName}}</div>
      <div class="right text">
        <img src="../../assets/images/closeBtn.png" alt="" @click="map.clearInfoWindow()"/>
      </div>
    </div>
    <!-- 设备信息 -->
    <div class="content">
      <div class="eq-content display-default">
        <div class="text-wrapper">
          <div class="eq-text">设备类型：<span>{{title}}</span></div>
          <div class="eq-text">设备型号：<span>{{data.deviceModel}}</span></div>
          <div class="eq-text">所属管道：<span>{{data.pipeCode}}</span></div>
          <div class="eq-text">物联网编号：<span>{{data.iotNo}}</span></div>
        </div>
        <div class="pic">
          <img v-bind:src="data.iconUrl" alt="" />
        </div>
      </div>
      <!-- 维修人员 -->
      <div class="maintain-content">
        <div>管道所在地址：<span>{{data.deviceAddr}}</span></div>
        <div>安装日期：<span>{{data.installationTime}}</span></div>
        <div>最后巡检日期：<span></span></div>
        <div>备注信息：<span>{{data.remarks}}</span></div>
      </div>
      <!-- 报警状态 -->
      <!--<div class="warn-content">
        <div>报警状态 <span>报警</span></div>
        <div>详细信息：<span>管线两端设备压差较大，管线可能泄漏</span></div>
      </div>-->
    </div>

  </div>
</template>

<script>
//line移入时的的infowindow
export default {
  props: {
    obj: { typs: Object },
    title: "",
    data: {},
    map: null
  }
};
</script>

<style lang="scss" scoped>
.wrapper {
  width: 406px;
  background: #fff;
  border-radius: 4px;
  box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.16);
  overflow: hidden;
  .top {
    width: 100%;
    height: 51px;
    background-color: #053B6A;
    .text {
      font-weight: 600;
      font-size: 16px;
      color: #ffffff;
      line-height: 51px;
    }
    .left {
      padding-left: 22px;
    }
    .right {
      padding-right: 16px;
      cursor: pointer;
    }
  }

  .eq-content {
    height: 156px;
    box-sizing: border-box;
    padding: 13px 16px 13px 22px;
    .text-wrapper {
      padding-top: 1px;
      & > div {
        margin-bottom: 6px;
      }
      .eq-text {
        font-size: 14px;
        font-weight: 400;
        color: #1d1d1d;
        opacity: 1;
      }
    }
    .pic {
      width: 177px;
      height: 129px;
      background-color: black;
      img {
        width: 100%;
        height: 100%;
      }
    }
  }

  .maintain-content {
    width: 100%;
    height: 130px;
    padding-left: 22px;
    padding-top: 16px;
    box-sizing: border-box;
    & > div {
      margin-bottom: 8px;
      font-size: 14px;
      font-weight: 400;
      span {
        vertical-align: top;
        display: inline-block;
        word-break: break-all;
        max-width: 250px;
      }
    }
  }

  .warn-content {
    height: 82px;
    box-sizing: border-box;
    padding: 8px 0 0 22px;
    border-bottom: 1px solid #e2e2e2;
    & > div {
      font-size: 14px;
      font-weight: 400;
      margin-bottom: 8px;
    }
  }
  .btn {
    padding-top: 32px;
    text-align: center;
    .elbtn {
      background-color: #053b6a;
      box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.16);
      width: 95px;
      height: 33px;
    }
  }
}
.display-default {
  display: flex;
  justify-content: space-between;
}
.dot-top {
  font-size: 0;
  line-height: 0;
  border-width: 10px;
  border-color: #053B6A;
  border-top-width: 0;
  border-style: dashed;
  border-bottom-style: solid;
  border-left-color: transparent;
  border-right-color: transparent;
}
/* 向右的箭头 */
.dot-right {
  font-size: 0;
  line-height: 0;
  border-width: 10px;
  border-color: #053B6A;
  border-right-width: 0;
  border-style: dashed;
  border-left-style: solid;
  border-top-color: transparent;
  border-bottom-color: transparent;
}
/* 向下的箭头 */
.dot-bottom {
  font-size: 0;
  line-height: 0;
  border-width: 10px;
  border-color: #053B6A;
  border-bottom-width: 0;
  border-style: dashed;
  border-top-style: solid;
  border-left-color: transparent;
  border-right-color: transparent;
}
/* 向左的箭头 */
.dot-left {
  position: absolute;
  left: -12px;
  top: 8px;
  font-size: 0;
  line-height: 0;
  border-width: 13px;
  border-color: #053B6A;
  border-left-width: 0;
  border-style: dashed;
  border-right-style: solid;
  border-top-color: transparent;
  border-bottom-color: transparent;
}


.content {
  max-height: 480px;
  overflow: hidden;
  overflow-y: auto;
  .eq-content {
    min-height: 156px;
    box-sizing: border-box;
    padding: 13px 22px 0px 22px;
    // border-bottom: 1px solid #e2e2e2;
    .text-wrapper {
      padding-top: 1px;
      & > div {
        margin-bottom: 6px;
      }
      .eq-text {
        font-size: 14px;
        font-weight: 400;
        color: #1d1d1d;
        opacity: 1;
        & > span {
          vertical-align: top;
          display: inline-block;
          // white-space: nowrap;
          // text-overflow: ellipsis;
          // overflow: hidden;
          word-break: break-all;
          max-width: 88px;
        }
      }
    }
    .pic {
      width: 177px;
      height: 129px;
      // background-color: black;
      img {
        width: 100%;
        height: 100%;
      }
    }
  }
}

</style>
