群聊按钮新增防抖 全选按钮可以点击

This commit is contained in:
liwenhao 2025-04-21 11:13:19 +08:00
parent 66828a254c
commit 885707f328
2 changed files with 55 additions and 50 deletions

View File

@ -56,7 +56,7 @@
@click="() => allCheck(allCheckStatus)" @click="() => allCheck(allCheckStatus)"
> >
<div class="mr-[20rpx]"> <div class="mr-[20rpx]">
<checkBox :modelValue="allCheckStatus"></checkBox> <checkBox @change="(val) => allCheck(allCheckStatus)" :modelValue="allCheckStatus"></checkBox>
</div> </div>
<div class="font-medium text-[28rpx] leading-[40rpx]"> <div class="font-medium text-[28rpx] leading-[40rpx]">
{{ $t('radio.btn.selectAll') }} {{ $t('radio.btn.selectAll') }}

View File

@ -106,7 +106,7 @@
</div> </div>
<template #bottom> <template #bottom>
<customBtn :isBottom="true" :btnText="$t('pageTitle.create.group')" @click="handleConfirm" <customBtn :isBottom="true" :btnText="$t('pageTitle.create.group')" @click="handleConfirm"
:disabled="confirmBtnStatus"></customBtn> :isLoading="isLoading" :disabled="confirmBtnStatus || isLoading"></customBtn>
</template> </template>
</zPaging> </zPaging>
</div> </div>
@ -219,13 +219,17 @@
url: '/pages/chooseByDeps/index?chooseMode=2', url: '/pages/chooseByDeps/index?chooseMode=2',
}) })
} }
const isLoading = ref(false)
// //
const handleConfirm = async () => { const handleConfirm = async () => {
console.log(allChooseMembers.value) if (isLoading.value) return
isLoading.value = true
try {
let erp_ids = '' let erp_ids = ''
if (allChooseMembers?.value?.length > 0) { if (allChooseMembers?.value?.length > 0) {
allChooseMembers?.value?.forEach((ele) => { allChooseMembers.value.forEach((ele) => {
if (!erp_ids) { if (!erp_ids) {
erp_ids = String(ele.ID) erp_ids = String(ele.ID)
} else { } else {
@ -233,44 +237,45 @@
} }
}) })
} }
let res = null
if (groupActiveIndex.value === 0) { if (groupActiveIndex.value === 0) {
// //
let params = { const params = {
avatar: '', avatar: '',
name: groupName.value, name: groupName.value,
erp_ids: erp_ids, erp_ids: erp_ids,
type: 1, type: 1,
profile: '', profile: '',
} }
console.log(params) console.log('普通群参数:', params)
const res = await ServeCreateGroup(params) res = await ServeCreateGroup(params)
if (res.code === 200) {
resetGroupInfo()
uni.navigateBack()
}
} else if (groupActiveIndex.value === 1) { } else if (groupActiveIndex.value === 1) {
// //
const res = await createDepGroup() res = await createDepGroup()
if (res.code === 200) {
resetGroupInfo()
uni.navigateBack()
}
} else if (groupActiveIndex.value === 2) { } else if (groupActiveIndex.value === 2) {
// //
let params = { const params = {
avatar: '', avatar: '',
name: groupName.value, name: groupName.value,
erp_ids: erp_ids, erp_ids: erp_ids,
type: 3, type: 3,
profile: '', profile: '',
} }
console.log(params) console.log('项目群参数:', params)
const res = await ServeCreateGroup(params) res = await ServeCreateGroup(params)
if (res.code === 200) { }
if (res?.code === 200) {
resetGroupInfo() resetGroupInfo()
uni.navigateBack() uni.navigateBack()
} }
} else {} } catch (err) {
console.error(err)
} finally {
isLoading.value = false
}
} }
// //
const confirmBtnStatus = computed(() => { const confirmBtnStatus = computed(() => {