<!-- 我的信息 -->
<template>
    <div>
      <e-desc title="基本信息" column="3">
        <e-desc-item label="登录名">{{dataForm.userEntity?dataForm.userEntity.username:''}}</e-desc-item>
        <e-desc-item label="姓名">{{dataForm.userEntity?dataForm.userEntity.name:''}}</e-desc-item>
        <e-desc-item label="所属部门">{{dataForm.userEntity?dataForm.userEntity.orgName:''}}</e-desc-item>

        <e-desc-item label="邮箱">{{dataForm.userEntity?dataForm.userEntity.email:''}}</e-desc-item>
        <e-desc-item label="手机号">{{dataForm.userEntity?dataForm.userEntity.mobile:''}}</e-desc-item>
        <e-desc-item label="权限角色">{{dataForm.userEntity?dataForm.userEntity.roleNames:''}}</e-desc-item>

        <e-desc-item label="状态" span="3">{{dataForm.userEntity?(Number(dataForm.userEntity.status) === 1?'正常':'禁用'):''}}</e-desc-item>
      </e-desc>
      <e-desc title="掌握的工种" column="3">
        <el-table
          :data="dataForm.workTypeList"
          border
          style="width: 100%;"
        >
          <el-table-column
            label="序号"
            type="index"
            width="50"
            align="center">
          </el-table-column>
          <el-table-column
            prop="code"
            header-align="center"
            align="center"
            min-width="120"
            :show-tooltip-when-overflow="true"
            label="工种编码">
          </el-table-column>
          <el-table-column
            prop="name"
            header-align="center"
            align="center"
            min-width="140"
            :show-tooltip-when-overflow="true"
            label="工种名称">
          </el-table-column>
          <el-table-column
            prop="levelValue"
            header-align="center"
            align="center"
            min-width="100"
            :show-tooltip-when-overflow="true"
            label="工种级别">
          </el-table-column>
          <el-table-column
            prop="requirement"
            header-align="center"
            align="center"
            min-width="160"
            :show-tooltip-when-overflow="true"
            label="工种要求">
          </el-table-column>
          <el-table-column
            prop="notes"
            header-align="center"
            align="center"
            min-width="140"
            :show-tooltip-when-overflow="true"
            label="备注">
          </el-table-column>
        </el-table>
      </e-desc>
    </div>
</template>

<script>
  import EDesc from '../common/e-desc'
  import EDescItem from '../common/e-desc-item'
  import { getMyInfo } from '@/api/my'

  export default {
    name: 'my-info',
    components: {
      EDesc, EDescItem
    },
    data () {
      return {
        dataForm: {
          userEntity: {},
          workTypeList: []
        }
      }
    },
    created () {
      this.getDataList()
    },
    methods: {
      getDataList () {
        getMyInfo().then(({data}) => {
          if (data && data.code === '200') {
            this.dataForm = data.data
          }
        })
      }
    }
  }
</script>

<style scoped>

</style>
