groupList.vue
2.79 KB
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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
<template>
<div class="groupList" v-loading="loading">
<ul v-if="personList.length">
<li
v-for="(item, index) in personList"
:key="index"
:class="['flex aic', { active: index == active }]"
@click="liClick(item, index)">
<div class="ninebox">
<ul v-if="item.avatar">
<li v-for="(a, i) in item.avatar.split(',')" :key="i">
<img :src="a" />
</li>
</ul>
</div>
<div style="margin-left: 8px; line-height: 60px" class="toe" :title="item.groupName">
{{ item.name }}
<!-- <p>
<span class="fr gray">{{ item.msgTime }}</span>
</p> -->
<!-- <p class="gray" v-if="item">
{{ item.name }}:
{{ item.content }}
</p> -->
</div>
<!-- <el-row style="padding:10px" v-if="item.finalChatContext.msgtype=='file'">
<el-col :span="3"> </el-col>
<el-col :span="21">
<p><span class="fr gray">{{parseTime(item.finalChatContext.msgtime)}}</span></p>
<p class="gray padt10" >{{item.finalChatContext.from}}:
<span v-if="item.finalChatContext.file.fileext=='mp4'">[视频]</span>
</p>
</el-col>
</el-row> -->
</li>
</ul>
<el-empty v-else :image-size="100"></el-empty>
</div>
</template>
<script>
// import { parseTime } from '@/utils/common.js'
export default {
props: {
personList: {
type: Array,
defluat: () => [],
},
loading: {
type: Boolean,
defluat: false,
},
},
data() {
return {
loadings: true,
active: undefined,
}
},
methods: {
liClick(data, index) {
this.active = index
this.$emit('groupFn', data)
},
},
}
</script>
<style lang="scss" scoped>
.ninebox {
flex: none;
width: 54px;
height: 52px;
border: 1px solid var(--color);
border-radius: var(--border-radius);
overflow: hidden;
ul li {
float: left;
width: 15px;
height: 15px;
padding: 0 !important;
margin: 1px 1px 1px 1px;
}
}
.groupList {
overflow-y: auto;
height: calc(100vh - 328px);
::-webkit-scrollbar {
display: none;
}
::v-deep .el-loading-spinner {
margin-top: 20px;
}
.gray {
color: #999;
}
.padt10 {
padding-top: 10px;
}
ul li {
padding: 3px 10px;
overflow: hidden;
border-bottom: 1px solid #efefef;
cursor: pointer;
p {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
&:hover {
background: #efefef;
}
&.active {
background: var(--color-lighter);
}
img {
width: 100%;
height: 100%;
float: left;
}
}
}
</style>