wjx 1 Minggu lalu
induk
melakukan
a5c33d9b4e

+ 1 - 12
src/pages/launchSystemV3/monitorEWList/astraGroup.tsx

@@ -4,30 +4,19 @@ import { Button, Card, DatePicker, Select, Table } from 'antd';
 import React, { useEffect, useState } from 'react';
 import moment from 'moment';
 import { LocalCsgroupDayListTableConfig } from './tableConfig';
-import { getLocalCorpCsgroupListAllApi } from '@/services/adqV3/global';
 
 /**
  * 客服组加粉数据
  * @returns 
  */
-const AstraGroup: React.FC = () => {
+const AstraGroup: React.FC<{ localCorpCsgroupList: { label: string, value: string }[] }> = ({ localCorpCsgroupList }) => {
 
     /*******************************************/
     const [queryParamsNew, setQueryParamsNew] = useState<GetLocalCsgroupDayListProps>({ pageNum: 1, pageSize: 20 });
-    const [localCorpCsgroupList, setLocalCorpCsgroupList] = useState<{ label: string, value: string }[]>([]);
 
     const getLocalCsgroupDayList = useAjax((params) => getLocalCsgroupDayListApi(params))
-    const getLocalCorpCsgroupListAll = useAjax((params) => getLocalCorpCsgroupListAllApi(params))
     /*******************************************/
 
-    useEffect(() => {
-        getLocalCorpCsgroupListAll.run({}).then((res) => {
-            if (res && res.length > 0) {
-                setLocalCorpCsgroupList(res.map((item: { csgroupName: string; id: string; }) => ({ label: item.csgroupName, value: item.id })));
-            }
-        })
-    }, [])
-
     useEffect(() => {
         getLocalCsgroupDayList.run(queryParamsNew)
     }, [queryParamsNew])

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

@@ -6,12 +6,13 @@ import React, { useEffect, useState } from 'react';
 import moment from 'moment';
 import { CorpUserDayListTableConfig } from './tableConfig';
 import GroupUserEdit from '../tencenTasset/corpWechat/csgroup/components/group/groupUserEdit';
+import { POOLTYPE } from '../tencenTasset/corpWechat/csgroup/const';
 
 /**
  * 客服号加粉数据
  * @returns 
  */
-const AstraSupport: React.FC = () => {
+const AstraSupport: React.FC<{ localCorpCsgroupList: { label: string, value: string, type: 0 | 1 }[] }> = ({ localCorpCsgroupList }) => {
 
     /*******************************************/
     const [corpWechatList, setCorpWechatList] = useState<{ label: string, value: string }[]>([]);
@@ -64,6 +65,34 @@ const AstraSupport: React.FC = () => {
                 }}
                 options={corpWechatList}
             />
+            <Select
+                showSearch
+                placeholder="请选择本地客服组"
+                filterOption={(input, option) =>
+                    ((option?.label ?? '') as any).toLowerCase().includes(input.toLowerCase())
+                }
+                style={{ width: 140 }}
+                allowClear
+                value={queryParams?.localCsgroupId}
+                onChange={(e) => {
+                    setQueryParams({ ...queryParams, localCsgroupId: e, pageNum: 1 })
+                }}
+                options={localCorpCsgroupList?.filter(item => item.type === 1)}
+            />
+            <Select
+                showSearch
+                placeholder="归属客服池"
+                filterOption={(input, option) =>
+                    ((option?.label ?? '') as any).toLowerCase().includes(input.toLowerCase())
+                }
+                disabled={!queryParams?.localCsgroupId}
+                allowClear
+                value={queryParams?.poolType}
+                onChange={(e) => {
+                    setQueryParams({ ...queryParams, poolType: e, pageNum: 1 })
+                }}
+                options={Object.keys(POOLTYPE).map((key) => ({ label: POOLTYPE[key as keyof typeof POOLTYPE], value: key }))}
+            />
             <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 })} />

+ 23 - 10
src/pages/launchSystemV3/monitorEWList/index.tsx

@@ -1,7 +1,9 @@
 import { Tabs } from 'antd';
-import React from 'react';
+import React, { useEffect, useState } from 'react';
 import AstraSupport from './astraSupport‌';
 import AstraGroup from './astraGroup';
+import { getLocalCorpCsgroupListAllApi } from '@/services/adqV3/global';
+import { useAjax } from '@/Hook/useAjax';
 
 /**
  * 企微客服组监控
@@ -10,6 +12,17 @@ import AstraGroup from './astraGroup';
 const MonitorEWList: React.FC = () => {
 
     const [currentTab, setCurrentTab] = React.useState<string>('hao');
+    const [localCorpCsgroupList, setLocalCorpCsgroupList] = useState<{ label: string, value: string, type: 0 | 1 }[]>([]);
+
+    const getLocalCorpCsgroupListAll = useAjax((params) => getLocalCorpCsgroupListAllApi(params))
+
+    useEffect(() => {
+        getLocalCorpCsgroupListAll.run({}).then((res) => {
+            if (res && res.length > 0) {
+                setLocalCorpCsgroupList(res.map((item: { csgroupName: string; id: string; type: 0 | 1 }) => ({ label: item.csgroupName, value: item.id, type: item.type })));
+            }
+        })
+    }, [])
 
     return <Tabs
         type="card"
@@ -17,18 +30,18 @@ const MonitorEWList: React.FC = () => {
         onChange={(key) => setCurrentTab(key)}
         tabBarStyle={{ marginBottom: 2 }}
         items={[
-            { 
-                label: '客服号加粉数据', 
-                key: 'hao', 
+            {
+                label: '客服号加粉数据',
+                key: 'hao',
                 children: <>
-                    {currentTab === 'hao' && <AstraSupport />}
-                </> 
+                    {currentTab === 'hao' && <AstraSupport localCorpCsgroupList={localCorpCsgroupList} />}
+                </>
             },
-            { 
-                label: '客服组加粉数据', 
-                key: 'zu', 
+            {
+                label: '客服组加粉数据',
+                key: 'zu',
                 children: <>
-                    {currentTab === 'zu' && <AstraGroup />}
+                    {currentTab === 'zu' && <AstraGroup localCorpCsgroupList={localCorpCsgroupList} />}
                 </>
             }
         ]}

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

@@ -12,6 +12,8 @@ export interface GetCorpUserDayListProps {
     sortAsc?: boolean
     addFansMin?: number | null
     addFansMax?: number | null
+    localCsgroupId?: number
+    poolType?: string
 }
 
 /**