<template>
  <div>
    <slot name="edit" :data="mainInfo"></slot>
    <div class="container normal-panel normal-margin">
      <el-descriptions title="员工信息" :column="6">
          <el-descriptions-item label="编号">{{mainInfo.hrcode?mainInfo.hrcode:'--'}}</el-descriptions-item>
          <el-descriptions-item label="身份证号">{{mainInfo.idcard?mainInfo.idcard:'--'}}</el-descriptions-item>
          <el-descriptions-item label="部门">{{mainInfo.depname?mainInfo.depname:'--'}}</el-descriptions-item>
          <el-descriptions-item label="是否部门负责人">{{mainInfo.isleader === 1?'是':'否'}}</el-descriptions-item>
          <el-descriptions-item label="职位">{{mainInfo.position?mainInfo.position:'--'}}</el-descriptions-item>
          <el-descriptions-item label="办公电话">{{mainInfo.officetelephone?mainInfo.officetelephone:'--'}}</el-descriptions-item>
          <el-descriptions-item label="姓名">{{mainInfo.name?mainInfo.name:'--'}}</el-descriptions-item>
          <el-descriptions-item label="电话">{{mainInfo.phonenumber?mainInfo.phonenumber:'--'}}</el-descriptions-item>
          <el-descriptions-item label="性别">{{mainInfo.sex?mainInfo.sex:'--'}}</el-descriptions-item>
          <el-descriptions-item label="电子邮箱">{{mainInfo.email?mainInfo.email:'--'}}</el-descriptions-item>
           <el-descriptions-item label="汇报对象">{{mainInfo.reporthrname?mainInfo.reporthrname:'--'}}</el-descriptions-item>
          
      </el-descriptions>
    </div>
    <div class="container normal-panel normal-margin">
      <el-descriptions title="系统信息" :column="4">
          <el-descriptions-item label="创建人">{{mainInfo.createby?mainInfo.createby:'--'}}</el-descriptions-item>
          <el-descriptions-item label="最后修改人">{{mainInfo.changeby?mainInfo.changeby:'--'}}</el-descriptions-item>
          <el-descriptions-item label="手机号">{{mainInfo.userphonenumber?mainInfo.userphonenumber:'--'}}</el-descriptions-item>
          <el-descriptions-item label="创建时间">{{mainInfo.createdate?mainInfo.createdate:'--'}}</el-descriptions-item>
          <el-descriptions-item label="最后修改时间">{{mainInfo.changedate?mainInfo.changedate:'--'}}</el-descriptions-item>
      </el-descriptions>
    </div>
    <div class="container normal-panel normal-margin user-panel">
      <el-descriptions :column="5">
          <div slot="title" class="flex-align-center flex-between">
            <span>账号信息</span>
            <div class="flex-align-center flex-between">
              <slot name="createuser" :data="mainInfo"></slot>
              <slot name="linkact" :data="mainInfo"></slot>
            </div>
          </div>
          <!-- <el-descriptions-item label="头像"><img width="40" style="margin-top:-8px" src="../../../../../assets/avatar.png" alt=""></el-descriptions-item> -->
          <el-descriptions-item label="账号名称">{{mainInfo.username?mainInfo.username:'--'}}</el-descriptions-item>
          <el-descriptions-item label="账号类型">{{mainInfo.usertypename?mainInfo.usertypename:'--'}}</el-descriptions-item>
          <el-descriptions-item label="角色">{{mainInfo.userrole?(mainInfo.userrole).toString():''}}</el-descriptions-item>
          <el-descriptions-item label="账号密码">
            <div class="flex-align-center flex-between">
              *******
             <slot name="restpas"></slot>
            </div>
          </el-descriptions-item>
      </el-descriptions>
    </div>
  </div>
</template>

<script>
export default {
  props:['data'],
  components:{
  },
  data () {
    return {
      mainInfo:{}
    }
  },
  methods:{
     async query_hrMain () {
      const res = await this.$api.requested({
        "classname": "webmanage.hr.hr",
        "method": "query_hrMain",
        "content": {
            "hrid":this.$route.query.id
        }
      })
      this.mainInfo = res.data
    },
  },
  mounted () {
    this.query_hrMain()
  }
}

</script>
<style>
.user-panel .el-descriptions__title{width: 100%;}
</style>