fix(ckchat): 修复聊天窗口输入框事件处理和类型定义
修复输入框的onKeyPress事件为onKeyDown以更好处理键盘事件 更新Person组件props类型定义以支持weChatGroup类型 将getkfUserList改为异步函数以备后续实现
This commit is contained in:
@@ -23,14 +23,14 @@ import {
|
|||||||
EditOutlined,
|
EditOutlined,
|
||||||
CheckOutlined,
|
CheckOutlined,
|
||||||
} from "@ant-design/icons";
|
} 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 { useCkChatStore } from "@/store/module/ckchat/ckchat";
|
||||||
import styles from "./Person.module.scss";
|
import styles from "./Person.module.scss";
|
||||||
|
|
||||||
const { Sider } = Layout;
|
const { Sider } = Layout;
|
||||||
|
|
||||||
interface PersonProps {
|
interface PersonProps {
|
||||||
contract: ContractData;
|
contract: ContractData | weChatGroup;
|
||||||
showProfile: boolean;
|
showProfile: boolean;
|
||||||
onToggleProfile?: () => void;
|
onToggleProfile?: () => void;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -965,7 +965,7 @@ const ChatWindow: React.FC<ChatWindowProps> = ({
|
|||||||
<TextArea
|
<TextArea
|
||||||
value={inputValue}
|
value={inputValue}
|
||||||
onChange={e => setInputValue(e.target.value)}
|
onChange={e => setInputValue(e.target.value)}
|
||||||
onKeyPress={handleKeyPress}
|
onKeyDown={handleKeyPress}
|
||||||
placeholder="输入消息..."
|
placeholder="输入消息..."
|
||||||
autoSize={{ minRows: 1, maxRows: 4 }}
|
autoSize={{ minRows: 1, maxRows: 4 }}
|
||||||
className={styles.messageInput}
|
className={styles.messageInput}
|
||||||
|
|||||||
@@ -27,9 +27,10 @@ export const useCkChatStore = createPersistStore<CkChatState>(
|
|||||||
// await kfUserService.createManyWithServerId(data);
|
// await kfUserService.createManyWithServerId(data);
|
||||||
},
|
},
|
||||||
// 获取客服列表
|
// 获取客服列表
|
||||||
getkfUserList: () => {
|
getkfUserList: async () => {
|
||||||
const state = useCkChatStore.getState();
|
const state = useCkChatStore.getState();
|
||||||
return state.kfUserList;
|
return state.kfUserList;
|
||||||
|
// return await kfUserService.findAll();
|
||||||
},
|
},
|
||||||
// 异步设置标签列表
|
// 异步设置标签列表
|
||||||
asyncCountLables: async (data: ContactGroupByLabel[]) => {
|
asyncCountLables: async (data: ContactGroupByLabel[]) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user