fix(ckchat): 修复聊天窗口输入框事件处理和类型定义

修复输入框的onKeyPress事件为onKeyDown以更好处理键盘事件
更新Person组件props类型定义以支持weChatGroup类型
将getkfUserList改为异步函数以备后续实现
This commit is contained in:
超级老白兔
2025-09-02 11:49:26 +08:00
parent efa34a1ac6
commit 316a237297
4 changed files with 5 additions and 4 deletions

View File

@@ -23,14 +23,14 @@ import {
EditOutlined,
CheckOutlined,
} from "@ant-design/icons";
import { ContractData } from "@/pages/pc/ckbox/data";
import { ContractData, weChatGroup } from "@/pages/pc/ckbox/data";
import { useCkChatStore } from "@/store/module/ckchat/ckchat";
import styles from "./Person.module.scss";
const { Sider } = Layout;
interface PersonProps {
contract: ContractData;
contract: ContractData | weChatGroup;
showProfile: boolean;
onToggleProfile?: () => void;
}

View File

@@ -965,7 +965,7 @@ const ChatWindow: React.FC<ChatWindowProps> = ({
<TextArea
value={inputValue}
onChange={e => setInputValue(e.target.value)}
onKeyPress={handleKeyPress}
onKeyDown={handleKeyPress}
placeholder="输入消息..."
autoSize={{ minRows: 1, maxRows: 4 }}
className={styles.messageInput}

View File

@@ -27,9 +27,10 @@ export const useCkChatStore = createPersistStore<CkChatState>(
// await kfUserService.createManyWithServerId(data);
},
// 获取客服列表
getkfUserList: () => {
getkfUserList: async () => {
const state = useCkChatStore.getState();
return state.kfUserList;
// return await kfUserService.findAll();
},
// 异步设置标签列表
asyncCountLables: async (data: ContactGroupByLabel[]) => {