群聊按钮新增防抖 全选按钮可以点击
This commit is contained in:
parent
66828a254c
commit
885707f328
@ -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') }}
|
||||||
|
@ -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(() => {
|
||||||
|
Loading…
Reference in New Issue
Block a user