<template>
  <div id="recruit">
    <el-row>
      <el-col :span="24">
        <el-tabs v-model="activeName" type="border-card">
          <el-tab-pane :label="`${$site === 'master' ? '宣讲会' : '校外宣讲'}`" name="talkOut">
            <el-col :span="24">
              <el-col :span="12" v-for="(item, index) in talksoutList" :key="index" class="talksList">
                <el-col :span="18">
                  <el-col :span="24" class="title textOver">
                    <el-link :underline="false" @click.native="$router.push({ path: '/talk/detail', query: { id: item.id } })">{{ item.title }}</el-link>
                  </el-col>
                  <el-col :span="24" class="schname textOver">
                    {{ item.schname }}
                  </el-col>
                  <el-col :span="24" class="address textOver">
                    {{ item.address }}
                  </el-col>
                </el-col>
                <el-col :span="6">
                  <el-col :span="24" class="time">{{ item.time }}</el-col>
                  <el-col :span="24" class="timedian">{{ item.timedian }}</el-col>
                  <el-col :span="24" class="size"><i class="el-icon-view"></i>{{ item.team_size }}</el-col>
                </el-col>
              </el-col>
            </el-col>
          </el-tab-pane>
          <el-tab-pane label="校内宣讲" name="talkIn" v-if="$site !== 'master'">
            <el-col :span="24">
              <el-col :span="12" v-for="(item, index) in talksList" :key="index" class="talksList">
                <el-col :span="18">
                  <el-col :span="24" class="title textOver">
                    <el-link :underline="false" @click.native="$router.push({ path: '/talk/detail', query: { id: item.id } })"> {{ item.title }}</el-link>
                  </el-col>
                  <el-col :span="24" class="schname textOver">
                    {{ item.schname }}
                  </el-col>
                  <el-col :span="24" class="address textOver">
                    {{ item.address }}
                  </el-col>
                </el-col>
                <el-col :span="6">
                  <el-col :span="24" class="time">{{ item.time }}</el-col>
                  <el-col :span="24" class="timedian">{{ item.timedian }}</el-col>
                  <el-col :span="24" class="size"><i class="el-icon-view"></i>{{ item.team_size }}</el-col>
                </el-col>
              </el-col>
            </el-col>
          </el-tab-pane>
          <el-tab-pane label="招聘会" name="jobfair">
            <el-col :span="24" v-for="(item, index) in fairsList" :key="index" class="fairsList">
              <el-col :span="19">
                <el-col :span="24" class="title textOver">
                  <el-link :underline="false" @click.native="$router.push({ path: '/jobfair/detail', query: { id: item.id } })">{{ item.title }}</el-link>
                </el-col>
                <el-col :span="24" class="schname textOver">主办方：{{ item.schname }}</el-col>
                <el-col :span="24" class="address textOver">{{ item.address }}</el-col>
              </el-col>
              <el-col :span="5" class="time">{{ item.time }}&nbsp;{{ item.timedian }}</el-col>
            </el-col>
          </el-tab-pane>
          <el-tab-pane label="招聘快讯" name="jobinfo">
            <el-col :span="24" v-for="(item, index) in infoList" :key="index" class="fairsList">
              <el-col :span="24" class="title textOver">
                <el-link :underline="false" @click.native="$router.push({ path: '/jobinfo/detail', query: { id: item.id } })">{{ item.title }}</el-link>
              </el-col>
              <el-col :span="24" class="schname textOver">主办方：{{ item.schname }}</el-col>
              <el-col :span="24" class="address textOver">{{ item.corpname }}</el-col>
            </el-col>
          </el-tab-pane>
        </el-tabs>
        <el-link :inderline="false" class="moreLink" :style="`color:${Color}`" @click="toMore()">MORE<i class="el-icon-video-play"></i> </el-link>
      </el-col>
    </el-row>
  </div>
</template>

<script>
export default {
  name: 'recruit',
  props: {
    talksList: null,
    fairsList: null,
    talksoutList: null,
    infoList: null,
  },
  components: {},
  data: () => ({
    activeName: 'jobinfo',
    Color: '#850000',
  }),
  created() {},
  computed: {},
  methods: {
    toMore() {
      if (this.activeName === 'talkIn') this.$router.push({ path: '/talk/list/in' });
      if (this.activeName === 'talkOut') this.$router.push({ path: '/talk/list/out' });
      if (this.activeName === 'jobfair') this.$router.push({ path: '/jobfair/list/in' });
      if (this.activeName === 'jobinfo') this.$router.push({ path: '/jobinfo/list' });
    },
  },
};
</script>

<style lang="less" scoped>
.moreLink {
  position: absolute;
  top: 10px;
  right: 10px;
  color: #850000;
}
/deep/.el-tabs__header {
  margin: 0;
}
/deep/.el-tabs--border-card > .el-tabs__content {
  padding: 0;
}
.talksList {
  padding: 12px 10px;
  border-bottom: 1px dashed #ccc;
}
.talksList .title .el-link {
  font-size: 18px;
}
.talksList .schname {
  font-size: 16px;
  color: #999;
  padding: 4px 0;
}
.talksList .address {
  font-size: 16px;
  color: #999;
}
.talksList .time {
  font-size: 16px;
  color: red;
}
.talksList .timedian {
  font-size: 16px;
  color: red;
  padding: 4px 0;
}
.textOver {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fairsList {
  padding: 10px;
  border-bottom: 1px dashed #ccc;
}
.fairsList .title .el-link {
  font-size: 18px;
}
.fairsList .schname {
  font-size: 16px;
  color: #999;
  padding: 6px 0;
}
.fairsList .address {
  font-size: 16px;
  color: #999;
}
.fairsList .time {
  font-size: 16px;
  color: red;
}
</style>
