jiangshuai
2024-07-24 9d94fd9277cc985f1c86b41e646e176cdf78004a
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
<template>
  <div class="chat-list">
    <ChatItem v-for="item in renderList" :key="item.id" :item-data="item" />
    <a-result v-if="!renderList.length" status="404" />
  </div>
</template>
 
<script lang="ts" setup>
  import { PropType } from 'vue';
  import { ChatRecord } from '@/api/message';
  import ChatItem from './chat-item.vue';
 
  defineProps({
    renderList: {
      type: Array as PropType<ChatRecord[]>,
      default() {
        return [];
      },
    },
  });
</script>
 
<style scoped lang="less">
  .chat-item {
    padding: 8px;
    font-size: 12px;
    line-height: 20px;
    border-radius: 2px;
 
    &-footer {
      display: flex;
      align-items: center;
      justify-content: space-between;
    }
 
    &-actions {
      display: flex;
      opacity: 0;
 
      &-item {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 20px;
        height: 20px;
        margin-right: 4px;
        color: var(--color-text-3);
        font-size: 14px;
        border-radius: 50%;
        cursor: pointer;
 
        &:hover {
          background-color: rgb(var(--gray-3));
        }
 
        &:last-child {
          margin-right: 0;
        }
      }
    }
 
    &-collected {
      .message-item-actions-collect {
        color: rgb(var(--gold-6));
      }
    }
 
    &:hover {
      background-color: rgb(var(--gray-2));
 
      .message-item-actions {
        opacity: 1;
      }
    }
  }
</style>