wupengfei
2025-03-21 1bbd7061dac79cacf5513234a04cac8ba0be5c6f
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
<template>
  <div class="info-avatar-wrapper">
    <Avatar
      :size="size === 'normal' ? 40 : 30"
      :class="['info-avatar', { size }]"
      :src="src"
      @click="emit('onAvatarClick')"
    />
    <div class="user-info">
      <div class="user-info-item-name">{{ name }}</div>
      <div class="user-info-item-company">{{ company }}</div>
    </div>
  </div>
</template>
 
<script setup lang="ts">
import Avatar from './Avatar.vue';
 
defineOptions({
  name: 'InfoAvatar',
});
 
type Props = {
  src?: string;
  name?: string;
  company?: string;
  size?: 'normal' | 'small';
};
 
const props = withDefaults(defineProps<Props>(), {
  size: 'normal',
});
 
const emit = defineEmits<{
  (e: 'onAvatarClick'): void;
}>();
</script>
 
<style lang="scss">
@import '@/styles/common.scss';
 
.info-avatar-wrapper {
  display: flex;
 
  .info-avatar {
    margin-right: 24px;
 
    &.small {
      margin-right: 36px;
    }
  }
 
  .user-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
 
    .user-info-item-name {
      font-weight: 600;
      font-size: 28px;
      color: boleGetCssVar('text-color', 'primary');
      line-height: 40px;
      margin-bottom: 8px;
      @include ellipsis;
    }
 
    .user-info-item-company {
      font-weight: 400;
      font-size: 24px;
      color: boleGetCssVar('text-color', 'secondary');
      line-height: 34px;
    }
  }
}
</style>