Browse Source

Merge branch 'develop' of http://git.zanxiangnet.com/wjx/ad-manage

wjx 4 days ago
parent
commit
f7c18f0c4f

+ 3 - 1
src/pages/launchSystemV3/monitorEWList/astraSupport‌.tsx

@@ -1,7 +1,7 @@
 import { useAjax } from '@/Hook/useAjax';
 import { getCorpWechatAllApi } from '@/services/adqV3/global';
 import { getCorpUserDayListApi, GetCorpUserDayListProps } from '@/services/adqV3/monitorEWList';
-import { Button, Card, DatePicker, Input, Select, Table } from 'antd';
+import { Button, Card, DatePicker, Input, InputNumber, Select, Table } from 'antd';
 import React, { useEffect, useState } from 'react';
 import moment from 'moment';
 import { CorpUserDayListTableConfig } from './tableConfig';
@@ -65,6 +65,8 @@ const AstraSupport: React.FC = () => {
                 options={corpWechatList}
             />
             <Input value={queryParams?.corpUserName} style={{ width: 140 }} placeholder='客服号名称' onChange={(e) => setQueryParams({ ...queryParams, corpUserName: e.target.value, pageNum: 1 })} allowClear />
+            <InputNumber value={queryParams?.addFansMin} placeholder='新增粉丝数最小值' style={{ width: 150 }} onChange={(e) => setQueryParams({ ...queryParams, addFansMin: e, pageNum: 1 })} />
+            <InputNumber value={queryParams?.addFansMax} placeholder='新增粉丝数最大值' style={{ width: 150 }} onChange={(e) => setQueryParams({ ...queryParams, addFansMax: e, pageNum: 1 })} />
             <Button type='primary' onClick={() => {
                 setQueryParamsNew({ ...queryParams })
             }}>搜索</Button>

+ 20 - 13
src/pages/launchSystemV3/monitorEWList/tableConfig.tsx

@@ -7,6 +7,7 @@ import AstraGroupIndexEle from "./astraGroupIndexEle";
 import DoubleDelDetails from "./doubleDelDetails";
 import { POOLTYPEEle } from "../tencenTasset/corpWechat/csgroup/const";
 import { FormOutlined } from "@ant-design/icons";
+import GroupUserInfo from "../tencenTasset/corpWechat/csgroup/components/group/groupUserInfo";
 
 /** 客服号加粉 */
 export const CorpUserDayListTableConfig = (updateLimitAddFansOfDay: (data: any) => void): ColumnsType<never> => {
@@ -149,8 +150,8 @@ export const CorpUserDayListTableConfig = (updateLimitAddFansOfDay: (data: any)
             title: '客服号最新加粉时间',
             dataIndex: 'lastAddFansTime',
             key: 'lastAddFansTime',
-            width: 100,
-            align: 'right',
+            width: 130,
+            align: 'center',
             sorter: true,
             render(value) {
                 return <span style={{ fontSize: 12 }}>{value || '--'}</span>
@@ -193,24 +194,30 @@ export const CorpUserDayListTableConfig = (updateLimitAddFansOfDay: (data: any)
                 return <span style={{ fontSize: 12 }}>{value}</span>
             },
         },
-        
+
         {
             title: '操作',
             dataIndex: 'cz',
             key: 'cz',
-            width: 70,
+            width: 140,
             align: 'center',
             fixed: 'right',
             render(_, record: any) {
-                return <AstraSupportHour
-                    corpName={record.corpName}
-                    corpUserName={record.corpUserName}
-                    data={{
-                        corpId: record.corpId,
-                        corpUserId: record.corpUserId,
-                        day: record.day
-                    }}
-                />
+                return <Space>
+                    <GroupUserInfo groupData={{
+                        localCorpId: record.corpId,
+                        csgroupName: record.corpName
+                    }} />
+                    <AstraSupportHour
+                        corpName={record.corpName}
+                        corpUserName={record.corpUserName}
+                        data={{
+                            corpId: record.corpId,
+                            corpUserId: record.corpUserId,
+                            day: record.day
+                        }}
+                    />
+                </Space>
             },
         }
     ]

+ 23 - 13
src/pages/launchSystemV3/tencenTasset/corpWechat/csgroup/components/group/groupUserInfo.tsx

@@ -19,13 +19,13 @@ interface GroupUserInfoProps {
  * @param param0 
  * @returns 
  */
-const GroupUserInfo: React.FC<GroupUserInfoProps> = ({ groupData: { id: localCsgroupId, csgroupName, tencentCorpName, tencentCorpId }, adAccountId }) => {
+const GroupUserInfo: React.FC<GroupUserInfoProps> = ({ groupData: { id: localCsgroupId, localCorpId, csgroupName, tencentCorpName, tencentCorpId }, adAccountId }) => {
 
     /********************************************/
     const [visible, setVisible] = React.useState<boolean>(false);
     const [addData, setAddData] = React.useState<{ visible: boolean, data: any }>({ visible: false, data: undefined });
-    const [queryForm, setQueryForm] = useState<GetCustomerServiceGroupUserListProps>({ pageNum: 1, pageSize: 20, localCsgroupId });
-    const [queryParamsNew, setQueryParamsNew] = useState<GetCustomerServiceGroupUserListProps>({ pageNum: 1, pageSize: 20, localCsgroupId });
+    const [queryForm, setQueryForm] = useState<GetCustomerServiceGroupUserListProps>({ pageNum: 1, pageSize: 20, localCsgroupId, localCorpId });
+    const [queryParamsNew, setQueryParamsNew] = useState<GetCustomerServiceGroupUserListProps>({ pageNum: 1, pageSize: 20, localCsgroupId, localCorpId });
     const [selectedRows, setSelectedRows] = useState<any[]>([])
     const [userEditData, setUserEditData] = useState<{ visible: boolean, idList: number[] }>();
     const [logData, setLogData] = useState<{ visible: boolean, data: any }>();
@@ -43,9 +43,9 @@ const GroupUserInfo: React.FC<GroupUserInfoProps> = ({ groupData: { id: localCsg
 
     useEffect(() => {
         if (visible) {
-            getLocalCorpCsgroupUserList.run({ ...queryParamsNew, localCsgroupId })
+            getLocalCorpCsgroupUserList.run({ ...queryParamsNew, localCsgroupId, localCorpId })
         }
-    }, [visible, localCsgroupId, queryParamsNew])
+    }, [visible, localCsgroupId, localCorpId, queryParamsNew])
 
     const add = useCallback(() => {
         getLocalCorpCsgroupUserAllList.run({ localCsgroupId }).then((res) => {
@@ -64,8 +64,8 @@ const GroupUserInfo: React.FC<GroupUserInfoProps> = ({ groupData: { id: localCsg
     }, [csgroupName, tencentCorpName, tencentCorpId, localCsgroupId, csgroupName])
 
     /** 删除客服 */
-    const delUser = (idList: number[]) => {
-        delLocalCorpCsgroupUser.run({ localCsgroupId, idList }).then((res) => {
+    const delUser = (idList: number[], groupId?: number) => {
+        delLocalCorpCsgroupUser.run({ localCsgroupId: localCsgroupId || groupId, idList }).then((res) => {
             if (res) {
                 message.success('删除成功');
                 getLocalCorpCsgroupUserList.refresh();
@@ -94,7 +94,7 @@ const GroupUserInfo: React.FC<GroupUserInfoProps> = ({ groupData: { id: localCsg
             title={<strong style={{ fontSize: 20 }}>{csgroupName} 客服组成员</strong>}
             open={visible}
             onClose={() => setVisible(false)}
-            width={1000}
+            width={1200}
             headerStyle={{ padding: '10px 16px' }}
             maskClosable={false}
             className={`modalResetCss targetingSelect`}
@@ -131,13 +131,13 @@ const GroupUserInfo: React.FC<GroupUserInfoProps> = ({ groupData: { id: localCsg
                                 <Popconfirm
                                     title="确定删除?"
                                     onConfirm={() => {
-                                        delUser(selectedRows.map(item => item.id))
+                                        delUser(selectedRows.map(item => item.id), selectedRows[0]?.localCsgroupId)
                                     }}
                                     disabled={selectedRows.length === 0}
                                 >
                                     <Button type="primary" disabled={selectedRows.length === 0} danger icon={<DeleteOutlined />} loading={delLocalCorpCsgroupUser.loading}>删除</Button>
                                 </Popconfirm>
-                                <Button type="primary" icon={<PlusOutlined />} loading={getLocalCorpCsgroupUserAllList.loading} onClick={add}>成员加减</Button>
+                                {localCsgroupId && <Button type="primary" icon={<PlusOutlined />} loading={getLocalCorpCsgroupUserAllList.loading} onClick={add}>成员加减</Button>}
                             </Space>
                         </div>
                         <Table
@@ -167,7 +167,7 @@ const GroupUserInfo: React.FC<GroupUserInfoProps> = ({ groupData: { id: localCsg
                                     title: '归属客服池',
                                     dataIndex: 'poolType',
                                     key: 'poolType',
-                                    width: 100,
+                                    width: 120,
                                     align: 'center',
                                     render(value) {
                                         return <span style={{ fontSize: 12 }}>{POOLTYPEEle[value as keyof typeof POOLTYPEEle]}</span>
@@ -183,6 +183,16 @@ const GroupUserInfo: React.FC<GroupUserInfoProps> = ({ groupData: { id: localCsg
                                         return <span style={{ fontSize: 12 }}>{(value || value === 0) ? value : '--'}</span>
                                     }
                                 },
+                                {
+                                    title: '归属客服组',
+                                    dataIndex: 'localCsgroupName',
+                                    key: 'localCsgroupName',
+                                    width: 150,
+                                    ellipsis: true,
+                                    render(value) {
+                                        return <span style={{ fontSize: 12 }}>{value}</span>
+                                    }
+                                },
                                 {
                                     title: '创建时间',
                                     dataIndex: 'createTime',
@@ -214,7 +224,7 @@ const GroupUserInfo: React.FC<GroupUserInfoProps> = ({ groupData: { id: localCsg
                                             <Popconfirm
                                                 title="确定删除?"
                                                 onConfirm={() => {
-                                                    delUser([records.id])
+                                                    delUser([records.id], records.localCsgroupId)
                                                 }}
                                             >
                                                 <a style={{ color: 'red' }}>删除</a>
@@ -226,7 +236,7 @@ const GroupUserInfo: React.FC<GroupUserInfoProps> = ({ groupData: { id: localCsg
                             dataSource={getLocalCorpCsgroupUserList.data?.records}
                             size="small"
                             loading={getLocalCorpCsgroupUserList?.loading}
-                            scroll={{ y: 500 }}
+                            scroll={{ y: 600 }}
                             rowKey={'id'}
                             pagination={{
                                 total: getLocalCorpCsgroupUserList.data?.total,

+ 2 - 1
src/pages/launchSystemV3/tencenTasset/corpWechat/csgroup/components/group/tableConfig.tsx

@@ -39,8 +39,9 @@ const columns = (handleEdit: (data: any) => void): TableProps<any>['columns'] =>
             title: '归属组集',
             dataIndex: 'parentName',
             key: 'parentName',
-            width: 100,
+            width: 150,
             align: 'center',
+            ellipsis: true,
             render(value) {
                 return <span style={{ fontSize: 12 }}>{value || '--'}</span>
             }

+ 2 - 1
src/services/adqV3/global.ts

@@ -1062,9 +1062,10 @@ export async function getLocalCorpCsgroupListAllApi(params: { accountId?: number
 }
 
 export interface GetCustomerServiceGroupUserListProps {
-    localCsgroupId: number, // 企业微信ID
     pageNum: number, // 页码
     pageSize: number, // 页大小
+    localCorpId?: number,
+    localCsgroupId?: number, // 企业微信ID
     localCorpUserName?: string, // 客服组成员名称
     poolType?: 'BLOCKLIST' | 'OFFLINE' | 'ONLINE' | 'WAITING' | 'WARRING', // 客服组成员状态
 }

+ 2 - 0
src/services/adqV3/monitorEWList.ts

@@ -10,6 +10,8 @@ export interface GetCorpUserDayListProps {
     corpUserName?: string
     sortFiled?: string,
     sortAsc?: boolean
+    addFansMin?: number | null
+    addFansMax?: number | null
 }
 
 /**