Browse Source

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

wjx 2 years ago
parent
commit
6850293ea4

+ 7 - 6
src/models/useLaunchAdq/useBdMediaPup.ts

@@ -33,11 +33,11 @@ type State = {
     selectItem?: any[],//单选素材时存放选中的素材
     knewsdefaultData?: any,//k图文编辑时的默认内容
     sortVisible?: boolean,//排序弹窗
-
     num?: number, //选择数量
     size?: number,  // 需要上传素材的大小
     upLoadLoading?: boolean,
-    cloudSize?: any[]
+    cloudSize?: any[],
+    maxSize?:number,//素材最大尺寸
 }
 export type Action = {
     type: 'set' | 'init',
@@ -81,13 +81,12 @@ const initData: State = {
     newsVisrible: false,
     sortVisible: false,
     sort: 0,
-
     num: 1
 }
 /**本地素材管理器 */
 function useBdMediaPup() {
     const [state, dispatch]: [State, Dispatch<Action>] = useReducer(reducer, initData)
-    const { fileName, sort, belongUser, mediaType, parentId, selectFile, selectItem, delPupId, cloudSize, num, rightClickPup, actionItem, path, publicPath, videoTitle, videoDescription, size } = state
+    const { fileName, sort, belongUser, mediaType, parentId, selectFile, selectItem, delPupId, cloudSize, num, rightClickPup, actionItem, path, publicPath, videoTitle, videoDescription, size,maxSize } = state
     const list = useAjax((params) => bdSysMediaList(params))
     const add = useAjax((params) => bdSysMediaAdd(params), { msgNmae: '新增' })
     const del = useAjax((params) => delMedia(params), { msgNmae: '删除' })
@@ -103,6 +102,7 @@ function useBdMediaPup() {
     })
     /**初始化数据 */
     const init = useCallback((params: any) => {
+        console.log('params======>',params)
         dispatch({ type: 'init', params })
     }, [])
     /**设置state */
@@ -251,11 +251,12 @@ function useBdMediaPup() {
     }, [list, selectFile, mediaType])
     /**获取本地素材数据列表 */
     const getList = useCallback((props?: any) => {
-        let obj = { pageSize: 20, pageNum: 1, belongUser: belongUser === '0' ? false : true, mediaType, parentId, sizeQueries: cloudSize, ...props }
+        console.log('getList====>',props)
+        let obj = { pageSize: 20, pageNum: 1, belongUser: belongUser === '0' ? false : true, mediaType, parentId, sizeQueries: cloudSize,maxSize, ...props }
         list.run(obj).then((res) => {
             setIsOk(true)
         })
-    }, [list, mediaType, belongUser, parentId, cloudSize])
+    }, [list, mediaType, belongUser, parentId, cloudSize,maxSize])
     /**选中文件 single 开启可单选为了在右键删除选择时只选一个*/
     const onFile = useCallback((e: any, item: { id: any, folder?: boolean }, isAll?: boolean, single?: boolean) => {
         let { id } = item

+ 45 - 12
src/pages/launchSystemNew/adq/ad/index.tsx

@@ -1,17 +1,40 @@
 
 import { useAjax } from '@/Hook/useAjax'
 import { PromotedObjectType } from '@/services/launchAdq/enum'
-import { Col, Row, Input, Select, Button, message } from 'antd'
-import React, { useEffect, useState, useCallback } from 'react'
+import { Col, Row, Input, Select, message } from 'antd'
+import React, { useEffect, useCallback } from 'react'
 import TableData from '../../components/TableData'
 import tableConfig from './tableConfig'
-import { putAdqAdgroupsSync, getAdqAdgroupsList } from '@/services/launchAdq/adq'
-
-function Ad(props: { accountId: string, adAccountId: string ,userId:string}) {
-    let { accountId, adAccountId,userId } = props
+import { putAdqAdgroupsSync, getAdqAdgroupsList,putAdqAdgroupsConfigStatus } from '@/services/launchAdq/adq'
+type Props = {
+    accountId: string,
+    adAccountId: string,
+    userId: string,
+    queryParmas: {
+        accountId?: string,//账户ID
+        campaignId?: string,//计划ID
+        adgroupId?: string,//广告ID
+        adcreativeId?: string,//创意ID
+        pageId?: string,//落地页ID
+        targetingId?: string,//定向ID}
+    },
+    tableIdClick: (props: {
+        activeKey: string, parma: {
+            accountId?: string,//账户ID
+            campaignId?: string,//计划ID
+            adgroupId?: string,//广告ID
+            adcreativeId?: string,//创意ID
+            pageId?: string,//落地页ID
+            targetingId?: string,//定向ID
+        }
+    }) => void
+}
+function Ad(props:Props) {
+    let { accountId, adAccountId,userId,tableIdClick } = props
     // api方法
     const listAjax = useAjax((params) => getAdqAdgroupsList(params), { formatResult: true })
     const syncAjax = useAjax((adAccountId) => putAdqAdgroupsSync(adAccountId))
+    const switchAjax = useAjax((params) => putAdqAdgroupsConfigStatus(params))
     console.log('创意=====》')
     useEffect(() => {
         getList({ pageNum: 1, pageSize: 20 })
@@ -40,14 +63,24 @@ function Ad(props: { accountId: string, adAccountId: string ,userId:string}) {
 
         })
     }, [adAccountId, listAjax])
+    // 启停
+    const switchHandle=useCallback((data,checked)=>{
+        let { accountId,adgroupId}=data
+        console.log(checked)
+        let configuredStatus = checked ? 'AD_STATUS_NORMAL' : 'AD_STATUS_SUSPEND'
+        switchAjax.run({accountId,adgroupId,configuredStatus}).then(res=>{
+            res && listAjax.refresh()
+            res ? message.success(checked?'开启广告成功!':'关闭广告成功!') : message.error(checked?'开启广告失败':'关闭广告失败!')
+        })
+    },[])
     return <div>
         <TableData
-            columns={tableConfig}
+            columns={()=>tableConfig(switchHandle,tableIdClick)}
             ajax={listAjax}
             syncAjax={sync}
             dataSource={listAjax?.data?.data?.records}
             loading={listAjax?.loading || syncAjax?.loading}
-            scroll={{ x: 2500 }}
+            scroll={{ x: 2500,y:550 }}
             total={listAjax?.data?.data?.total}
             page={listAjax?.data?.data?.current}
             pageSize={listAjax?.data?.data?.size}
@@ -56,7 +89,7 @@ function Ad(props: { accountId: string, adAccountId: string ,userId:string}) {
                 <Row gutter={[10, 10]}>
                     <Col>
                         <Input
-                            placeholder='创意名称'
+                            placeholder='广告名称'
                             allowClear
                             onBlur={(e) => {
                                 let value = e.target.value
@@ -94,9 +127,9 @@ function Ad(props: { accountId: string, adAccountId: string ,userId:string}) {
                 </Row>
             </>}
             onChange={(props: any) => {
-                // let { sortData, pagination } = props
-                // let { current, pageSize } = pagination
-                // getList({ pageNum: current, pageSize })
+                let { sortData, pagination } = props
+                let { current, pageSize } = pagination
+                getList({ pageNum: current, pageSize })
             }}
         />
     </div>

+ 79 - 58
src/pages/launchSystemNew/adq/ad/tableConfig.tsx

@@ -1,17 +1,31 @@
-import { AdStatusEnum, ConfiguredStatusEnum, OptimizationGoalEnum, PromotedObjectType } from '@/services/launchAdq/enum'
+import { AdStatusEnum, OptimizationGoalEnum, PromotedObjectType } from '@/services/launchAdq/enum'
 import React from 'react'
 import { Badge, Switch } from 'antd'
-function tableConfig():any{
+function tableConfig(
+    switchHandle: (data: any, Status: any) => void,
+    tableIdClick: (props: {
+        activeKey: string,
+        parma: {
+            accountId?: string,//账户ID
+            campaignId?: string,//计划ID
+            adgroupId?: string,//广告ID
+            adcreativeId?: string,//创意ID
+            pageId?: string,//落地页ID
+            targetingId?: string,//定向ID
+        }
+    }) => void): any {
     return [
         {
             title: '启停',
             dataIndex: 'qt',
             key: 'qt',
             align: 'center',
-            width:50,
-            fixed:'left',
-            render:(a:string)=>{
-                return <Switch /> 
+            width: 50,
+            fixed: 'left',
+            render: (a: string, b: any) => {
+                return <Switch defaultChecked={b?.configuredStatus === 'AD_STATUS_NORMAL'} onChange={(checked: boolean) => {
+                    switchHandle(b, checked)
+                }} />
             }
         },
         {
@@ -19,10 +33,12 @@ function tableConfig():any{
             dataIndex: 'accountId',
             key: 'accountId',
             align: 'center',
-            width:90,
-            fixed:'left',
-            render:(a:string)=>{
-                return <a>{a}</a>
+            width: 90,
+            fixed: 'left',
+            render: (a: string) => {
+                return <a onClick={() => {
+                    tableIdClick({ activeKey: '1', parma: { accountId: a } })
+                }}>{a}</a>
             }
         },
         {
@@ -30,10 +46,12 @@ function tableConfig():any{
             dataIndex: 'adgroupId',
             key: 'adgroupId',
             align: 'center',
-            width:100,
-            fixed:'left',
-            render:(a:string)=>{
-                return <a>{a}</a>
+            width: 100,
+            fixed: 'left',
+            render: (a: string) => {
+                return <a onClick={() => {
+                    tableIdClick({ activeKey: '3', parma: { adgroupId: a } })
+                }}>{a}</a>
             }
         },
         {
@@ -41,10 +59,12 @@ function tableConfig():any{
             dataIndex: 'campaignId',
             key: 'campaignId',
             align: 'center',
-            width:100,
-            fixed:'left',
-            render:(a:string)=>{
-                return <a>{a}</a>
+            width: 100,
+            fixed: 'left',
+            render: (a: string) => {
+                return <a onClick={() => {
+                    tableIdClick({ activeKey: '2', parma: { campaignId: a } })
+                }}>{a}</a>
             }
         },
         {
@@ -52,36 +72,36 @@ function tableConfig():any{
             dataIndex: 'adgroupName',
             key: 'adgroupName',
             align: 'center',
-            width:300,
+            width: 300,
         },
         {
             title: '推广目标类型',
             dataIndex: 'promotedObjectType',
             key: 'promotedObjectType',
             align: 'center',
-            width:130,
-           render:(a: string | number)=>{
-            return PromotedObjectType[a]
-           } 
+            width: 130,
+            render: (a: string | number) => {
+                return PromotedObjectType[a]
+            }
         },
         {
             title: '广告优化目标类型',
             dataIndex: 'optimizationGoal',
             key: 'optimizationGoal',
             align: 'center',
-            width:130,
-           render:(a: string | number)=>{
-            return OptimizationGoalEnum[a]
-           } 
+            width: 130,
+            render: (a: string | number) => {
+                return OptimizationGoalEnum[a]
+            }
         },
         {
             title: '投放日期',
             dataIndex: 'beginDate',
             key: 'beginDate',
             align: 'center',
-            width:160,
-            render:(a: string,b: { endDate: string })=>{
-                return b?.endDate ? a+'~'+b.endDate : a+'~'+'长期投放'
+            width: 160,
+            render: (a: string, b: { endDate: string }) => {
+                return b?.endDate ? a + '~' + b.endDate : a + '~' + '长期投放'
             }
         },
         {
@@ -89,40 +109,30 @@ function tableConfig():any{
             dataIndex: 'firstDayBeginTime',
             key: 'firstDayBeginTime',
             align: 'center',
-            width:130,
+            width: 130,
         },
         {
             title: '广告出价(分)',
             dataIndex: 'bidAmount',
             key: 'bidAmount',
-            align: 'center',  
-            width:130,
+            align: 'center',
+            width: 130,
         },
         {
             title: '广告组日预算(分)',
             dataIndex: 'dailyBudget',
             key: 'dailyBudget',
-            align: 'center',  
-            width:130,
+            align: 'center',
+            width: 130,
         },
         {
             title: '是否开启自动版位功能',
             dataIndex: 'automaticSiteEnabled',
             key: 'automaticSiteEnabled',
-            align: 'center', 
-            width:150,
-            render: (a: any, b: any) => {
-                return a? '开' : '关'
-            }
-        },
-        {
-            title: '是否已删除',
-            dataIndex: 'isDeleted',
-            key: 'isDeleted',
             align: 'center',
-            width:100,
+            width: 150,
             render: (a: any, b: any) => {
-                return  <Badge status={!a ? "processing" :"error" } text={a? '是' : '否'} />
+                return a ? '开' : '关'
             }
         },
         {
@@ -130,16 +140,27 @@ function tableConfig():any{
             dataIndex: 'createdTime',
             key: 'createdTime',
             align: 'center',
-            width:160,
-        },
+            width: 160,
+        },
+        // {
+        //     title: '客户设置的状态',
+        //     dataIndex: 'configuredStatus',
+        //     key: 'configuredStatus',
+        //     align: 'center',
+        //     width:130,
+        //     render:(a:string)=>{
+        //         return  <Badge status={a==='AD_STATUS_NORMAL' ? "processing" :"error" } text={ConfiguredStatusEnum[a]} />
+        //     }
+        // },
         {
-            title: '客户设置的状态',
-            dataIndex: 'configuredStatus',
-            key: 'configuredStatus',
+            title: '是否已删除',
+            dataIndex: 'isDeleted',
+            key: 'isDeleted',
             align: 'center',
-            width:130,
-            render:(a:string)=>{
-                return  <Badge status={a==='AD_STATUS_NORMAL' ? "processing" :"error" } text={ConfiguredStatusEnum[a]} />
+            width: 70,
+            fixed: 'right',
+            render: (a: any, b: any) => {
+                return <Badge status={!a ? "processing" : "error"} text={a ? '是' : '否'} />
             }
         },
         {
@@ -147,9 +168,9 @@ function tableConfig():any{
             dataIndex: 'status',
             key: 'status',
             align: 'center',
-            width:70,
-            fixed:'right',
-            render:(a:string)=>{
+            width: 70,
+            fixed: 'right',
+            render: (a: string) => {
                 return AdStatusEnum[a]
             }
         },

+ 94 - 0
src/pages/launchSystemNew/adq/adAccount/index.tsx

@@ -0,0 +1,94 @@
+
+import { useAjax } from '@/Hook/useAjax'
+import {  Row,  message } from 'antd'
+import React, { useEffect, useState, useCallback } from 'react'
+import TableData from '../../components/TableData'
+import tableConfig from './tableConfig'
+import { putAdqAdAccountSyncByIds, getAdqAdAccountList } from '@/services/launchAdq/adq'
+type Props = {
+    accountId: string,
+    adAccountId: string,
+    userId: string,
+    queryParmas: {
+        accountId?: string,//账户ID
+        campaignId?: string,//计划ID
+        adgroupId?: string,//广告ID
+        adcreativeId?: string,//创意ID
+        pageId?: string,//落地页ID
+        targetingId?: string,//定向ID}
+    },
+    tableIdClick: (props: {
+        activeKey: string, parma: {
+            accountId?: string,//账户ID
+            campaignId?: string,//计划ID
+            adgroupId?: string,//广告ID
+            adcreativeId?: string,//创意ID
+            pageId?: string,//落地页ID
+            targetingId?: string,//定向ID
+        }
+    }) => void
+}
+function AdAccount(props:Props) {
+    let { accountId, adAccountId, userId,tableIdClick } = props
+    let [selectedRowKeys,setSelectedRowKeys]=useState<any[]>([])
+    // api方法
+    const listAjax = useAjax((params) => getAdqAdAccountList(params), { formatResult: true })
+    const syncAjax = useAjax((params) => putAdqAdAccountSyncByIds(params))
+    console.log('创意=====》')
+    useEffect(() => {
+        getList({ pageNum: 1, pageSize: 20 })
+    }, [accountId, userId])
+    // 获取列表
+    const getList = useCallback((params: {
+        pageNum: number;
+        pageSize: number;
+        accountId?: string;
+        adcreativeName?: string;
+    }) => {
+        if (!params.adcreativeName || params.adcreativeName !== listAjax?.params[0]?.adcreativeName) {
+            !params.adcreativeName && delete params.adcreativeName
+            listAjax.run({ ...params, userId, accountIds:accountId?[accountId]:null })
+        }
+    }, [accountId, userId, listAjax])
+    // 同步 
+    const sync = useCallback(() => {
+        if (selectedRowKeys?.length === 0) {
+            message.error('请勾选要同步的广点通账号!')
+            return
+        }
+        syncAjax.run(selectedRowKeys).then(res => {
+            res && listAjax.refresh()
+            res ? message.success('同步成功!') : message.error('同步失败!')
+
+        })
+    }, [adAccountId, listAjax,selectedRowKeys])
+    return <div>
+        <TableData
+            columns={()=>tableConfig(tableIdClick)}
+            ajax={listAjax}
+            syncAjax={sync}
+            dataSource={listAjax?.data?.data?.records}
+            loading={listAjax?.loading || syncAjax?.loading}
+            scroll={{ y:550 }}
+            total={listAjax?.data?.data?.total}
+            page={listAjax?.data?.data?.current}
+            pageSize={listAjax?.data?.data?.size}
+            myKey={'adgroupId'}
+            leftChild={<>
+                <Row gutter={[10, 10]}>
+                </Row>
+            </>}
+            rowSelection={{
+                onChange: (selectedRowKeys: React.Key[], selectedRows: any[]) => {
+                    setSelectedRowKeys(selectedRowKeys)
+                }
+            }}
+            onChange={(props: any) => {
+                let { sortData, pagination } = props
+                let { current, pageSize } = pagination
+                getList({ pageNum: current, pageSize })
+            }}
+        />
+    </div>
+}
+export default AdAccount

+ 67 - 0
src/pages/launchSystemNew/adq/adAccount/tableConfig.tsx

@@ -0,0 +1,67 @@
+import {  FundStatusEnum, } from '@/services/launchAdq/enum'
+import React from 'react'
+import { Badge } from 'antd'
+function tableConfig(tableIdClick: (props: {
+    activeKey: string,
+    parma: {
+        accountId?: string,//账户ID
+        campaignId?: string,//计划ID
+        adgroupId?: string,//广告ID
+        adcreativeId?: string,//创意ID
+        pageId?: string,//落地页ID
+        targetingId?: string,//定向ID
+    }
+}) => void):any{
+    return [
+        {
+            title: 'ID',
+            dataIndex: 'id',
+            key: 'id',
+            align: 'center',
+            width:50,
+            render:(a:string)=>{
+                return <a>{a}</a>
+            }
+        },
+        {
+            title: '账号ID',
+            dataIndex: 'accountId',
+            key: 'accountId',
+            align: 'center',
+            width:90,
+            render:(a:string)=>{
+                return <a onClick={() => {
+                    tableIdClick({ activeKey: '1', parma: { accountId: a } })
+                }}>{a}</a>
+            }
+        },
+        {
+            title: '账户余额(分)',
+            dataIndex: 'balance',
+            key: 'balance',
+            align: 'center',
+            width:150,
+        },
+        {
+            title: '资金状态',
+            dataIndex: 'fundStatus',
+            key: 'fundStatus',
+            align: 'center',
+            width:130,
+           render:(a: string | number)=>{
+            return FundStatusEnum[a]
+           } 
+        },
+        {
+            title: '是否启用',
+            dataIndex: 'enabled',
+            key: 'enabled',
+            align: 'center',
+            width:130,
+            render: (a: any, b: any) => {
+                return  <Badge status={a ? "processing" :"error" } text={a? '是' : '否'} />
+            }
+        },
+    ]
+}
+export default tableConfig

+ 45 - 12
src/pages/launchSystemNew/adq/campaign/index.tsx

@@ -1,17 +1,41 @@
 
 import { useAjax } from '@/Hook/useAjax'
 import { CampaignTypeEnum, ConfiguredStatusEnum, PromotedObjectType } from '@/services/launchAdq/enum'
-import { Col, Row, Input, Select, Button, message } from 'antd'
-import React, { useEffect, useState, useCallback } from 'react'
+import { Col, Row, Input, Select, message } from 'antd'
+import React, { useEffect, useCallback } from 'react'
 import TableData from '../../components/TableData'
 import tableConfig from './tableConfig'
-import { getAdqCampaignList, putAdqCampaignPage } from '@/services/launchAdq/adq'
+import { getAdqCampaignList, putAdqCampaignPage, putAdqCampaignConfigStatus } from '@/services/launchAdq/adq'
+type Props = {
+    accountId: string,
+    adAccountId: string,
+    userId: string,
+    queryParmas: {
+        accountId?: string,//账户ID
+        campaignId?: string,//计划ID
+        adgroupId?: string,//广告ID
+        adcreativeId?: string,//创意ID
+        pageId?: string,//落地页ID
+        targetingId?: string,//定向ID}
+    },
+    tableIdClick: (props: {
+        activeKey: string, parma: {
+            accountId?: string,//账户ID
+            campaignId?: string,//计划ID
+            adgroupId?: string,//广告ID
+            adcreativeId?: string,//创意ID
+            pageId?: string,//落地页ID
+            targetingId?: string,//定向ID
+        }
+    }) => void
+}
 
-function Campaign(props: { accountId: string, adAccountId: string, userId: string }) {
-    let { accountId, adAccountId, userId } = props
+function Campaign(props: Props) {
+    let { accountId, adAccountId, userId,queryParmas, tableIdClick } = props
     // api方法
     const listAjax = useAjax((params) => getAdqCampaignList(params), { formatResult: true })
     const syncAjax = useAjax((adAccountId) => putAdqCampaignPage(adAccountId))
+    const switchAjax = useAjax((params) => putAdqCampaignConfigStatus(params))
     console.log('创意=====》')
     useEffect(() => {
         getList({ pageNum: 1, pageSize: 20 })
@@ -45,18 +69,27 @@ function Campaign(props: { accountId: string, adAccountId: string, userId: strin
 
         })
     }, [adAccountId, listAjax])
+    // 启停
+    const switchHandle = useCallback((data, checked) => {
+        let { accountId, campaignId } = data
+        let configuredStatus = checked ? 'AD_STATUS_NORMAL' : 'AD_STATUS_SUSPEND'
+        switchAjax.run({ accountId, campaignId, configuredStatus }).then(res => {
+            res && listAjax.refresh()
+            res ? message.success(checked ? '开启计划成功!' : '关闭计划成功!') : message.error(checked ? '开启计划失败' : '关闭计划失败!')
+        })
+    }, [])
     return <div>
         <TableData
-            columns={tableConfig}
+            columns={() => tableConfig(switchHandle, tableIdClick)}
             ajax={listAjax}
             syncAjax={sync}
             dataSource={listAjax?.data?.data?.records}
             loading={listAjax?.loading || syncAjax?.loading}
-            scroll={{ x: 2000 }}
+            scroll={{ x: 2000, y: 550 }}
             total={listAjax?.data?.data?.total}
             page={listAjax?.data?.data?.current}
             pageSize={listAjax?.data?.data?.size}
-            myKey={'adcreativeId'}
+            myKey={'campaignId'}
             leftChild={<>
                 <Row gutter={[10, 10]}>
                     <Col>
@@ -86,7 +119,7 @@ function Campaign(props: { accountId: string, adAccountId: string, userId: strin
                         <Select placeholder='推广目标选择' style={{ minWidth: 200 }} showSearch filterOption={(input: any, option: any) =>
                             (option!.children as unknown as string).toLowerCase().includes(input.toLowerCase())
                         } allowClear onChange={(value: any) => {
-                            getList({ pageNum: 1, pageSize: 20, promotedObjectType:value })
+                            getList({ pageNum: 1, pageSize: 20, promotedObjectType: value })
                         }}>
                             {
                                 Object.keys(PromotedObjectType).map(key => {
@@ -128,9 +161,9 @@ function Campaign(props: { accountId: string, adAccountId: string, userId: strin
                 </Row>
             </>}
             onChange={(props: any) => {
-                // let { sortData, pagination } = props
-                // let { current, pageSize } = pagination
-                // getList({ pageNum: current, pageSize })
+                let { sortData, pagination } = props
+                let { current, pageSize } = pagination
+                getList({ pageNum: current, pageSize })
             }}
         />
     </div>

+ 65 - 45
src/pages/launchSystemNew/adq/campaign/tableConfig.tsx

@@ -1,17 +1,32 @@
-import {  CampaignTypeEnum, ConfiguredStatusEnum, PromotedObjectType, SpeedMode } from '@/services/launchAdq/enum'
-import { Badge,Switch } from 'antd'
+import { CampaignTypeEnum, ConfiguredStatusEnum, PromotedObjectType, SpeedMode } from '@/services/launchAdq/enum'
+import { Badge, Switch } from 'antd'
 import React from 'react'
-function tableConfig():any{
+
+function tableConfig(
+    switchHandle: (data: any, Status: any) => void,
+    tableIdClick: (props: {
+        activeKey: string,
+        parma: {
+            accountId?: string,//账户ID
+            campaignId?: string,//计划ID
+            adgroupId?: string,//广告ID
+            adcreativeId?: string,//创意ID
+            pageId?: string,//落地页ID
+            targetingId?: string,//定向ID
+        }
+    }) => void): any {
     return [
         {
             title: '启停',
             dataIndex: 'qt',
             key: 'qt',
             align: 'center',
-            width:50,
-            fixed:'left',
-            render:(a:string)=>{
-                return <Switch /> 
+            width: 50,
+            fixed: 'left',
+            render: (a: string, b: any) => {
+                return <Switch defaultChecked={b?.configuredStatus === 'AD_STATUS_NORMAL'} onChange={(checked: boolean) => {
+                    switchHandle(b, checked)
+                }} />
             }
         },
         {
@@ -19,10 +34,12 @@ function tableConfig():any{
             dataIndex: 'accountId',
             key: 'accountId',
             align: 'center',
-            width:90,
-            fixed:'left',
-            render:(a:string)=>{
-                return <a>{a}</a>
+            width: 90,
+            fixed: 'left',
+            render: (a: string) => {
+                return <a onClick={() => {
+                    tableIdClick({ activeKey: '1', parma: { accountId: a } })
+                }}>{a}</a>
             }
         },
         {
@@ -30,10 +47,12 @@ function tableConfig():any{
             dataIndex: 'campaignId',
             key: 'campaignId',
             align: 'center',
-            width:100,
-            fixed:'left',
-            render:(a:string)=>{
-                return <a>{a}</a>
+            width: 100,
+            fixed: 'left',
+            render: (a: string) => {
+                return <a onClick={() => {
+                    tableIdClick({ activeKey: '2', parma: { campaignId: a } })
+                }}>{a}</a>
             }
         },
         {
@@ -41,78 +60,79 @@ function tableConfig():any{
             dataIndex: 'campaignName',
             key: 'campaignName',
             align: 'center',
-            width:300,
+            width: 350,
         },
         {
             title: '推广计划类型',
             dataIndex: 'campaignType',
             key: 'campaignType',
             align: 'center',
-            width:130,
-           render:(a: string | number)=>{
-            return CampaignTypeEnum[a]
-           } 
+            width: 130,
+            render: (a: string | number) => {
+                return CampaignTypeEnum[a]
+            }
         },
         {
             title: '推广目标类型',
             dataIndex: 'promotedObjectType',
             key: 'promotedObjectType',
             align: 'center',
-            width:130,
-           render:(a: string | number)=>{
-            return PromotedObjectType[a]
-           } 
+            width: 130,
+            render: (a: string | number) => {
+                return PromotedObjectType[a]
+            }
         },
         {
             title: '投放速度模式',
             dataIndex: 'speedMode',
             key: 'speedMode',
             align: 'center',
-            width:130,
-           render:(a: string | number)=>{
-            return SpeedMode[a]
-           } 
+            width: 130,
+            render: (a: string | number) => {
+                return SpeedMode[a]
+            }
         },
         {
             title: '广告组日预算(分)',
             dataIndex: 'dailyBudget',
             key: 'dailyBudget',
-            align: 'center',  
-            width:130,
+            align: 'center',
+            width: 130,
         },
         {
             title: '推广计划总预算(分)',
             dataIndex: 'totalBudget',
             key: 'totalBudget',
-            align: 'center',  
-            width:130,
+            align: 'center',
+            width: 130,
+        },
+        {
+            title: '创建时间',
+            dataIndex: 'createdTime',
+            key: 'createdTime',
+            align: 'center',
+            width: 160,
         },
         {
             title: '是否已删除',
             dataIndex: 'isDeleted',
             key: 'isDeleted',
             align: 'center',
-            width:100,
+            width: 70,
+            fixed: 'right',
             render: (a: any, b: any) => {
-                return  <Badge status={!a ? "processing" :"error" } text={a? '是' : '否'} />
+                return <Badge status={!a ? "processing" : "error"} text={a ? '是' : '否'} />
             }
         },
-        {
-            title: '创建时间',
-            dataIndex: 'createdTime',
-            key: 'createdTime',
-            align: 'center',
-            width:160,
-        },
         {
             title: '计划状态',
             dataIndex: 'configuredStatus',
             key: 'configuredStatus',
             align: 'center',
-            width:70,
-            fixed:'right',
-            render:(a:string)=>{
-                return  <Badge status={a==='AD_STATUS_NORMAL' ? "processing" :"error" } text={ConfiguredStatusEnum[a]} />
+            width: 70,
+            fixed: 'right',
+            render: (a: string) => {
+                return <Badge status={a === 'AD_STATUS_NORMAL' ? "processing" : "error"} text={ConfiguredStatusEnum[a]} />
             }
         },
     ]

+ 32 - 10
src/pages/launchSystemNew/adq/creative/index.tsx

@@ -1,14 +1,36 @@
 
 import { useAjax } from '@/Hook/useAjax'
 import { PromotedObjectType } from '@/services/launchAdq/enum'
-import { Col, Row, Input, Select, Button, message } from 'antd'
-import React, { useEffect, useState, useCallback } from 'react'
+import { Col, Row, Input, Select, message } from 'antd'
+import React, { useEffect, useCallback } from 'react'
 import TableData from '../../components/TableData'
 import tableConfig from './tableConfig'
 import { getAdqAdcreativeList, putAdqTargetingSyncAll } from '@/services/launchAdq/adq'
-
-function Creative(props: { accountId: string, adAccountId: string ,userId:string}) {
-    let { accountId, adAccountId,userId } = props
+type Props = {
+    accountId: string,
+    adAccountId: string,
+    userId: string,
+    queryParmas: {
+        accountId?: string,//账户ID
+        campaignId?: string,//计划ID
+        adgroupId?: string,//广告ID
+        adcreativeId?: string,//创意ID
+        pageId?: string,//落地页ID
+        targetingId?: string,//定向ID}
+    },
+    tableIdClick: (props: {
+        activeKey: string, parma: {
+            accountId?: string,//账户ID
+            campaignId?: string,//计划ID
+            adgroupId?: string,//广告ID
+            adcreativeId?: string,//创意ID
+            pageId?: string,//落地页ID
+            targetingId?: string,//定向ID
+        }
+    }) => void
+}
+function Creative(props: Props) {
+    let { accountId, adAccountId,userId,tableIdClick } = props
     // api方法
     const listAjax = useAjax((params) => getAdqAdcreativeList(params), { formatResult: true })
     const syncAjax = useAjax((adAccountId) => putAdqTargetingSyncAll(adAccountId))
@@ -43,12 +65,12 @@ function Creative(props: { accountId: string, adAccountId: string ,userId:string
     }, [adAccountId, listAjax])
     return <div>
         <TableData
-            columns={tableConfig}
+            columns={()=>tableConfig(tableIdClick)}
             ajax={listAjax}
             syncAjax={sync}
             dataSource={listAjax?.data?.data?.records}
             loading={listAjax?.loading || syncAjax?.loading}
-            // scroll={{ x: 2000 }}
+            scroll={{x:1200, y:550 }}
             total={listAjax?.data?.data?.total}
             page={listAjax?.data?.data?.current}
             pageSize={listAjax?.data?.data?.size}
@@ -95,9 +117,9 @@ function Creative(props: { accountId: string, adAccountId: string ,userId:string
                 </Row>
             </>}
             onChange={(props: any) => {
-                // let { sortData, pagination } = props
-                // let { current, pageSize } = pagination
-                // getList({ pageNum: current, pageSize })
+                let { sortData, pagination } = props
+                let { current, pageSize } = pagination
+                getList({ pageNum: current, pageSize })
             }}
         />
     </div>

+ 28 - 12
src/pages/launchSystemNew/adq/creative/tableConfig.tsx

@@ -1,16 +1,27 @@
-import { CreativeTemplateVersionTypeEnum, HeadClickTypeEnum, LinkPageNameTypeEnum, LinkPageTypeEnum, PageTypeEnum, PromotedObjectType, SourceEnum } from '@/services/launchAdq/enum'
+import { LinkPageTypeEnum, PromotedObjectType } from '@/services/launchAdq/enum'
 import React from 'react'
-import { Space } from 'antd'
-function tableConfig(): any {
+function tableConfig(tableIdClick: (props: {
+    activeKey: string,
+    parma: {
+        accountId?: string,//账户ID
+        campaignId?: string,//计划ID
+        adgroupId?: string,//广告ID
+        adcreativeId?: string,//创意ID
+        pageId?: string,//落地页ID
+        targetingId?: string,//定向ID
+    }
+}) => void): any {
     return [
         {
             title: '所属账号',
             dataIndex: 'accountId',
             key: 'accountId',
             align: 'center',
-            width:70,
-            render:(a:string)=>{
-                return <a>{a}</a>
+            width: 90,
+            render: (a: string) => {
+                return <a onClick={() => {
+                    tableIdClick({ activeKey: '1', parma: { accountId: a } })
+                }}>{a}</a>
             }
         },
         {
@@ -18,9 +29,11 @@ function tableConfig(): any {
             dataIndex: 'adcreativeId',
             key: 'adcreativeId',
             align: 'center',
-            width: 70,
-            render:(a:string)=>{
-                return <a>{a}</a>
+            width: 100,
+            render: (a: string) => {
+                return <a onClick={() => {
+                    tableIdClick({ activeKey: '4', parma: { adcreativeId: a } })
+                }}>{a}</a>
             }
         },
         {
@@ -28,9 +41,11 @@ function tableConfig(): any {
             dataIndex: 'campaignId',
             key: 'campaignId',
             align: 'center',
-            width: 70,
-            render:(a:string)=>{
-                return <a>{a}</a>
+            width: 100,
+            render: (a: string) => {
+                return <a onClick={() => {
+                    tableIdClick({ activeKey: '2', parma: { campaignId: a } })
+                }}>{a}</a>
             }
         },
         // {
@@ -58,6 +73,7 @@ function tableConfig(): any {
             title: '创意名称',
             dataIndex: 'adcreativeName',
             key: 'adcreativeName',
+            width: 250,
             align: 'center',
         },
         // {

+ 112 - 21
src/pages/launchSystemNew/adq/index.tsx

@@ -1,7 +1,8 @@
-import React, { useState, useEffect } from 'react'
-import {  Card, Col, Menu, Row, Select, Tabs } from 'antd';
+import React, { useState, useEffect, useCallback } from 'react'
+import { Badge, Card, Col, Menu, Row, Select, Tabs, Tag } from 'antd';
 // import './index.less'
 import Campaign from './campaign';
+import AdAccount from './adAccount';
 import Ad from './ad';
 import Creative from './creative';
 import LandingPage from './landingPage';
@@ -13,8 +14,8 @@ import { useModel } from 'umi';
 const { TabPane } = Tabs;
 let Menus: any = Menu
 const tabsConfig = [
-    { key: '1', tab: '账户信息', jsx: () => null },
-    { key: '2', tab: '计划', jsx:(props: any) => <Campaign {...props} />},
+    { key: '1', tab: '账户信息', jsx: (props: any) => <AdAccount {...props} /> },
+    { key: '2', tab: '计划', jsx: (props: any) => <Campaign {...props} /> },
     { key: '3', tab: '广告', jsx: (props: any) => <Ad {...props} /> },
     { key: '4', tab: '创意', jsx: (props: any) => <Creative {...props} /> },
     { key: '5', tab: '落地页', jsx: (props: any) => <LandingPage {...props} /> },
@@ -24,13 +25,39 @@ function Adq() {
     const userInfo = useModel('@@initialState', model => model.initialState?.currentUser)
     const allOfMember = useAjax(() => getAdAccountAllOfMember(), { formatResult: true })
     const [userAll, setUserAll] = useState([])
-    const [activeKey, setActiveKey] = useState('2')
-    const [userId, setUserId] = useState<any>('1'||userInfo?.userId?.toString())
+    const [activeKey, setActiveKey] = useState('1')
+    const [userId, setUserId] = useState<any>(userInfo?.userId?.toString())
     const [selectedArr, setSelectedArr] = useState([])
+    const [queryParmas, setQueryParmas] = useState({
+        accountId: '',//账户ID
+        campaignId: '',//计划ID
+        adgroupId: '',//广告ID
+        adcreativeId: '',//创意ID
+        pageId: '',//落地页ID
+        targetingId: '',//定向ID
+    })
     const [idS, setIds] = useState({//需要用到的accountId,adAccountId
         accountId: '',
         adAccountId: ''
     })
+    // 点击table中的ID添加对应条件
+    const tableIdClick = useCallback((props: {
+        activeKey: string, parma: {
+            accountId?: string,//账户ID
+            campaignId?: string,//计划ID
+            adgroupId?: string,//广告ID
+            adcreativeId?: string,//创意ID
+            pageId?: string,//落地页ID
+            targetingId?: string,//定向ID
+        }
+    }) => {
+        // 暂时注释不开放
+        // let { activeKey, parma } = props
+        // setQueryParmas({ ...queryParmas, ...parma })
+        // setActiveKey(activeKey)
+
+    }, [queryParmas, activeKey])
+    // 获取组员
     useEffect(() => {
         allOfMember.run().then(res => {
             if (res?.data) {
@@ -52,15 +79,35 @@ function Adq() {
             }
         })
     }, [])
+    //选中的组员的子账号
     useEffect(() => {
         if (userAll.length > 0 && userId) {
             let newArr: any = userAll?.filter((item: any) => item.key == userId)
             setSelectedArr(newArr[0]?.childrenarr || [])
         }
     }, [userAll, userId])
-    console.log('selectedArr===>', selectedArr)
+    // 用户点击table中的账号ID处理
+    useEffect(() => {
+        if (selectedArr.length > 0 && queryParmas.accountId) {
+            let obj: any = selectedArr?.filter((item: any) => item.key.includes(queryParmas.accountId))[0]
+            if (obj) {
+                let arr = obj.key.split('_')
+                setIds({ accountId: arr[0], adAccountId: arr[1] })
+            }
+        }
+    }, [queryParmas, selectedArr])
+    // 初始跳转到自己的名称
+    useEffect(() => {
+        if (userAll?.length > 0 && userInfo?.userId) {
+            let topEq = userAll?.findIndex((item: any) => item.key == userInfo?.userId)
+            let em:any = document.getElementById('myMenus')
+            if (em) {
+                em.scrollTop=52 * topEq - 36
+            }
+        }
+    }, [userInfo?.userId, userAll])
     return <Row style={{ position: 'relative' }}>
-        <Col style={{ height: '100%', overflowY: 'auto', position: 'absolute', left: 0, top: 0, bottom: 0, width: 150, background: '#fff' }}>
+        <Col id='myMenus' style={{ height: '100%', overflowY: 'auto', position: 'absolute', left: 0, top: 0, bottom: 0, width: 150, background: '#fff' }}>
             <Menus
                 theme='light'
                 onClick={(e: any) => {//点击菜单
@@ -75,18 +122,24 @@ function Adq() {
         <Col span={21} style={{ marginLeft: 150 }}>
             <Card>
                 <Tabs activeKey={activeKey} type="card" onChange={(activeKey) => { setActiveKey(activeKey) }} tabBarExtraContent={
-                    <Select placeholder='广点通账号' style={{ minWidth: 200 }} showSearch filterOption={(input: any, option: any) =>
-                        (option!.children as unknown as string).toLowerCase().includes(input.toLowerCase())
-                    } allowClear onChange={(value: any) => {
-                        let accountId = ''
-                        let adAccountId = ''
-                        if (value) {
-                            let arr = value.split('_')
-                            accountId = arr[0]
-                            adAccountId = arr[1]
-                        }
-                        setIds({ accountId, adAccountId })
-                    }} >
+                    <Select
+                        placeholder='广点通账号'
+                        style={{ minWidth: 200 }}
+                        showSearch
+                        filterOption={(input: any, option: any) =>
+                            (option!.children as unknown as string).toLowerCase().includes(input.toLowerCase())
+                        } allowClear onChange={(value: any) => {
+                            let accountId = ''
+                            let adAccountId = ''
+                            if (value) {
+                                let arr = value.split('_')
+                                accountId = arr[0]
+                                adAccountId = arr[1]
+                            }
+                            setIds({ accountId, adAccountId })
+                        }}
+                        value={idS.accountId ? idS.accountId + '_' + idS.adAccountId : null}
+                    >
                         {
                             selectedArr?.map((item: any) => {
                                 return <Select.Option value={item.key} key={item.key}>{item.label}</Select.Option>
@@ -97,7 +150,45 @@ function Adq() {
                     {
                         tabsConfig?.map(item => {
                             return <TabPane tab={item.tab} key={item.key} >
-                                {activeKey=== item.key && item.jsx({...idS, userId })}
+                                <>
+                                    {/* 点击了列表中的ID默认展示并搜索对应ID条件 */}
+                                    <Row >
+                                        <Col>
+                                            {
+                                                Object.keys(queryParmas)?.filter(key => queryParmas[key])?.map(key => {
+                                                    enum nameEnum {
+                                                        accountId = '账户ID',
+                                                        campaignId = '计划ID',
+                                                        adgroupId = '广告ID',
+                                                        adcreativeId = '创意ID',
+                                                        pageId = '落地页ID',
+                                                        targetingId = '定向ID',
+                                                    }
+                                                    return <Badge
+                                                        key={key}
+                                                        count={
+                                                            <span
+                                                                style={{ width: 14, height: 14, borderRadius: '50%', background: '#ff4d4f', boxShadow: '0 0 0 1px #fff', color: '#fff', textAlign: 'center' }}
+                                                                onClick={() => {
+                                                                    setQueryParmas({ ...queryParmas, [key]: '' })
+                                                                    setIds({
+                                                                        accountId: '',
+                                                                        adAccountId: ''
+                                                                    })
+                                                                }}
+                                                            >x</span>}
+                                                        size='small'
+                                                        offset={[-20, 2]}
+                                                        style={{ cursor: 'pointer' }}
+                                                    >
+                                                        <Tag style={{ marginRight: 20, marginBottom: 20 }}>{nameEnum[key]}:{queryParmas[key]}</Tag>
+                                                    </Badge>
+                                                })
+                                            }
+                                        </Col>
+                                    </Row>
+                                    {activeKey === item.key && item.jsx({ ...idS, userId, queryParmas, tableIdClick })}
+                                </>
                             </TabPane>
                         })
                     }

+ 1 - 1
src/pages/launchSystemNew/adq/landingPage/index.tsx

@@ -49,7 +49,7 @@ function LandingPage(props: { accountId: string, adAccountId: string, userId: st
             syncAjax={sync}
             dataSource={listAjax?.data?.data?.records}
             loading={listAjax?.loading || syncAjax?.loading}
-            // scroll={{ y: 600 }}
+            scroll={{ y:550 }}
             total={listAjax?.data?.data?.total}
             page={listAjax?.data?.data?.current}
             pageSize={listAjax?.data?.data?.size}

+ 3 - 3
src/pages/launchSystemNew/adq/landingPage/tableConfig.tsx

@@ -1,6 +1,6 @@
-import { CanvasTypeEnum, PageStatusEnum, PageTypeEnum, PromotedObjectType, SourceTypeEnum, VideoResourceStatusEnum } from '@/services/launchAdq/enum'
+import {  PageStatusEnum, PageTypeEnum, SourceTypeEnum } from '@/services/launchAdq/enum'
 import React from 'react'
-import { Badge, Space } from 'antd'
+import { Badge } from 'antd'
 function tableConfig(): any {
     return [
         {
@@ -8,7 +8,7 @@ function tableConfig(): any {
             dataIndex: 'accountId',
             key: 'accountId',
             align: 'center',
-            width:70,
+            width:100,
             render:(a:string)=>{
                 return <a>{a}</a>
             }

+ 2 - 2
src/pages/launchSystemNew/adq/targeting/index.tsx

@@ -1,4 +1,4 @@
-import React, { useEffect, useCallback, useState } from 'react'
+import React, { useEffect, useCallback } from 'react'
 import { Col, Input, message, Row } from 'antd'
 import { useAjax } from '@/Hook/useAjax'
 import { getAdqTargetingList, putAdqTargetingSyncAll } from '@/services/launchAdq/adq'
@@ -46,7 +46,7 @@ function Targeting(props: { adAccountId: any, userId: string, accountId: any })
             syncAjax={sync}
             dataSource={listAjax?.data?.data?.records}
             loading={listAjax?.loading || syncAjax?.loading}
-            scroll={{ x: 2000 }}
+            scroll={{ x: 2000,y:550}}
             total={listAjax?.data?.data?.total}
             page={listAjax?.data?.data?.current}
             pageSize={listAjax?.data?.data?.size}

+ 5 - 5
src/pages/launchSystemNew/adq/targeting/tableConfig.tsx

@@ -8,7 +8,7 @@ function tableConfig(): any {
             dataIndex: 'accountId',
             key: 'accountId',
             align: 'center',
-            width:70,
+            width:80,
             render:(a:string)=>{
                 return <a>{a}</a>
             }
@@ -49,19 +49,19 @@ function tableConfig(): any {
                     title={
                         <div style={{ display: 'flex', flexFlow: 'column' }}>
                             {
-                                a?.split(';')?.filter((str: any) => !!str)?.map((str: string) => {
+                                a?.split(';')?.filter((str: any) => !!str)?.map((str: string,index:number) => {
                                     let arr = str?.split(':')
-                                    return <span>{arr[0]}:<a>{arr[1]}</a></span>
+                                    return <span key={index}>{arr[0]}:<a>{arr[1]}</a></span>
                                 })
                             }
                         </div>
                     }>
                     <div style={{ display: 'flex', flexFlow: 'column' }}>
                         {
-                            a?.split(';')?.filter((str: any) => !!str)?.map((str: string) => {
+                            a?.split(';')?.filter((str: any) => !!str)?.map((str: string,index:number) => {
                                 if (str.includes('地理位置')) {
                                     let arr = str?.split(':')
-                                    return <span>{arr[0]}:<a>{arr[1]}....</a></span>
+                                    return <span key={index}>{arr[0]}:<a>{arr[1]}....</a></span>
                                 } else {
                                     return null
                                 }

+ 61 - 13
src/pages/launchSystemNew/components/TableData/index.tsx

@@ -36,14 +36,14 @@ interface Prosp {
         }
     }) => void,
     ajax?: any,//接口刷新
-    syncAjax?:any,//同步
+    syncAjax?: any,//同步
     hoverable?: boolean,
     rowSelection?: any,
-    myKey?:any,//自定义使用哪个值做key
+    myKey?: any,//自定义使用哪个值做key
 }
 
 function TableData(props: Prosp) {
-    const { isZj, scroll, columns, title, dataSource, expandedRowRender, className, leftChild, page = undefined, rowSelection = false, pageSize = undefined, size = 'small', total = 0, loading = false, onChange, config, configName, ajax,syncAjax, hoverable = true ,myKey} = props
+    const { isZj, scroll, columns, title, dataSource, expandedRowRender, className, leftChild, page = undefined, rowSelection = false, pageSize = undefined, size = 'small', total = 0, loading = false, onChange, config, configName, ajax, syncAjax, hoverable = true, myKey } = props
     const { state: userState } = useModel('useOperating.useUser')
     const { isFell } = userState
     const [visible, setVisible] = useState<boolean>(false)
@@ -52,6 +52,11 @@ function TableData(props: Prosp) {
     const [newColumns, setNewColumns] = useState<any[]>([])
     // const [oldConfigName, setOldConfigName] = useState<any>('')//上次的配置名称
     const [selectData, setSelectData] = useState<{ selectData: any[], fixed: { left: string, right: string } }>({ selectData: [], fixed: { left: '0', right: '0' } })
+    const [tiptopShow, setTipTopShow] = useState({//tiptop开关
+        ajaxShow: false,
+        syncAjaxShow: false,
+        configShow: false,
+    })
     const ref = useRef(null)
     const oldName = useRef(null)
     const version = '1.0.0'
@@ -120,6 +125,37 @@ function TableData(props: Prosp) {
             localStorage.setItem(`myAdMonitorConfig${version}_` + configName, JSON.stringify(newSelectData))
         }
     }, [configName, selectData])
+    // 初始展示TIPTOP提示功能
+    useEffect(() => {
+        let time: any = null
+        function timeOut(arg: any) {
+            return new Promise((res, rel) => {
+                time = setTimeout(() => {
+                    setTipTopShow({ ...tiptopShow, ...arg })
+                    res(true)
+                }, 3000)
+            })
+        }
+        async function isShow() {
+            if (ajax) {
+                setTipTopShow({ ...tiptopShow, ajaxShow: true })
+                await timeOut({ ajaxShow: false })
+            }
+            if (syncAjax) {
+                setTipTopShow({ ...tiptopShow, syncAjaxShow: true })
+                await timeOut({ syncAjaxShow: false })
+            }
+            if (config) {
+                setTipTopShow({ ...tiptopShow, configShow: true })
+                await timeOut({ configShow: false })
+            }
+        }
+        isShow()
+        return () => {
+            clearTimeout(time)
+            time = null
+        }
+    }, [])
     const header = <Col span={24}>
         <Row gutter={[0, 10]}>
             <Col span={24} style={{
@@ -131,43 +167,55 @@ function TableData(props: Prosp) {
                     {leftChild}
                 </Space>
                 {/*紧凑*/}
-                <div style={{ float: 'right',display:'flex',flexFlow:'row' }}>
+                <div style={{ float: 'right', display: 'flex', flexFlow: 'row' }}>
                     {
                         ajax && <Button
                             size='small'
                             type='text'
-                            style={{display:'flex',alignItems:'center'}}
+                            style={{ display: 'flex', alignItems: 'center' }}
                             onClick={() => {
                                 ajax.refresh()
                             }}>
                             <span style={{ fontSize: 10, color: '#999' }}>刷新时间:{ajax?.data?.reqTime}</span>
-                            <Tooltip title='刷新'><RedoOutlined style={{color:'#2196f3',fontSize:17}}/></Tooltip>
+                            <Tooltip
+                                title='刷新'
+                                visible={tiptopShow.ajaxShow}
+                                onVisibleChange={(visible) => {
+                                    setTipTopShow({ ...tiptopShow, ajaxShow: visible })
+                                }}
+                            ><RedoOutlined style={{ color: '#2196f3', fontSize: 17 }} /></Tooltip>
                         </Button>
                     }
                     {
                         syncAjax && <Button
                             size='small'
                             type='text'
-                            style={{display:'flex',alignItems:'center'}}
+                            style={{ display: 'flex', alignItems: 'center' }}
                             onClick={() => {
                                 syncAjax()
                             }}>
-                            <Tooltip title='同步最新'><SyncOutlined style={{color:'red',fontSize:17}}/></Tooltip>
+                            <Tooltip
+                                title='同步最新'
+                                visible={tiptopShow.syncAjaxShow}
+                                onVisibleChange={(visible) => {
+                                    setTipTopShow({ ...tiptopShow, syncAjaxShow: visible })
+                                }}
+                            ><SyncOutlined style={{ color: 'red', fontSize: 17 }} /></Tooltip>
                         </Button>
                     }
                     {config && <Button
                         size='small'
                         type='text'
-                        style={{display:'flex',alignItems:'center'}}
+                        style={{ display: 'flex', alignItems: 'center' }}
                         onClick={() => {
                             setVisible(true)
                         }}>
-                        <Tooltip title='设置'><SettingOutlined style={{fontSize:17}}/></Tooltip>
+                        <Tooltip title='设置'><SettingOutlined style={{ fontSize: 17 }} /></Tooltip>
                     </Button>}
                     <Button
                         type='text'
                         size='small'
-                        style={{display:'flex',alignItems:'center'}}
+                        style={{ display: 'flex', alignItems: 'center' }}
                         onClick={() => {
                             if (ref?.current) {
                                 quanpin(ref?.current)
@@ -192,7 +240,7 @@ function TableData(props: Prosp) {
             >
                 <Row gutter={[0, 20]}>
                     {header}
-                    <Tab {...{ size, newColumns, handelResize, className, isZj, rowSelection, columns, loading, scroll, isFell, page, pageSize, dataSource, onChange, expandedRowRender, total, ajax ,myKey}} />
+                    <Tab {...{ size, newColumns, handelResize, className, isZj, rowSelection, columns, loading, scroll, isFell, page, pageSize, dataSource, onChange, expandedRowRender, total, ajax, myKey }} />
                 </Row>
             </Card>
         </Col>
@@ -204,7 +252,7 @@ function TableData(props: Prosp) {
 
 /**表格 */
 const Tab = React.memo((props: any) => {
-    const { size, newColumns, className, handelResize, columns, scroll, loading, rowSelection, isFell, page, pageSize, dataSource, onChange, expandedRowRender, total, ajax ,myKey} = props
+    const { size, newColumns, className, handelResize, columns, scroll, loading, rowSelection, isFell, page, pageSize, dataSource, onChange, expandedRowRender, total, ajax, myKey } = props
     return < Col span={24} >
         <div className={`${style[size]} ${className ? style[className] : ''} `}>
             {dataSource || !ajax?.loading ? <Tables

+ 8 - 8
src/pages/launchSystemNew/components/addLandingPage/index.tsx

@@ -140,28 +140,28 @@ function AddLandingPage(props: Props) {
             setIsFootlock(() => false)
             if (selectData?.adLocation === 'sns') { // 朋友圈信息流
                 if (selectData?.outerStyle === 0) { // 常规广告
-                    init({ mediaType: 'IMG', cloudSize: [[{ relation: '=', width: 800, height: 800 }]] })
+                    init({ mediaType: 'IMG', cloudSize: [[{ relation: '=', width: 800, height: 800 }]],maxSize:300*1024 })
                 } else { // 卡片广告
-                    init({ mediaType: 'IMG', cloudSize: [[{ relation: '=', width: 800, height: 450 }]] })
+                    init({ mediaType: 'IMG', cloudSize: [[{ relation: '=', width: 800, height: 450 }]],maxSize:300*1024})
                 }
             } else { // 公众号及其他
-                init({ mediaType: 'IMG', cloudSize: [[{ relation: '=', width: 800, height: 800 }], [{ relation: '=', width: 800, height: 450 }], [{ relation: '=', width: 800, height: 640 }], [{ relation: '=', width: 640, height: 800 }]] })
+                init({ mediaType: 'IMG', cloudSize: [[{ relation: '=', width: 800, height: 800 }], [{ relation: '=', width: 800, height: 450 }], [{ relation: '=', width: 800, height: 640 }], [{ relation: '=', width: 640, height: 800 }]] ,maxSize:300*1024})
             }
         } else if (selectData?.elementType === 'IMAGE') { // 内容图片
             setIsFootlock(() => false)
-            init({ mediaType: 'IMG', cloudSize: [[{ relation: '=', width: 750, height: null }, { relation: '<=', width: null, height: 1536 }]] })
+            init({ mediaType: 'IMG', cloudSize: [[{ relation: '=', width: 750, height: null }, { relation: '<=', width: null, height: 1536 }]],maxSize:300*1024 })
         } else if (selectData?.elementType === 'TOP_SLIDER') { // 轮播图
-            init({ mediaType: 'IMG', num: selectData?.imageUrlList?.length || 3, cloudSize: [[{ relation: '=', width: 800, height: 800 }]] })
+            init({ mediaType: 'IMG', num: selectData?.imageUrlList?.length || 3, cloudSize: [[{ relation: '=', width: 800, height: 800 }]],maxSize:300*1024 })
             setIsFootlock(() => false)
         } else if (selectData?.elementType === 'TOP_VIDEO') { // 视频
             if (selectData?.adLocation === 'sns') { // 朋友圈信息流
                 if (selectData?.outerStyle === 0) { // 常规广告
-                    init({ mediaType: 'VIDEO', cloudSize: [[{ relation: '=', width: 640, height: 480 }], [{ relation: '=', width: 640, height: 360 }], [{ relation: '=', width: 750, height: 1334 }], [{ relation: '=', width: 720, height: 1280 }] ] })
+                    init({ mediaType: 'VIDEO', cloudSize: [[{ relation: '=', width: 640, height: 480 }], [{ relation: '=', width: 640, height: 360 }], [{ relation: '=', width: 750, height: 1334 }], [{ relation: '=', width: 720, height: 1280 }] ],maxSize:20*1024*1024  })
                 } else { // 卡片广告
-                    init({ mediaType: 'VIDEO', cloudSize: [[{ relation: '=', width: 750, height: null }, { relation: '<=', width: null, height: 1536 }]] })
+                    init({ mediaType: 'VIDEO', cloudSize: [[{ relation: '=', width: 750, height: null }, { relation: '<=', width: null, height: 1536 }]],maxSize:20*1024*1024 })
                 }
             } else { // 公众号及其它
-                init({ mediaType: 'VIDEO', cloudSize: [[{ relation: '=', width: 750, height: null }, { relation: '<=', width: null, height: 1536 }]] })
+                init({ mediaType: 'VIDEO', cloudSize: [[{ relation: '=', width: 750, height: null }, { relation: '<=', width: null, height: 1536 }]],maxSize:20*1024*1024  })
                 setIsFootlock(() => false)
             }
         } else if (selectData?.elementType === 'shelfnew') {  // 图文复合组件 1个

+ 4 - 3
src/pages/launchSystemNew/launchManage/localAd/ad/modal.tsx

@@ -1,10 +1,11 @@
 import React, { useCallback, useEffect } from 'react'
-import { Modal, Form, Input, Divider, Select, Radio, DatePicker, Switch, Checkbox, message } from 'antd'
-import { SiteSetEnum, BidModeEnum, OptimizationGoalEnum, BidStrategyEnum, PromotedObjectType, EducationEnum } from '@/services/launchAdq/enum'
+import { Modal, Form, Input, Divider, Select, Radio, DatePicker, Switch, Checkbox, message,Tooltip } from 'antd'
+import { SiteSetEnum, BidModeEnum, OptimizationGoalEnum, BidStrategyEnum, PromotedObjectType } from '@/services/launchAdq/enum'
 import { ModalConfig } from '.'
 import moment from 'moment';
 import { useAjax } from '@/Hook/useAjax';
 import { getSceneTagsList } from '@/services/launchAdq/global';
+import { ExclamationCircleOutlined } from '@ant-design/icons';
 const { RangePicker }: { RangePicker: any } = DatePicker;
 let DatePickers: any = DatePicker
 interface Props {
@@ -221,7 +222,7 @@ function AdModal(props: Props) {
                     <Radio.Button value={'1'}>全天投放</Radio.Button>
                 </Radio.Group>
             </Form.Item>
-            <Form.Item label={<strong>出价方式</strong>} name='bidMode'>
+            <Form.Item label={<strong>出价方式<Tooltip title='出价方式不同将影响自定义人群,行为兴趣意向等某些功能无法使用'><ExclamationCircleOutlined style={{color:'#e91e63',marginLeft:5}}/></Tooltip></strong>} name='bidMode'>
                 <Radio.Group >
                     {
                         Object.keys(BidModeEnum).map(key => {

+ 5 - 4
src/pages/launchSystemNew/launchManage/localAd/creative/modal.tsx

@@ -469,7 +469,7 @@ function CreativeModal(props: Props) {
                                     {/* 视频 */}
                                     {
                                         (item.name === 'short_video1' || item.name === 'video') && <div className={`${styles.box} ${styles.video}`} onClick={() => {
-                                            init({ mediaType: 'VIDEO', cloudSize:adcreativeTemplateId === 1708 ?  [[{ relation: '=', width: 1280, height: 720 }]]:[[{ relation: '=', width: item.restriction.videoRestriction.minWidth, height: item.restriction.videoRestriction.minHeight }]] })
+                                            init({ mediaType: 'VIDEO', cloudSize:adcreativeTemplateId === 1708 ?  [[{ relation: '=', width: 1280, height: 720 }]]:[[{ relation: '=', width: item.restriction.videoRestriction.minWidth, height: item.restriction.videoRestriction.minHeight }]],maxSize:item.restriction.videoRestriction.fileSize *1024})
                                             setTimeout(() => {
                                                 set_selectImgVisible(true)
                                                 setMaterialConfig({
@@ -493,7 +493,7 @@ function CreativeModal(props: Props) {
                                     {/* 单图 */}
                                     {
                                         item.name === 'image' && <div className={`${styles.box} ${styles.image}`} onClick={() => {
-                                            init({ mediaType: 'IMG', cloudSize: [[{ relation: '=', width: item.restriction.imageRestriction.width, height: item.restriction.imageRestriction.height }]] })
+                                            init({ mediaType: 'IMG', cloudSize: [[{ relation: '=', width: item.restriction.imageRestriction.width, height: item.restriction.imageRestriction.height }]],maxSize:item.restriction.imageRestriction.fileSize *1024 })
                                             setTimeout(() => {
                                                 set_selectImgVisible(true)
                                                 setMaterialConfig({
@@ -517,7 +517,7 @@ function CreativeModal(props: Props) {
                                     {/* 多图 */}
                                     {
                                         item.name === 'image_list' && <div className={`${styles.box} ${item.arrayProperty.maxNumber >= 3 ? styles.image_list : styles.image}`} onClick={() => {
-                                            init({ mediaType: 'IMG', num: item.arrayProperty.maxNumber, cloudSize: [[{ relation: '=', width: item.restriction.imageRestriction.width, height: item.restriction.imageRestriction.height }]] })
+                                            init({ mediaType: 'IMG', num: item.arrayProperty.maxNumber, cloudSize: [[{ relation: '=', width: item.restriction.imageRestriction.width, height: item.restriction.imageRestriction.height }]],maxSize:item.restriction.imageRestriction.fileSize *1024 })
                                             setTimeout(() => {
                                                 set_selectImgVisible(true)
                                                 setMaterialConfig({
@@ -586,9 +586,10 @@ function CreativeModal(props: Props) {
                         }
                         {//过滤了不必传和品牌名称,品牌标识图(外部传)短视频结构(组装使用)
                             adcreative_template?.adcreativeElements?.filter(item => item.required && item.name === 'description').map(item => {
+                                let maxNum=adcreativeTemplateId === 1708? pupState.xd_show? 10 : item.restriction.textRestriction.maxLength : item.restriction.textRestriction.maxLength
                                 return <div key={item.fieldType}>
                                     <Form.Item label={<strong>{item.description}</strong>} className={'my_description'}>
-                                        <Form.Item name={item.name} noStyle rules={[{ required: true, pattern: RegExp(item.restriction.textRestriction.textPattern?.replace(/\+/ig, `{1,${item.restriction.textRestriction.maxLength}}`)), message: '请输入正确的' + item.description }]}>
+                                        <Form.Item name={item.name} noStyle rules={[{ required: true, pattern: RegExp(item.restriction.textRestriction.textPattern?.replace(/\+/ig, `{1,${maxNum}}`)), message: '请输入正确的' + item.description }]}>
                                             <Input
                                                 placeholder={'请输入' + item.description}
                                                 style={{ width: 500 }}

+ 48 - 0
src/services/launchAdq/adq.ts

@@ -16,6 +16,34 @@ export async function getAdAccountAllOfMember() {
 //   }).then(res=>res.json())
 // }
 
+/**
+ * 获取ADQ账号列表
+ * @param adgroupName 广告名称
+ * @param promotedObjectType 广告类型
+ * @param accountId 账户ID
+ * @param adgroupName 广告名称
+ */
+ export async function getAdqAdAccountList(params: {
+  pageNum: number;
+  pageSize: number;
+  userId?:string;//用户ID
+  accountIds?: string[];//账号本地ID
+}) {
+  return request(api + '/adq/adAccount/list', {
+    method: 'POST',
+    data: params,
+  });
+}
+/**
+ * 按账号同步计划
+ * @param adAccountId 本地ID
+ */
+ export async function putAdqAdAccountSyncByIds(data:any) {
+  return request(api + `/adq/adAccount/syncByIds`, {
+    method: 'PUT',
+    data
+  });
+}
 /**
  * 获取ADQ计划列表
  * @param adgroupName 广告名称
@@ -156,3 +184,23 @@ export async function getAdqTargetingList(params: {
   });
 }
 
+/**
+ * 计划启停
+ * @param adAccountId 本地ID
+ */
+ export async function putAdqCampaignConfigStatus(params: any) {
+   let {accountId,campaignId,configuredStatus}=params
+  return request(api + `/adq/campaign/configStatus/${accountId}/${campaignId}/${configuredStatus}`, {
+    method: 'PUT',
+  });
+}
+/**
+ * 广告启停
+ * @param adAccountId 本地ID
+ */
+ export async function putAdqAdgroupsConfigStatus(params: any) {
+   let {accountId,adgroupId,configuredStatus}=params
+  return request(api + `/adq/adgroups/configStatus/${accountId}/${adgroupId}/${configuredStatus}`, {
+    method: 'PUT',
+  });
+}

+ 7 - 0
src/services/launchAdq/enum.ts

@@ -456,3 +456,10 @@ export enum AdStatusEnum {
   STATUS_PART_READY = '部分待投放',
   STATUS_PART_ACTIVE = '部分投放中',
 }
+/**资金状态*/
+export enum FundStatusEnum {
+  FUND_STATUS_NORMAL = '有效',
+  FUND_STATUS_NOT_ENOUGH = '余额不足',
+  FUND_STATUS_CLOSED = '资金账户已销户',
+  FUND_STATUS_FROZEN = '资金冻结',
+}