<template>
  <el-form>
    <el-form-item label="真实姓名">
      <el-input v-model.trim="dataForm.realName" />
    </el-form-item>
    <el-form-item label="Email">
      <el-input v-model.trim="dataForm.email" />
    </el-form-item>
    <el-form-item label="工号">
      <el-input v-model.trim="dataForm.code" />
    </el-form-item>
    <el-form-item label="职位">
      <el-input v-model.trim="dataForm.job" />
    </el-form-item>
    <el-form-item label="联系方式">
      <el-input v-model.trim="dataForm.contact" />
    </el-form-item>
    <el-form-item>
      <el-button type="primary" @click="submit">保存更新</el-button>
    </el-form-item>
  </el-form>
</template>

<script>
  import {updateProfile} from "@/api/admin"
export default {
  props: {
    dataForm: {
      type: Object,
      default: () => {
        return {
          name: '',
          email: ''
        }
      }
    }
  },
  methods: {
    submit() {
       let _this=this;
       updateProfile(this.dataForm).then(res=>{
         _this.$message("用户资料更新成功")
       })
    }
  }
}
</script>
