<template>
  <div class="siteModelBox">
    <h2>
      站点信息
      <img
        class="close"
        src="../../../../assets/images/close.png"
        alt=""
        @click="sendMsg"
      />
    </h2>
    <img
      src="../../../../assets/images/site-img.png"
      alt=""
      style="width: 100%; height: 1.2rem"
    />
    <div class="siteDetailInfo">
      <div class="infoLine">
        <span>站点名称：</span>
        <p>{{ siteName }}</p>
      </div>
      <div class="infoLine">
        <span>站点地址：</span>
        <p>{{ siteAddress }}</p>
      </div>
      <div class="infoLine">
        <span>投运时间：</span>
        <p>{{ createTime }}</p>
      </div>
      <div class="infoLine">
        <span>监控类型：</span>
        <p>{{ deviceType }}</p>
      </div>
      <div class="infoLine">
        <span>联系人：</span>
        <p>{{ userName }}</p>
      </div>
      <div class="infoLine">
        <span>联系电话：</span>
        <p>{{ phone }}</p>
      </div>
    </div>
  </div>
</template>
<script>
import api from "../../../../api/Overview/index";
import { ElMessage } from "element-plus";
export default {
  props: ["fshow"],
  data() {
    return {
      //   localShow: this.fshow,
      userName: "", //联系人
      phone: "", //联系电话
      siteName: "", //站点名称
      siteAddress: "", //站点地址
      createTime: "", //投运时间
      deviceType: "", //监控类型
    };
  },

  mounted() {
    api.siteOne({ siteId: this.$store.state.siteId }).then((requset) => {
      if (requset.status === "SUCCESS") {
        // console.log(requset);
        var data = requset.data;
        this.userName = data.userName;
        this.phone = data.phone;
        this.siteName = data.siteName;
        this.siteAddress = data.siteAddress;
        this.createTime = data.createTime;
        data.deviceType.map((val) => {
          return (this.deviceType += val);
        });
      } else {
        ElMessage.success({
          message: requset.msg,
          type: "success",
        });
      }
    });
  },
  methods: {
    sendMsg() {
      //   this.localShow = false;
      //   this.$emit("func", this.localShow);
      this.fShow = false;
      this.$emit("func", this.fShow);
    },
  },
};
</script>

<style scoped lang="scss">
</style>