Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
 
 
 
 
 
 

42 lignes
1.5 KiB

  1. <template>
  2. <view class="page">
  3. <l-list border>
  4. <l-list-item title="头像"><l-avatar :src="avatarSrc" slot="action" /></l-list-item>
  5. <l-list-item :action="currentUser.account" title="账号" />
  6. <l-list-item :action="currentUser.enCode" title="工号" />
  7. <l-list-item :action="currentUser.realName" title="姓名" />
  8. <l-list-item :action="Number(currentUser.gender) === 1 ? '男' : '女'" title="性别" />
  9. <l-list-item :action="info.company" title="公司" />
  10. <l-list-item :action="info.dep" title="部门" />
  11. <l-list-item :action="info.job" title="岗位" />
  12. <l-list-item :action="info.role" title="角色" />
  13. </l-list>
  14. </view>
  15. </template>
  16. <script>
  17. export default {
  18. computed: {
  19. // 当前用户对象
  20. currentUser() {
  21. return this.GET_GLOBAL('loginUser')
  22. },
  23. // 计算出用户公司、岗位等信息
  24. info() {
  25. const company = this.currentUser.companyId ? this.GET_GLOBAL('company')[this.currentUser.companyId]?.name : ''
  26. const dep = this.currentUser.departmentId ? this.GET_GLOBAL('department')[this.currentUser.departmentId]?.name : ''
  27. const role = (this.currentUser.role || []).map(t => t.F_FullName).join(' · ')
  28. const job = (this.currentUser.post || []).map(t => t.F_Name).join(' · ')
  29. return { company, dep, role, job }
  30. },
  31. // 头像图片 url
  32. avatarSrc() {
  33. return this.API + `/user/img?data=${this.currentUser.userId}`
  34. }
  35. }
  36. }
  37. </script>