<template>
  <div class="infoWin">
    <div class="header-new"><img class="header-img" src="@/assets/images/mapSearch/电子围栏.png" alt="" />{{ info.name }}</div>
    <div class="content-new">
      <div class="content-new-label">生效时间：</div>
      <div class="content-new-value">{{ info.beginTime }}-{{ info.endTime }}</div>
    </div>
    <div class="content-new">
      <div class="content-new-label">围栏类型：</div>
      <div class="content-new-value">{{ info.ruleTypeText }}</div>
    </div>
    <div class="content-new">
      <div class="content-new-label">驻勤人员：</div>
      <div class="content-new-value active" @click="clickStationEmployees(info, 'rail')">
        {{ info.countOfSecurityMan }}
      </div>
    </div>
    <div class="content-new">
      <div class="content-new-label">所属单位：</div>
      <el-tooltip effect="dark" :content="info.companyName" placement="top">
        <div class="content-new-value active" @click="clickCompany(info, 'rail')">{{ info.companyName }}</div>
      </el-tooltip>
    </div>
    <div class="content-new">
      <div class="content-new-label">所属驻勤点：</div>
      <div class="content-new-value">{{ info.stationName }}</div>
    </div>

    <div class="content-new">
      <div class="content-new-label">创建人员：</div>
      <div class="content-new-value">{{ info.principalName || info.creator }}</div>
    </div>
  </div>
</template>

<script>
export default {
  name: "OverlayRail",
  props: {
    info: {
      type: Object,
    },
    returnWin: {
      type: Object,
    },
  },
  data() {
    return {
      typeList: [
        {
          id: "Exit",
          name: "离开告警",
        },
        {
          id: "Enter",
          name: "进入告警",
        },
        // {
        //   id: "Access",
        //   name: "进出告警",
        // },
      ],
    };
  },
  methods: {
    /* @点击驻勤人数
     */
    clickStationEmployees(info, infoType) {
      info["longitude"] = info.locationValue.geos[0].lon;
      info["latitude"] = info.locationValue.geos[0].lat;
      this.$bus.$emit("click-stationEmployees", { info, infoType });
    },
    /**
     * @跳转公司
     */
    clickCompany(info, infoType) {
      this.$bus.$emit("click-company", { info, infoType }); // 对应父组件 resource/index.vue eventBusBinding 方法中 this.$bus.$on("click-company", this.showCompanyInfo)
    },
  },
};
</script>

<style scoped></style>
