wjx 6 months ago
parent
commit
398e7bab10

+ 6 - 0
config/routerConfig.ts

@@ -186,6 +186,12 @@ const launchSystemV3 = {
                     path: '/launchSystemV3/tencenTasset/game',
                     access: 'game',
                     component: './launchSystemV3/tencenTasset/game',
+                },
+                {
+                    name: '账户资产共享',
+                    path: '/launchSystemV3/tencenTasset/accountAssetSharing',
+                    access: 'accountAssetSharing',
+                    component: './launchSystemV3/tencenTasset/accountAssetSharing',
                 }
             ],
         },

+ 2 - 2
src/pages/launchSystemV3/material/cloudNew/manageFolder.tsx

@@ -105,12 +105,12 @@ const ManageFolder: React.FC<Props> = ({ parentIdStr = '0', visible, onChange, o
                     <Form.Item name="isPublic" label={<strong>权限</strong>}>
                         <Radio.Group buttonStyle="solid">
                             <Radio.Button value={true}>所有人可见</Radio.Button>
-                            <Radio.Button value={false}>指定人员可见</Radio.Button>
+                            <Radio.Button value={false}>仅自己可见/指定人员可见</Radio.Button>
                         </Radio.Group>
                     </Form.Item>
                     {isPublic === false && <Form.Item name="permissionUserId" label={<strong>人员</strong>} valuePropName="targetKeys">
                         <Transfer
-                            dataSource={getUserAll?.data || []}
+                            dataSource={getUserAll?.data?.filter((item: { userId: string | null }) => item.userId?.toString() !== localStorage.getItem('userId')) || []}
                             rowKey={record => record.userId}
                             render={item => item.nickname}
                             titles={['未选', '已选']}

+ 86 - 0
src/pages/launchSystemV3/tencenTasset/accountAssetSharing/index.tsx

@@ -0,0 +1,86 @@
+import { useAjax } from "@/Hook/useAjax"
+import { getAccountAssetsGroupListApi } from "@/services/adqV3/global"
+import { PlusOutlined, SearchOutlined } from "@ant-design/icons"
+import { Button, Card, Input } from "antd"
+import React, { useEffect, useState } from "react"
+import '../../tencentAdPutIn/index.less'
+
+
+/**
+ * 账户资产共享
+ * @returns 
+ */
+const AccountAssetSharing: React.FC = () => {
+
+    /****************************************/
+    const [queryForm, setQueryForm] = useState<{ accountGroupName?: string, authMainAccountIds?: number[], pageNum: number, pageSize: number }>({ pageNum: 1, pageSize: 20 })
+    const [queryFormNew, setQueryFormNew] = useState<{ accountGroupName?: string, authMainAccountIds?: number[], pageNum: number, pageSize: number }>({ pageNum: 1, pageSize: 20 })
+    const [visible, setVisible] = useState<boolean>(false)
+
+    const getAccountAssetsGroupList = useAjax((params) => getAccountAssetsGroupListApi(params))
+    /****************************************/
+
+    useEffect(() => {
+        getAccountAssetsGroupList.run(queryFormNew)
+    }, [queryFormNew])
+
+    return <Card
+        className="cardResetCss"
+        title={<div className="flexStart" style={{ gap: 8 }}>
+            <Input style={{ width: 200 }} placeholder="请输入账户组名称" value={queryForm?.accountGroupName} allowClear onChange={(e) => setQueryForm({ ...queryForm, accountGroupName: e.target.value, pageNum: 1 })} />
+            <Input.TextArea
+                style={{ width: 300 }}
+                placeholder="请输入主账户ID列表(多个逗号隔开)"
+                allowClear
+                rows={1}
+                onChange={(e) => {
+                    let value = e.target.value
+                    let arr: any[] = []
+                    if (value) {
+                        value = value.replace(/[,,\s]/g, ',')
+                        arr = value.split(',').filter((a: any) => a)
+                    }
+                    setQueryForm({ ...queryForm, authMainAccountIds: arr, pageNum: 1 })
+                }}
+            />
+            <Button type="primary" icon={<SearchOutlined />} onClick={() => setQueryFormNew({ ...queryForm })}>搜索</Button>
+            <Button type="primary" icon={<PlusOutlined />} onClick={() => { setVisible(true) }}>新增账户组</Button>
+        </div>}
+    >
+
+        {/* <Table
+            columns={columns(del)}
+            dataSource={getGameLibraryList.data?.records}
+            size="small"
+            loading={getGameLibraryList?.loading}
+            scroll={{ y: 600 }}
+            bordered
+            rowKey={'id'}
+            pagination={{
+                defaultPageSize: 20,
+                current: getGameLibraryList.data?.current || 1,
+                pageSize: getGameLibraryList.data?.size || 10,
+                total: getGameLibraryList.data?.total || 0
+            }}
+            onChange={(pagination) => {
+                const { current, pageSize } = pagination
+                setQueryForm({ ...queryForm, pageNum: current || 1, pageSize: pageSize || 10 })
+                setQueryFormNew({ ...queryForm, pageNum: current || 1, pageSize: pageSize || 10 })
+            }}
+        /> */}
+
+        {/* 新增修改 */}
+        {/* {visible && <Modify
+            visible={visible}
+            onClose={() => {
+                setVisible(false)
+            }}
+            onChange={() => {
+                setVisible(false)
+                getGameLibraryList.refresh()
+            }}
+        />} */}
+    </Card>
+}
+
+export default AccountAssetSharing

+ 56 - 0
src/pages/launchSystemV3/tencenTasset/accountAssetSharing/modifyAccountGroup.tsx

@@ -0,0 +1,56 @@
+import { Form, Input, Modal } from "antd"
+import React from "react"
+import '../../tencentAdPutIn/index.less'
+
+interface Props {
+    visible?: boolean
+    onClose?: () => void
+    onChange?: () => void
+}
+
+/**
+ * 新增修改账户组
+ * @returns 
+ */
+const ModifyAccountGroup: React.FC<Props> = ({ visible, onChange, onClose }) => {
+
+    /******************************************/
+    const [form] = Form.useForm()
+    /******************************************/
+
+    return <Modal
+        title={<strong>账户资产共享组新增</strong>}
+        open={visible}
+        onCancel={onClose}
+        className="modalResetCss"
+    >
+        <Form
+            name="basicMiniProgramWechat"
+            form={form}
+            layout='vertical'
+            autoComplete="off"
+            initialValues={{
+
+            }}
+        >
+            <Form.Item label={<strong>账户资产共享组名称</strong>} name="accountGroupName" rules={[{ required: true, message: '请输入账户资产共享组名称!' }]}>
+                <Input placeholder="请输入游戏名称" allowClear />
+            </Form.Item>
+            <Form.Item label={<strong>授权</strong>} name="gameName" rules={[{ required: true, message: '请输入游戏名称!' }]}>
+                <Input placeholder="请输入游戏名称" allowClear />
+            </Form.Item>
+            <Form.Item
+                label={<strong>appId</strong>}
+                name="appId"
+                rules={[
+                    { required: true, message: '请输入appId!' }
+                ]}
+            >
+                <Input placeholder="请输入appId" allowClear />
+            </Form.Item>
+        </Form>
+    </Modal>
+}
+
+
+export default React.memo(ModifyAccountGroup)

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

@@ -684,4 +684,91 @@ export async function getBarrageRecommendListApi(params: { adAccountId?: number,
         method: 'GET',
         params
     })
+}
+
+
+/**
+ * 账户资产组分页查询
+ * @param params 
+ * @returns 
+ */
+export async function getAccountAssetsGroupListApi(data: { accountGroupName?: string, authMainAccountIds?: number[], pageNum: number, pageSize: number }) {
+    return request(api + `/adq/v3/marketingAssets/accountAssetsGroup/pageList`, {
+        method: 'POST',
+        data
+    })
+}
+
+
+/**
+ * 账户资产组修改(只能改名字)
+ * @param data 
+ * @returns 
+ */
+export async function updateAccountAssetsGroupApi(data: { accountGroupId: number, accountGroupName: string }) {
+    return request(api + `/adq/v3/marketingAssets/accountAssetsGroup/update`, {
+        method: 'POST',
+        data
+    })
+}
+
+/**
+ * 账户资产组取消授权
+ * @param data 
+ * @returns 
+ */
+export async function revokeAuthAccountAssetsGroupApi(data: { accountAssetsGroupId: number, accountId: number[] }) {
+    return request(api + `/adq/v3/marketingAssets/accountAssetsGroup/revokeAuth`, {
+        method: 'POST',
+        data
+    })
+}
+
+/**
+ * 删除账户组
+ * @param data 
+ * @returns 
+ */
+export async function delAuthAccountAssetsGroupApi(data: { id: number }) {
+    return request(api + `/adq/v3/marketingAssets/accountAssetsGroup/delete/${data.id}`, {
+        method: 'POST',
+        data
+    })
+}
+
+/**
+ * 账户资产组创建
+ * @param data 
+ * @returns 
+ */
+export async function createAccountAssetsGroupApi(data: { accountGroupId?: number, accountGroupName: string, authMainAccountId: number, authType: string }) {
+    return request(api + `/adq/v3/marketingAssets/accountAssetsGroup/create`, {
+        method: 'POST',
+        data
+    })
+}
+
+
+/**
+ * 查询被授权的账户
+ * @param data 
+ * @returns 
+ */
+export async function getAccountAssetsGroupAccountListApi(data: { groupId: number }) {
+    return request(api + `/adq/v3/marketingAssets/accountAssetsGroup/authAccountList/${data.groupId}`, {
+        method: 'GET'
+    })
+}
+
+
+/**
+ * 账户资产授权
+ * @param data 
+ * @returns 
+ */
+export async function authAccountAssetsGroupAccountApi(data: { accountAssetsGroupId: number, accountId: number[] }) {
+    return request(api + `/adq/v3/marketingAssets/accountAssetsGroup/auth`, {
+        method: 'POST',
+        data
+    })
 }