From 42418046e8c67533fc992ba308371cf980ec7329 Mon Sep 17 00:00:00 2001 From: zhengw <247276359@qq.com> Date: Sun, 23 Apr 2023 10:06:55 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BC=80=E5=8F=91:=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E8=81=8A=E5=A4=A9tab=E5=88=87=E6=8D=A2bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/ChatLogs/components/ChatVote.tsx | 4 +- src/pages/ChatLogs/index.module.scss | 2 +- src/pages/ChatLogs/index.tsx | 117 +++------- src/pages/Workbench/index.tsx | 246 +++++++++++---------- 4 files changed, 163 insertions(+), 206 deletions(-) diff --git a/src/pages/ChatLogs/components/ChatVote.tsx b/src/pages/ChatLogs/components/ChatVote.tsx index eb1d85e..1748c22 100644 --- a/src/pages/ChatLogs/components/ChatVote.tsx +++ b/src/pages/ChatLogs/components/ChatVote.tsx @@ -31,7 +31,7 @@ export const ChatVote: React.FC = (props) => { {Array.isArray(msg?.voteitem) ? [0, 1, 2].map((item) => { return msg?.voteitem[item] ? ( -
+
{msg?.voteitem[item]}
) : ( @@ -60,7 +60,7 @@ export const ChatVote: React.FC = (props) => { {Array.isArray(voteitem) ? voteitem.map((item) => { return ( -
+
{item}
); diff --git a/src/pages/ChatLogs/index.module.scss b/src/pages/ChatLogs/index.module.scss index bb83ad1..2c2eb1e 100644 --- a/src/pages/ChatLogs/index.module.scss +++ b/src/pages/ChatLogs/index.module.scss @@ -165,7 +165,7 @@ left: 0; z-index: 1; width: 100%; - max-height: 50vh; + max-height: 60vh; overflow: auto; background-color: #fff; box-shadow: 0 4px 6px #ccc; diff --git a/src/pages/ChatLogs/index.tsx b/src/pages/ChatLogs/index.tsx index 1a28a20..5754315 100644 --- a/src/pages/ChatLogs/index.tsx +++ b/src/pages/ChatLogs/index.tsx @@ -7,14 +7,9 @@ import { stringify } from 'qs'; import React, { useEffect, useRef, useState } from 'react'; import { CustDetailContent } from '../CustomList/components/CustDetailContent'; import { DepartmentMembersDetail } from '../DepartmentsList/components/DepartmentMemberDetail'; +import { GroupDetailContent } from '../GroupList/components/GroupDetailContent'; import { IChat, ICustFollow, IGroup, IGroupMembers, IStaffsItem } from './ChatLogsType'; -import { - adminList, - getAdminList, - groupMembersCount, - groupMembersCount2, - groupMembersListItem, -} from './ChatUtils'; +import { getAdminList } from './ChatUtils'; import { ChatBar } from './components/ChatBar'; import { ChatTime } from './components/ChatTime'; import { GroupListWidget } from './GroupList'; @@ -85,7 +80,7 @@ const ChatLogs: React.FC = () => { '2': '', }); - const [flolowsBoxShow, setFlolowsBox] = useState(false); + const [followBoxShow, setFlolowBoxShow] = useState(false); const [delFollowListShow, setDelFollowListShow] = useState(false); const timeShowRef = useRef(false); @@ -93,16 +88,17 @@ const ChatLogs: React.FC = () => { const isAllChatRef = useRef(false); const chatLogLoadingRef = useRef(false); const [chatLogLoading, setChatLogLoading] = useState(false); + const [staffSearchWord, setStaffSearchWord] = useState(''); function show() { - setFlolowsBox(false); + setFlolowBoxShow(false); } const getChatLogsList = () => { chatLogLoadingRef.current = true; setChatLogLoading(true); post({ - url: tabKey == '2' ? '/ChatLogs/GroupList' : '/ChatLogs/List', + url: tabKeyRef.current == '2' ? '/ChatLogs/GroupList' : '/ChatLogs/List', data: stringify(param), }).then((res) => { const count = res.count || 0; @@ -151,9 +147,10 @@ const ChatLogs: React.FC = () => { const page = (curr: number) => { param.curr_page = curr; param.msg_from = selectStaffRef.current?.user_id + ''; - if (tabKey == '0') { + + if (tabKeyRef.current == '0') { param.msg_to_list = selectInnerStaffRef.current?.user_id + ''; - } else if (tabKey == '1') { + } else if (tabKeyRef.current == '1') { param.msg_to_list = selectCustFollowRef.current?.cust_id + ''; } else { param.room_id = selectGroupRef.current?.group_id + ''; @@ -482,8 +479,25 @@ const ChatLogs: React.FC = () => {
-
+
+
{ + e.stopPropagation(); + }} + style={{ padding: '12px 0', background: '#fff', position: 'sticky', top: 0 }} + > + { + setStaffSearchWord(e.target.value.trim()); + }} + allowClear + /> +
{staffsList.map((item) => { + if (!item.name.includes(staffSearchWord)) return null; return (
{ setChatLogs([]); setSelectStaff({ ...item }); selectStaffRef.current = { ...item }; - setFlolowsBox(false); + setFlolowBoxShow(false); // if (tabKey == '1') { getCustFollowsList(); // } else if (tabKey == '2') { @@ -537,7 +551,7 @@ const ChatLogs: React.FC = () => { className={`${styles.chatA}`} onClick={(e) => { e.stopPropagation(); - setFlolowsBox(!flolowsBoxShow); + setFlolowBoxShow(!followBoxShow); }} > {selectStaff ? ( @@ -563,7 +577,7 @@ const ChatLogs: React.FC = () => { {selectStaff.name}
- {flolowsBoxShow ? : } + {followBoxShow ? : } ) : null}
@@ -634,77 +648,14 @@ const ChatLogs: React.FC = () => { width={600} onClose={() => setOpen(false)} footer={false} + destroyOnClose > {tabKeyRef.current == '0' ? ( ) : tabKeyRef.current == '1' ? ( ) : ( -
-
- 群主: - {groupMembersObjRef.current[selectGroupRef.current?.owner as string]?.name} -
-
- {adminList(selectGroupRef.current?.admin_list, groupMembersObjRef.current)} -
-
- 创建时间:{selectGroupRef.current?.create_time} -
-
群公告:{selectGroupRef.current?.notice}
-
- 群成员 • {groupMembersList.length} -
- {groupMembersList.map((item) => { - return item.group_members_type == '2' || item.state == 0 - ? null - : groupMembersListItem(item, selectGroupRef.current as IGroup); - })} - {groupMembersCount2(groupMembersList, '2', 1) != 0 ? ( -
- 微信: -
- ) : null} - {groupMembersList.map((item) => { - return item.group_members_type == '1' || item.state == 0 - ? null - : groupMembersListItem(item, selectGroupRef.current as IGroup); - })} - {groupMembersCount(groupMembersList, 0) != 0 ? ( -
- 已离群: -
- ) : null} - {groupMembersList.map((item) => { - return item.state == 1 - ? null - : groupMembersListItem(item, selectGroupRef.current as IGroup); - })} -
+ )}
@@ -738,10 +689,10 @@ const ChatLogs: React.FC = () => { ); } else { return ( -
+
{/* {item.show_time ? : null} */} - {tabKey == '2' ? ( + {tabKeyRef.current == '2' ? ( { custsChart: [], groupsChart: [], }); + const [loading, setLoading] = useState(false); const getWorkBenchInfo = () => { + setLoading(true); post({ url: '/WorkBench/Info' }).then((res) => { + setLoading(false); if (res.err_code == 0) { if (res.over_view) { data.overView = res.over_view; @@ -87,137 +91,139 @@ const Workbench: React.FC = () => { return ( -
-
- 数据总览 - {/* 更新时间:2022-12-12 23:30:30 */} + +
+
+ 数据总览 + {/* 更新时间:2022-12-12 23:30:30 */} +
+
+ } + count={data.overView.custs_total} + /> + } + count={data.overView.groups_total} + /> + } + count={data.overView.groups_members_total} + /> +
-
- } - count={data.overView.custs_total} - /> - } - count={data.overView.groups_total} - /> - } - count={data.overView.groups_members_total} - /> -
-
-
-
客户数据
-
- - - {/* +
客户数据
+
+ + + {/* */} - {/* */} - - - - - - {/* */} + + + + + + {/* */} -
- `${(v / 10e8).toFixed(1)} B`, - // }, - // },} - legend={{ - position: 'top', - }} - smooth={true} - // @TODO 后续会换一种动画方式 - animation={{ - appear: { - animation: 'path-in', - duration: 3000, - }, - }} - /> -
-
-
客群数据
-
- - - - - - - + `${(v / 10e8).toFixed(1)} B`, + // }, + // },} + legend={{ + position: 'top', + }} + smooth={true} + // @TODO 后续会换一种动画方式 + animation={{ + appear: { + animation: 'path-in', + duration: 3000, + }, + }} />
- -
+
+
客群数据
+
+ + + + + + + +
+ +
+ ); };