
<!--
  @description:专家教育经历查看组件
  @Modifier: wxy
  @routerPath:
  @date:  2020-09-08 9:41:26
-->
<template>
  <div class="projectInfoDetail">
    <div class="page-title">
      3.教育经历
    </div>
    <section>
      <el-table ref="smallTable" :data="tableData" class="tableLimit" border>
        <el-table-column
          prop="graduateSchool"
          label="毕业院校"
          header-align="center"
          align="center"
          min-width="140"
        />
        <el-table-column
          prop="specialty"
          label="所学专业"
          header-align="center"
          align="center"
          min-width="140"
        />
        <el-table-column
          prop="educationDvCode"
          label="学历"
          header-align="center"
          align="center"
          min-width="140"
        >
          <template slot-scope="scope">
            <span>{{ filterDictText(EducationList, scope.row.educationDvCode) }}</span>
          </template>
        </el-table-column>
        <el-table-column
          prop="startDate"
          label="入学时间"
          header-align="center"
          align="center"
          min-width="140"
        >
          <template slot-scope="scope">
            <span>{{ $Moment(scope.row.startDate).format(momentDate) }}</span>
          </template>
        </el-table-column>
        <el-table-column
          prop="endDate"
          label="毕业时间"
          header-align="center"
          align="center"
          min-width="140"
        >
          <template slot-scope="scope">
            <span>{{ $Moment(scope.row.endDate).format(momentDate) }}</span>
          </template>
        </el-table-column>
        <el-table-column label="操作" align="center" min-width="150" fixed="right">
          <template slot-scope="scope">
            <el-link
              type="primary"
              @click.stop="clickDetail(scope.row)"
            >
              [查看]
            </el-link>
          </template>
        </el-table-column>
      </el-table>
    </section>
    <ExperEducationExperienceDetailDialog v-if="dialogData.dialog" :dialog-data="dialogData" />
  </div>
</template>

<script>
/* 接口*/
import { getExpertEducationById } from '@/api/expert/expertscloud'
import { commonMxin } from '@/mixins/commonMxin'
/* 公共方法 */
import { filterDictText } from '@/assets/js/utils'
import { expertInfo } from '@/views/expert/expertInfo/mixins/expertInfo'
/* 组件 */
import ExperEducationExperienceDetailDialog from '@/views/expert/experImprovetBaseInfo/expertEducationExperience/experEducationExperienceDetail-dialog'
export default {
  components: {
    ExperEducationExperienceDetailDialog
  },
  mixins: [commonMxin, expertInfo],
  data() {
    return {
      tableData: [], // 教育经历
      educationDvCodeList: [], // 字典信息学历
      // 弹框数据
      dialogData: {
        dialog: false,
        id: ''
      }
    }
  },
  created() {
    // 获取教育经历
    this.initData()
    // 字典信息查询的key
    const data = ['Education']
    this.$store.dispatch('getGroupType', data).then(res => {
      this.educationDvCodeList = res.res.Education.data.typeList
    })
  },
  methods: {
    filterDictText, // 引入字典值替换文本通用方法
    initData() {
      const data = {
        expertId: this.$route.params.expertId
      } // 专家id
      getExpertEducationById(data).then(res => {
        this.tableData = res.data.records // 教育经历
      }).catch(() => {})
    },
    clickDetail(row) {
      this.dialogData = {
        dialog: true,
        id: row.id
      }
    }
  }
}
</script>

<style lang='less' scoped>
.baseInfo{
   font-weight: bolder;
}
</style>
