<template>
  <div class="infoWin">
    <div class="header-new"><img class="header-img" src="@/assets/images/mapSearch/考场点-2.png" alt="" />{{ info.name }}</div>

    <div v-if="returnWin?.infoType === 'exam'" class="back" @click="onClickExam(returnWin.info)">&lt; 返回考场信息</div>

    <div class="content-new">
      <div class="content-new-label">所属地区：</div>
      <div class="content-new-value">{{ info.region }}</div>
    </div>
    <div class="content-new">
      <div class="content-new-label">所属培训单位：</div>
      <div class="content-new-value">
        <el-tooltip effect="dark" :content="info.companyName" placement="top">
          <div class="content-new-value active" @click="clickCompany(info, 'exam')">
            {{ info.companyNameSlice }}
          </div>
        </el-tooltip>
      </div>
    </div>
    <div class="content-new">
      <div class="content-new-label">详细地址：</div>
      <div class="content-new-value">
        <el-tooltip effect="dark" :content="info.address" placement="top">
          {{ info.addressSlice }}
        </el-tooltip>
      </div>
    </div>
    <div class="content-new">
      <div class="content-new-label">考场数：</div>
      <div class="content-new-value">{{ info.countOfTeachers }}</div>
    </div>
    <div class="content-new">
      <div class="content-new-label">最大容纳人数：</div>
      <div class="content-new-value">
        {{ info.countOfRoom }}
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: "OverlayExamSite",
  props: {
    info: {
      type: Object,
    },
    returnWin: {
      type: Object,
    },
  },
  data() {
    return {};
  },
  methods: {
    /**
     * @跳转考场
     */
    clickExam(info, infoType) {
      this.$bus.$emit("click-exam", { info, infoType }); // 对应父组件 resource/index.vue eventBusBinding 方法中 this.$bus.$on("click-company", this.showCompanyInfo)
    },
    /**
     * @跳转公司
     */
    clickCompany(info, infoType, employeeInfo) {
      if (this.returnWin?.infoType !== "employee") {
        employeeInfo = undefined;
      }
      this.$bus.$emit("click-company", { info, infoType, employeeInfo }); // 对应父组件 resource/index.vue eventBusBinding 方法中 this.$bus.$on("click-company", this.showCompanyInfo)
    },
  },
};
</script>

<style scoped></style>
