患者回话列表筛选
This commit is contained in:
@@ -236,21 +236,31 @@ export class LocalConversationViewModel {
|
||||
}
|
||||
this.offset = result.offset
|
||||
this.isFinished = result.finished
|
||||
let newConversation = result.conversationList
|
||||
if (this.conversationList.length > 0 && newConversation.length > 0) {
|
||||
this.conversationList =
|
||||
this.conversationList.filter(conversation => !newConversation.find((m) => m.conversationId ===
|
||||
conversation.conversationId))
|
||||
}
|
||||
this.conversationList?.push(...newConversation)
|
||||
// let newConversation = result.conversationList
|
||||
// if (this.conversationList.length > 0 && newConversation.length > 0) {
|
||||
// this.conversationList =
|
||||
// this.conversationList.filter(conversation => !newConversation.find((m) => m.conversationId ===
|
||||
// conversation.conversationId))
|
||||
// }
|
||||
// this.conversationList?.push(...newConversation)
|
||||
//异步有问题
|
||||
if (this.conversationList.length > 0 ) {
|
||||
const resultconversationList =await this.conversationList.filter(async conversation =>
|
||||
await patientDbManager.getPatientByUuid(ChatKitClient.nim.conversationIdUtil.parseConversationTargetId(conversation.conversationId))!=null
|
||||
)
|
||||
this.conversationList =resultconversationList;
|
||||
|
||||
// if (this.conversationList.length > 0 ) {
|
||||
// const resultconversationList =await this.conversationList.filter(async conversation =>
|
||||
// await patientDbManager.getPatientByUuid(ChatKitClient.nim.conversationIdUtil.parseConversationTargetId(conversation.conversationId))!=null
|
||||
// )
|
||||
// this.conversationList =resultconversationList;
|
||||
//
|
||||
// }
|
||||
const filteredConversations: V2NIMLocalConversation[] = [];
|
||||
for (const conversation of result.conversationList) {
|
||||
const uuid = ChatKitClient.nim.conversationIdUtil.parseConversationTargetId(conversation.conversationId);
|
||||
// 假设 selectUserStyleWithModel 返回 "1" 表示 type=1
|
||||
const style = await patientDbManager.getPatientTypeByUuid(uuid);
|
||||
if (style == 1) {
|
||||
filteredConversations.push(conversation);
|
||||
}
|
||||
}
|
||||
this.conversationList = filteredConversations;
|
||||
|
||||
this.conversationList?.sort((a, b) => this.sortConversation(a, b))
|
||||
this.isFinishedSyncLoad = true
|
||||
|
||||
Reference in New Issue
Block a user