开发: 修改页面, 修改引入录音js
This commit is contained in:
@@ -136,6 +136,7 @@ export default defineConfig({
|
|||||||
headScripts: [
|
headScripts: [
|
||||||
// 解决首次加载时白屏的问题
|
// 解决首次加载时白屏的问题
|
||||||
{ src: '/scripts/loading.js', async: true },
|
{ src: '/scripts/loading.js', async: true },
|
||||||
|
{ src: '/scripts/amrnb.js', async: true },
|
||||||
],
|
],
|
||||||
//================ pro 插件配置 =================
|
//================ pro 插件配置 =================
|
||||||
presets: ['umi-presets-pro'],
|
presets: ['umi-presets-pro'],
|
||||||
|
@@ -54,10 +54,17 @@ export interface ICustFollow {
|
|||||||
state: number;
|
state: number;
|
||||||
sync_time: string;
|
sync_time: string;
|
||||||
tags: string;
|
tags: string;
|
||||||
|
|
||||||
|
add_way: number;
|
||||||
|
|
||||||
|
create_time: string;
|
||||||
|
|
||||||
|
user_id: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface IGroup {
|
export interface IGroup {
|
||||||
admin_list: string;
|
admin_list: string;
|
||||||
|
adminUserIDs: string[];
|
||||||
create_time: string;
|
create_time: string;
|
||||||
group_id: string;
|
group_id: string;
|
||||||
name: string;
|
name: string;
|
||||||
|
@@ -60,6 +60,27 @@ export const adminList = (data: any, groupMembers: any) => {
|
|||||||
|
|
||||||
return <></>;
|
return <></>;
|
||||||
};
|
};
|
||||||
|
/**
|
||||||
|
* 返回群管理员 userid 数组
|
||||||
|
* @param data
|
||||||
|
* @returns
|
||||||
|
*/
|
||||||
|
export const getAdminList = (data: any) => {
|
||||||
|
if (data) {
|
||||||
|
try {
|
||||||
|
const msg = JSON.parse(data);
|
||||||
|
if (Array.isArray(msg)) {
|
||||||
|
let arr: string[] = [];
|
||||||
|
msg.forEach((item) => {
|
||||||
|
arr.push(item.userid);
|
||||||
|
});
|
||||||
|
return arr;
|
||||||
|
}
|
||||||
|
} catch (e) {}
|
||||||
|
}
|
||||||
|
|
||||||
|
return [];
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 客户等级等信息
|
* 客户等级等信息
|
||||||
|
@@ -7,28 +7,34 @@ export const Gender: React.FC<IProps> = (props) => {
|
|||||||
{props?.gender ? (
|
{props?.gender ? (
|
||||||
<>
|
<>
|
||||||
{props?.gender == 1 ? (
|
{props?.gender == 1 ? (
|
||||||
<svg viewBox="0 0 1024 1024" width="16" height="16">
|
<span title="男" style={{ display: 'inline-flex', alignItems: 'center' }}>
|
||||||
<path
|
<svg viewBox="0 0 1024 1024" width="16" height="16">
|
||||||
d="M828.875 765.657c-191.159-16.86-202.516-102.922-202.516-102.922v-85.997c111.656-43.063 145.76-207.699 145.76-207.699 0-65.457-32.153-67.281-32.153-67.281V195.093c7.486-177.753-100.33-136.61-102.25-136.61-1.791 0-60.466-46.774-60.466-46.774-41.751-31.8-134.499 11.262-134.499 11.262l-3.839 0.064c-104.937 2.751-132.387 78.479-132.387 78.479l1.92 196.437c-54.804 0-47.35 76.719-47.35 76.719 0 84.142 147.616 200.148 147.616 200.148 9.47 110.472-49.174 166.46-49.174 166.46s-100.266 3.711-213.84 37.432c-2.72 0.863-5.344 1.6-7.967 2.463C30.617 817.421 0 920.855 0 920.855v101.033l463.579 1.888 68.465-1.92h491.732V943.25c1.92-115.815-194.901-177.593-194.901-177.593z m-244.65 129.22l-71.25 128.675-69.616-128.676-16.124-64.05 30.68-136.354h111.656l29.178 136.354-14.525 64.05z"
|
<path
|
||||||
fill="#1890ff"
|
d="M828.875 765.657c-191.159-16.86-202.516-102.922-202.516-102.922v-85.997c111.656-43.063 145.76-207.699 145.76-207.699 0-65.457-32.153-67.281-32.153-67.281V195.093c7.486-177.753-100.33-136.61-102.25-136.61-1.791 0-60.466-46.774-60.466-46.774-41.751-31.8-134.499 11.262-134.499 11.262l-3.839 0.064c-104.937 2.751-132.387 78.479-132.387 78.479l1.92 196.437c-54.804 0-47.35 76.719-47.35 76.719 0 84.142 147.616 200.148 147.616 200.148 9.47 110.472-49.174 166.46-49.174 166.46s-100.266 3.711-213.84 37.432c-2.72 0.863-5.344 1.6-7.967 2.463C30.617 817.421 0 920.855 0 920.855v101.033l463.579 1.888 68.465-1.92h491.732V943.25c1.92-115.815-194.901-177.593-194.901-177.593z m-244.65 129.22l-71.25 128.675-69.616-128.676-16.124-64.05 30.68-136.354h111.656l29.178 136.354-14.525 64.05z"
|
||||||
></path>
|
fill="#1890ff"
|
||||||
</svg>
|
></path>
|
||||||
|
</svg>
|
||||||
|
</span>
|
||||||
) : (
|
) : (
|
||||||
<svg viewBox="0 0 1025 1024" width="16" height="16">
|
<span title="女" style={{ display: 'inline-flex', alignItems: 'center' }}>
|
||||||
<path
|
<svg viewBox="0 0 1025 1024" width="16" height="16">
|
||||||
d="M613.312 626.496v-11.2h151.296V318.08c0-124.736-113.152-225.856-252.608-225.856S259.392 193.344 259.392 318.08v297.216h151.36v11.072h-0.256L115.648 820.16v107.136H908.48v-105.92l-295.168-194.88z m7.68 186.752c-72.192 69.824-109.504-36.416-109.504-36.416s-37.312 106.24-109.568 36.416c0 0-31.744-20.544-35.136-158.208l144.704 121.728L656.192 655.04c-3.392 137.6-35.2 158.208-35.2 158.208z"
|
<path
|
||||||
fill="#1890ff"
|
d="M613.312 626.496v-11.2h151.296V318.08c0-124.736-113.152-225.856-252.608-225.856S259.392 193.344 259.392 318.08v297.216h151.36v11.072h-0.256L115.648 820.16v107.136H908.48v-105.92l-295.168-194.88z m7.68 186.752c-72.192 69.824-109.504-36.416-109.504-36.416s-37.312 106.24-109.568 36.416c0 0-31.744-20.544-35.136-158.208l144.704 121.728L656.192 655.04c-3.392 137.6-35.2 158.208-35.2 158.208z"
|
||||||
></path>
|
fill="#1890ff"
|
||||||
</svg>
|
></path>
|
||||||
|
</svg>
|
||||||
|
</span>
|
||||||
)}
|
)}
|
||||||
</>
|
</>
|
||||||
) : (
|
) : (
|
||||||
<svg viewBox="0 0 1024 1024" width="16" height="16">
|
<span title="未知" style={{ display: 'inline-flex', alignItems: 'center' }}>
|
||||||
<path
|
<svg viewBox="0 0 1024 1024" width="16" height="16">
|
||||||
d="M880.864 704.346c-56.813-25.397-141.118-90.818-265.945-113.298 31.924-34.36 56.084-88.097 80.937-151.754 14.403-36.893 11.935-68.343 11.935-113.121 0-33.073 6.193-86.156-1.97-115.329-27.533-98.59-97.1-125.79-178.61-125.79-81.577 0-151.229 27.328-178.71 126.087-8.097 29.083-1.888 82.044-1.888 115.037 0 44.875-2.422 76.432 12.019 113.383 25.044 63.984 48.854 117.644 80.655 151.86-123.826 22.89-207.498 87.822-263.95 113.138C58.523 756.945 57.95 814.296 57.95 814.296v97.42l940.724-0.112v-97.308s-0.547-57.548-117.809-109.95z"
|
<path
|
||||||
fill="#1890ff"
|
d="M880.864 704.346c-56.813-25.397-141.118-90.818-265.945-113.298 31.924-34.36 56.084-88.097 80.937-151.754 14.403-36.893 11.935-68.343 11.935-113.121 0-33.073 6.193-86.156-1.97-115.329-27.533-98.59-97.1-125.79-178.61-125.79-81.577 0-151.229 27.328-178.71 126.087-8.097 29.083-1.888 82.044-1.888 115.037 0 44.875-2.422 76.432 12.019 113.383 25.044 63.984 48.854 117.644 80.655 151.86-123.826 22.89-207.498 87.822-263.95 113.138C58.523 756.945 57.95 814.296 57.95 814.296v97.42l940.724-0.112v-97.308s-0.547-57.548-117.809-109.95z"
|
||||||
></path>
|
fill="#1890ff"
|
||||||
</svg>
|
></path>
|
||||||
|
</svg>
|
||||||
|
</span>
|
||||||
)}
|
)}
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
43
src/pages/ChatLogs/components/Svgs.tsx
Normal file
43
src/pages/ChatLogs/components/Svgs.tsx
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
export const OwnerSvg = () => {
|
||||||
|
return (
|
||||||
|
<span
|
||||||
|
title="创建者"
|
||||||
|
style={{
|
||||||
|
display: 'inline-flex',
|
||||||
|
alignItems: 'center',
|
||||||
|
position: 'absolute',
|
||||||
|
top: 0,
|
||||||
|
right: 0,
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<svg viewBox="0 0 1024 1024" width="16" height="16">
|
||||||
|
<path
|
||||||
|
d="M880.864 704.346c-56.813-25.397-141.118-90.818-265.945-113.298 31.924-34.36 56.084-88.097 80.937-151.754 14.403-36.893 11.935-68.343 11.935-113.121 0-33.073 6.193-86.156-1.97-115.329-27.533-98.59-97.1-125.79-178.61-125.79-81.577 0-151.229 27.328-178.71 126.087-8.097 29.083-1.888 82.044-1.888 115.037 0 44.875-2.422 76.432 12.019 113.383 25.044 63.984 48.854 117.644 80.655 151.86-123.826 22.89-207.498 87.822-263.95 113.138C58.523 756.945 57.95 814.296 57.95 814.296v97.42l940.724-0.112v-97.308s-0.547-57.548-117.809-109.95z"
|
||||||
|
fill="#f4ea2a"
|
||||||
|
></path>
|
||||||
|
</svg>
|
||||||
|
</span>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export const AdminSvg = () => {
|
||||||
|
return (
|
||||||
|
<span
|
||||||
|
title="管理员"
|
||||||
|
style={{
|
||||||
|
display: 'inline-flex',
|
||||||
|
alignItems: 'center',
|
||||||
|
position: 'absolute',
|
||||||
|
top: 0,
|
||||||
|
right: 0,
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<svg viewBox="0 0 1024 1024" width="16" height="16">
|
||||||
|
<path
|
||||||
|
d="M880.864 704.346c-56.813-25.397-141.118-90.818-265.945-113.298 31.924-34.36 56.084-88.097 80.937-151.754 14.403-36.893 11.935-68.343 11.935-113.121 0-33.073 6.193-86.156-1.97-115.329-27.533-98.59-97.1-125.79-178.61-125.79-81.577 0-151.229 27.328-178.71 126.087-8.097 29.083-1.888 82.044-1.888 115.037 0 44.875-2.422 76.432 12.019 113.383 25.044 63.984 48.854 117.644 80.655 151.86-123.826 22.89-207.498 87.822-263.95 113.138C58.523 756.945 57.95 814.296 57.95 814.296v97.42l940.724-0.112v-97.308s-0.547-57.548-117.809-109.95z"
|
||||||
|
fill="#1890ff"
|
||||||
|
></path>
|
||||||
|
</svg>
|
||||||
|
</span>
|
||||||
|
);
|
||||||
|
};
|
@@ -66,6 +66,19 @@
|
|||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.inGroupAvatar {
|
||||||
|
position: relative;
|
||||||
|
display: flex;
|
||||||
|
flex-shrink: 0;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
width: 56px;
|
||||||
|
height: 56px;
|
||||||
|
line-height: 1;
|
||||||
|
background-color: #69b1ff;
|
||||||
|
border-radius: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
.chatBBox {
|
.chatBBox {
|
||||||
position: relative;
|
position: relative;
|
||||||
height: calc(100vh - 212px - 164px);
|
height: calc(100vh - 212px - 164px);
|
||||||
@@ -82,8 +95,8 @@
|
|||||||
transition: top 0.3s, height 0.3s;
|
transition: top 0.3s, height 0.3s;
|
||||||
|
|
||||||
&.delFollowListShow {
|
&.delFollowListShow {
|
||||||
top: 0;
|
top: 164px;
|
||||||
height: calc(100% - 34px);
|
height: calc(100% - 164px);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -5,12 +5,13 @@ import { Drawer, Form, Input, Tabs } from 'antd';
|
|||||||
import Spin from 'antd/lib/spin';
|
import Spin from 'antd/lib/spin';
|
||||||
import { stringify } from 'qs';
|
import { stringify } from 'qs';
|
||||||
import React, { useEffect, useRef, useState } from 'react';
|
import React, { useEffect, useRef, useState } from 'react';
|
||||||
|
import { CustDetailContent } from '../CustomList/components/CustDetailContent';
|
||||||
import { DepartmentMembersDetail } from '../DepartmentsList/components/DepartmentMemberDetail';
|
import { DepartmentMembersDetail } from '../DepartmentsList/components/DepartmentMemberDetail';
|
||||||
import { IChat, ICustFollow, IGroup, IGroupMembers, IStaffsItem } from './ChatLogsType';
|
import { IChat, ICustFollow, IGroup, IGroupMembers, IStaffsItem } from './ChatLogsType';
|
||||||
import { adminList, formatTags, groupMembersCount, groupMembersCount2 } from './ChatUtils';
|
import { adminList, getAdminList, groupMembersCount, groupMembersCount2 } from './ChatUtils';
|
||||||
import { ChatBar } from './components/ChatBar';
|
import { ChatBar } from './components/ChatBar';
|
||||||
import { ChatTime } from './components/ChatTime';
|
import { ChatTime } from './components/ChatTime';
|
||||||
import { Gender } from './components/Gender';
|
import { AdminSvg, OwnerSvg } from './components/Svgs';
|
||||||
import styles from './index.module.scss';
|
import styles from './index.module.scss';
|
||||||
|
|
||||||
const ChatLogs: React.FC = () => {
|
const ChatLogs: React.FC = () => {
|
||||||
@@ -187,11 +188,22 @@ const ChatLogs: React.FC = () => {
|
|||||||
if (res.err_code == 0) {
|
if (res.err_code == 0) {
|
||||||
if (Array.isArray(res.data)) {
|
if (Array.isArray(res.data)) {
|
||||||
groupMembersObjRef.current = {};
|
groupMembersObjRef.current = {};
|
||||||
|
let owner: IGroupMembers[] = [];
|
||||||
|
let admin_list: IGroupMembers[] = [];
|
||||||
|
let other: IGroupMembers[] = [];
|
||||||
res.data.forEach((item: IGroupMembers) => {
|
res.data.forEach((item: IGroupMembers) => {
|
||||||
item.avatar = item.staff_avatar || item.avatar;
|
item.avatar = item.staff_avatar || item.avatar;
|
||||||
groupMembersObjRef.current[item.user_id] = item;
|
groupMembersObjRef.current[item.user_id] = item;
|
||||||
|
if (item.user_id == selectGroupRef.current?.owner) {
|
||||||
|
owner.push(item);
|
||||||
|
} else if (selectGroupRef.current?.adminUserIDs.includes(item.user_id)) {
|
||||||
|
admin_list.push(item);
|
||||||
|
} else {
|
||||||
|
other.push(item);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
setGroupMembersList(res.data);
|
// 对群员 创建者 > 管理员 > 普通成员 排序
|
||||||
|
setGroupMembersList([...owner, ...admin_list, ...other]);
|
||||||
page(1);
|
page(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -256,18 +268,79 @@ const ChatLogs: React.FC = () => {
|
|||||||
getStaffsList();
|
getStaffsList();
|
||||||
|
|
||||||
observer.observe(chatBoxRef.current, { childList: true });
|
observer.observe(chatBoxRef.current, { childList: true });
|
||||||
const myScript = document.createElement('script');
|
|
||||||
myScript.src = '/public/scripts/amrnb.js';
|
|
||||||
myScript.async = false;
|
|
||||||
document.body.appendChild(myScript);
|
|
||||||
|
|
||||||
return () => {
|
return () => {
|
||||||
document.removeEventListener('click', show, false);
|
document.removeEventListener('click', show, false);
|
||||||
observer.disconnect();
|
observer.disconnect();
|
||||||
document.body.removeChild(myScript);
|
|
||||||
};
|
};
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
|
// 外部联系人Item
|
||||||
|
const custFollowsListItem = (item: ICustFollow) => {
|
||||||
|
return (
|
||||||
|
<div
|
||||||
|
key={item.cust_id}
|
||||||
|
className={`${styles.chatB} ${item.state == 0 ? styles.state0 : ''} ${
|
||||||
|
selectCustFollow?.cust_id == item.cust_id ? styles.active : ''
|
||||||
|
}`}
|
||||||
|
onClick={() => {
|
||||||
|
tabKeyRef.current = tabKey;
|
||||||
|
|
||||||
|
setSelectInnerStaff(undefined);
|
||||||
|
selectInnerStaffRef.current = undefined;
|
||||||
|
setSelectGroup(undefined);
|
||||||
|
selectGroupRef.current = undefined;
|
||||||
|
|
||||||
|
setSelectCustFollow(item);
|
||||||
|
selectCustFollowRef.current = item;
|
||||||
|
page(1);
|
||||||
|
}}
|
||||||
|
style={{ display: item.name.includes(searchWord['1']) ? '' : 'none' }}
|
||||||
|
>
|
||||||
|
<div className={styles.avatar} style={{ background: item?.avatar ? '#fff' : '' }}>
|
||||||
|
<img src={item.avatar} alt="" style={{ maxWidth: '100%', maxHeight: '100%', objectFit: 'cover' }} />
|
||||||
|
</div>
|
||||||
|
<div className={styles.chatAMsg} style={{ flexDirection: 'column' }}>
|
||||||
|
<div className={styles.chatAName} title={item.name}>
|
||||||
|
{item.name}
|
||||||
|
</div>
|
||||||
|
<div>{item.remark}</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
// 客户群聊列表项
|
||||||
|
const groupListItem = (item: IGroup) => {
|
||||||
|
return (
|
||||||
|
<div
|
||||||
|
key={item.group_id}
|
||||||
|
className={`${styles.chatB} ${item.state == 0 ? styles.state0 : ''} ${selectGroup?.group_id == item.group_id ? styles.active : ''}`}
|
||||||
|
onClick={() => {
|
||||||
|
tabKeyRef.current = tabKey;
|
||||||
|
setSelectCustFollow(undefined);
|
||||||
|
selectCustFollowRef.current = undefined;
|
||||||
|
setSelectInnerStaff(undefined);
|
||||||
|
selectInnerStaffRef.current = undefined;
|
||||||
|
setSelectGroup(item);
|
||||||
|
selectGroupRef.current = item;
|
||||||
|
selectGroupRef.current.adminUserIDs = getAdminList(item.admin_list);
|
||||||
|
|
||||||
|
getGroupMembersList();
|
||||||
|
}}
|
||||||
|
style={{ display: item.name.includes(searchWord['2']) ? '' : 'none' }}
|
||||||
|
>
|
||||||
|
<div className={styles.avatar}>{item.name ? item.name[0] : '群'}</div>
|
||||||
|
<div className={styles.chatAMsg} style={{ flexDirection: 'column' }}>
|
||||||
|
<div className={styles.chatAName} title={item.name}>
|
||||||
|
{item.name || '未定义群名'}
|
||||||
|
</div>
|
||||||
|
<div style={{ color: '#999' }}>{groupStatus[item.status]}</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
// const { notification } = App.useApp();
|
// const { notification } = App.useApp();
|
||||||
const tabContent = () => {
|
const tabContent = () => {
|
||||||
if (tabKey == '0') {
|
if (tabKey == '0') {
|
||||||
@@ -282,9 +355,7 @@ const ChatLogs: React.FC = () => {
|
|||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
key={`${item.user_id}_${item.name}`}
|
key={`${item.user_id}_${item.name}`}
|
||||||
className={`${styles.chatB} ${
|
className={`${styles.chatB} ${selectInnerStaff?.user_id == item.user_id ? styles.active : ''}`}
|
||||||
selectInnerStaff?.user_id == item.user_id ? styles.active : ''
|
|
||||||
}`}
|
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
tabKeyRef.current = tabKey;
|
tabKeyRef.current = tabKey;
|
||||||
|
|
||||||
@@ -324,9 +395,7 @@ const ChatLogs: React.FC = () => {
|
|||||||
);
|
);
|
||||||
})
|
})
|
||||||
) : (
|
) : (
|
||||||
<div style={{ lineHeight: '44px', textAlign: 'center', color: '#999' }}>
|
<div style={{ lineHeight: '44px', textAlign: 'center', color: '#999' }}>暂无内部联系人</div>
|
||||||
暂无内部联系人
|
|
||||||
</div>
|
|
||||||
)}
|
)}
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
@@ -335,53 +404,12 @@ const ChatLogs: React.FC = () => {
|
|||||||
<>
|
<>
|
||||||
{custFollowsList.length ? (
|
{custFollowsList.length ? (
|
||||||
custFollowsList.map((item) => {
|
custFollowsList.map((item) => {
|
||||||
if (item.state == 0) return null;
|
return item.state == 0 ? null : custFollowsListItem(item);
|
||||||
return (
|
|
||||||
<div
|
|
||||||
key={item.cust_id}
|
|
||||||
className={`${styles.chatB} ${item.state == 0 ? styles.state0 : ''} ${
|
|
||||||
selectCustFollow?.cust_id == item.cust_id ? styles.active : ''
|
|
||||||
}`}
|
|
||||||
onClick={() => {
|
|
||||||
tabKeyRef.current = tabKey;
|
|
||||||
|
|
||||||
setSelectInnerStaff(undefined);
|
|
||||||
selectInnerStaffRef.current = undefined;
|
|
||||||
setSelectGroup(undefined);
|
|
||||||
selectGroupRef.current = undefined;
|
|
||||||
|
|
||||||
setSelectCustFollow(item);
|
|
||||||
selectCustFollowRef.current = item;
|
|
||||||
page(1);
|
|
||||||
}}
|
|
||||||
style={{ display: item.name.includes(searchWord['1']) ? '' : 'none' }}
|
|
||||||
>
|
|
||||||
<div className={styles.avatar} style={{ background: item?.avatar ? '#fff' : '' }}>
|
|
||||||
<img
|
|
||||||
src={item.avatar}
|
|
||||||
alt=""
|
|
||||||
style={{ maxWidth: '100%', maxHeight: '100%', objectFit: 'cover' }}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<div className={styles.chatAMsg} style={{ flexDirection: 'column' }}>
|
|
||||||
<div className={styles.chatAName} title={item.name}>
|
|
||||||
{item.name}
|
|
||||||
</div>
|
|
||||||
<div>{item.remark}</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
})
|
})
|
||||||
) : (
|
) : (
|
||||||
<div style={{ lineHeight: '44px', textAlign: 'center', color: '#999' }}>
|
<div style={{ lineHeight: '44px', textAlign: 'center', color: '#999' }}>暂无外部联系人</div>
|
||||||
暂无外部联系人
|
|
||||||
</div>
|
|
||||||
)}
|
)}
|
||||||
<div
|
<div className={`${styles.delFollowList} ${delFollowListShow ? styles.delFollowListShow : ''}`}>
|
||||||
className={`${styles.delFollowList} ${
|
|
||||||
delFollowListShow ? styles.delFollowListShow : ''
|
|
||||||
}`}
|
|
||||||
>
|
|
||||||
<div
|
<div
|
||||||
className={styles.delFollowListBar}
|
className={styles.delFollowListBar}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
@@ -391,51 +419,9 @@ const ChatLogs: React.FC = () => {
|
|||||||
<span>已删联系人</span>
|
<span>已删联系人</span>
|
||||||
{delFollowListShow ? <UpOutlined /> : <DownOutlined />}
|
{delFollowListShow ? <UpOutlined /> : <DownOutlined />}
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div className={`${styles.delFollowListBox} ${delFollowListShow ? styles.delFollowListBoxShow : ''}`}>
|
||||||
className={`${styles.delFollowListBox} ${
|
|
||||||
delFollowListShow ? styles.delFollowListBoxShow : ''
|
|
||||||
}`}
|
|
||||||
>
|
|
||||||
{custFollowsList.map((item) => {
|
{custFollowsList.map((item) => {
|
||||||
if (item.state == 1) return null;
|
return item.state == 1 ? null : custFollowsListItem(item);
|
||||||
return (
|
|
||||||
<div
|
|
||||||
key={item.cust_id}
|
|
||||||
className={`${styles.chatB} ${item.state == 0 ? styles.state0 : ''} ${
|
|
||||||
selectCustFollow?.cust_id == item.cust_id ? styles.active : ''
|
|
||||||
}`}
|
|
||||||
onClick={() => {
|
|
||||||
tabKeyRef.current = tabKey;
|
|
||||||
|
|
||||||
setSelectInnerStaff(undefined);
|
|
||||||
selectInnerStaffRef.current = undefined;
|
|
||||||
setSelectGroup(undefined);
|
|
||||||
selectGroupRef.current = undefined;
|
|
||||||
|
|
||||||
setSelectCustFollow(item);
|
|
||||||
selectCustFollowRef.current = item;
|
|
||||||
page(1);
|
|
||||||
}}
|
|
||||||
style={{ display: item.name.includes(searchWord['1']) ? '' : 'none' }}
|
|
||||||
>
|
|
||||||
<div
|
|
||||||
className={styles.avatar}
|
|
||||||
style={{ background: item?.avatar ? '#fff' : '' }}
|
|
||||||
>
|
|
||||||
<img
|
|
||||||
src={item.avatar}
|
|
||||||
alt=""
|
|
||||||
style={{ maxWidth: '100%', maxHeight: '100%', objectFit: 'cover' }}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<div className={styles.chatAMsg} style={{ flexDirection: 'column' }}>
|
|
||||||
<div className={styles.chatAName} title={item.name}>
|
|
||||||
{item.name}
|
|
||||||
</div>
|
|
||||||
<div>{item.remark}</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
})}
|
})}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -446,45 +432,12 @@ const ChatLogs: React.FC = () => {
|
|||||||
<>
|
<>
|
||||||
{groupList.length ? (
|
{groupList.length ? (
|
||||||
groupList.map((item) => {
|
groupList.map((item) => {
|
||||||
if (item.state == 0) return null;
|
return item.state == 0 ? null : groupListItem(item);
|
||||||
return (
|
|
||||||
<div
|
|
||||||
key={item.group_id}
|
|
||||||
className={`${styles.chatB} ${item.state == 0 ? styles.state0 : ''} ${
|
|
||||||
selectGroup?.group_id == item.group_id ? styles.active : ''
|
|
||||||
}`}
|
|
||||||
onClick={() => {
|
|
||||||
tabKeyRef.current = tabKey;
|
|
||||||
setSelectCustFollow(undefined);
|
|
||||||
selectCustFollowRef.current = undefined;
|
|
||||||
setSelectInnerStaff(undefined);
|
|
||||||
selectInnerStaffRef.current = undefined;
|
|
||||||
setSelectGroup(item);
|
|
||||||
selectGroupRef.current = item;
|
|
||||||
getGroupMembersList();
|
|
||||||
}}
|
|
||||||
style={{ display: item.name.includes(searchWord['2']) ? '' : 'none' }}
|
|
||||||
>
|
|
||||||
<div className={styles.avatar}>{item.name ? item.name[0] : '群'}</div>
|
|
||||||
<div className={styles.chatAMsg} style={{ flexDirection: 'column' }}>
|
|
||||||
<div className={styles.chatAName} title={item.name}>
|
|
||||||
{item.name || '未定义群名'}
|
|
||||||
</div>
|
|
||||||
<div style={{ color: '#999' }}>{groupStatus[item.status]}</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
})
|
})
|
||||||
) : (
|
) : (
|
||||||
<div style={{ lineHeight: '44px', textAlign: 'center', color: '#999' }}>
|
<div style={{ lineHeight: '44px', textAlign: 'center', color: '#999' }}>暂无客户群聊</div>
|
||||||
暂无客户群聊
|
|
||||||
</div>
|
|
||||||
)}
|
)}
|
||||||
<div
|
<div className={`${styles.delFollowList} ${delGroupListShow ? styles.delFollowListShow : ''}`}>
|
||||||
className={`${styles.delFollowList} ${
|
|
||||||
delGroupListShow ? styles.delFollowListShow : ''
|
|
||||||
}`}
|
|
||||||
>
|
|
||||||
<div
|
<div
|
||||||
className={styles.delFollowListBar}
|
className={styles.delFollowListBar}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
@@ -494,40 +447,9 @@ const ChatLogs: React.FC = () => {
|
|||||||
<span>已解散的群</span>
|
<span>已解散的群</span>
|
||||||
{delGroupListShow ? <UpOutlined /> : <DownOutlined />}
|
{delGroupListShow ? <UpOutlined /> : <DownOutlined />}
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div className={`${styles.delFollowListBox} ${delGroupListShow ? styles.delFollowListBoxShow : ''}`}>
|
||||||
className={`${styles.delFollowListBox} ${
|
|
||||||
delGroupListShow ? styles.delFollowListBoxShow : ''
|
|
||||||
}`}
|
|
||||||
>
|
|
||||||
{groupList.map((item) => {
|
{groupList.map((item) => {
|
||||||
if (item.state == 1) return null;
|
return item.state == 1 ? null : groupListItem(item);
|
||||||
return (
|
|
||||||
<div
|
|
||||||
key={item.group_id}
|
|
||||||
className={`${styles.chatB} ${item.state == 0 ? styles.state0 : ''} ${
|
|
||||||
selectGroup?.group_id == item.group_id ? styles.active : ''
|
|
||||||
}`}
|
|
||||||
onClick={() => {
|
|
||||||
tabKeyRef.current = tabKey;
|
|
||||||
setSelectCustFollow(undefined);
|
|
||||||
selectCustFollowRef.current = undefined;
|
|
||||||
setSelectInnerStaff(undefined);
|
|
||||||
selectInnerStaffRef.current = undefined;
|
|
||||||
setSelectGroup(item);
|
|
||||||
selectGroupRef.current = item;
|
|
||||||
getGroupMembersList();
|
|
||||||
}}
|
|
||||||
style={{ display: item.name.includes(searchWord['2']) ? '' : 'none' }}
|
|
||||||
>
|
|
||||||
<div className={styles.avatar}>{item.name ? item.name[0] : '群'}</div>
|
|
||||||
<div className={styles.chatAMsg} style={{ flexDirection: 'column' }}>
|
|
||||||
<div className={styles.chatAName} title={item.name}>
|
|
||||||
{item.name || '未定义群名'}
|
|
||||||
</div>
|
|
||||||
<div style={{ color: '#999' }}>{groupStatus[item.status]}</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
})}
|
})}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -536,6 +458,104 @@ const ChatLogs: React.FC = () => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// 删除的联系人/群
|
||||||
|
const tabContentDel = () => {
|
||||||
|
if (tabKey == '0') {
|
||||||
|
return <></>;
|
||||||
|
} else if (tabKey == '1') {
|
||||||
|
return (
|
||||||
|
<div className={`${styles.delFollowList} ${delFollowListShow ? styles.delFollowListShow : ''}`}>
|
||||||
|
<div
|
||||||
|
className={styles.delFollowListBar}
|
||||||
|
onClick={() => {
|
||||||
|
setDelFollowListShow(!delFollowListShow);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<span>已删联系人</span>
|
||||||
|
{delFollowListShow ? <UpOutlined /> : <DownOutlined />}
|
||||||
|
</div>
|
||||||
|
<div className={`${styles.delFollowListBox} ${delFollowListShow ? styles.delFollowListBoxShow : ''}`}>
|
||||||
|
{custFollowsList.map((item) => {
|
||||||
|
return item.state == 1 ? null : custFollowsListItem(item);
|
||||||
|
})}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
return (
|
||||||
|
<div className={`${styles.delFollowList} ${delGroupListShow ? styles.delFollowListShow : ''}`}>
|
||||||
|
<div
|
||||||
|
className={styles.delFollowListBar}
|
||||||
|
onClick={() => {
|
||||||
|
setDelGroupListShow(!delGroupListShow);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<span>已解散的群</span>
|
||||||
|
{delGroupListShow ? <UpOutlined /> : <DownOutlined />}
|
||||||
|
</div>
|
||||||
|
<div className={`${styles.delFollowListBox} ${delGroupListShow ? styles.delFollowListBoxShow : ''}`}>
|
||||||
|
{groupList.map((item) => {
|
||||||
|
return item.state == 1 ? null : groupListItem(item);
|
||||||
|
})}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// 群 Drawer 群员
|
||||||
|
const groupMembersListItem = (item: IGroupMembers) => {
|
||||||
|
return (
|
||||||
|
<div
|
||||||
|
key={item.user_id}
|
||||||
|
style={{
|
||||||
|
display: 'inline-flex',
|
||||||
|
justifyContent: 'flex-start',
|
||||||
|
alignItems: 'center',
|
||||||
|
width: 80,
|
||||||
|
flexDirection: 'column',
|
||||||
|
verticalAlign: 'top',
|
||||||
|
marginTop: 12,
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<div className={styles.inGroupAvatar}>
|
||||||
|
{item.avatar ? (
|
||||||
|
<img
|
||||||
|
style={{
|
||||||
|
maxWidth: '100%',
|
||||||
|
maxHeight: '100%',
|
||||||
|
objectFit: 'cover',
|
||||||
|
borderRadius: 4,
|
||||||
|
}}
|
||||||
|
src={item.avatar}
|
||||||
|
alt=""
|
||||||
|
/>
|
||||||
|
) : item.name ? (
|
||||||
|
item.name[0]
|
||||||
|
) : (
|
||||||
|
''
|
||||||
|
)}
|
||||||
|
{item.user_id == selectGroupRef.current?.owner ? <OwnerSvg /> : null}
|
||||||
|
{selectGroupRef.current?.adminUserIDs?.includes(item.user_id) ? <AdminSvg /> : null}
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
style={{
|
||||||
|
padding: '0 4px',
|
||||||
|
whiteSpace: 'nowrap',
|
||||||
|
minWidth: 0,
|
||||||
|
textOverflow: 'ellipsis',
|
||||||
|
overflow: 'hidden',
|
||||||
|
width: 72,
|
||||||
|
textAlign: 'center',
|
||||||
|
}}
|
||||||
|
title={item.name}
|
||||||
|
>
|
||||||
|
{item.name}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<PageContainer>
|
<PageContainer>
|
||||||
<div className={styles.box}>
|
<div className={styles.box}>
|
||||||
@@ -646,6 +666,7 @@ const ChatLogs: React.FC = () => {
|
|||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<div className={styles.chatBBox}>{tabContent()}</div>
|
<div className={styles.chatBBox}>{tabContent()}</div>
|
||||||
|
{tabContentDel()}
|
||||||
</div>
|
</div>
|
||||||
<div style={{ flex: 1 }}>
|
<div style={{ flex: 1 }}>
|
||||||
<div className={styles.logTop}>
|
<div className={styles.logTop}>
|
||||||
@@ -687,53 +708,15 @@ const ChatLogs: React.FC = () => {
|
|||||||
{tabKeyRef.current == '0' ? (
|
{tabKeyRef.current == '0' ? (
|
||||||
<DepartmentMembersDetail record={selectInnerStaff as IStaffsItem} />
|
<DepartmentMembersDetail record={selectInnerStaff as IStaffsItem} />
|
||||||
) : tabKeyRef.current == '1' ? (
|
) : tabKeyRef.current == '1' ? (
|
||||||
<div>
|
<CustDetailContent record={selectCustFollow as ICustFollow} />
|
||||||
<div
|
|
||||||
style={{
|
|
||||||
display: 'flex',
|
|
||||||
borderBottom: '1px solid #ddd',
|
|
||||||
paddingBottom: 12,
|
|
||||||
marginBottom: 12,
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<div className={styles.modalAvatar}>
|
|
||||||
<img src={selectCustFollow?.avatar} alt="" />
|
|
||||||
</div>
|
|
||||||
<div style={{ display: 'flex', flexDirection: 'column' }}>
|
|
||||||
<div style={{ fontSize: 16 }}>
|
|
||||||
<span style={{ marginRight: 8 }}>{selectCustFollow?.name}</span>
|
|
||||||
<Gender gender={selectCustFollow?.gender} />
|
|
||||||
</div>
|
|
||||||
<div style={{ color: '#666' }}>{selectCustFollow?.description}</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div>备注名称:{selectCustFollow?.remark}</div>
|
|
||||||
<div
|
|
||||||
style={{
|
|
||||||
paddingTop: 12,
|
|
||||||
marginBottom: 12,
|
|
||||||
paddingBottom: 12,
|
|
||||||
borderBottom: '1px solid #ddd',
|
|
||||||
fontSize: 16,
|
|
||||||
fontWeight: 'bold',
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
标签
|
|
||||||
</div>
|
|
||||||
{formatTags(selectCustFollow?.tags)}
|
|
||||||
</div>
|
|
||||||
) : (
|
) : (
|
||||||
<div>
|
<div>
|
||||||
<div style={{ marginBottom: 8, textIndent: '2em' }}>
|
<div style={{ marginBottom: 8, textIndent: '2em' }}>
|
||||||
群主:
|
群主:
|
||||||
{groupMembersObjRef.current[selectGroupRef.current?.owner as string]?.name}
|
{groupMembersObjRef.current[selectGroupRef.current?.owner as string]?.name}
|
||||||
</div>
|
</div>
|
||||||
<div style={{ marginBottom: 8 }}>
|
<div style={{ marginBottom: 8 }}>{adminList(selectGroupRef.current?.admin_list, groupMembersObjRef.current)}</div>
|
||||||
{adminList(selectGroupRef.current?.admin_list, groupMembersObjRef.current)}
|
<div style={{ marginBottom: 8 }}>创建时间:{selectGroupRef.current?.create_time}</div>
|
||||||
</div>
|
|
||||||
<div style={{ marginBottom: 8 }}>
|
|
||||||
创建时间:{selectGroupRef.current?.create_time}
|
|
||||||
</div>
|
|
||||||
<div style={{ textIndent: '1em' }}>群公告:{selectGroupRef.current?.notice}</div>
|
<div style={{ textIndent: '1em' }}>群公告:{selectGroupRef.current?.notice}</div>
|
||||||
<div
|
<div
|
||||||
style={{
|
style={{
|
||||||
@@ -747,54 +730,7 @@ const ChatLogs: React.FC = () => {
|
|||||||
群成员 • {groupMembersList.length}
|
群成员 • {groupMembersList.length}
|
||||||
</div>
|
</div>
|
||||||
{groupMembersList.map((item) => {
|
{groupMembersList.map((item) => {
|
||||||
if (item.group_members_type == '2' || item.state == 0) return null;
|
return item.group_members_type == '2' || item.state == 0 ? null : groupMembersListItem(item);
|
||||||
return (
|
|
||||||
<div
|
|
||||||
key={item.user_id}
|
|
||||||
style={{
|
|
||||||
display: 'inline-flex',
|
|
||||||
justifyContent: 'flex-start',
|
|
||||||
alignItems: 'center',
|
|
||||||
width: 80,
|
|
||||||
flexDirection: 'column',
|
|
||||||
verticalAlign: 'top',
|
|
||||||
marginTop: 12,
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<div className={styles.avatar}>
|
|
||||||
{item.avatar ? (
|
|
||||||
<img
|
|
||||||
style={{
|
|
||||||
maxWidth: '100%',
|
|
||||||
maxHeight: '100%',
|
|
||||||
objectFit: 'cover',
|
|
||||||
borderRadius: 4,
|
|
||||||
}}
|
|
||||||
src={item.avatar}
|
|
||||||
alt=""
|
|
||||||
/>
|
|
||||||
) : item.name ? (
|
|
||||||
item.name[0]
|
|
||||||
) : (
|
|
||||||
''
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
style={{
|
|
||||||
padding: '0 4px',
|
|
||||||
whiteSpace: 'nowrap',
|
|
||||||
minWidth: 0,
|
|
||||||
textOverflow: 'ellipsis',
|
|
||||||
overflow: 'hidden',
|
|
||||||
width: 72,
|
|
||||||
textAlign: 'center',
|
|
||||||
}}
|
|
||||||
title={item.name}
|
|
||||||
>
|
|
||||||
{item.name}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
})}
|
})}
|
||||||
{groupMembersCount2(groupMembersList, '2', 1) != 0 ? (
|
{groupMembersCount2(groupMembersList, '2', 1) != 0 ? (
|
||||||
<div
|
<div
|
||||||
@@ -810,54 +746,7 @@ const ChatLogs: React.FC = () => {
|
|||||||
</div>
|
</div>
|
||||||
) : null}
|
) : null}
|
||||||
{groupMembersList.map((item) => {
|
{groupMembersList.map((item) => {
|
||||||
if (item.group_members_type == '1' || item.state == 0) return null;
|
return item.group_members_type == '1' || item.state == 0 ? null : groupMembersListItem(item);
|
||||||
return (
|
|
||||||
<div
|
|
||||||
key={item.user_id}
|
|
||||||
style={{
|
|
||||||
display: 'inline-flex',
|
|
||||||
justifyContent: 'flex-start',
|
|
||||||
alignItems: 'center',
|
|
||||||
width: 80,
|
|
||||||
flexDirection: 'column',
|
|
||||||
verticalAlign: 'top',
|
|
||||||
marginTop: 12,
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<div className={styles.avatar}>
|
|
||||||
{item.avatar ? (
|
|
||||||
<img
|
|
||||||
style={{
|
|
||||||
maxWidth: '100%',
|
|
||||||
maxHeight: '100%',
|
|
||||||
objectFit: 'cover',
|
|
||||||
borderRadius: 4,
|
|
||||||
}}
|
|
||||||
src={item.avatar}
|
|
||||||
alt=""
|
|
||||||
/>
|
|
||||||
) : item.name ? (
|
|
||||||
item.name[0]
|
|
||||||
) : (
|
|
||||||
''
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
style={{
|
|
||||||
padding: '0 4px',
|
|
||||||
whiteSpace: 'nowrap',
|
|
||||||
minWidth: 0,
|
|
||||||
textOverflow: 'ellipsis',
|
|
||||||
overflow: 'hidden',
|
|
||||||
width: 72,
|
|
||||||
textAlign: 'center',
|
|
||||||
}}
|
|
||||||
title={item.name}
|
|
||||||
>
|
|
||||||
{item.name}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
})}
|
})}
|
||||||
{groupMembersCount(groupMembersList, 0) != 0 ? (
|
{groupMembersCount(groupMembersList, 0) != 0 ? (
|
||||||
<div
|
<div
|
||||||
@@ -873,54 +762,7 @@ const ChatLogs: React.FC = () => {
|
|||||||
</div>
|
</div>
|
||||||
) : null}
|
) : null}
|
||||||
{groupMembersList.map((item) => {
|
{groupMembersList.map((item) => {
|
||||||
if (item.state == 1) return null;
|
return item.state == 1 ? null : groupMembersListItem(item);
|
||||||
return (
|
|
||||||
<div
|
|
||||||
key={item.user_id}
|
|
||||||
style={{
|
|
||||||
display: 'inline-flex',
|
|
||||||
justifyContent: 'flex-start',
|
|
||||||
alignItems: 'center',
|
|
||||||
width: 80,
|
|
||||||
flexDirection: 'column',
|
|
||||||
verticalAlign: 'top',
|
|
||||||
marginTop: 12,
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<div className={styles.avatar}>
|
|
||||||
{item.avatar ? (
|
|
||||||
<img
|
|
||||||
style={{
|
|
||||||
maxWidth: '100%',
|
|
||||||
maxHeight: '100%',
|
|
||||||
objectFit: 'cover',
|
|
||||||
borderRadius: 4,
|
|
||||||
}}
|
|
||||||
src={item.avatar}
|
|
||||||
alt=""
|
|
||||||
/>
|
|
||||||
) : item.name ? (
|
|
||||||
item.name[0]
|
|
||||||
) : (
|
|
||||||
''
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
style={{
|
|
||||||
padding: '0 4px',
|
|
||||||
whiteSpace: 'nowrap',
|
|
||||||
minWidth: 0,
|
|
||||||
textOverflow: 'ellipsis',
|
|
||||||
overflow: 'hidden',
|
|
||||||
width: 72,
|
|
||||||
textAlign: 'center',
|
|
||||||
}}
|
|
||||||
title={item.name}
|
|
||||||
>
|
|
||||||
{item.name}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
})}
|
})}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
@@ -931,48 +773,26 @@ const ChatLogs: React.FC = () => {
|
|||||||
className={styles.chatLogBox}
|
className={styles.chatLogBox}
|
||||||
ref={chatBoxRef}
|
ref={chatBoxRef}
|
||||||
onScroll={(e: any) => {
|
onScroll={(e: any) => {
|
||||||
if (
|
if (e.target?.scrollTop == 0 && !isAllChatRef.current && !chatLogLoadingRef.current) {
|
||||||
e.target?.scrollTop == 0 &&
|
|
||||||
!isAllChatRef.current &&
|
|
||||||
!chatLogLoadingRef.current
|
|
||||||
) {
|
|
||||||
page(param.curr_page + 1);
|
page(param.curr_page + 1);
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{isAllChatRef.current ? (
|
{isAllChatRef.current ? <div style={{ marginBottom: 12, textAlign: 'center', color: '#999' }}>没有更多聊天记录了</div> : null}
|
||||||
<div style={{ marginBottom: 12, textAlign: 'center', color: '#999' }}>
|
|
||||||
没有更多聊天记录了
|
|
||||||
</div>
|
|
||||||
) : null}
|
|
||||||
{chatLogs.map((item) => {
|
{chatLogs.map((item) => {
|
||||||
if (item.curr_page) {
|
if (item.curr_page) {
|
||||||
return (
|
return <div key={item.curr_page} className={`curr_page${param.curr_page}`} style={{ height: 0 }} />;
|
||||||
<div
|
|
||||||
key={item.curr_page}
|
|
||||||
className={`curr_page${param.curr_page}`}
|
|
||||||
style={{ height: 0 }}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
} else {
|
} else {
|
||||||
return (
|
return (
|
||||||
<div key={item.msg_id}>
|
<div key={item.msg_id}>
|
||||||
{/* {item.show_time ? <ChatTime msgtime={item.msg_time}></ChatTime> : null} */}
|
{/* {item.show_time ? <ChatTime msgtime={item.msg_time}></ChatTime> : null} */}
|
||||||
<ChatTime msgtime={item.msg_time} />
|
<ChatTime msgtime={item.msg_time} />
|
||||||
{tabKey == '2' ? (
|
{tabKey == '2' ? (
|
||||||
<ChatBar
|
<ChatBar from={selectStaff} to={groupMembersObjRef.current[item.msg_from]} chat={item} />
|
||||||
from={selectStaff}
|
|
||||||
to={groupMembersObjRef.current[item.msg_from]}
|
|
||||||
chat={item}
|
|
||||||
/>
|
|
||||||
) : (
|
) : (
|
||||||
<ChatBar
|
<ChatBar
|
||||||
from={selectStaff}
|
from={selectStaff}
|
||||||
to={
|
to={tabKeyRef.current == '0' ? selectInnerStaffRef.current : selectCustFollowRef.current}
|
||||||
tabKeyRef.current == '0'
|
|
||||||
? selectInnerStaffRef.current
|
|
||||||
: selectCustFollowRef.current
|
|
||||||
}
|
|
||||||
chat={item}
|
chat={item}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
61
src/pages/CustomList/components/CustDetailContent.tsx
Normal file
61
src/pages/CustomList/components/CustDetailContent.tsx
Normal file
@@ -0,0 +1,61 @@
|
|||||||
|
import { ICustFollow } from '@/pages/ChatLogs/ChatLogsType';
|
||||||
|
import { formatTags } from '@/pages/ChatLogs/ChatUtils';
|
||||||
|
import { Gender } from '@/pages/ChatLogs/components/Gender';
|
||||||
|
import { AddWay, CustType } from '@/services/config';
|
||||||
|
import React from 'react';
|
||||||
|
import styles from './index.module.scss';
|
||||||
|
|
||||||
|
type IProps = {
|
||||||
|
record: ICustFollow;
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 客户抽屉内容
|
||||||
|
* @param props IProps
|
||||||
|
* @returns
|
||||||
|
*/
|
||||||
|
export const CustDetailContent: React.FC<IProps> = (props) => {
|
||||||
|
const { record } = props;
|
||||||
|
return (
|
||||||
|
<div>
|
||||||
|
<div
|
||||||
|
style={{
|
||||||
|
display: 'flex',
|
||||||
|
borderBottom: '1px solid #ddd',
|
||||||
|
paddingBottom: 12,
|
||||||
|
marginBottom: 12,
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<div className={styles.modalAvatar}>
|
||||||
|
<img src={record?.avatar} alt="" />
|
||||||
|
</div>
|
||||||
|
<div style={{ display: 'flex', flexDirection: 'column' }}>
|
||||||
|
<div style={{ fontSize: 16, display: 'flex', alignItems: 'center' }}>
|
||||||
|
<span style={{ marginRight: 8 }}>
|
||||||
|
{record?.name}[{record?.remark}]
|
||||||
|
</span>
|
||||||
|
<Gender gender={record?.gender} />
|
||||||
|
</div>
|
||||||
|
<span style={{ color: '#389e0d' }}>@{record ? CustType[record?.type] : ''}</span>
|
||||||
|
<div style={{ color: '#666' }}>{record?.description}</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div>添加方式:{record ? AddWay[record?.add_way] : ''}</div>
|
||||||
|
<div>跟进员工:{record?.user_id}</div>
|
||||||
|
<div>添加时间:{record?.create_time}</div>
|
||||||
|
<div
|
||||||
|
style={{
|
||||||
|
paddingTop: 12,
|
||||||
|
marginBottom: 12,
|
||||||
|
paddingBottom: 12,
|
||||||
|
borderBottom: '1px solid #ddd',
|
||||||
|
fontSize: 16,
|
||||||
|
fontWeight: 'bold',
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
标签
|
||||||
|
</div>
|
||||||
|
{formatTags(record?.tags)}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
@@ -2,56 +2,16 @@ import { SearchBarPlugin, SearchBottonsCardPlugin } from '@/components/SearchBar
|
|||||||
import { post } from '@/services/ajax';
|
import { post } from '@/services/ajax';
|
||||||
import { AddWay, CustType } from '@/services/config';
|
import { AddWay, CustType } from '@/services/config';
|
||||||
import { PageContainer } from '@ant-design/pro-components';
|
import { PageContainer } from '@ant-design/pro-components';
|
||||||
import {
|
import { Button, Col, DatePicker, Drawer, Form, Image, Input, Pagination, Popover, Row, Select, Table, Tag } from 'antd';
|
||||||
Button,
|
|
||||||
Col,
|
|
||||||
DatePicker,
|
|
||||||
Drawer,
|
|
||||||
Form,
|
|
||||||
Image,
|
|
||||||
Input,
|
|
||||||
Pagination,
|
|
||||||
Popover,
|
|
||||||
Row,
|
|
||||||
Select,
|
|
||||||
Table,
|
|
||||||
Tag,
|
|
||||||
} from 'antd';
|
|
||||||
import { stringify } from 'qs';
|
import { stringify } from 'qs';
|
||||||
import React, { useEffect, useState } from 'react';
|
import React, { useEffect, useState } from 'react';
|
||||||
import { formatTags } from '../ChatLogs/ChatUtils';
|
|
||||||
|
import { ICustFollow } from '../ChatLogs/ChatLogsType';
|
||||||
import { Gender } from '../ChatLogs/components/Gender';
|
import { Gender } from '../ChatLogs/components/Gender';
|
||||||
import styles from './index.module.scss';
|
import { CustDetailContent } from './components/CustDetailContent';
|
||||||
|
|
||||||
interface ICustItem {
|
|
||||||
add_way: number;
|
|
||||||
avatar: string;
|
|
||||||
create_time: string;
|
|
||||||
cust_id: string;
|
|
||||||
description: string;
|
|
||||||
gender: number;
|
|
||||||
name: string;
|
|
||||||
oper_user_id: string;
|
|
||||||
remark: string;
|
|
||||||
remark_mobiles: string;
|
|
||||||
state: number;
|
|
||||||
tags: string;
|
|
||||||
type: number;
|
|
||||||
user_id: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
type Param = {
|
|
||||||
curr_page: number;
|
|
||||||
page_count: number;
|
|
||||||
type?: number | string;
|
|
||||||
name?: string;
|
|
||||||
add_way?: string;
|
|
||||||
create_timeL?: string;
|
|
||||||
create_timeU?: string;
|
|
||||||
};
|
|
||||||
|
|
||||||
const CustomList: React.FC = () => {
|
const CustomList: React.FC = () => {
|
||||||
const [param] = useState<Param>({
|
const [param] = useState({
|
||||||
curr_page: 1,
|
curr_page: 1,
|
||||||
page_count: 20,
|
page_count: 20,
|
||||||
type: '',
|
type: '',
|
||||||
@@ -61,15 +21,15 @@ const CustomList: React.FC = () => {
|
|||||||
create_timeU: '',
|
create_timeU: '',
|
||||||
});
|
});
|
||||||
|
|
||||||
const [custsList, setCustsList] = useState<ICustItem[]>([]);
|
const [custsList, setCustsList] = useState<ICustFollow[]>([]);
|
||||||
const [count, setCount] = useState(0);
|
const [count, setCount] = useState(0);
|
||||||
const [loading, setLoading] = useState(false);
|
const [loading, setLoading] = useState(false);
|
||||||
const [open, setOpen] = useState(false);
|
const [open, setOpen] = useState(false);
|
||||||
const [record, setRecord] = useState<ICustItem>();
|
const [record, setRecord] = useState<ICustFollow>();
|
||||||
|
|
||||||
const getCustsList = () => {
|
const getCustsList = () => {
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
post({ url: '/CustFollows/CustsList', data: stringify(param) }).then((res) => {
|
post({ url: '/CustFollows/List', data: stringify(param) }).then((res) => {
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
if (res.err_code == 0) {
|
if (res.err_code == 0) {
|
||||||
if (Array.isArray(res.data)) {
|
if (Array.isArray(res.data)) {
|
||||||
@@ -192,7 +152,7 @@ const CustomList: React.FC = () => {
|
|||||||
title="客户"
|
title="客户"
|
||||||
width={200}
|
width={200}
|
||||||
dataIndex={'name'}
|
dataIndex={'name'}
|
||||||
render={(value, record: ICustItem) => {
|
render={(value, record: ICustFollow) => {
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
@@ -221,9 +181,7 @@ const CustomList: React.FC = () => {
|
|||||||
</div>
|
</div>
|
||||||
<div style={{ display: 'flex', alignItems: 'center' }}>
|
<div style={{ display: 'flex', alignItems: 'center' }}>
|
||||||
<Gender gender={record.gender}></Gender>
|
<Gender gender={record.gender}></Gender>
|
||||||
<span style={{ marginLeft: 4, color: '#389e0d' }}>
|
<span style={{ marginLeft: 4, color: '#389e0d' }}>@{CustType[record.type]}</span>
|
||||||
@{CustType[record.type]}
|
|
||||||
</span>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -267,19 +225,11 @@ const CustomList: React.FC = () => {
|
|||||||
);
|
);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Tag
|
<Tag color="green" title={`${arr[0]?.group_name}:${arr[0]?.tag_name}`} style={{ marginBottom: 4 }}>
|
||||||
color="green"
|
|
||||||
title={`${arr[0]?.group_name}:${arr[0]?.tag_name}`}
|
|
||||||
style={{ marginBottom: 4 }}
|
|
||||||
>
|
|
||||||
{arr[0]?.tag_name}
|
{arr[0]?.tag_name}
|
||||||
</Tag>
|
</Tag>
|
||||||
{arr[1] ? (
|
{arr[1] ? (
|
||||||
<Tag
|
<Tag color="green" title={`${arr[1]?.group_name}:${arr[1]?.tag_name}`} style={{ marginBottom: 4 }}>
|
||||||
color="green"
|
|
||||||
title={`${arr[1]?.group_name}:${arr[1]?.tag_name}`}
|
|
||||||
style={{ marginBottom: 4 }}
|
|
||||||
>
|
|
||||||
{arr[1]?.tag_name}
|
{arr[1]?.tag_name}
|
||||||
</Tag>
|
</Tag>
|
||||||
) : null}
|
) : null}
|
||||||
@@ -289,19 +239,11 @@ const CustomList: React.FC = () => {
|
|||||||
</Popover>
|
</Popover>
|
||||||
) : (
|
) : (
|
||||||
<>
|
<>
|
||||||
<Tag
|
<Tag color="green" title={`${arr[0]?.group_name}:${arr[0]?.tag_name}`} style={{ marginBottom: 4 }}>
|
||||||
color="green"
|
|
||||||
title={`${arr[0]?.group_name}:${arr[0]?.tag_name}`}
|
|
||||||
style={{ marginBottom: 4 }}
|
|
||||||
>
|
|
||||||
{arr[0]?.tag_name}
|
{arr[0]?.tag_name}
|
||||||
</Tag>
|
</Tag>
|
||||||
{arr[1] ? (
|
{arr[1] ? (
|
||||||
<Tag
|
<Tag color="green" title={`${arr[1]?.group_name}:${arr[1]?.tag_name}`} style={{ marginBottom: 4 }}>
|
||||||
color="green"
|
|
||||||
title={`${arr[1]?.group_name}:${arr[1]?.tag_name}`}
|
|
||||||
style={{ marginBottom: 4 }}
|
|
||||||
>
|
|
||||||
{arr[1]?.tag_name}
|
{arr[1]?.tag_name}
|
||||||
</Tag>
|
</Tag>
|
||||||
) : null}
|
) : null}
|
||||||
@@ -328,53 +270,8 @@ const CustomList: React.FC = () => {
|
|||||||
<Table.Column title="添加时间" width={140} dataIndex={'create_time'} />
|
<Table.Column title="添加时间" width={140} dataIndex={'create_time'} />
|
||||||
{/* <Table.Column title="操作" width={160} dataIndex={'position'} /> */}
|
{/* <Table.Column title="操作" width={160} dataIndex={'position'} /> */}
|
||||||
</Table>
|
</Table>
|
||||||
<Drawer
|
<Drawer title={`${record?.name} 客户详情`} open={open} onClose={() => setOpen(false)} width={800}>
|
||||||
title={`${record?.name} 客户详情`}
|
<CustDetailContent record={record as ICustFollow} />
|
||||||
open={open}
|
|
||||||
onClose={() => setOpen(false)}
|
|
||||||
width={800}
|
|
||||||
>
|
|
||||||
<div>
|
|
||||||
<div
|
|
||||||
style={{
|
|
||||||
display: 'flex',
|
|
||||||
borderBottom: '1px solid #ddd',
|
|
||||||
paddingBottom: 12,
|
|
||||||
marginBottom: 12,
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<div className={styles.modalAvatar}>
|
|
||||||
<img src={record?.avatar} alt="" />
|
|
||||||
</div>
|
|
||||||
<div style={{ display: 'flex', flexDirection: 'column' }}>
|
|
||||||
<div style={{ fontSize: 16 }}>
|
|
||||||
<span style={{ marginRight: 8 }}>{record?.name}</span>
|
|
||||||
<Gender gender={record?.gender} />
|
|
||||||
</div>
|
|
||||||
<span style={{ marginLeft: 4, color: '#389e0d' }}>
|
|
||||||
@{record ? CustType[record?.type] : ''}
|
|
||||||
</span>
|
|
||||||
<div style={{ color: '#666' }}>{record?.description}</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div>备注名称:{record?.remark}</div>
|
|
||||||
<div>添加方式:{record ? AddWay[record?.add_way] : ''}</div>
|
|
||||||
<div>跟进员工:{record?.user_id}</div>
|
|
||||||
<div>添加时间:{record?.create_time}</div>
|
|
||||||
<div
|
|
||||||
style={{
|
|
||||||
paddingTop: 12,
|
|
||||||
marginBottom: 12,
|
|
||||||
paddingBottom: 12,
|
|
||||||
borderBottom: '1px solid #ddd',
|
|
||||||
fontSize: 16,
|
|
||||||
fontWeight: 'bold',
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
标签
|
|
||||||
</div>
|
|
||||||
{formatTags(record?.tags)}
|
|
||||||
</div>
|
|
||||||
</Drawer>
|
</Drawer>
|
||||||
<Pagination
|
<Pagination
|
||||||
style={{
|
style={{
|
||||||
|
@@ -42,7 +42,7 @@ export const DepartmentMembersDetail: React.FC<IProps> = (props) => {
|
|||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
<div style={{ marginRight: 32 }}>
|
<div style={{ marginRight: 32 }}>
|
||||||
<div>
|
<div style={{ display: 'flex', alignItems: 'center' }}>
|
||||||
<span style={{ marginRight: 8, fontSize: 18 }}>{record?.name}</span>
|
<span style={{ marginRight: 8, fontSize: 18 }}>{record?.name}</span>
|
||||||
<Gender gender={record?.gender}></Gender>
|
<Gender gender={record?.gender}></Gender>
|
||||||
</div>
|
</div>
|
||||||
|
@@ -34,6 +34,7 @@ const Login: React.FC = () => {
|
|||||||
const [userLoginState, setUserLoginState] = useState<API.LoginResult>({});
|
const [userLoginState, setUserLoginState] = useState<API.LoginResult>({});
|
||||||
const [type, setType] = useState<string>('account');
|
const [type, setType] = useState<string>('account');
|
||||||
const { initialState, setInitialState } = useModel('@@initialState');
|
const { initialState, setInitialState } = useModel('@@initialState');
|
||||||
|
const [loading, setLoading] = useState(false);
|
||||||
|
|
||||||
const containerClassName = useEmotionCss(() => {
|
const containerClassName = useEmotionCss(() => {
|
||||||
return {
|
return {
|
||||||
@@ -52,12 +53,14 @@ const Login: React.FC = () => {
|
|||||||
window.NotificationCF = notification;
|
window.NotificationCF = notification;
|
||||||
|
|
||||||
const handleSubmit = async (values: API.LoginParams) => {
|
const handleSubmit = async (values: API.LoginParams) => {
|
||||||
|
setLoading(true);
|
||||||
const data = {
|
const data = {
|
||||||
user: values.username,
|
user: values.username,
|
||||||
password: values.password,
|
password: values.password,
|
||||||
};
|
};
|
||||||
|
|
||||||
post({ url: '/User/Login', data: qsStringify(data) }).then((res: IAjaxReturn) => {
|
post({ url: '/User/Login', data: qsStringify(data) }).then((res: IAjaxReturn) => {
|
||||||
|
setLoading(false);
|
||||||
if (res && res.err_code == 0) {
|
if (res && res.err_code == 0) {
|
||||||
notification.success({
|
notification.success({
|
||||||
message: '登录成功',
|
message: '登录成功',
|
||||||
@@ -91,6 +94,7 @@ const Login: React.FC = () => {
|
|||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<LoginForm
|
<LoginForm
|
||||||
|
loading={loading}
|
||||||
contentStyle={{
|
contentStyle={{
|
||||||
minWidth: 280,
|
minWidth: 280,
|
||||||
maxWidth: '75vw',
|
maxWidth: '75vw',
|
||||||
|
@@ -35,7 +35,8 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.dataCount {
|
.dataCount {
|
||||||
font-size: 24px;
|
font-size: 26px;
|
||||||
|
font-weight: 500;
|
||||||
}
|
}
|
||||||
|
|
||||||
.dataCardBox {
|
.dataCardBox {
|
||||||
|
@@ -102,19 +102,19 @@ const Workbench: React.FC = () => {
|
|||||||
<div style={{ display: 'flex' }}>
|
<div style={{ display: 'flex' }}>
|
||||||
<DataSumItemCard
|
<DataSumItemCard
|
||||||
title="客户数量"
|
title="客户数量"
|
||||||
content="当前员工权限范围内的全部客户数量(含重复)"
|
content="全部客户数量(含重复)"
|
||||||
icon={<TeamOutlined className={styles.icon} />}
|
icon={<TeamOutlined className={styles.icon} />}
|
||||||
count={data.overView.custs_total}
|
count={data.overView.custs_total}
|
||||||
/>
|
/>
|
||||||
<DataSumItemCard
|
<DataSumItemCard
|
||||||
title="客群数量"
|
title="客群数量"
|
||||||
content="当前员工权限范围内的全部客群数量"
|
content="全部客群数量"
|
||||||
icon={<CommentOutlined className={styles.icon} />}
|
icon={<CommentOutlined className={styles.icon} />}
|
||||||
count={data.overView.groups_total}
|
count={data.overView.groups_total}
|
||||||
/>
|
/>
|
||||||
<DataSumItemCard
|
<DataSumItemCard
|
||||||
title="客群成员总数"
|
title="客群成员总数"
|
||||||
content="当前员工权限范围内客群成员的总数(含员工)(含重复)"
|
content="客群成员的总数(含员工)(含重复)"
|
||||||
icon={<BarChartOutlined className={styles.icon} />}
|
icon={<BarChartOutlined className={styles.icon} />}
|
||||||
count={data.overView.groups_members_total}
|
count={data.overView.groups_members_total}
|
||||||
/>
|
/>
|
||||||
@@ -125,31 +125,31 @@ const Workbench: React.FC = () => {
|
|||||||
<div className={styles.dataCardBox}>
|
<div className={styles.dataCardBox}>
|
||||||
<DataItemCard
|
<DataItemCard
|
||||||
title="今日新增客户"
|
title="今日新增客户"
|
||||||
content="当前员工权限范围内今日添加的客户数(含重复及流失)"
|
content="今日添加的客户数(含重复及流失)"
|
||||||
count={data.custsInfo.today_custs}
|
count={data.custsInfo.today_custs}
|
||||||
/>
|
/>
|
||||||
<span style={{ width: 16 }} />
|
<span style={{ width: 16 }} />
|
||||||
{/* <DataItemCard
|
{/* <DataItemCard
|
||||||
title="今日跟进客户"
|
title="今日跟进客户"
|
||||||
content="当前员工权限范围内今日处于跟进中状态的客户数(含重复)"
|
content="今日处于跟进中状态的客户数(含重复)"
|
||||||
count={11}
|
count={11}
|
||||||
/> */}
|
/> */}
|
||||||
{/* <span style={{ width: 16 }} /> */}
|
{/* <span style={{ width: 16 }} /> */}
|
||||||
<DataItemCard
|
<DataItemCard
|
||||||
title="今日净增客户"
|
title="今日净增客户"
|
||||||
content="当前员工权限范围内今日添加的客户数(不含重复及流失)"
|
content="今日添加的客户数(不含重复及流失)"
|
||||||
count={data.custsInfo.today_net_growth}
|
count={data.custsInfo.today_net_growth}
|
||||||
/>
|
/>
|
||||||
<span style={{ width: 16 }} />
|
<span style={{ width: 16 }} />
|
||||||
<DataItemCard
|
<DataItemCard
|
||||||
title="今日流失客户"
|
title="今日流失客户"
|
||||||
content="当前员工权限范围内的流失的全部客户数量"
|
content="今日流失的全部客户数量"
|
||||||
count={data.custsInfo.today_loss}
|
count={data.custsInfo.today_loss}
|
||||||
/>
|
/>
|
||||||
<span style={{ width: 16 }} />
|
<span style={{ width: 16 }} />
|
||||||
<DataItemCard
|
<DataItemCard
|
||||||
title="本月新增客户"
|
title="本月新增客户"
|
||||||
content="当前员工权限范围内本月添加的客户数(含重复及流失)"
|
content="本月添加的客户数(含重复及流失)"
|
||||||
count={data.custsInfo.month_custs}
|
count={data.custsInfo.month_custs}
|
||||||
/>
|
/>
|
||||||
{/* <DataItemCard
|
{/* <DataItemCard
|
||||||
@@ -186,25 +186,25 @@ const Workbench: React.FC = () => {
|
|||||||
<div className={styles.dataCardBox}>
|
<div className={styles.dataCardBox}>
|
||||||
<DataItemCard
|
<DataItemCard
|
||||||
title="今日新增客群"
|
title="今日新增客群"
|
||||||
content="当前员工权限范围内今日创建的客群数"
|
content="今日创建的客群数"
|
||||||
count={data.groupsInfo.today_groups}
|
count={data.groupsInfo.today_groups}
|
||||||
/>
|
/>
|
||||||
<span style={{ width: 16 }} />
|
<span style={{ width: 16 }} />
|
||||||
<DataItemCard
|
<DataItemCard
|
||||||
title="今日解散客群"
|
title="今日解散客群"
|
||||||
content="当前员工权限范围内今日解散的客群数"
|
content="今日解散的客群数"
|
||||||
count={data.groupsInfo.today_diss_groups}
|
count={data.groupsInfo.today_diss_groups}
|
||||||
/>
|
/>
|
||||||
<span style={{ width: 16 }} />
|
<span style={{ width: 16 }} />
|
||||||
<DataItemCard
|
<DataItemCard
|
||||||
title="今日新增成员"
|
title="今日新增成员"
|
||||||
content="当前员工权限范围内今日新增客群成员数(含员工)"
|
content="今日新增客群成员数(含员工)"
|
||||||
count={data.groupsInfo.today_groups_members}
|
count={data.groupsInfo.today_groups_members}
|
||||||
/>
|
/>
|
||||||
<span style={{ width: 16 }} />
|
<span style={{ width: 16 }} />
|
||||||
<DataItemCard
|
<DataItemCard
|
||||||
title="今日退出成员"
|
title="今日退出成员"
|
||||||
content="当前员工权限范围内今日退出客群成员数(含员工)"
|
content="今日退出客群成员数(含员工)"
|
||||||
count={data.groupsInfo.today_diss_groups_members}
|
count={data.groupsInfo.today_diss_groups_members}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
@@ -18,13 +18,17 @@ export const post = async (param: IPost) => {
|
|||||||
const { url, data, showError = true } = param;
|
const { url, data, showError = true } = param;
|
||||||
return await request('/api' + url, {
|
return await request('/api' + url, {
|
||||||
data: data,
|
data: data,
|
||||||
}).then((res: IAjaxReturn) => {
|
})
|
||||||
if (res.err_code != 0 && showError) {
|
.then((res: IAjaxReturn) => {
|
||||||
notificationError({
|
if (res.err_code != 0 && showError) {
|
||||||
message: `${res.err_msg}`,
|
notificationError({
|
||||||
description: `${res.err_code}:${res.err_msg}`,
|
message: `${res.err_msg}`,
|
||||||
});
|
description: `${res.err_code}:${res.err_msg}`,
|
||||||
}
|
});
|
||||||
return res;
|
}
|
||||||
});
|
return res;
|
||||||
|
})
|
||||||
|
.catch((res) => {
|
||||||
|
return res;
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user