提交 1e604eab 作者: ZhangLingKun

功能:消息管理-客服消息问题修复

上级 e2957478
流水线 #9031 已通过 于阶段
in 1 分 2 秒
...@@ -10,6 +10,9 @@ type DataType = InterDataType<selectUserListType>; ...@@ -10,6 +10,9 @@ type DataType = InterDataType<selectUserListType>;
// 列表类型 // 列表类型
type ListType = InterListType<selectUserMessageType>; type ListType = InterListType<selectUserMessageType>;
// 定时任务
let getMessageTimer: NodeJS.Timer;
const MessageChatContentView: React.FC<{ currentData: DataType[0]; userAccountId: number }> = ({ const MessageChatContentView: React.FC<{ currentData: DataType[0]; userAccountId: number }> = ({
currentData, currentData,
userAccountId, userAccountId,
...@@ -69,6 +72,12 @@ const MessageChatContentView: React.FC<{ currentData: DataType[0]; userAccountId ...@@ -69,6 +72,12 @@ const MessageChatContentView: React.FC<{ currentData: DataType[0]; userAccountId
useEffect(() => { useEffect(() => {
if (!currentData?.userAccountId) return; if (!currentData?.userAccountId) return;
getMessageList().then(); getMessageList().then();
getMessageTimer = setInterval(() => {
getMessageList().then();
}, 5000);
return () => {
clearInterval(getMessageTimer as any);
};
}, [currentData]); }, [currentData]);
// 消息列表副作用 // 消息列表副作用
useEffect(() => { useEffect(() => {
......
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
height: 45px; height: 45px;
border-radius: 50%; border-radius: 50%;
margin-right: 8px; margin-right: 8px;
object-fit: fill;
} }
.item-content { .item-content {
...@@ -132,6 +133,7 @@ ...@@ -132,6 +133,7 @@
height: 40px; height: 40px;
border-radius: 50%; border-radius: 50%;
margin-right: 10px; margin-right: 10px;
object-fit: fill;
} }
.title { .title {
......
...@@ -13,6 +13,9 @@ import MessageChatSystemView from '~/pages/messageManage/messageChat/comp/messag ...@@ -13,6 +13,9 @@ import MessageChatSystemView from '~/pages/messageManage/messageChat/comp/messag
// 消息类型 // 消息类型
type MessageType = InterDataType<selectUserListType>; type MessageType = InterDataType<selectUserListType>;
// 定时任务
let intervalTimer: NodeJS.Timer;
const MessageChatPage: React.FC = () => { const MessageChatPage: React.FC = () => {
// 登录的用户信息 // 登录的用户信息
const { userInfo } = useSelector((state: any) => state.UserInfo); const { userInfo } = useSelector((state: any) => state.UserInfo);
...@@ -92,6 +95,12 @@ const MessageChatPage: React.FC = () => { ...@@ -92,6 +95,12 @@ const MessageChatPage: React.FC = () => {
useEffect(() => { useEffect(() => {
if (isNull(userAccountId)) return; if (isNull(userAccountId)) return;
getMessageList().then(); getMessageList().then();
intervalTimer = setInterval(() => {
getMessageList().then();
}, 10000);
return () => {
clearInterval(intervalTimer as any);
};
}, [userAccountId]); }, [userAccountId]);
return ( return (
<div className='message-chat flex-start'> <div className='message-chat flex-start'>
......
...@@ -1462,7 +1462,6 @@ export const routerList: Array<RouteObjectType> = [ ...@@ -1462,7 +1462,6 @@ export const routerList: Array<RouteObjectType> = [
id: 1400, id: 1400,
icon: <CommentOutlined />, icon: <CommentOutlined />,
title: '消息管理', title: '消息管理',
develop: true,
}, },
children: [ children: [
{ {
...@@ -1473,7 +1472,6 @@ export const routerList: Array<RouteObjectType> = [ ...@@ -1473,7 +1472,6 @@ export const routerList: Array<RouteObjectType> = [
id: 1410, id: 1410,
title: '客服消息', title: '客服消息',
icon: <CommentOutlined />, icon: <CommentOutlined />,
develop: true,
}, },
}, },
], ],
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论