Bladeren bron

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

wjx 1 jaar geleden
bovenliggende
commit
a7eb85f2c3

+ 9 - 8
config/routerConfig.ts

@@ -23,10 +23,10 @@ function headrRouter(initialState: any, history: any) {
             }
         })
     }
-    if (history?.location?.pathname === '/adMonitor') { //当切换一级菜单的辅助跳转
+    if (history?.location?.pathname === '/toutiao') { //当切换一级菜单的辅助跳转
         history?.goBack()
         initialState?.menu?.data.forEach((item: { roles: string[], path: string, routes: { path: string, routes: any[] }[] }) => {
-            if (item?.routes?.some((i: { path: string }) => i.path?.includes('/adMonitor'))) {
+            if (item?.routes?.some((i: { path: string }) => i.path?.includes('/toutiao'))) {
                 let path = item?.routes?.length > 0 ? (item?.routes[0]?.routes?.length > 0 && item?.routes[0]?.routes[0]?.path) ? item?.routes[0]?.routes[0]?.path : item?.routes[0].path : item?.routes[0].path
                 isPhone ? history.push(path) : window.open(location.origin + '/#' + path)
             }
@@ -145,17 +145,18 @@ const launchSystem = {
                 },
             ],
         },
-    ]
+    ],
+
 }
-/** 广告监控 */
+/** 头条 */
 const adMonitor = {
-    path: '/adMonitor',
+    path: '/toutiao',
     routes: [
         {
-            path: '/adMonitor/adMonitorList',
+            path: '/toutiao/ttAccountManage',
             name: '广告监控',
-            component: './adMonitor/adMonitorList',
-            access: 'adMonitorList',
+            component: './toutiao/ttAccountManage',
+            access: 'ttAccountManage',
         },
     ]
 }

+ 1 - 1
src/app.tsx

@@ -59,7 +59,7 @@ export async function getInitialState(): Promise<{
         if (userInfo?.data?.userInfo?.account === 'admin' && path.length > 0) {//假如是ADMIN加入api测试
           path[0].routes.push({ key: 0, path: '/operatePage/apitest', name: 'api测试', icon: '', component: './operatePage/apitest', roles: 'admin' })
         }
-        return { data: path }
+        return { data: path.reverse() }
       });
       localStorage.setItem('sex', userInfo?.data?.userInfo?.sex)
       localStorage.setItem('userId', userInfo?.data?.userInfo?.userId)

+ 3 - 1
src/pages/launchSystemNew/account/qqAuto.tsx

@@ -22,7 +22,9 @@ function QQAuth(props: { qqVisible: boolean, callBack: () => void }) {
         authorization: `Bearer ${sessionStorage.getItem('Admin-Token')}`
     })
     let adAppIdonChange = useCallback((checkedValue) => {
-        setData({ ...data, adAppType: checkedValue })
+        let v = checkedValue.target.value
+        console.log("checkedValue===>",v)
+        setData({ ...data, adAppType:v})
     }, [data])
     let submit = useCallback(() => {
         if (data.users.some(user => isNaN(user))) {

+ 9 - 0
src/pages/toutiao/ttAccountManage/index.less

@@ -0,0 +1,9 @@
+.manage {
+    height: calc(100% - 42px);
+    display: flex;
+    justify-content: flex-start;
+  
+    &__left {
+      width: calc(100% - 200px);
+    }
+  }

+ 84 - 0
src/pages/toutiao/ttAccountManage/index.tsx

@@ -0,0 +1,84 @@
+import HocError from '@/Hoc/HocError'
+import GroupLeft from '@/pages/launchSystemNew/account/groupLeft'
+import TeamMembers from '@/pages/launchSystemNew/components/teamMembers'
+import { GetAdAccountParams } from '@/services/launchAdq/adAuthorize'
+import { MenuFoldOutlined, MenuUnfoldOutlined } from '@ant-design/icons'
+import { Tabs } from 'antd'
+import React, { useCallback, useEffect, useState } from 'react'
+import style from './index.less'
+import { getAdAccountAllOfMember } from '@/services/launchAdq/adq'
+import { useAjax } from '@/Hook/useAjax'
+import TableData from '@/pages/launchSystemNew/components/TableData'
+import { oceanengine_adAccount_listOfUser } from '@/services/toutiao/ttAccountManage'
+function ttAccountManage() {
+    const [activeKey, setActiveKey] = useState<string>('1')
+    const [showLeft, setShowLeft] = useState<boolean>(false)
+    const [queryForm, setQueryForm] = useState<GetAdAccountParams>({ pageNum: 1, pageSize: 20 })
+
+    const allOfMember = useAjax(() => getAdAccountAllOfMember(), { formatResult: true })
+    const getAdAccountList = useAjax((params) => oceanengine_adAccount_listOfUser(params), { formatResult: true })
+
+    useEffect(() => {
+        getList()
+    }, [])
+
+
+    /** 获取账号列表 */
+    const getList = useCallback(() => {
+        let params = JSON.parse(JSON.stringify(queryForm))
+        if (params.accountIds) {
+            params.accountIds = params.accountIds.split(/[\,\,]/)
+        } else {
+            delete params?.accountIds
+        }
+        getAdAccountList.run(params)
+    }, [queryForm])
+    return <div style={{ height: '100%' }}>
+        <Tabs
+            tabBarStyle={{ marginBottom: 1 }}
+            activeKey={activeKey}
+            type="card"
+            // tabBarExtraContent={<Button type='primary' onClick={()=>setVisible(true)}><PlusOutlined />广告账号授权</Button>}
+            onChange={(activeKey) => {
+                if (activeKey !== 'contract') {
+                    let newQueryForm = JSON.parse(JSON.stringify(queryForm))
+                    delete newQueryForm?.groupId
+                    delete newQueryForm?.putUserId
+                    setQueryForm(newQueryForm)
+                    setActiveKey(activeKey)
+                } else {
+                    setShowLeft(!showLeft)
+                }
+            }}
+        >
+            <Tabs.TabPane tab='我的' key='1' />
+            <Tabs.TabPane tab='组员' key='2' />
+            <Tabs.TabPane tab={showLeft ? <MenuUnfoldOutlined /> : <MenuFoldOutlined />} key='contract' />
+        </Tabs>
+        <div className={style.manage}>
+            {!showLeft && activeKey === '1' && <GroupLeft onChange={(groupId) => setQueryForm({ ...queryForm, groupId, pageNum: 1 })} value={queryForm?.groupId} />}
+            {!showLeft && activeKey === '2' && <TeamMembers allOfMember={allOfMember} onChange={(putUserId) => setQueryForm({ ...queryForm, putUserId, pageNum: 1 })} value={queryForm?.putUserId} />}
+            <div className={style.manage__left} style={showLeft ? { width: '100%' } : { width: 'calc(100% - 200px)' }}>
+                <TableData
+                    ajax={getAdAccountList}
+                    dataSource={getAdAccountList?.data?.data?.records}
+                    loading={getAdAccountList?.loading}
+                    columns={() => []}
+                    total={getAdAccountList?.data?.data?.total}
+                    page={getAdAccountList?.data?.data?.current}
+                    pageSize={getAdAccountList?.data?.data?.size}
+                    size="small"
+                    scroll={{ y: 600 }}
+                    // leftChild={null}
+                    onChange={(props: any) => {
+                        let { pagination } = props
+                        let { current, pageSize } = pagination
+                        setQueryForm({ ...queryForm, pageNum: current, pageSize })
+                    }}
+                />
+            </div>
+        </div>
+    </div>
+}
+
+export default HocError(ttAccountManage)

+ 0 - 37
src/pages/user/login/components/defaultVideo.ts

@@ -36,7 +36,6 @@ const videoS: any = {
     // '动漫1': 'https://zx-oss-dev.oss-cn-hangzhou.aliyuncs.com/file/f0d8a5e4-0162-456e-9fa9-e3054d0174a9.mp4',
     // '樱花街': 'https://zx-oss-dev.oss-cn-hangzhou.aliyuncs.com/file/361d6999-332a-415e-9658-d5af2be55252.mp4',
     // '海贼王': 'https://zx-oss-dev.oss-cn-hangzhou.aliyuncs.com/file/a2fceef5-134a-434a-b7ce-450c3aa3d8a3.mp4',
-    '6': `https://img-baofun.zhhainiao.com/pcwallpaper_ugc/scene/9d7771069772fa8031ae501262c1b3ca_preview.mp4`,
     'eva1':`https://zx-oss-dev.oss-cn-hangzhou.aliyuncs.com/file/C8653BBB13A64D97A09DDD5AD027B51E.mp4`,
    '朋克1': 'https://zx-oss-dev.oss-cn-hangzhou.aliyuncs.com/file/7463699D414F4822956676E4F42C7FEA.mp4',
    '棒球女孩': 'https://img-baofun.zhhainiao.com/pcwallpaper_ugc/preview/9da87253dd6864c47cddb125b5802a48_preview.mp4',
@@ -102,7 +101,6 @@ const videoS: any = {
 }
 /**男*/ 
 const man: any = {
-    '6': `https://img-baofun.zhhainiao.com/pcwallpaper_ugc/scene/9d7771069772fa8031ae501262c1b3ca_preview.mp4`,
      'eva1':`https://zx-oss-dev.oss-cn-hangzhou.aliyuncs.com/file/C8653BBB13A64D97A09DDD5AD027B51E.mp4`,
     '朋克1': 'https://zx-oss-dev.oss-cn-hangzhou.aliyuncs.com/file/7463699D414F4822956676E4F42C7FEA.mp4',
     '棒球女孩': 'https://img-baofun.zhhainiao.com/pcwallpaper_ugc/preview/9da87253dd6864c47cddb125b5802a48_preview.mp4',
@@ -124,41 +122,6 @@ const man: any = {
     '2':'https://zx-oss-dev.oss-cn-hangzhou.aliyuncs.com/file/3bcd566d-4f34-45b8-b6df-4c0ff1388a2b.mp4',
     '阳光明媚': 'https://zx-oss-dev.oss-cn-hangzhou.aliyuncs.com/file/56fc43ad-9cb8-4f1f-833d-65bdb9e17785.mp4',
     'eva4':`https://zx-oss-dev.oss-cn-hangzhou.aliyuncs.com/file/C8653BBB13A64D97A09DDD5AD027B51E.mp4`,
-    'cg1':`https://s7.huoying666.com/video/20200219/b52c899c75797aacff78795c599027a1/158211449089118620e2be30fe.mp4_pre.mp4`,
-    'cg2':`https://s7.huoying666.com/video/20191203/2557b283b2ccb961f05218761800abab/15753593754632b62e44951553.mp4_pre.mp4`,
-    'cg3':`https://s7.huoying666.com/video/20191019/2ca796a22cc408cd11ac0321507be8d4/1571495538acabaca50ef95562.mp4_pre.mp4`,
-    'cg4':`https://s7.huoying666.com/video/20210405/3666fbade04959f71b1ee50db08621d3/16175528109394797dcb63adac.mp4_pre.mp4`,
-    'cg5':`https://zx-oss-dev.oss-cn-hangzhou.aliyuncs.com/file/FC81B729086F4C618EAF20DA2CE83BC2.mp4`
-    // '1': `https://img-baofun.zhhainiao.com/pcwallpaper_ugc/preview/47fafec0ae6f5598584c97214409e518_preview.mp4`,
-    // '2': `https://img-baofun.zhhainiao.com/fs/live/preview_video/2875ba225ae5fc2acf93919b3a0bb469_preview.mp4`,
-    // '3': `https://img-baofun.zhhainiao.com/pcwallpaper_ugc/preview/af7f52f33cbcea0a33ccee511d9cb156_preview.mp4`,
-    // '4': 'https://img-baofun.zhhainiao.com/pcwallpaper_ugc/preview/2c9a4dde0296d6ca199619b5d62636a8_preview.mp4',
-    // '6': `https://img-baofun.zhhainiao.com/pcwallpaper_ugc/scene/9d7771069772fa8031ae501262c1b3ca_preview.mp4`,
-    // '7': `https://img-baofun.zhhainiao.com/pcwallpaper_ugc/preview/91248d99b61ebc72d64e5eb20d250bcd_preview.mp4`,
-    // '小乔': 'https://zx-oss-dev.oss-cn-hangzhou.aliyuncs.com/file/F5DBC23D42C944A9A04BC4BA235EE516.mp4',
-    // '12': 'https://img-baofun.zhhainiao.com/pcwallpaper_ugc/preview/86933bad61717d5418046bb363f9c790_preview.mp4',
-    // '15': 'https://img-baofun.zhhainiao.com/pcwallpaper_ugc/preview/1921b281bed7a1dd5766b9e1ea95533d_preview.mp4',
-    // '5': `https://img-baofun.zhhainiao.com/pcwallpaper_ugc/preview/b122fec7d08353b9f9a0d696488877f0_preview.mp4`,
-    // '小乔1': 'https://img-baofun.zhhainiao.com/pcwallpaper_ugc/preview/c1da28f04d77d120c8ba26e032c9aecd_preview.mp4',
-    // '小乔2': 'https://img-baofun.zhhainiao.com/pcwallpaper_ugc/preview/64a73ef9e72d2e2564170ced01971df8_preview.mp4',
-    // '小乔3': 'https://img-baofun.zhhainiao.com/fs/live/preview_video/2875ba225ae5fc2acf93919b3a0bb469_preview.mp4',
-    // '小乔4': 'https://img-baofun.zhhainiao.com/pcwallpaper_ugc/preview/60042d664fc1647bdf7b7e3671f7b686_preview.mp4',
-    // '小乔5': 'https://img-baofun.zhhainiao.com/fs/live/preview_video/b086d1dcef4a96e5c7b4e568166cd622_preview.mp4',
-    // '大天使': 'https://img-baofun.zhhainiao.com/pcwallpaper_ugc/preview/68a600702d6620ef61eb3d42f61e21db_preview.mp4',
-    // '朋克1': 'https://zx-oss-dev.oss-cn-hangzhou.aliyuncs.com/file/7463699D414F4822956676E4F42C7FEA.mp4',
-    // '棒球女孩': 'https://img-baofun.zhhainiao.com/pcwallpaper_ugc/preview/9da87253dd6864c47cddb125b5802a48_preview.mp4',
-    // 'm1': 'https://zx-oss-dev.oss-cn-hangzhou.aliyuncs.com/file/93CA7D8022AE477D82E351A855C150E7.mp4',
-    // 'm2': 'https://zx-oss-dev.oss-cn-hangzhou.aliyuncs.com/file/B4669C7253514732885F60EE410B7D6C.mp4',
-    // 'm3': 'https://zx-oss-dev.oss-cn-hangzhou.aliyuncs.com/file/A00FEAF16F4A46E9BCA2BB24BFDDFF12.mp4',
-    // 'm4': 'https://zx-oss-dev.oss-cn-hangzhou.aliyuncs.com/file/1D5E117AA32A4FB9BDD7C811190E00D7.mp4',
-    // '8': 'https://img-baofun.zhhainiao.com/pcwallpaper_ugc/preview/69566b57fc250a3149f6d3af363b9eb2_preview.mp4',
-    // '9': 'https://img-baofun.zhhainiao.com/pcwallpaper_ugc/preview/743219b60f03c85e601607b3d5b3a2ae_preview.mp4',
-    // '10': 'https://img-baofun.zhhainiao.com/pcwallpaper_ugc/preview/4bbf9e696479f6ee77476dd1b7644a0b_preview.mp4',
-    // '11': 'https://img-baofun.zhhainiao.com/pcwallpaper_ugc/preview/270f138fd07ff9014a12e0ded6358084_preview.mp4',
-    // '13': 'https://img-baofun.zhhainiao.com/pcwallpaper_ugc/preview/561e9da5e4bcf2e06c0669ff81f84e20_preview.mp4',
-    // '14': 'https://img-baofun.zhhainiao.com/pcwallpaper_ugc/preview/b564e76758fe756689f379a963912c12_preview.mp4',
-    // '16': 'https://img-baofun.zhhainiao.com/pcwallpaper_ugc/preview/b946235d4e4f078cdfe5099736e1dbc8_preview.mp4',
-
 }
 /**女*/
 const woman:any={

+ 34 - 0
src/services/toutiao/ttAccountManage.ts

@@ -0,0 +1,34 @@
+import { request } from 'umi';
+import { api } from '../api'
+
+
+
+
+/**用户所有头条账号*/ 
+// export async function oceanengine_adAccount_allOfUser(mpId: number) {
+//     return request(`${api}/oceanengine/adAccount/allOfUser`);
+// }
+/**所有有该账号操作权限的用户 投放助理回填*/ 
+export async function oceanengine_adAccount_accountOperationUser(accountId: number) {
+    return request(`${api}/oceanengine/adAccount/accountOperationUser/${accountId}`);
+}
+/**账号列表(拥有账号所有权)*/ 
+export async function oceanengine_adAccount_listOfUser(params: any) {
+    return request(`${api}/oceanengine/adAccount/listOfUser`, {
+        method: 'POST',
+        data: params
+    });
+}
+/**批量指派操作权的用户*/ 
+export async function oceanengine_adAccount_configOperationUser(params: any) {
+    let {accountId,operationUserIds} = params
+    return request(`${api}/oceanengine/adAccount/configOperationUser/${accountId}/${operationUserIds}`, {
+        method: 'PUT',
+    });
+}
+
+
+
+
+
+

+ 1 - 1
src/services/user.ts

@@ -16,7 +16,7 @@ export async function queryCurrent() {
 export async function getMenu(): Promise<any> {
   return request(api + '/erp/menu/getRouters', {
     method: 'PUT',
-    data: ["adq_put"]// "ad_monitor"
+    data: ["adq_put","ad_tt"]// "ad_monitor"
   })
 }