Browse Source

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

wjx 3 ngày trước cách đây
mục cha
commit
2378567eab

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

@@ -1,13 +1,14 @@
 import { useAjax } from '@/Hook/useAjax';
-import { delLocalCorpCsgroupUserApi, GetCustomerServiceGroupUserListProps, getLocalCorpCsgroupUserAllListApi, getLocalCorpCsgroupUserListApi, getUserlogListApi } from '@/services/adqV3/global';
-import { DeleteOutlined, EditOutlined, PlusOutlined, SearchOutlined, TeamOutlined } from '@ant-design/icons';
-import { Button, Card, Drawer, Input, message, Modal, Popconfirm, Select, Space, Table } from 'antd';
+import { delLocalCorpCsgroupUserApi, GetCustomerServiceGroupUserListProps, getLocalCorpCsgroupUserAllListApi, getLocalCorpCsgroupUserListApi, getUserlogListApi, putUserDecodeApi } from '@/services/adqV3/global';
+import { DeleteOutlined, DownOutlined, EditOutlined, PlusOutlined, SearchOutlined, TeamOutlined } from '@ant-design/icons';
+import { Button, Card, Drawer, Dropdown, Input, message, Modal, Popconfirm, Select, Space, Table } from 'antd';
 import React, { useCallback, useEffect, useState } from 'react';
 import '../../../../../tencentAdPutIn/index.less';
 import SettingsEnterprise from './settingsEnterprise';
 import style from '@/pages/launchSystemV3/tencentAdPutIn/create/index.less';
 import { POOLTYPE, POOLTYPEEle } from '../../const';
 import GroupUserEdit from './groupUserEdit';
+import UserDecodeLog from './userDecodeLog';
 
 interface GroupUserInfoProps {
     groupData: { [x: string]: any };
@@ -30,11 +31,13 @@ const GroupUserInfo: React.FC<GroupUserInfoProps> = ({ groupData: { id: localCsg
     const [userEditData, setUserEditData] = useState<{ visible: boolean, idList: number[] }>();
     const [logData, setLogData] = useState<{ visible: boolean, data: any }>();
     const [logParams, setLogParams] = useState<{ pageNum: number, pageSize: number }>({ pageNum: 1, pageSize: 20 })
+    const [decodeVisible, setDecodeVisible] = useState<boolean>(false)
 
     const getLocalCorpCsgroupUserList = useAjax((params) => getLocalCorpCsgroupUserListApi(params))
     const getUserlogList = useAjax((params) => getUserlogListApi(params))
     const getLocalCorpCsgroupUserAllList = useAjax((params) => getLocalCorpCsgroupUserAllListApi(params))
     const delLocalCorpCsgroupUser = useAjax((params) => delLocalCorpCsgroupUserApi(params))
+    const putUserDecode = useAjax((params) => putUserDecodeApi(params))
     /********************************************/
 
     const handleUser = useCallback(() => {
@@ -88,6 +91,16 @@ const GroupUserInfo: React.FC<GroupUserInfoProps> = ({ groupData: { id: localCsg
         }
     }, [logParams, logData])
 
+    const handleSync = () => {
+        const hide = message.loading({ content: '操作中...', key: 'sync' });
+        putUserDecode.run({ localCsgroupId }).then((res) => {
+            hide();
+            if (res) {
+                message.success('操作成功');
+            }
+        }).catch(() => hide())
+    }
+
     return <>
         <Button icon={<TeamOutlined />} style={{ border: 'none', fontSize: 12 }} size='small' onClick={() => handleUser()}>成员</Button>
         {visible && <Drawer
@@ -127,6 +140,37 @@ const GroupUserInfo: React.FC<GroupUserInfoProps> = ({ groupData: { id: localCsg
                                 <Button type="primary" icon={<SearchOutlined />} loading={getLocalCorpCsgroupUserList.loading} onClick={() => setQueryParamsNew({ ...queryForm, pageNum: 1 })}>搜索</Button>
                             </Space>
                             <Space>
+                                <Dropdown menu={{
+                                    items: [
+                                        {
+                                            label: '解密同步',
+                                            key: '1'
+                                        },
+                                        {
+                                            label: '解密查询',
+                                            key: '2'
+                                        }
+                                    ],
+                                    onClick: ({ key }) => {
+                                        switch (key) {
+                                            case '1':
+                                                handleSync()
+                                                break
+                                            case '2':
+                                                setDecodeVisible(true)
+                                                break
+                                            default:
+                                                break
+                                        }
+                                    }
+                                }}>
+                                    <Button>
+                                        <Space>
+                                            服务商授权
+                                            <DownOutlined />
+                                        </Space>
+                                    </Button>
+                                </Dropdown>
                                 <Button type="primary" disabled={selectedRows.length === 0} icon={<EditOutlined />} onClick={userEdit}>修改</Button>
                                 <Popconfirm
                                     title="确定删除?"
@@ -377,6 +421,12 @@ const GroupUserInfo: React.FC<GroupUserInfoProps> = ({ groupData: { id: localCsg
                 }}
             />
         </Modal>}
+
+        {decodeVisible && <UserDecodeLog
+            visible={decodeVisible}
+            onClose={() => setDecodeVisible(false)}
+            localCsgroupId={localCsgroupId}
+        />}
     </>
 };
 

+ 103 - 0
src/pages/launchSystemV3/tencenTasset/corpWechat/csgroup/components/group/userDecodeLog.tsx

@@ -0,0 +1,103 @@
+import { Modal, Table } from 'antd';
+import React, { useEffect, useState } from 'react';
+import '../../../../../tencentAdPutIn/index.less';
+import { useAjax } from '@/Hook/useAjax';
+import { getUserDecodeListApi } from '@/services/adqV3/global';
+
+interface UserDecodeLogProps {
+    localCsgroupId: number;
+    visible?: boolean;
+    onClose?: () => void;
+}
+
+/**
+ * 解密查询
+ * @param param0 
+ * @returns 
+ */
+const UserDecodeLog: React.FC<UserDecodeLogProps> = ({ visible, localCsgroupId, onClose }) => {
+
+    /**********************************************/
+    const [queryForm, setQueryForm] = useState<{ localCsgroupId: number, pageNum: number, pageSize: number }>({ localCsgroupId, pageNum: 1, pageSize: 20 })
+    const getUserDecodeList = useAjax((params) => getUserDecodeListApi(params))
+    /**********************************************/
+
+    useEffect(() => {
+        getUserDecodeList.run({ ...queryForm, localCsgroupId })
+    }, [queryForm, localCsgroupId])
+
+    return (
+        <Modal
+            title={<strong>服务商授权解密查询</strong>}
+            open={visible}
+            onCancel={onClose}
+            footer={null}
+            className='modalResetCss'
+            width={800}
+        >
+            <Table
+                columns={[
+                    {
+                        title: '本地企微ID',
+                        dataIndex: 'localCorpId',
+                        key: 'localCorpId',
+                        width: 100,
+                        ellipsis: true,
+                        align: 'center',
+                        render(value) {
+                            return <span style={{ fontSize: 12 }}>{value}</span>
+                        }
+                    },
+                    {
+                        title: '本地客服号ID',
+                        dataIndex: 'localCorpUserId',
+                        key: 'localCorpUserId',
+                        width: 100,
+                        ellipsis: true,
+                        align: 'center',
+                        render(value) {
+                            return <span style={{ fontSize: 12 }}>{value}</span>
+                        }
+                    },
+                    {
+                        title: '客服号名称',
+                        dataIndex: 'getLocalCorpUserName',
+                        key: 'getLocalCorpUserName',
+                        width: 100,
+                        ellipsis: true,
+                        align: 'center',
+                        render(value) {
+                            return <span style={{ fontSize: 12 }}>{value}</span>
+                        }
+                    },
+                    {
+                        title: '腾讯客服号ID',
+                        dataIndex: 'tencentCorpUserId',
+                        key: 'tencentCorpUserId',
+                        width: 200,
+                        render(value) {
+                            return <span style={{ fontSize: 12 }}>{value}</span>
+                        }
+                    }
+                ]}
+                dataSource={getUserDecodeList.data?.records}
+                size="small"
+                loading={getUserDecodeList?.loading}
+                scroll={{ y: 500 }}
+                rowKey={'id'}
+                pagination={{
+                    total: getUserDecodeList.data?.total,
+                    defaultPageSize: 20,
+                    current: getUserDecodeList.data?.current,
+                    pageSize: getUserDecodeList.data?.size
+                }}
+                onChange={(pagination) => {
+                    const { current, pageSize } = pagination
+                    setQueryForm({ ...queryForm, pageNum: current as number, pageSize: pageSize as number || 20 })
+                }}
+            />
+        </Modal>
+    );
+};
+
+export default React.memo(UserDecodeLog);

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

@@ -1213,6 +1213,31 @@ export async function modifyLocalCorpCsgroupApi(data: AddLocalCorpCsgroupProps)
     })
 }
 
+
+/**
+ * 服务商解密同步
+ * @param params 
+ * @returns 
+ */
+export async function putUserDecodeApi(params: { localCsgroupId: number }) {
+    return request(api + `/adq/localCorpCsgroup/userDecode/sync`, {
+        method: 'GET',
+        params
+    })
+}
+
+/**
+ * 服务商解密查询
+ * @param data 
+ * @returns 
+ */
+export async function getUserDecodeListApi(data: { localCsgroupId: number, pageNum: number, pageSize: number }) {
+    return request(api + `/adq/localCorpCsgroup/userDecode/list`, {
+        method: 'POST',
+        data
+    })
+}
+
 export interface getWechatPagesCsgroupUserProps {
     adAccountId: number,
     tencentCorpId: string,