From 7056e00fcc71879e8ad43fc1c4923875b42ed674 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B6=85=E7=BA=A7=E8=80=81=E7=99=BD=E5=85=94?= Date: Thu, 23 Oct 2025 17:21:25 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=B6=88=E6=81=AF=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E7=BB=84=E4=BB=B6=EF=BC=8C=E6=96=B0=E5=A2=9E=E5=BD=93?= =?UTF-8?q?=E5=89=8D=E5=AE=A2=E6=88=B7=E7=8A=B6=E6=80=81=E7=AE=A1=E7=90=86?= =?UTF-8?q?=EF=BC=8C=E4=BC=98=E5=8C=96=E6=B6=88=E6=81=AF=E7=AD=9B=E9=80=89?= =?UTF-8?q?=E9=80=BB=E8=BE=91=E4=BB=A5=E6=8F=90=E5=8D=87=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E4=BD=93=E9=AA=8C=E5=92=8C=E4=BB=A3=E7=A0=81=E5=8F=AF=E8=AF=BB?= =?UTF-8?q?=E6=80=A7=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/SidebarMenu/MessageList/index.tsx | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Touchkebao/src/pages/pc/ckbox/weChat/components/SidebarMenu/MessageList/index.tsx b/Touchkebao/src/pages/pc/ckbox/weChat/components/SidebarMenu/MessageList/index.tsx index dec222c6..9ff4cb21 100644 --- a/Touchkebao/src/pages/pc/ckbox/weChat/components/SidebarMenu/MessageList/index.tsx +++ b/Touchkebao/src/pages/pc/ckbox/weChat/components/SidebarMenu/MessageList/index.tsx @@ -10,6 +10,7 @@ import { import { useWeChatStore } from "@/store/module/weChat/weChat"; import { useCkChatStore } from "@/store/module/ckchat/ckchat"; import { useWebSocketStore } from "@/store/module/websocket/websocket"; +import { useCustomerStore } from "@/store/module/weChat/customer"; import { updateConfig } from "@/pages/pc/ckbox/api"; import { getMessageList } from "./api"; import { dataProcessing } from "./api"; @@ -23,8 +24,8 @@ interface MessageListProps {} const MessageList: React.FC = () => { const { setCurrentContact, currentContract } = useWeChatStore(); - const kfSelected = useCkChatStore(state => state.kfSelected); const searchKeyword = useCkChatStore(state => state.searchKeyword); + const { currentCustomer } = useCustomerStore(); const { sendCommand } = useWebSocketStore(); const { user } = useUserStore(); const currentUserId = user?.id || 0; @@ -392,9 +393,9 @@ const MessageList: React.FC = () => { useEffect(() => { let filtered = [...sessions]; - // 根据客服筛选 - if (kfSelected !== 0) { - filtered = filtered.filter(v => v.wechatAccountId === kfSelected); + // 根据当前选中的客服筛选 + if (currentCustomer && currentCustomer.id !== 0) { + filtered = filtered.filter(v => v.wechatAccountId === currentCustomer.id); } // 根据搜索关键词进行模糊匹配 @@ -408,7 +409,7 @@ const MessageList: React.FC = () => { } setFilteredSessions(filtered); - }, [sessions, kfSelected, searchKeyword]); + }, [sessions, currentCustomer, searchKeyword]); // ==================== WebSocket消息处理 ====================