搜索:判断某个成员是不是禁言

This commit is contained in:
cbb
2026-02-12 17:51:42 +08:00
parent a040b56c74
commit 2191f46317
16 changed files with 388 additions and 212 deletions

View File

@@ -255,8 +255,10 @@
deleteImGroup,
quitImGroup
} from '../../../../api/tui-kit'
import { useAuthUser } from '../../../../composables/useAuthUser'
const { showLoading, hideLoading, showDialog } = useUI()
const { tencentUserSig } = useAuthUser()
const TUIGroupServer = Server.getInstance()
const TUIConstants = TUIGroupServer.constants
@@ -307,7 +309,7 @@
const delDialogShow = ref(false)
const groupMemberList = ref<IGroupMember[]>([])
const deletedUserList = ref([])
const currentGroup = ref<IGroupModel>()
const currentGroup = ref<any>()
const currentSelfRole = ref('')
const groupIDValue = ref<string>('')
const groupMemberOffset = ref<number | string>(0)
@@ -324,10 +326,20 @@
})
})
/** 更新用户群状态 */
const setUserAudioPlayed = async (group: any) => {
const res = await TUIGroupService.getGroupMemberProfile({
groupID: group.groupID,
userIDList: [tencentUserSig.value.userId]
})
currentGroup.value = group
currentGroup.value.selfInfo.role = res.data.memberList[0].role
}
TUIStore.watch(StoreName.GRP, {
currentGroup: (group: IGroupModel) => {
if (group) {
currentGroup.value = group
setUserAudioPlayed(group)
currentSelfRole.value = currentGroup.value?.selfInfo?.role
}
},
@@ -393,7 +405,11 @@
const isAdmin = computed(() => {
const userRole = currentGroup.value?.selfInfo?.role
return userRole === TUIChatEngine.TYPES.GRP_MBR_ROLE_OWNER
return [
TUIChatEngine.TYPES.GRP_MBR_ROLE_OWNER,
TUIChatEngine.TYPES.GRP_MBR_ROLE_ADMIN
].includes(userRole)
})
const isWorkGroup = computed(() => {
@@ -749,9 +765,8 @@
switch (transferType.value) {
case 'add':
try {
imMemberResponse = await TUIGroupService.getGroupMemberProfile(
options
)
imMemberResponse =
await TUIGroupService.getGroupMemberProfile(options)
transferList.value = transferList.value.filter(
(item: any) => item.userID !== imResponse.data[0]?.userID
)
@@ -777,9 +792,8 @@
break
case 'remove':
try {
imResponse = await TUIGroupService.getGroupMemberProfile(
options
)
imResponse =
await TUIGroupService.getGroupMemberProfile(options)
if (imResponse.data.memberList.length === 0) {
const message = TUITranslateService.t(
'TUIGroup.该用户不在群组内'

View File

@@ -1,7 +1,7 @@
<template>
<div class="admin-main">
<view class="admin-box">
<div class="admin-manage">
<div v-if="!isAdmin" class="admin-manage">
<div class="admin-manage-header">
{{ TUITranslateService.t(`TUIGroup.群管理员`) }}
</div>
@@ -112,11 +112,11 @@
</template>
<script lang="ts" setup>
import {
import TUIChatEngine, {
TUITranslateService,
IGroupModel
} from '@tencentcloud/chat-uikit-engine-lite'
import { watchEffect, ref } from '../../../adapter-vue'
import { watchEffect, ref, computed } from '../../../adapter-vue'
import Slider from '../../common/Slider/index.vue'
import Icon from '../../common/Icon.vue'
import plusSVG from '../../../assets/icon/plus.svg'
@@ -156,6 +156,13 @@
currentGroupAdmin.value = props.currentGroup
})
const isAdmin = computed(() => {
return (
props.currentGroup?.selfInfo?.role ===
TUIChatEngine.TYPES.GRP_MBR_ROLE_ADMIN
)
})
const emits = defineEmits([
'addAdmin',
'removeAdmin',
@@ -287,7 +294,7 @@
.admin-mute-all {
margin: 0 10px;
padding: 20rpx ;
padding: 20rpx;
border-bottom: 1px solid #e8e8e9;
display: flex;
flex-direction: row;