<template>
  <div class="wrapper">
    <div class="top display-default">
      <div class="left text">{{ obj.pipeName }}</div>
      <div v-if="!obj.editorPage" class="right text">
        <img src="../../assets/images/closeBtn.png" alt="" />
      </div>
    </div>
    <!-- 设备信息 -->
    <div class="eq-content display-default">
      <div class="text-wrapper">
        <div :title="obj.pipeName" class="eq-text">
          <span>管道名称：</span>
          <span>{{ obj.pipeName }}</span>
        </div>
        <div class="eq-text">
          <span>管道编号：</span>
          <span>{{ obj.pipeCode }}</span>
        </div>
        <div class="eq-text">
          <span>管道长度：</span>
          <span>{{ `${obj.pipeLength ?obj.pipeLength+'米':""}` }}</span>
        </div>
        <div class="eq-text">
          <span>管道类型：</span>
          <span>{{ ["地埋管线", "地表管线"][obj.pipeType] }}</span>
        </div>
        <div class="eq-text">
          <span>管道压力：</span>
          <span>{{
            ["低押", "中压", "次高压", "高压"][obj.pipePressure]
          }}</span>
        </div>
      </div>

      <div class="pic">
        <img :src="obj.url" alt="" />
      </div>
    </div>

    <div class="maintain-content">
      <div>
        安装日期：<span>{{ obj.installationTime }}</span>
      </div>
      <div>
        最后巡检日期：<span>{{ obj.inspectionTime }}</span>
      </div>
      <div>
        备注信息；<span>{{ obj.remarks }}</span>
      </div>
    </div>
    <template v-if="!obj.editorPage">
      <div class="warn-content">
        <div>报警状态 <span>报警</span></div>
        <div>详细信息：<span>管线两端设备压差较大，管线可能泄漏</span></div>
      </div>
      <div class="btn">
        <el-button class="elbtn" type="primary">生成工单</el-button>
      </div>
    </template>
    <!-- 报警状态 -->
  </div>
</template>

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

<style lang="scss" scoped>
.wrapper {
  width: 406px;
  // height: 488px;
  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;
    }
  }

  .eq-content {
    min-height: 156px;
    box-sizing: border-box;
    padding: 13px 16px 13px 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 {
          display: inline-block;
          white-space: nowrap;
          text-overflow: ellipsis;
          overflow: hidden;
          word-break: break-all;
          max-width: 100px;
        }
      }
    }
    .pic {
      width: 177px;
      height: 129px;
      background-color: black;
      img {
        width: 100%;
      }
    }
  }

  .maintain-content {
    width: 100%;
    height: 109px;
    padding-left: 22px;
    padding-top: 16px;
    box-sizing: border-box;
    border-bottom: 1px solid #e2e2e2;
    & > div {
      margin-bottom: 8px;
      font-size: 14px;
      font-weight: 400;
    }
  }

  .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;
    }
  }
}

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