<template>
  <div id="jobfairInfo">
    <el-row>
      <el-col :span="24" class="top">
        <el-col :span="24">
          <el-breadcrumb separator-class="el-icon-arrow-right">
            <el-breadcrumb-item :to="{ path: '/' }"
              ><i class="el-icon-s-home"></i>
              <span>网站首页</span>
            </el-breadcrumb-item>
            <el-breadcrumb-item><span>招聘会</span></el-breadcrumb-item>
            <el-breadcrumb-item class="webDetail">详情</el-breadcrumb-item>
          </el-breadcrumb>
        </el-col>
      </el-col>
      <el-col :span="24" class="talk">
        <el-col :span="24" class="talkTop">
          <h3 style="border-left:5px solid #0457c7;padding:0 10px;">招聘会信息</h3>
          <el-col :span="24" class="talkTopInfo">
            <p>
              {{ jobfairInfo && jobfairInfo.title ? jobfairInfo.title : '2019年11月30日招聘会'
              }}<el-button type="primary" icon="el-icon-search" class="btn" @click="turnTo">工商查询</el-button>
            </p>
          </el-col>
          <el-col :span="24" class="talkTopInfo">
            <p>时间：{{ jobfairInfo && jobfairInfo.time ? jobfairInfo.time : '2019-11-30' }}</p>
          </el-col>
          <el-col :span="24" class="talkTopInfo">
            <p>地点：{{ jobfairInfo && jobfairInfo.address ? jobfairInfo.address : '不知道' }}</p>
          </el-col>
        </el-col>
        <el-col :span="24" class="talkJobs">
          <h3 style="border-left:5px solid #0457c7;padding:0 10px;">招聘会相关</h3>
          <el-col :span="24">
            <el-tabs v-model="tabs" type="card">
              <el-tab-pane label="企业列表" name="corp">
                <el-table :data="corpList" style="width: 100%" stripe :show-header="false">
                  <el-table-column label="企业" prop="corpname">
                    <template v-slot="scoped">
                      <el-link @click="$router.push({ path: '/corp', query: { id: scoped.row.corpid } })">{{ scoped.row.corpname }}</el-link>
                    </template>
                  </el-table-column>
                </el-table>
              </el-tab-pane>
              <el-tab-pane label="招聘职位" name="jobs">
                <el-row class="rowStyle" v-for="(item, index) in jobsList" :key="index" :gutter="10">
                  <el-col :span="16">
                    <el-link class="job__name" :underline="false" @click="turnToJobs(item.id)">
                      <span title="查看职位">{{ item.job_name ? item.job_name : '' }}</span>
                    </el-link>
                  </el-col>
                  <el-col class="money" :span="4">
                    {{ item.salary ? item.salary.text : '' }}
                  </el-col>
                  <el-col :span="4" style="text-align:center;"> {{ item.job_number }}人</el-col>
                  <el-col :span="16"> 招聘专业 : {{ item.zy_req ? item.zy_req : '' }} </el-col>
                  <el-col :span="8"> {{ item.xl_req ? item.xl_req : '' }} | {{ item.city ? item.city : '' }} </el-col>
                </el-row>
              </el-tab-pane>
            </el-tabs>
          </el-col>
        </el-col>
      </el-col>
    </el-row>
  </div>
</template>

<script>
import _ from 'lodash';
export default {
  name: 'jobfairInfo',
  props: {
    jobfairInfo: null,
    corpList: null,
    jobsList: null,
  },
  components: {},
  data: () => ({
    tabs: 'corp',
  }),
  created() {},
  computed: {},
  methods: {
    turnTo() {
      window.open('https://www.tianyancha.com/');
    },
    turnToJobs(id) {
      let query = {};
      if (this.origin) query.origin = this.origin;
      if (this.type) query.type = this.type;
      query.id = id;
      this.$router.push({ path: '/jobsDetail', query: query });
    },
  },
};
</script>

<style lang="less" scoped>
p {
  padding: 0;
  margin: 0;
}
.btn {
  margin: 0 20px;
}
.top {
  padding: 10px 0;
}
.talkTopInfo {
  padding: 5px 15px;
}
.talkJianjie p {
  padding: 0 15px;
}
.talkJobs .rowStyle {
  padding: 10px;
  border-bottom: 1px dashed #ccc;
}
.job__name {
  font-size: 18px;
}
</style>
