diff --git a/Touchkebao/src/store/module/ckchat/api.ts b/Touchkebao/src/store/module/ckchat/api.ts index c10f10d5..f7f365a9 100644 --- a/Touchkebao/src/store/module/ckchat/api.ts +++ b/Touchkebao/src/store/module/ckchat/api.ts @@ -21,7 +21,6 @@ export const createContractList = async ( for (const label of countLables) { let data; if (label.groupType === 1) { - console.log(label.groupName); if (label.id == 0) { data = await contractService.findWhereMultiple([ { @@ -30,22 +29,28 @@ export const createContractList = async ( value: realGroup, }, ]); - // 过滤出 kfSelected 对应的联系人 - if (kfSelected && kfSelected != 0) { - data = data.filter(contact => contact.wechatAccountId === kfSelected); - } } else { data = await contractService.findWhere("groupId", label.id); - // 过滤出 kfSelected 对应的联系人 - if (kfSelected && kfSelected != 0) { - data = data.filter(contact => contact.wechatAccountId === kfSelected); - } } - + // 过滤出 kfSelected 对应的联系人 + if (kfSelected && kfSelected != 0) { + data = data.filter(contact => contact.wechatAccountId === kfSelected); + } // console.log(`标签 ${label.groupName} 对应的联系人数据:`, data); } else if (label.groupType === 2) { // groupType: 2, 查询 weChatGroupService - data = await weChatGroupService.findWhere("groupId", label.id); + if (label.id == 0) { + data = await weChatGroupService.findWhereMultiple([ + { + field: "groupId", + operator: "notIn", + value: realGroup, + }, + ]); + } else { + data = await weChatGroupService.findWhere("groupId", label.id); + // 过滤出 kfSelected 对应的联系人 + } if (kfSelected && kfSelected != 0) { data = data.filter(contact => contact.wechatAccountId === kfSelected); }