<template>
  <div id="listRight">
    <el-row>
      <el-col :span="24" class="listRight" :style="`border-color:${Color}`">
        <el-col :span="24" class="topInfo">
          <el-col :span="10" class="top">
            <p :style="`color:${Color}`"><i class="el-icon-document"></i>{{ title }}</p>
          </el-col>
          <el-col :span="14" class="bread">
            <el-breadcrumb separator-class="el-icon-arrow-right">
              <el-breadcrumb-item :to="{ path: '/' }">网站首页</el-breadcrumb-item>
              <el-breadcrumb-item>{{ title }}列表</el-breadcrumb-item>
            </el-breadcrumb>
          </el-col>
        </el-col>
        <el-col :span="24" class="list">
          <el-col :span="24" class="rightList" v-for="(item, index) in rightList" :key="index">
            <talk v-if="jobs === 'talk'" :data="item"></talk>
            <jobfair v-if="jobs === 'jobfair'" :data="item"></jobfair>
            <jobinfo v-if="jobs === 'jobinfo'" :data="item"></jobinfo>
            <post v-if="jobs === 'jobs'" :data="item"></post>
          </el-col>
        </el-col>
      </el-col>
      <el-col :span="24" class="page">
        <el-pagination @current-change="search" :current-page="currentPage" :page-size="pageSize" layout="total, prev, pager, next, jumper" :total="total">
        </el-pagination>
      </el-col>
    </el-row>
  </div>
</template>

<script>
import talk from '@/layout/jobs-list/talk.vue';
import jobfair from '@/layout/jobs-list/jobfair.vue';
import jobinfo from '@/layout/jobs-list/jobinfo.vue';
import post from '@/layout/jobs-list/post.vue';

export default {
  name: 'listRight',
  props: {
    rightList: null,
    Color: null,
    total: { type: Number, defaultl: 0 },
  },
  components: {
    talk,
    jobfair,
    jobinfo,
    post,
  },
  data: () => ({
    currentPage: 1,
    pageSize: 8,
  }),
  created() {},
  computed: {
    title() {
      let jobs = this.$route.params.jobs;
      let returns;
      if (jobs === 'talk') returns = '宣讲会';
      if (jobs === 'jobfair') returns = '招聘会';
      if (jobs === 'jobinfo') returns = '招聘信息';
      if (jobs === 'jobs') returns = '岗位信息';
      return returns;
    },
    jobs() {
      return this.$route.params.jobs;
    },
  },
  methods: {
    search(page) {
      let skip = (page - 1) * this.pageSize;
      this.$emit('search', { skip: skip, limit: this.pageSize });
    },
  },
};
</script>

<style lang="less" scoped>
p {
  padding: 0;
  margin: 0;
}
.textOver {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.listRight {
  height: 930px;
  border-left: 1px solid;
}
.topInfo {
  height: 47px;
  line-height: 47px;
}
.top {
  padding: 0 10px;
}
.top p {
  font-size: 24px;
}
.bread {
  padding: 16px 0px 16px 220px;
}
.dian {
  display: inline-block;
  width: 4px;
  height: 4px;
  background-color: #4f4f4f;
  border-radius: 90px;
  margin: 5px 8px;
}
.list {
  padding: 0 10px;
  height: 883px;
  overflow: hidden;
}
.rightList {
  min-height: 110px;
  border-bottom: 1px dashed #ccc;
}
.rightList .title {
  padding: 10px 0;
}
.rightList .title p {
  font-size: 16px;
  color: #4f4f4f;
}
.rightList .date {
  font-size: 14px;
  color: #323131;
  text-align: right;
  padding: 10px 0;
}
.content {
  padding: 0 20px;
}
.content p {
  font-size: 14px;
  color: #323131;
  line-height: 25px;
  overflow: hidden;
  text-overflow: ellipsis;
  -webkit-line-clamp: 2;
  word-break: break-all;
  display: -webkit-box;
  -webkit-box-orient: vertical;
}
.rightList:hover .title p {
  color: #0874ee;
  cursor: pointer;
}
.page {
  padding: 51px 0px;
  text-align: center;
}
</style>
