wjx 1 tuần trước cách đây
mục cha
commit
3d9fc86ab5

+ 63 - 0
src/pages/launchSystemV3/tencenTasset/corpWechat/csgroup/components/group/associateCSG.tsx

@@ -0,0 +1,63 @@
+import { useAjax } from "@/Hook/useAjax"
+import { getRelationGroupListApi } from "@/services/adqV3/global"
+import { LinkOutlined } from "@ant-design/icons"
+import { Button, Modal, Table } from "antd"
+import React, { useState } from "react"
+
+
+const AssociateCSG: React.FC<{ localCorpCsgroupId: number }> = ({ localCorpCsgroupId }) => {
+
+    /****************************************/
+    const [visible, setVisible] = useState<boolean>(false)
+
+    const getRelationGroupList = useAjax((params) => getRelationGroupListApi(params))
+    /****************************************/
+
+    const getList = () => {
+        setVisible(true)
+        getRelationGroupList.run({ localCorpCsgroupId })
+    }
+
+    return <>
+        <Button icon={<LinkOutlined />} style={{ border: 'none', fontSize: 12, padding: 0 }} size='small' onClick={getList}>已关联客服组</Button>
+
+        {visible && <Modal
+            title={<strong>已关联腾讯客服组</strong>}
+            open={visible}
+            onCancel={() => setVisible(false)}
+            footer={null}
+            width={650}
+        >
+            <Table
+                columns={[
+                    {
+                        title: '客服组名称',
+                        dataIndex: 'groupName',
+                        key: 'groupName',
+                        width: 220,
+                        ellipsis: true,
+                        render(value, records) {
+                            return <span style={{ fontSize: 12 }}>{value}({records.groupId})</span>
+                        }
+                    },
+                    {
+                        title: 'AccountId',
+                        dataIndex: 'accountId',
+                        key: 'accountId',
+                        render(value) {
+                            return <span style={{ fontSize: 12 }}>{value}</span>
+                        }
+                    }
+                ]}
+                dataSource={getRelationGroupList.data}
+                size="small"
+                loading={getRelationGroupList?.loading}
+                scroll={{ y: 500 }}
+                rowKey={'groupId'}
+            />
+        </Modal>}
+    </>
+}
+
+
+export default React.memo(AssociateCSG)

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

@@ -102,7 +102,7 @@ const GroupUserInfo: React.FC<GroupUserInfoProps> = ({ groupData: { id: localCsg
     }
 
     return <>
-        <Button icon={<TeamOutlined />} style={{ border: 'none', fontSize: 12 }} size='small' onClick={() => handleUser()}>成员</Button>
+        <Button icon={<TeamOutlined />} style={{ border: 'none', fontSize: 12, padding: 0 }} size='small' onClick={() => handleUser()}>成员</Button>
         {visible && <Drawer
             title={<strong style={{ fontSize: 20 }}>{csgroupName} 客服组成员</strong>}
             open={visible}

+ 6 - 3
src/pages/launchSystemV3/tencenTasset/corpWechat/csgroup/components/group/tableConfig.tsx

@@ -3,6 +3,7 @@ import React from "react"
 import { EditOutlined } from "@ant-design/icons"
 import GroupUserInfo from "./groupUserInfo"
 import CloseSwitch from "./closeSwitch"
+import AssociateCSG from "./associateCSG"
 
 const columns = (handleEdit: (data: any) => void, refresh: () => void): TableProps<any>['columns'] => {
 
@@ -72,10 +73,11 @@ const columns = (handleEdit: (data: any) => void, refresh: () => void): TablePro
             title: '切号策略',
             dataIndex: 'policyName',
             key: 'policyName',
-            width: 100,
+            width: 160,
             align: 'center',
+            ellipsis: true,
             render(value) {
-                return <span style={{ fontSize: 12 }}>{value}</span>
+                return <span style={{ fontSize: 12 }}>{value || '--'}</span>
             }
         },
         {
@@ -147,7 +149,8 @@ const columns = (handleEdit: (data: any) => void, refresh: () => void): TablePro
                 return <Space>
                     {/* <UserInfo userInfoList={record.userInfoList} createTime={record.createTime} groupMemberCnt={record.groupMemberCnt} /> */}
                     {record.type == 1 && <GroupUserInfo adAccountId={record.accountId} groupData={record} />}
-                    <Button icon={<EditOutlined />} style={{ border: 'none', fontSize: 12 }} size='small' onClick={() => handleEdit(record)}>修改</Button>
+                    <Button icon={<EditOutlined />} style={{ border: 'none', fontSize: 12, padding: 0 }} size='small' onClick={() => handleEdit(record)}>修改</Button>
+                    {!record?.parentId && <AssociateCSG localCorpCsgroupId={record.id} />}
                 </Space>
             }
         }

+ 12 - 0
src/services/adqV3/global.ts

@@ -1073,6 +1073,18 @@ export async function getLocalCorpCsgroupListAllApi(params: { accountId?: number
     })
 }
 
+/**
+ * 已关联腾讯客服组
+ * @param params 
+ * @returns 
+ */
+export async function getRelationGroupListApi(params: { localCorpCsgroupId: number }) {
+    return request(api + `/adq/localCorpCsgroup/getRelationGroup`, {
+        method: 'GET',
+        params
+    })
+}
+
 export interface GetCustomerServiceGroupUserListProps {
     pageNum: number, // 页码
     pageSize: number, // 页大小