<!--
 * @Author: your name
 * @Date: 2022-01-27 14:25:45
 * @LastEditTime: 2024-07-25 17:13:31
 * @LastEditors: 纪泽龙 jizelong@qq.com
 * @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">{{ companyType[deviceData.companyType] }}</div>
    <div class="close" @click="close">
      <!-- <img src="@/assets/mapImages/closeBtn.png" alt="" /> -->
      <i class="el-icon-close" style="font-size: 20px; color: #49d8ff"></i>
    </div>
    <div class="line"></div>

    <div class="group flex first">
      <div class="first once left">管道名称：</div>
      <div class="right pipeAddr right zzz">{{ deviceData.pipeName }}</div>
    </div>

    <div class="group flex">
      <div class="left first">管道长度：</div>
      <div class="right zzz">{{ deviceData.pipeLength }}米</div>
      <div class="left">管径：</div>
      <div class="right last">{{ deviceData.pipeDiameter }}</div>
    </div>

    <!-- <div class="group flex">

    </div> -->

    <div class="group flex">
      <div class="left first">管道压力：</div>
      <div :title="deviceData.pipePressure" class="right zzz">
        {{ pipePressure[deviceData.pipePressure] }}
      </div>
      <div class="left">所属公司：</div>
      <div class="right last">{{ companyType[deviceData.companyType] }}</div>
    </div>

    <div class="group flex">
      <div class="first left">管道材质：</div>
      <div class="right">{{ deviceData.pipeMaterial }}</div>
      <div class="left">管道埋深：</div>
      <div class="right last">{{ deviceData.pipeDepth }}米</div>
    </div>

    <div class="group flex">
      <div class="left first">管道走向：</div>
      <div class="right zzz" :title="deviceData.pipeTrend">
        {{ deviceData.pipeTrend }}
      </div>
      <div class="left">权属单位：</div>
      <div :title="deviceData.powerCompany" class="right last zzz">
        {{ deviceData.powerCompany }}
      </div>
    </div>
    <div class="group flex">
      <div class="first left">建设年代：</div>
      <div class="right">{{ deviceData.buildyear }}</div>
      <div class="left">建设单位：</div>
      <div class="last right zzz" :title="deviceData.buildCompany">
        {{ deviceData.buildCompany }}
      </div>
    </div>

    <div class="group flex">
      <div class="first once left">管道位置：</div>
      <div
        v-unValue
        :title="deviceData.pipeAddr"
        class="last pipeAddr right zzz"
      >
        {{ deviceData.pipeAddr }}
      </div>
    </div>
  </div>
</template>

<script>
import { companyType, pipePressure } from "@/utils/mapClass/config.js";
export default {
  data() {
    return {
      companyType,
      pipePressure,
    };
  },
  computed: {
    prodTest() {
      return this.vueRoot.$store.state.user.systemSetting.prod_test;
    },
    company() {
      return this.vueRoot.$store.state.bigWindowCompany.company;
    },
  },
  mounted() {
    // 如果不是测试，而是真数据，就要用帧数据的东西
    if (this.prodTest != "test") {
      this.companyType = {};
      this.company.forEach((item) => {
        this.companyType[item.conpanyId] = item.companyName;
      });
    }
  },
  methods: {
    close() {
      this.mapClass.infowindowClose();
    },
  },
};
</script>

<style lang="scss" scoped>
.user-wrapper {
  // box-shadow: 0px 0px 10px #54e0ef inset;
  // background-color: #071738;
  background: rgba(2, 26, 51, 0.9);
  border: 1px solid #127bd1;
  box-shadow: inset 0px 0px 10px 0px #164db2;
  padding: 10px;
  position: relative;
  width: 500px;
  border-radius: 7px;
  .title {
    padding-left: 5px;
    font-size: 14px;
    line-height: 14px;
    color: #ffffff;
  }
  .line {
    width: 50%;
    height: 2px;

    margin-top: 10px;
    background: linear-gradient(
      90deg,
      rgba(29, 33, 41, 0) 0%,
      #568ef6 38%,
      #19d1ed 49%,
      rgba(29, 33, 41, 0) 109%
    );
    // border: 2px solid;
  }
  .close {
    position: absolute;
    right: 10px;
    top: 5px;
    cursor: pointer;
  }
  .group {
    border-top: none;
    height: 28px;
    font-size: 14px;
    line-height: 28px;
    color: #ffffff;
    &.first {
      margin-top: 10px;
    }
    div {
      flex: 1;
    }
    .left {
      text-align: right;
    }
    .right {
      box-sizing: border-box;
      text-align: left;
      padding: 0 1em;
    }
    .last {
      border: none;
    }
    .once {
      flex: 1;
    }
    .pipeAddr {
      flex: 3;
      padding: 0 3em 0 1em;
    }
  }
  .flex {
    display: flex;
    justify-content: space-between;
  }
}
</style>
