<template>
  <div id="list">
    <el-row :gutter="20" style="padding-bottom:1.2rem;">
      <el-col :span="6">
        <el-input v-model="searchInfo.studname" placeholder="请输入学生名称"></el-input>
      </el-col>
      <el-col :span="2">
        <el-button type="info" circle icon="el-icon-search icons" @click="handleCurrentChange"></el-button>
      </el-col>
    </el-row>
    <el-table :data="list" stripe border style="width: 100%">
      <el-table-column align="center" type="selection" width="40"> </el-table-column>
      <el-table-column align="center" type="index" prop="num" label="序号" width="50"></el-table-column>
      <el-table-column align="center" prop="data" label="头像">
        <div class="demo-basic--circle">
          <div class="block"><el-avatar :size="80" :src="circleUrl"></el-avatar></div>
        </div>
      </el-table-column>
      <el-table-column align="center" prop="date" label="基本信息">
        <el-row><el-button type="text">姓名</el-button></el-row>
        <el-row>性别|学校</el-row>
        <el-row>学历|专业</el-row>
      </el-table-column>
      <el-table-column align="center" prop="date" label="投递职位"></el-table-column>
      <el-table-column align="center" prop="data" label="投递日期"></el-table-column>
      <el-table-column align="center" prop="data" label="简历状态">
        <template v-slot="scoped">
          <el-row v-if="type == '1'" type="text">未处理</el-row>
          <el-row v-if="type == '2'" type="text">合格</el-row>
          <el-row v-if="type == '3'" type="text">暂不考虑</el-row>
        </template>
      </el-table-column>
      <el-table-column align="center" prop="data" label="操作">
        <template v-slot="scoped">
          <el-row>
            <el-col :span="24">
              <el-button size="mini" type="text" @click="checkResume(scoped.row.id)">查看简历</el-button>
            </el-col>
            <el-col :span="12">
              <el-button size="mini" v-if="type !== '2'" type="text" @click="changeStatus('1')">纳入考虑</el-button>
            </el-col>
            <el-col :span="12">
              <el-button size="mini" v-if="type !== '3'" type="text" @click="changeStatus('2')">暂不考虑</el-button>
            </el-col>
            <el-col :span="12">
              <el-button size="mini" type="text">查看回复</el-button>
            </el-col>
            <el-col :span="12">
              <el-button size="mini" type="text">通知</el-button>
            </el-col>
          </el-row>
          <el-row> </el-row>
        </template>
      </el-table-column>
    </el-table>
    <el-row class="row_pagination">
      <el-col :span="24">
        <el-pagination
          @current-change="handleCurrentChange"
          :current-page="currentPage"
          :page-size="15"
          layout="total, prev, pager, next, jumper"
          :total="totalRow"
        >
        </el-pagination>
      </el-col>
    </el-row>
    <el-dialog title="简历详情" center :visible.sync="resumeDialog" :fullscreen="true">
      <resumes :info="info"></resumes>
    </el-dialog>
  </div>
</template>

<script>
import resumes from '@publics/src/views/resumeCor.vue';
export default {
  name: 'list',
  props: {
    type: { type: String, defalut: 'none' },
    list: { type: Array, defalut: () => [] },
    totalRow: { type: Number, defalut: 0 },
    info: { type: Object, default: () => {} },
  },
  components: {
    resumes,
  },
  data: () => ({
    currentPage: 1,
    resumeDialog: false,
    circleUrl: '',
    searchInfo: {},
  }),
  created() {},
  computed: {},
  methods: {
    // selectInfo(selection) {
    //   //选择/全选方法,删除或者其他批量操作使用
    //   let ids = [];
    //   selection.map(item => {
    //     ids.push(item.id);
    //   });
    //   this.$emit('selectInfo', { type: this.type, ids: ids });
    // },
    handleCurrentChange(val) {
      this.currentPage = val ? 1 : val;
      this.$emit('changePage', { type: this.type, currentPage: this.currentPage, searchInfo: this.searchInfo });
    },
    checkResume(id) {
      this.$emit('searchInfo', id);
      this.resumeDialog = true;
    },
    changeStatus(value) {
      this.$emit('changeStatus', { id: this.info.id, status: value });
    },
  },
};
</script>

<style lang="less" scoped>
.row_pagination {
  text-align: right;
  margin-top: 1rem;
}
/deep/.el-dialog__body {
  padding: 0;
}
</style>
