diff --git a/src/app.tsx b/src/app.tsx index 13759f6..ca9b03b 100644 --- a/src/app.tsx +++ b/src/app.tsx @@ -58,7 +58,9 @@ export const layout: RunTimeLayoutConfig = ({ initialState, setInitialState }) = // actionsRender: () => [, ], actionsRender: () => [], avatarProps: { - src: initialState?.currentUser?.avatar ? '/api/' + initialState?.currentUser?.avatar : AvatarSvg, + src: initialState?.currentUser?.avatar + ? '/api/' + initialState?.currentUser?.avatar + : AvatarSvg, title: , render: (_, avatarChildren) => { return {avatarChildren}; diff --git a/src/components/Footer/index.tsx b/src/components/Footer/index.tsx index 5f2798e..b7435f1 100644 --- a/src/components/Footer/index.tsx +++ b/src/components/Footer/index.tsx @@ -6,6 +6,7 @@ const Footer: React.FC = () => { = (props) => { // const [device, setDevice] = useState(window.innerWidth); const isPhone = getDevice() === 'phone'; + const [open, setOpen] = useState(false); const [searchBarText, setSearchBarText] = useState('展开'); // useEffect(() => { // const handleResize = (e: any) => { @@ -39,24 +40,60 @@ export const SearchBarPlugin: React.FC = (props) => { }; return ( -
-
- {props.children} -
-
+ <> + {isPhone ? ( + <> + setOpen(false)}> +
{props.body}
+
{ + setOpen(false); + }} + > + {props.footer} +
+
+
+ +
+ + ) : ( +
+
+ {props.body} +
+
{props.footer}
+ {/*
{searchBarText}
{searchBarText == '展开' ? : }
-
-
+
*/} +
+ )} + ); }; - -export const SearchBottonsCardPlugin: React.FC = (props) => { - return
{props.children}
; -}; diff --git a/src/global.less b/src/global.less index b9dc0fd..8008eeb 100644 --- a/src/global.less +++ b/src/global.less @@ -48,6 +48,10 @@ ol { padding-right: 24px !important; } +.ant-pro-global-footer-list { + margin-bottom: 0 !important; +} + input { background-clip: text; -webkit-text-fill-color: #000; // 改变了字体颜色 @@ -85,4 +89,10 @@ input { } } } + + .ant-pro-page-container-children-content, + .ant-page-header { + padding-left: 12px !important; + padding-right: 12px !important; + } } \ No newline at end of file diff --git a/src/pages/ChatLogs/ChatLogsType.ts b/src/pages/ChatLogs/ChatLogsType.ts index c65ca34..cc2a9f8 100644 --- a/src/pages/ChatLogs/ChatLogsType.ts +++ b/src/pages/ChatLogs/ChatLogsType.ts @@ -43,6 +43,7 @@ export interface ICustFollow { avatar: string; gender: number; + add_staff_tot?: number | undefined; name: string; staff_name?: string; @@ -72,6 +73,7 @@ export interface IGroup { owner: string; staff_name?: string; state: number; + status: number; sync_time: string; notice: string; @@ -99,6 +101,7 @@ export interface IChat { action: string; content: string; msg_from: string; + doc?: string; msg_id: string; msg_time: string; msg_to_list: string; diff --git a/src/pages/ChatLogs/components/ChatCollect.tsx b/src/pages/ChatLogs/components/ChatCollect.tsx index 2317d13..89b9196 100644 --- a/src/pages/ChatLogs/components/ChatCollect.tsx +++ b/src/pages/ChatLogs/components/ChatCollect.tsx @@ -8,7 +8,7 @@ export const ChatCollect: React.FC = (props) => {
群名:{msg.room_name}
-
创建者:{msg.creator}
+
群主:{msg.creator}
表名:{msg.title}
= (props) => { - const votetype: any = { 101: '发起投票', 102: '参与投票' }; + const votetype: any = { '101': '发起投票', '102': '参与投票' }; + const [open, setOpen] = useState(false); + const [voteitem, setVoteitem] = useState([]); + + useEffect(() => { + try { + const msg = JSON.parse(props.chat?.content as string); + setVoteitem(msg?.voteitem); + } catch (e) {} + }, [props.chat]); function content() { + try { + const msg = JSON.parse(props.chat?.content as string); + + return ( + <> +
setOpen(true)} + > +
{msg?.votetitle}
+
+ {Array.isArray(msg?.voteitem) + ? [0, 1, 2].map((item) => { + return msg?.voteitem[item] ? ( +
{msg?.voteitem[item]}
+ ) : ( + <> + ); + }) + : null} +
+
+ 投票 [ + {votetype[msg?.votetype as string]}] +
+
+ { + setOpen(false); + }} + footer={false} + > +
+ {Array.isArray(voteitem) + ? voteitem.map((item) => { + return ( +
+ {item} +
+ ); + }) + : null} +
+
+ + ); + } catch (e) {} + return (
-
{props.chat?.votetitle}
-
{props.chat?.voteitem}
+
{props.chat?.content}
- 投票 [{votetype[props.chat?.votetype as string]}] + 投票
); diff --git a/src/pages/ChatLogs/components/EmojiFormat.tsx b/src/pages/ChatLogs/components/EmojiFormat.tsx index ea907a2..c47b948 100644 --- a/src/pages/ChatLogs/components/EmojiFormat.tsx +++ b/src/pages/ChatLogs/components/EmojiFormat.tsx @@ -7,13 +7,16 @@ type IProps = { export const EmojiFormat: React.FC = (props) => { const format = () => { let txt = props.content; - emoji.forEach((item) => { - const reg = new RegExp(`\\[${item}\\]`, 'g'); - txt = txt.replace( - reg, - ``, - ); - }); + if (txt.includes('[') && txt.includes(']')) { + emoji.forEach((item) => { + const reg = new RegExp(`\\[${item}\\]`, 'g'); + txt = txt.replace( + reg, + ``, + ); + }); + } + return txt; }; diff --git a/src/pages/ChatLogs/components/Svgs.tsx b/src/pages/ChatLogs/components/Svgs.tsx index 4a08287..0b6307f 100644 --- a/src/pages/ChatLogs/components/Svgs.tsx +++ b/src/pages/ChatLogs/components/Svgs.tsx @@ -1,7 +1,7 @@ export const OwnerSvg = () => { return ( { other.push(item); } }); - // 对群员 创建者 > 管理员 > 普通成员 排序 + // 对群员 群主 > 管理员 > 普通成员 排序 setGroupMembersList([...owner, ...admin_list, ...other]); page(1); } @@ -242,8 +242,8 @@ const ChatLogs: React.FC = () => { // }); setStaffsList(res.data); setInnerStaffsList(res.data); - getCustFollowsList(); - getGroupList(); + // getCustFollowsList(); + // getGroupList(); } } }); @@ -566,8 +566,11 @@ const ChatLogs: React.FC = () => { setSelectStaff({ ...item }); selectStaffRef.current = { ...item }; setFlolowsBox(false); - getCustFollowsList(); - getGroupList(); + if (tabKey == '1') { + getCustFollowsList(); + } else if (tabKey == '2') { + getGroupList(); + } }} style={{ background: selectStaff?.user_id == item.user_id ? '#bae0ff' : '' }} > @@ -651,6 +654,11 @@ const ChatLogs: React.FC = () => { tabBarGutter={12} onChange={(val) => { setTabKey(val); + if (val == '1') { + getCustFollowsList(); + } else if (val == '2') { + getGroupList(); + } }} />
{tabContent()}
@@ -724,7 +732,7 @@ const ChatLogs: React.FC = () => { {groupMembersList.map((item) => { return item.group_members_type == '2' || item.state == 0 ? null - : groupMembersListItem(item, selectGroupRef.current); + : groupMembersListItem(item, selectGroupRef.current as IGroup); })} {groupMembersCount2(groupMembersList, '2', 1) != 0 ? (
{ {groupMembersList.map((item) => { return item.group_members_type == '1' || item.state == 0 ? null - : groupMembersListItem(item, selectGroupRef.current); + : groupMembersListItem(item, selectGroupRef.current as IGroup); })} {groupMembersCount(groupMembersList, 0) != 0 ? (
{ {groupMembersList.map((item) => { return item.state == 1 ? null - : groupMembersListItem(item, selectGroupRef.current); + : groupMembersListItem(item, selectGroupRef.current as IGroup); })}
)} diff --git a/src/pages/CustomList/components/CustDetailContent.tsx b/src/pages/CustomList/components/CustDetailContent.tsx index 763da64..6ee3764 100644 --- a/src/pages/CustomList/components/CustDetailContent.tsx +++ b/src/pages/CustomList/components/CustDetailContent.tsx @@ -1,8 +1,11 @@ import { ICustFollow } from '@/pages/ChatLogs/ChatLogsType'; import { formatTags } from '@/pages/ChatLogs/ChatUtils'; import { Gender } from '@/pages/ChatLogs/components/Gender'; +import { post } from '@/services/ajax'; import { AddWay, CustType } from '@/services/config'; -import React from 'react'; +import { Spin, Steps } from 'antd'; +import { stringify } from 'qs'; +import React, { useEffect, useState } from 'react'; import styles from './index.module.scss'; type IProps = { @@ -16,6 +19,39 @@ type IProps = { */ export const CustDetailContent: React.FC = (props) => { const { record } = props; + const [timeLine, setTimeLine] = useState([]); + const [loading, setLoading] = useState(false); + + const getList = () => { + setLoading(true); + post({ + url: '/CustFollows/CustPath', + data: stringify({ + cust_id: record.cust_id, + }), + }).then((res) => { + setLoading(false); + if (res.err_code == 0) { + if (Array.isArray(res.data)) { + let arr: any = []; + res.data.forEach((item: any) => { + arr.push({ + title: item.staff_name + ' 添加了好友', + description: item.create_time, + }); + }); + setTimeLine(arr); + } + } + }); + }; + + useEffect(() => { + if (props.record.cust_id) { + getList(); + } + }, [props.record]); + return (
= (props) => {
添加时间:{record?.create_time}
= (props) => { 标签
{formatTags(record?.tags)} + +
+ 客户轨迹 +
+ + +
); }; diff --git a/src/pages/CustomList/index.tsx b/src/pages/CustomList/index.tsx index d6404aa..0664ff5 100644 --- a/src/pages/CustomList/index.tsx +++ b/src/pages/CustomList/index.tsx @@ -1,4 +1,4 @@ -import { SearchBarPlugin, SearchBottonsCardPlugin } from '@/components/SearchBarPlugin'; +import { SearchBarPlugin } from '@/components/SearchBarPlugin'; import { post } from '@/services/ajax'; import { AddWay, CustType } from '@/services/config'; import { PageContainer } from '@ant-design/pro-components'; @@ -79,110 +79,113 @@ const CustomList: React.FC = () => { return (
- -
- - - - { - param.name = e.target.value.trim(); - }} - allowClear - onPressEnter={() => page(1)} - /> - - - - 客户类型}> - - - - - - - - - - 添加方式}> - - - - - 添加日期}> - { - // console.log(dateStrings); - param.create_timeL = dateStrings[0]; - param.create_timeU = dateStrings[1]; - }} - /> - - + + + + + { + param.name = e.target.value.trim(); + }} + allowClear + onPressEnter={() => page(1)} + /> + + + + 客户类型}> + + + + + + + + + + 添加方式}> + + + + + 添加日期}> + { + // console.log(dateStrings); + param.create_timeL = dateStrings[0]; + param.create_timeU = dateStrings[1]; + }} + /> + + + + + } + footer={ + + - - - - - - - + } + /> + { return `${record.cust_id}_${record.user_id}`; }} loading={loading} + onRow={(record: ICustFollow) => { + if ( + record?.add_staff_tot && + !isNaN(record?.add_staff_tot) && + Number(record?.add_staff_tot) > 1 + ) { + return { + style: { + background: '#fcffe6', + }, + }; + } + return {}; + }} > { */}
- -
- -
- 姓名}> - { - param.name = e.target.value.trim(); - }} - allowClear - onPressEnter={() => page(1)} - /> - - - - 职务}> - { - param.position = e.target.value.trim(); - }} - allowClear - onPressEnter={() => page(1)} - /> - - - - - { - param.mobile = e.target.value.trim(); - }} - allowClear - onPressEnter={() => page(1)} - /> - - + + + + 姓名}> + { + param.name = e.target.value.trim(); + }} + allowClear + onPressEnter={() => page(1)} + /> + + + + 职务}> + { + param.position = e.target.value.trim(); + }} + allowClear + onPressEnter={() => page(1)} + /> + + + + + { + param.mobile = e.target.value.trim(); + }} + allowClear + onPressEnter={() => page(1)} + /> + + + + + } + footer={ + + + + - - - - - - - - - + } + > +
= (props) => { other.push(item); } }); - // 对群员 创建者 > 管理员 > 普通成员 排序 + // 对群员 群主 > 管理员 > 普通成员 排序 setGroupMembersList([...owner, ...admin_list, ...other]); } } @@ -62,15 +63,33 @@ export const GroupDetailContent: React.FC = (props) => { {groupMembersList.length ? (
-
- 群主: - {groupMembersObjRef.current[record?.owner as string]?.name} +
+
+
+ 群主: + {groupMembersObjRef.current[record?.owner as string]?.name} +
+
+ {adminList(record?.admin_list, groupMembersObjRef.current)} +
+
创建时间:{record?.create_time}
+
+
+
+
+ 群公告 +
+
{record?.notice || '未设置'}
+
+
-
- {adminList(record?.admin_list, groupMembersObjRef.current)} -
-
创建时间:{record?.create_time}
-
群公告:{record?.notice}
+
{ return (
- -
- -
- 群名}> - { - param.name = e.target.value.trim(); - }} - allowClear - onPressEnter={() => page(1)} - /> - - - - 创建者}> - { - param.owner = e.target.value.trim(); - }} - allowClear - onPressEnter={() => page(1)} - /> - - - - 状态}> - - - + + + + 群名}> + { + param.name = e.target.value.trim(); + }} + allowClear + onPressEnter={() => page(1)} + /> + + + + 群主}> + { + param.owner = e.target.value.trim(); + }} + allowClear + onPressEnter={() => page(1)} + /> + + + + 状态}> + + + - - 是否解散}> - - - - - 创建时间}> - { - // console.log(dateStrings); - param.create_timeL = dateStrings[0]; - param.create_timeU = dateStrings[1]; - }} - /> - - + + 是否解散}> + + + + + 创建时间}> + { + // console.log(dateStrings); + param.create_timeL = dateStrings[0]; + param.create_timeU = dateStrings[1]; + }} + /> + + + + + } + footer={ + + - - - - - - - + } + /> +
{ }} /> { return <>{r?.staff_name}; diff --git a/src/pages/Workbench/index.module.scss b/src/pages/Workbench/index.module.scss index f860dd9..edd7373 100644 --- a/src/pages/Workbench/index.module.scss +++ b/src/pages/Workbench/index.module.scss @@ -1,9 +1,17 @@ +.dataSumBox { + display: flex; +} + .dataSum { margin-bottom: 24px; padding: 24px; color: #000; background-color: #fff; border-radius: 8px; + + &:last-child { + margin-bottom: 12px; + } } .dataItem { @@ -20,6 +28,7 @@ .dataIconBox { display: flex; + flex-shrink: 0; align-items: center; justify-content: center; width: 64px; @@ -35,8 +44,8 @@ } .dataCount { - font-size: 26px; font-weight: 500; + font-size: 26px; } .dataCardBox { @@ -51,3 +60,30 @@ border: 1px solid #ddd; border-radius: 12px; } + +@media only screen and (max-width: 768px) { + .dataSumBox, + .dataCardBox { + flex-direction: column; + } + + .dataItem { + display: flex; + width: 100%; + padding-bottom: 12px; + border-right: none; + + &:last-child { + margin-bottom: 0; + padding-bottom: 0; + } + } + + .dataCard { + margin-bottom: 12px; + } + + .dataSum { + margin-bottom: 16px; + } +} diff --git a/src/pages/Workbench/index.tsx b/src/pages/Workbench/index.tsx index 5f464ea..8423873 100644 --- a/src/pages/Workbench/index.tsx +++ b/src/pages/Workbench/index.tsx @@ -99,7 +99,7 @@ const Workbench: React.FC = () => { 数据总览 {/* 更新时间:2022-12-12 23:30:30 */} -
+