shenwu 2 năm trước cách đây
mục cha
commit
b43172a49a

+ 27 - 5
src/pages/launchSystemNew/adq/ad/index.tsx

@@ -6,9 +6,31 @@ import React, { useEffect, useCallback } from 'react'
 import TableData from '../../components/TableData'
 import tableConfig from './tableConfig'
 import { putAdqAdgroupsSync, getAdqAdgroupsList,putAdqAdgroupsConfigStatus } from '@/services/launchAdq/adq'
-
-function Ad(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 Ad(props:Props) {
+    let { accountId, adAccountId,userId,tableIdClick } = props
     // api方法
     const listAjax = useAjax((params) => getAdqAdgroupsList(params), { formatResult: true })
     const syncAjax = useAjax((adAccountId) => putAdqAdgroupsSync(adAccountId))
@@ -53,12 +75,12 @@ function Ad(props: { accountId: string, adAccountId: string ,userId:string}) {
     },[])
     return <div>
         <TableData
-            columns={()=>tableConfig(switchHandle)}
+            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}

+ 71 - 52
src/pages/launchSystemNew/adq/ad/tableConfig.tsx

@@ -1,19 +1,31 @@
 import { AdStatusEnum, OptimizationGoalEnum, PromotedObjectType } from '@/services/launchAdq/enum'
 import React from 'react'
 import { Badge, Switch } from 'antd'
-function tableConfig(switchHandle:(data:any,Status:any)=>void):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,b:any)=>{
-                return <Switch defaultChecked={b?.configuredStatus=== 'AD_STATUS_NORMAL'} onChange={(checked:boolean)=>{
-                    switchHandle(b,checked)
-                }}/> 
+            width: 50,
+            fixed: 'left',
+            render: (a: string, b: any) => {
+                return <Switch defaultChecked={b?.configuredStatus === 'AD_STATUS_NORMAL'} onChange={(checked: boolean) => {
+                    switchHandle(b, checked)
+                }} />
             }
         },
         {
@@ -21,10 +33,12 @@ function tableConfig(switchHandle:(data:any,Status:any)=>void):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>
             }
         },
         {
@@ -32,10 +46,12 @@ function tableConfig(switchHandle:(data:any,Status:any)=>void):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>
             }
         },
         {
@@ -43,10 +59,12 @@ function tableConfig(switchHandle:(data:any,Status:any)=>void):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>
             }
         },
         {
@@ -54,36 +72,36 @@ function tableConfig(switchHandle:(data:any,Status:any)=>void):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 + '~' + '长期投放'
             }
         },
         {
@@ -91,40 +109,30 @@ function tableConfig(switchHandle:(data:any,Status:any)=>void):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 ? '开' : '关'
             }
         },
         {
@@ -132,7 +140,7 @@ function tableConfig(switchHandle:(data:any,Status:any)=>void):any{
             dataIndex: 'createdTime',
             key: 'createdTime',
             align: 'center',
-            width:160,
+            width: 160,
         },
         // {
         //     title: '客户设置的状态',
@@ -144,14 +152,25 @@ function tableConfig(switchHandle:(data:any,Status:any)=>void):any{
         //         return  <Badge status={a==='AD_STATUS_NORMAL' ? "processing" :"error" } text={ConfiguredStatusEnum[a]} />
         //     }
         // },
+        {
+            title: '是否已删除',
+            dataIndex: 'isDeleted',
+            key: 'isDeleted',
+            align: 'center',
+            width: 70,
+            fixed: 'right',
+            render: (a: any, b: any) => {
+                return <Badge status={!a ? "processing" : "error"} text={a ? '是' : '否'} />
+            }
+        },
         {
             title: '广告状态',
             dataIndex: 'status',
             key: 'status',
             align: 'center',
-            width:70,
-            fixed:'right',
-            render:(a:string)=>{
+            width: 70,
+            fixed: 'right',
+            render: (a: string) => {
                 return AdStatusEnum[a]
             }
         },

+ 27 - 5
src/pages/launchSystemNew/adq/adAccount/index.tsx

@@ -5,9 +5,31 @@ import React, { useEffect, useState, useCallback } from 'react'
 import TableData from '../../components/TableData'
 import tableConfig from './tableConfig'
 import { putAdqAdAccountSyncByIds, getAdqAdAccountList } from '@/services/launchAdq/adq'
-
-function AdAccount(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 AdAccount(props:Props) {
+    let { accountId, adAccountId, userId,tableIdClick } = props
     let [selectedRowKeys,setSelectedRowKeys]=useState<any[]>([])
     // api方法
     const listAjax = useAjax((params) => getAdqAdAccountList(params), { formatResult: true })
@@ -42,12 +64,12 @@ function AdAccount(props: { accountId: string, adAccountId: string, userId: stri
     }, [adAccountId, listAjax,selectedRowKeys])
     return <div>
         <TableData
-            columns={tableConfig}
+            columns={()=>tableConfig(tableIdClick)}
             ajax={listAjax}
             syncAjax={sync}
             dataSource={listAjax?.data?.data?.records}
             loading={listAjax?.loading || syncAjax?.loading}
-            // scroll={{ x: 2500 }}
+            scroll={{ y:550 }}
             total={listAjax?.data?.data?.total}
             page={listAjax?.data?.data?.current}
             pageSize={listAjax?.data?.data?.size}

+ 14 - 2
src/pages/launchSystemNew/adq/adAccount/tableConfig.tsx

@@ -1,7 +1,17 @@
 import {  FundStatusEnum, } from '@/services/launchAdq/enum'
 import React from 'react'
 import { Badge } 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: 'ID',
@@ -20,7 +30,9 @@ function tableConfig():any{
             align: 'center',
             width:90,
             render:(a:string)=>{
-                return <a>{a}</a>
+                return <a onClick={() => {
+                    tableIdClick({ activeKey: '1', parma: { accountId: a } })
+                }}>{a}</a>
             }
         },
         {

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

@@ -5,10 +5,33 @@ 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 ,putAdqCampaignConfigStatus} 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))
@@ -46,23 +69,23 @@ function Campaign(props: { accountId: string, adAccountId: string, userId: strin
 
         })
     }, [adAccountId, listAjax])
-      // 启停
-      const switchHandle=useCallback((data,checked)=>{
-        let { accountId,campaignId}=data
+    // 启停
+    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=>{
+        switchAjax.run({ accountId, campaignId, configuredStatus }).then(res => {
             res && listAjax.refresh()
-            res ? message.success(checked?'开启计划成功!':'关闭计划成功!') : message.error(checked?'开启计划失败':'关闭计划失败!')
+            res ? message.success(checked ? '开启计划成功!' : '关闭计划成功!') : message.error(checked ? '开启计划失败' : '关闭计划失败!')
         })
-    },[])
+    }, [])
     return <div>
         <TableData
-             columns={()=>tableConfig(switchHandle)}
+            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}
@@ -96,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 => {

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

@@ -1,19 +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(switchHandle:(data:any,Status:any)=>void):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,b:any)=>{
-                return <Switch defaultChecked={b?.configuredStatus=== 'AD_STATUS_NORMAL'} onChange={(checked:boolean)=>{
-                    switchHandle(b,checked)
-                }}/> 
+            width: 50,
+            fixed: 'left',
+            render: (a: string, b: any) => {
+                return <Switch defaultChecked={b?.configuredStatus === 'AD_STATUS_NORMAL'} onChange={(checked: boolean) => {
+                    switchHandle(b, checked)
+                }} />
             }
         },
         {
@@ -21,10 +34,12 @@ function tableConfig(switchHandle:(data:any,Status:any)=>void):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>
             }
         },
         {
@@ -32,10 +47,12 @@ function tableConfig(switchHandle:(data:any,Status:any)=>void):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>
             }
         },
         {
@@ -43,78 +60,79 @@ function tableConfig(switchHandle:(data:any,Status:any)=>void):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]} />
             }
         },
     ]

+ 27 - 5
src/pages/launchSystemNew/adq/creative/index.tsx

@@ -6,9 +6,31 @@ 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}

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

@@ -1,15 +1,27 @@
-import {  LinkPageTypeEnum, PromotedObjectType } from '@/services/launchAdq/enum'
+import { LinkPageTypeEnum, PromotedObjectType } from '@/services/launchAdq/enum'
 import React from 'react'
-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>
             }
         },
         {
@@ -17,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>
             }
         },
         {
@@ -27,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>
             }
         },
         // {
@@ -57,6 +73,7 @@ function tableConfig(): any {
             title: '创意名称',
             dataIndex: 'adcreativeName',
             key: 'adcreativeName',
+            width: 250,
             align: 'center',
         },
         // {

+ 99 - 19
src/pages/launchSystemNew/adq/index.tsx

@@ -1,5 +1,5 @@
-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';
@@ -14,8 +14,8 @@ import { useModel } from 'umi';
 const { TabPane } = Tabs;
 let Menus: any = Menu
 const tabsConfig = [
-    { key: '1', tab: '账户信息', jsx:(props: any) => <AdAccount {...props} />},
-    { 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} /> },
@@ -26,12 +26,38 @@ function Adq() {
     const allOfMember = useAjax(() => getAdAccountAllOfMember(), { formatResult: true })
     const [userAll, setUserAll] = useState([])
     const [activeKey, setActiveKey] = useState('1')
-    const [userId, setUserId] = useState<any>('1'||userInfo?.userId?.toString())
+    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) {
@@ -53,13 +79,23 @@ 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])
     return <Row style={{ position: 'relative' }}>
         <Col style={{ height: '100%', overflowY: 'auto', position: 'absolute', left: 0, top: 0, bottom: 0, width: 150, background: '#fff' }}>
             <Menus
@@ -76,18 +112,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>
@@ -98,7 +140,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}

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

@@ -8,7 +8,7 @@ function tableConfig(): any {
             dataIndex: 'accountId',
             key: 'accountId',
             align: 'center',
-            width:70,
+            width:100,
             render:(a:string)=>{
                 return <a>{a}</a>
             }

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

@@ -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}

+ 1 - 1
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>
             }

+ 1 - 1
src/services/launchAdq/adq.ts

@@ -200,7 +200,7 @@ export async function getAdqTargetingList(params: {
  */
  export async function putAdqAdgroupsConfigStatus(params: any) {
    let {accountId,adgroupId,configuredStatus}=params
-  return request(api + `/adq/campaign/configStatus/${accountId}/${adgroupId}/${configuredStatus}`, {
+  return request(api + `/adq/adgroups/configStatus/${accountId}/${adgroupId}/${configuredStatus}`, {
     method: 'PUT',
   });
 }