<style scoped>
.user-panel {
  margin: 10px auto;
}
.td_tit1 {
  font-size:22px;
  color: #000;
  height: 50px;
}
.td_tit2 {
  font-size:16px;
  height: 40px;
}
.td_tit3 {
  width: 70px;
  height: 30px;
}
.td_con {
  min-width:100px;
  color: #000;
}
.divider {
  border-top:1px dashed #cccccc;
  height: 1px;
  overflow:hidden;
}
</style>
<template>
  <el-dialog :visible.sync="showDialog" :title="title" :modal-append-to-body="false" style="text-align: left" @close="closeDialog" :close-on-click-modal="false">
    <div class="user-panel">
      <table style="width:100%;" border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td rowspan="19" style="width:160px;" valign="top">
            <el-avatar :size="125" shape="circle" :src="formModel.userPhoto+'?x-oss-process=image/resize,m_fill,w_64,h_64'"></el-avatar>
          </td>
          <td colspan="6" class="td_tit1">{{formModel.userName}}</td>
        </tr>
        <tr>
          <td class="td_tit3">联系方式：</td>
          <td class="td_con">{{formModel.userTel}}</td>
          <td class="td_tit3">性别：</td>
          <td class="td_con">{{formModel.sexName}}</td>
          <td class="td_tit3">求职状态：</td>
          <td class="td_con">{{formModel.jobStatusName}}</td>
        </tr>
        <tr>
          <td class="td_tit3">身份证号：</td>
          <td class="td_con">{{formModel.userIdCard}}</td>
          <td class="td_tit3">年龄：</td>
          <td class="td_con">{{formModel.userAge}}岁</td>
          <td class="td_tit3">期望职位：</td>
          <td class="td_con">{{formModel.positionCategoryName}}</td>
        </tr>
        <tr>
          <td class="td_tit3">出生年月：</td>
          <td class="td_con">{{formModel.birthday}}</td>
          <td class="td_tit3">学历：</td>
          <td class="td_con">{{formModel.educationName}}</td>
          <td class="td_tit3">期望地点：</td>
          <td class="td_con">{{formModel.dreamAddName}}</td>
        </tr>
        <tr>
          <td class="td_tit3">工作经验：</td>
          <td class="td_con">{{formModel.workExpName}}</td>
          <td class="td_tit3">期望薪资：</td>
          <td class="td_con">{{formModel.dreamMoneyName}}</td>
          <!-- <td class="td_tit3">常驻地址：</td>
          <td class="td_con">{{formModel.userAddress}}</td> -->
        </tr>
        <tr>
          <td colspan="6" style="height:60px">
            <el-button size="medium" type="primary" @click="handleEdit(row)">下载简历</el-button>
            <el-button size="medium" type="danger" @click="handleDelete(row)">立即沟通</el-button>
          </td>
        </tr>
        <tr>
          <td colspan="6" class="divider"></td>
        </tr>
        <tr>
          <td colspan="6" class="td_tit1">个人介绍</td>
        </tr>
        <tr>
          <td colspan="6" class="td_con">{{formModel.introduction}}</td>
        </tr>
        <tr>
          <td colspan="6" class="divider"></td>
        </tr>
        <tr>
          <td colspan="6" class="td_tit1">工作经历</td>
        </tr>
        <tr>
          <td colspan="6" class="td_con">
            <table v-for="item in formModel.workList" :key="item.id" style="width:100%;" border="0" cellpadding="0" cellspacing="0">
              <tr>
                <td colspan="2" class="td_tit2">{{item.companyName}}</td>
              </tr>
              <tr>
                <td class="td_tit3">工作时间：</td>
                <td class="td_con">{{item.startTime}}-{{item.endTime}}</td>
              </tr>
              <tr>
                <td class="td_tit3">在职职位：</td>
                <td class="td_con">{{item.job}}</td>
              </tr>
              <tr>
                <td class="td_tit3">工作职责：</td>
                <td class="td_con">{{item.content}}</td>
              </tr>
            </table>
          </td>
        </tr>
        <tr>
          <td colspan="6" class="divider"></td>
        </tr>
        <tr>
          <td colspan="6" class="td_tit1">教育经历</td>
        </tr>
        <tr>
          <td colspan="6" class="td_con">
            <table v-for="item in formModel.educateList" :key="item.id" style="width:100%;" border="0" cellpadding="0" cellspacing="0">
              <tr>
                <td colspan="2" class="td_tit2">{{item.schoolName}}</td>
              </tr>
              <tr>
                <td class="td_tit3">在校时间：</td>
                <td class="td_con">{{item.startTime}}-{{item.endTime}}</td>
              </tr>
              <tr>
                <td class="td_tit3">学历：</td>
                <td class="td_con">{{item.education}}</td>
              </tr>
              <tr>
                <td class="td_tit3">专业：</td>
                <td class="td_con">{{item.major}}</td>
              </tr>
            </table>
          </td>
        </tr>
        <tr>
          <td colspan="6" class="divider"></td>
        </tr>
        <tr>
          <td colspan="6" class="td_tit1">人员就业轨迹</td>
        </tr>
        <tr>
          <td colspan="6" class="td_con">
            <div>
              <el-timeline :reverse="true">
                <el-timeline-item v-for="(workStep, index) in formModel.workStepList" :key="index" :timestamp="workStep.date">
                  {{workStep.text}}
                </el-timeline-item>
              </el-timeline>
            </div>
          </td>
        </tr>
      </table>
    </div>
    <span slot="footer" class="dialog-footer">
      <el-button @click="closeDialog">关 闭</el-button>
    </span>
  </el-dialog>
</template>
<script>
import Constant from "@/constant";
import resumeApi from "@/api/job/resume";

export default {
  props: ["businessKey", "title"],
  data() {
    return {
      formModel: {},
      showDialog: true,
    };
  },
  methods: {
    closeDialog() {
      this.$emit("close", false);
    },
  },
  mounted: function () {
    var self = this;

    resumeApi.detail(self.businessKey).then(response=>{
      var jsonData = response.data;

      if(jsonData.result){
        self.formModel = jsonData.data;
        console.log(self.formModel);
      }
      else{
        self.$message.error(jsonData.message + "");
      }
    });
  },
};
</script>