user-info.vue 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. <template>
  2. <div class="user-info">
  3. <el-card>
  4. <div class="flex" style="height: 226px; ">
  5. <div class="avatar">
  6. <el-avatar :size="100" :src="user.avatar" @error="errorHandler">
  7. <img :src="user.avatar" />
  8. </el-avatar>
  9. </div>
  10. <div class="detail">
  11. <div class="nickname">{{ user.nickname }}</div>
  12. <div class="username">@{{ user.username }}</div>
  13. <div class="email">{{ user.email }}</div>
  14. <div class="postName">{{ user.postList[0].postName }}</div>
  15. <div class="dept">
  16. <svg width="12" height="12" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg">
  17. <g clip-path="url(#clip0_1_110)">
  18. <path d="M5.25 3.25L2.75 5V11" stroke="#167AF0" stroke-linecap="round" stroke-linejoin="round" />
  19. <path fill-rule="evenodd" clip-rule="evenodd" d="M5.25 1L7.75 2.75V6L9.5 7.25V11H5.25V1Z"
  20. stroke="#167AF0" stroke-linecap="round" stroke-linejoin="round" />
  21. <path d="M1 11H11" stroke="#167AF0" stroke-linecap="round" stroke-linejoin="round" />
  22. </g>
  23. <defs>
  24. <clipPath id="clip0_1_110">
  25. <rect width="12" height="12" fill="white" />
  26. </clipPath>
  27. </defs>
  28. </svg>
  29. {{ user.dept.name }}
  30. </div>
  31. </div>
  32. </div>
  33. <div class="task-list">
  34. <div class="task-item">
  35. <div class="task-title">代办任务</div>
  36. <div class="task-num">0</div>
  37. <svg width="30" height="30" viewBox="0 0 30 30" fill="none" xmlns="http://www.w3.org/2000/svg">
  38. <path d="M3.125 11.875H26.875V25.625C26.875 26.3154 26.3154 26.875 25.625 26.875H4.375C3.68464 26.875 3.125 26.3154 3.125 25.625V11.875Z" stroke="#167AF0" stroke-width="2" stroke-linejoin="round"/>
  39. <path d="M3.125 6.25C3.125 5.55964 3.68464 5 4.375 5H25.625C26.3154 5 26.875 5.55964 26.875 6.25V11.875H3.125V6.25Z" stroke="#167AF0" stroke-width="2" stroke-linejoin="round"/>
  40. <path d="M10 19.375L13.75 23.125L21.25 15.625" stroke="#167AF0" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
  41. <path d="M10 3.125V8.125" stroke="#167AF0" stroke-width="2" stroke-linecap="round"/>
  42. <path d="M20 3.125V8.125" stroke="#167AF0" stroke-width="2" stroke-linecap="round"/>
  43. </svg>
  44. </div>
  45. <div class="task-item">
  46. <div class="task-title">抄送任务</div>
  47. <div class="task-num">0</div>
  48. <svg width="30" height="30" viewBox="0 0 30 30" fill="none" xmlns="http://www.w3.org/2000/svg">
  49. <path d="M26.875 3.125L18.5625 26.875L13.8125 16.1875L3.125 11.4375L26.875 3.125Z" stroke="#167AF0" stroke-width="2" stroke-linejoin="round"/>
  50. <path d="M26.8751 3.125L13.8126 16.1875" stroke="#167AF0" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
  51. </svg>
  52. </div>
  53. </div>
  54. </el-card>
  55. </div>
  56. </template>
  57. <script setup lang="ts">
  58. const errorHandler = () => {
  59. return './src/assets/avatar.png'
  60. }
  61. const postName = computed(() => {
  62. return user.postList?.forEach((item: any) => {
  63. return item.postName
  64. })?.join('|')
  65. })
  66. const user = {
  67. "userId": "1",
  68. "username": "admin",
  69. "avatar": "/admin/sys-file/s3demo/063a1ea1f6714226851de23f1329672b.png",
  70. "dept": {
  71. "deptId": "4",
  72. "name": "销售部",
  73. },
  74. "postList": [
  75. {
  76. "postName": "CTO",
  77. }
  78. ],
  79. "nickname": "管理员",
  80. "name": "管理员",
  81. "email": "[email protected]"
  82. }
  83. </script>
  84. <style scoped lang="scss">
  85. .user-info {
  86. .flex {
  87. padding-top: 44px;
  88. display: flex;
  89. justify-content: center;
  90. box-sizing: border-box;
  91. .avatar {
  92. margin-top: 8px;
  93. width: 50%;
  94. padding-left: calc(50% - 110px);
  95. }
  96. .detail {
  97. width: 50%;
  98. padding-left: 10px;
  99. .nickname {
  100. font-size: 20px;
  101. font-weight: 600;
  102. }
  103. .username {
  104. font-size: 12px;
  105. line-height: 14px;
  106. color: rgba(136, 136, 136, 1);
  107. margin-top: 8px;
  108. }
  109. .email {
  110. font-size: 12px;
  111. line-height: 14px;
  112. color: rgba(136, 136, 136, 1);
  113. margin-top: 8px;
  114. }
  115. .postName {
  116. display: inline-block;
  117. font-size: 12px;
  118. line-height: 14px;
  119. color: rgba(136, 136, 136, 1);
  120. margin-top: 8px;
  121. border: 1px solid rgba(22, 122, 240, 1);
  122. line-height: 20px;
  123. border-width: 1px;
  124. border-radius: 4px;
  125. font-family: Source Han Sans SC;
  126. font-size: 11px;
  127. color: rgba(22, 122, 240, 1);
  128. padding: 0 4px;
  129. }
  130. .dept {
  131. font-size: 12px;
  132. line-height: 14px;
  133. color: rgba(136, 136, 136, 1);
  134. margin-top: 8px;
  135. }
  136. }
  137. }
  138. .task-list {
  139. height: 140px;
  140. padding-top: 60px;
  141. width: 100%;
  142. max-width: 280px;
  143. margin: 0 auto;
  144. display: flex;
  145. justify-content: space-between;
  146. border-top: 1px solid rgba(230, 230, 230, 1);
  147. .task-item {
  148. position: relative;
  149. padding-left: 42px;
  150. svg {
  151. position: absolute;
  152. left: 0;
  153. top: 0;
  154. }
  155. }
  156. .task-title {
  157. line-height: 17px;
  158. color: rgba(100, 100, 100, 1);
  159. font-size: 14px;
  160. }
  161. .task-num {
  162. font-size: 18px;
  163. line-height: 22px;
  164. color: rgba(18, 18, 18, 1);
  165. }
  166. }
  167. }
  168. </style>