admin-vue3/src/views/im/home/components/group/GroupMemberGrid.vue

50 lines
1.6 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<template>
<!--
群成员宫格单元
- 宫格展示的最小单位头像在上名字在下列宽 = size + 16自适应 size 留呼吸空间
- GroupMemberPickerPanel 右侧已选区grid 形态ConversationGroupSide 群成员区循环使用
-->
<div
class="relative flex flex-col items-center px-0.5 py-1"
:style="{ width: `${size! + 16}px` }"
>
<UserAvatar
:id="member.userId"
:url="member.avatar"
:name="member.nickname"
:size="size"
:clickable="clickable"
:add-source="ImFriendAddSource.GROUP"
:add-source-extra="groupName"
/>
<div
class="w-full mt-1 overflow-hidden text-12px leading-[18px] text-center truncate text-[var(--el-text-color-regular)]"
>
{{ member.showName }}
</div>
<slot></slot>
</div>
</template>
<script lang="ts" setup>
import UserAvatar from '../user/UserAvatar.vue'
import { ImFriendAddSource } from '../../../utils/constants'
import type { GroupMemberLite } from './GroupMember.vue'
defineOptions({ name: 'ImGroupMemberGrid' })
withDefaults(
defineProps<{
member: GroupMemberLite
clickable?: boolean // 头像点击是否弹 UserInfoCard选择器宫格里需要保持关闭避免和勾选交互冲突
size?: number // 头像像素大小;默认 38兼容选择器右侧已选区群信息抽屉传 50 对齐微信 PC
groupName?: string // 群名:加好友时拼「我是 'XX 群' 的 YY」话术落库 add_source=GROUP
}>(),
{
clickable: false,
size: 38,
groupName: ''
}
)
</script>