diff --git a/Cunkebao/src/pages/pc/ckbox/weChat/components/ChatWindow/components/MessageEnter/components/toContract/index.tsx b/Cunkebao/src/pages/pc/ckbox/weChat/components/ChatWindow/components/MessageEnter/components/toContract/index.tsx index 8fd4c404..be2f9cb2 100644 --- a/Cunkebao/src/pages/pc/ckbox/weChat/components/ChatWindow/components/MessageEnter/components/toContract/index.tsx +++ b/Cunkebao/src/pages/pc/ckbox/weChat/components/ChatWindow/components/MessageEnter/components/toContract/index.tsx @@ -7,7 +7,7 @@ import { WechatFriendRebackAllot, } from "@/pages/pc/ckbox/weChat/api"; import { useCurrentContact } from "@/store/module/weChat/weChat"; -import { deleteChatSession } from "@/store/module/ckchat/ckchat"; +import { useCkChatStore } from "@/store/module/ckchat/ckchat"; import { contractService, weChatGroupService } from "@/utils/db"; const { TextArea } = Input; const { Option } = Select; @@ -39,6 +39,7 @@ const ToContract: React.FC = ({ const [customerServiceList, setCustomerServiceList] = useState( [], ); + const deleteChatSession = useCkChatStore(state => state.deleteChatSession); // 打开弹窗 const openModal = () => { setVisible(true); @@ -89,12 +90,12 @@ const ToContract: React.FC = ({ message.success("转接成功"); try { // 删除聊天会话 - deleteChatSession(currentContact.id.toString()); + deleteChatSession(currentContact.id); // 删除本地数据库记录 if ("chatroomId" in currentContact) { await weChatGroupService.delete(currentContact.id); } else { - await contractService.delete(currentContact.id.toString()); + await contractService.delete(currentContact.id); } } catch (deleteError) { console.error("删除本地数据失败:", deleteError); @@ -129,7 +130,7 @@ const ToContract: React.FC = ({ message.success("转回成功"); try { // 删除聊天会话 - deleteChatSession(currentContact.id.toString()); + deleteChatSession(currentContact.id); // 删除本地数据库记录 if ("chatroomId" in currentContact) { await weChatGroupService.delete(currentContact.id); diff --git a/Cunkebao/src/pages/pc/ckbox/weChat/components/ChatWindow/components/MessageEnter/index.tsx b/Cunkebao/src/pages/pc/ckbox/weChat/components/ChatWindow/components/MessageEnter/index.tsx index 7676158d..22b99d15 100644 --- a/Cunkebao/src/pages/pc/ckbox/weChat/components/ChatWindow/components/MessageEnter/index.tsx +++ b/Cunkebao/src/pages/pc/ckbox/weChat/components/ChatWindow/components/MessageEnter/index.tsx @@ -1,12 +1,9 @@ import React, { useState } from "react"; -import { Layout, Input, Button, Tooltip, Modal } from "antd"; +import { Layout, Input, Button, Modal } from "antd"; import { - ShareAltOutlined, SendOutlined, - AudioOutlined, FolderOutlined, PictureOutlined, - MessageOutlined, } from "@ant-design/icons"; import { ContractData, weChatGroup } from "@/pages/pc/ckbox/data"; import { useWebSocketStore } from "@/store/module/websocket/websocket"; @@ -176,17 +173,7 @@ const MessageEnter: React.FC = ({ contract }) => { />
- { - console.log("转接数据:", data); - // 这里可以添加实际的转接逻辑 - }} - onReturn={() => { - console.log("执行一键转回操作"); - // 这里可以添加实际的转回逻辑 - }} - /> + { diff --git a/Cunkebao/src/store/module/ckchat/ckchat.data.ts b/Cunkebao/src/store/module/ckchat/ckchat.data.ts index 9477aacb..3d74c36c 100644 --- a/Cunkebao/src/store/module/ckchat/ckchat.data.ts +++ b/Cunkebao/src/store/module/ckchat/ckchat.data.ts @@ -60,7 +60,7 @@ export interface CkChatState { updateCtrlUser: (user: KfUserListData) => void; clearkfUserList: () => void; addChatSession: (session: any) => void; - deleteChatSession: (sessionId: string) => void; + deleteChatSession: (sessionId: number) => void; setUserInfo: (userInfo: CkUserInfo) => void; clearUserInfo: () => void; updateAccount: (account: Partial) => void; diff --git a/Cunkebao/src/store/module/ckchat/ckchat.ts b/Cunkebao/src/store/module/ckchat/ckchat.ts index 3ac0ba7f..5928866d 100644 --- a/Cunkebao/src/store/module/ckchat/ckchat.ts +++ b/Cunkebao/src/store/module/ckchat/ckchat.ts @@ -389,7 +389,7 @@ export const useCkChatStore = createPersistStore( })); }, // 删除聊天会话 - deleteChatSession: (sessionId: string) => { + deleteChatSession: (sessionId: number) => { set(state => ({ chatSessions: state.chatSessions.filter(item => item.id !== sessionId), }));