feat(数据库): 添加消息列表数据接口和表

refactor(聊天会话): 根据选中客服过滤会话列表

fix(聊天窗口): 移除重复的未读消息清除逻辑

refactor(侧边栏): 统一联系人点击处理逻辑

chore: 删除无用的数据库测试文件
This commit is contained in:
超级老白兔
2025-09-01 10:24:15 +08:00
parent 5437a47e37
commit 64c75772bb
8 changed files with 54 additions and 199 deletions

View File

@@ -16,7 +16,7 @@ export const useCkChatStore = createPersistStore<CkChatState>(
chatSessions: [], //聊天会话
kfUserList: [], //客服列表
newContractList: [], //联系人分组
kfSelected: 0,
kfSelected: 0, //选中的客服
//客服列表
asyncKfUserList: async data => {
set({ kfUserList: data });
@@ -80,7 +80,13 @@ export const useCkChatStore = createPersistStore<CkChatState>(
// 获取聊天会话
getChatSessions: () => {
const state = useCkChatStore.getState();
return state.chatSessions;
if (state.kfSelected != 0) {
return state.chatSessions.filter(
item => item.wechatAccountId === state.kfSelected,
);
} else {
return state.chatSessions;
}
},
// 添加聊天会话
addChatSession: (session: ContractData | weChatGroup) => {