From 4a670201c673ada52150332cb914cf08f2c3b4e9 Mon Sep 17 00:00:00 2001 From: wwt Date: Mon, 24 Mar 2025 11:34:13 +0800 Subject: [PATCH] fix bug#3909 --- src/pages/creatGroupChat/index.vue | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/pages/creatGroupChat/index.vue b/src/pages/creatGroupChat/index.vue index e639880..27b089a 100644 --- a/src/pages/creatGroupChat/index.vue +++ b/src/pages/creatGroupChat/index.vue @@ -317,11 +317,9 @@ const handleConfirm = async () => { } else { } } - //发起群聊按钮可点击状态 const confirmBtnStatus = computed(() => { let disabledT = false - console.log(groupActiveIndex.value !== -1) if ( groupName.value === '' || (groupActiveIndex.value && groupActiveIndex.value === -1) || @@ -329,9 +327,16 @@ const confirmBtnStatus = computed(() => { ) { return true } + // 选择的人员里面包含发起人,需要去重 + let temp = [] + allChooseMembers?.value?.forEach((ele) => { + if (ele.ID !== userInfo.value.ID) { + temp.push(ele) + } + }) switch (groupActiveIndex.value) { case 0: - if(allChooseMembers?.value?.length < 2) { + if(temp?.length < 2) { disabledT = true } break @@ -344,7 +349,7 @@ const confirmBtnStatus = computed(() => { } break case 2: - if(allChooseMembers?.value?.length < 2) { + if(temp?.length < 2) { disabledT = true } break