zhengyiming
2025-02-19 c8724a3d88607516fe95ffb91e4b52c99405d063
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
<template>
  <div class="user-info-avatar-wrapper">
    <Avatar :size="60" class="user-info-avatar" :src="src" />
    <div class="user-info">
      <div class="user-info-item-name-wrapper">
        <div class="user-info-item-name">{{ name }}</div>
        <template v-if="jobTitle">
          <div class="user-info-item-dot"></div>
          <div class="user-info-item-jobTitle">{{ jobTitle }}</div>
        </template>
      </div>
      <div class="user-info-item-company">{{ company }}</div>
    </div>
  </div>
</template>
 
<script setup lang="ts">
import { Avatar } from '@12333/components';
 
defineOptions({
  name: 'UserInfoAvatar',
});
 
type Props = {
  src?: string;
  name?: string;
  company?: string;
  jobTitle?: string;
};
 
const props = withDefaults(defineProps<Props>(), {});
</script>
 
<style lang="scss">
@import '@/styles/common.scss';
 
.user-info-avatar-wrapper {
  display: flex;
  flex: 1;
  min-width: 0;
 
  .user-info-avatar {
    margin-right: 24px;
  }
 
  .user-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 12px 0;
 
    .user-info-item-name-wrapper {
      color: #ffffff;
      line-height: 44px;
      @include ellipsis;
      vertical-align: middle;
      font-size: 0;
    }
 
    .user-info-item-name {
      display: inline-block;
      font-weight: 600;
      font-size: 32px;
      vertical-align: middle;
    }
 
    .user-info-item-dot {
      display: inline-block;
      width: 4px;
      height: 4px;
      background: #ffffff;
      vertical-align: middle;
      border-radius: 50%;
      margin: 0 8px;
    }
 
    .user-info-item-jobTitle {
      display: inline-block;
      font-weight: 400;
      font-size: 28px;
      vertical-align: middle;
    }
 
    .user-info-item-company {
      font-weight: 400;
      font-size: 24px;
      color: #ffffff;
      line-height: 34px;
      @include ellipsis;
    }
  }
}
</style>