wjx 2 years ago
parent
commit
7cbd7574d6

+ 3 - 1
src/models/useLaunchAdq/useAdAuthorize.ts

@@ -1,11 +1,12 @@
 import { useAjax } from '@/Hook/useAjax'
-import { getAdAccountApi } from '@/services/launchAdq/adAuthorize'
+import { getAdAccountApi, getAllUserAccountApi } from '@/services/launchAdq/adAuthorize'
 import { getGroupListApi } from '@/services/launchAdq/subgroup'
 
 
 export default function useAdAuthorize() {
 
     const getAdAccount = useAjax(() => getAdAccountApi(), { formatResult: true })
+    const getAllUserAccount = useAjax(() => getAllUserAccountApi(), { formatResult: true })
 
     /** 所有分组列表 */
     const getGroupList = useAjax(() => getGroupListApi())
@@ -22,6 +23,7 @@ export default function useAdAuthorize() {
 
     return {
         getAdAccount,
+        getAllUserAccount,
         getGroupList,
         groupListInit,
         groupRefresh

File diff suppressed because it is too large
+ 12 - 5
src/pages/adMonitor/adMonitorList/components/box.tsx


+ 158 - 307
src/pages/launchSystemNew/adq/ad/index.tsx

@@ -5,7 +5,7 @@ import { Col, Row, Input, Select, message, Space, Button, Popconfirm, Switch, no
 import React, { useEffect, useCallback, useState } from 'react'
 import TableData from '../../components/TableData'
 import tableConfig from './tableConfig'
-import { putAdqAdgroupsSync, getAdqAdgroupsList, delListAdqAdgroupsApi, newEditAdqAdgroupsDataApi, editAdqAdgroupsDataApi ,putAdqAdgroupsSyncBatch} from '@/services/launchAdq/adq'
+import { putAdqAdgroupsSync, getAdqAdgroupsList, delListAdqAdgroupsApi, newEditAdqAdgroupsDataApi, editAdqAdgroupsDataApi, putAdqAdgroupsSyncBatch } from '@/services/launchAdq/adq'
 import { CopyOutlined, DeleteOutlined, FieldTimeOutlined, PauseCircleOutlined, PlayCircleOutlined, SyncOutlined, TransactionOutlined } from '@ant-design/icons'
 import UpdateAd from './updateAd'
 import Copy from './copy'
@@ -92,10 +92,7 @@ const Ad: React.FC<Props> = (props) => {
         memoList?: any[]
         remarkList?: any[]
     }) => {
-        if (!params.adgroupName || params.adgroupName !== listAjax?.params[0]?.adgroupName) {
-            !params.adgroupName && delete params.adgroupName
-            listAjax.run({ ...params, userId })
-        }
+        listAjax.run({ ...params, userId })
     }, [userId, listAjax])
     // 同步 
     const sync = useCallback(() => {
@@ -161,13 +158,13 @@ const Ad: React.FC<Props> = (props) => {
         })
     }
     //同步广告
-    const syncAd=useCallback(()=>{
-        putAdqAdgroupsSyncBatchApi.run({adgroupIds:selectedRows?.map(item=>item.adgroupId)}).then(res=>{
-            if(res){
+    const syncAd = useCallback(() => {
+        putAdqAdgroupsSyncBatchApi.run({ adgroupIds: selectedRows?.map(item => item.adgroupId) }).then(res => {
+            if (res) {
                 message.success('同步成功!')
             }
         })
-    },[selectedRows])
+    }, [selectedRows])
     // 批量复制
     const copyHandle = () => {
         setCopyData({ visible: true })
@@ -203,6 +200,158 @@ const Ad: React.FC<Props> = (props) => {
         />}
         {/* 复制广告 */}
         {copyData.visible && <Copy selectedRows={selectedRows} {...copyData} onClose={() => setCopyData({ visible: false })} onChange={() => { setCopyData({ visible: false }); listAjax.refresh(); setSelectedRows([]) }} />}
+        <Row gutter={[6, 6]} align='middle' style={{marginBottom:15}}>
+            <Col>
+                <Input
+                    placeholder='广告账号'
+                    allowClear
+                    style={{ width: 120 }}
+                    onChange={(e) => {
+                        let value = e.target.value
+                        let arr: any = []
+                        if (value) {
+                            value = value.replace(/[,,\s]/g, ',')
+                            arr = value.split(',').filter((a: any) => a)
+                        }
+                        set_queryFrom({ ...queryFrom, accountIdList: arr })
+                    }}
+                />
+            </Col>
+            <Col>
+                <Input
+                    placeholder='广告名称'
+                    allowClear
+                    style={{ width: 120 }}
+                    onChange={(e) => {
+                        let value = e.target.value
+                        set_queryFrom({ ...queryFrom, adgroupName: value })
+                    }}
+                />
+            </Col>
+            <Col>
+                <Input
+                    placeholder='广告ID'
+                    allowClear
+                    style={{ width: 120 }}
+                    onChange={(e) => {
+                        let value = e.target.value
+                        let arr: any = []
+                        if (value) {
+                            value = value.replace(/[,,\s]/g, ',')
+                            arr = value.split(',').filter((a: any) => a)
+                        }
+                        set_queryFrom({ ...queryFrom, adgroupIdList: arr })
+                    }}
+                />
+            </Col>
+            <Col>
+                <Input
+                    placeholder='计划ID'
+                    allowClear
+                    style={{ width: 120 }}
+                    onChange={(e) => {
+                        let value = e.target.value
+                        let arr: any = []
+                        if (value) {
+                            value = value.replace(/[,,\s]/g, ',')
+                            arr = value.split(',').filter((a: any) => a)
+                        }
+                        set_queryFrom({ ...queryFrom, campaignIdList: arr })
+                    }}
+                />
+            </Col>
+            <Col>
+                <Select
+                    placeholder='推广目标选择'
+                    style={{ width: 120 }}
+                    showSearch
+                    filterOption={(input: any, option: any) =>
+                        (option!.children as unknown as string).toLowerCase().includes(input.toLowerCase())
+                    }
+                    allowClear
+                    onChange={(value: any) => {
+                        set_queryFrom({ ...queryFrom, promotedObjectType: value })
+                    }}
+                >
+                    {Object.keys(PromotedObjectType).map(key => {
+                        return <Select.Option value={key} key={key}>{PromotedObjectType[key]}</Select.Option>
+                    })}
+                </Select>
+            </Col>
+            <Col>
+                <Select
+                    placeholder='是否已删除'
+                    style={{ width: 120 }}
+                    showSearch
+                    filterOption={(input: any, option: any) =>
+                        (option!.children as unknown as string).toLowerCase().includes(input.toLowerCase())
+                    }
+                    allowClear
+                    onChange={(value: any) => {
+                        set_queryFrom({ ...queryFrom, isDeleted: value })
+                    }}
+                >
+                    <Select.Option value={true}>已删除</Select.Option>
+                    <Select.Option value={false}>未删除</Select.Option>
+                </Select>
+            </Col>
+            <Col>
+                <Select
+                    placeholder='广告状态'
+                    mode="multiple"
+                    style={{ width: 120 }}
+                    showSearch
+                    filterOption={(input: any, option: any) =>
+                        (option!.children as unknown as string).toLowerCase().includes(input.toLowerCase())
+                    }
+                    allowClear
+                    onChange={(value: any) => {
+                        set_queryFrom({ ...queryFrom, statusList: value })
+                    }}
+                >
+                    {
+                        Object.keys(AdStatusEnum).map(key => {
+                            return <Select.Option value={key} key={key}>{AdStatusEnum[key]}</Select.Option>
+                        })
+                    }
+                </Select>
+            </Col>
+            <Col>
+                <Input
+                    placeholder='腾讯备注'
+                    allowClear
+                    style={{ width: 120 }}
+                    onChange={(e) => {
+                        let value = e.target.value
+                        let arr: any = []
+                        if (value) {
+                            value = value.replace(/[,,\s]/g, ',')
+                            arr = value.split(',').filter((a: any) => a)
+                        }
+                        set_queryFrom({ ...queryFrom, memoList: arr })
+                    }}
+                />
+            </Col>
+            <Col>
+                <Input
+                    placeholder='本地备注'
+                    allowClear
+                    style={{ width: 120 }}
+                    onChange={(e) => {
+                        let value = e.target.value
+                        let arr: any = []
+                        if (value) {
+                            value = value.replace(/[,,\s]/g, ',')
+                            arr = value.split(',').filter((a: any) => a)
+                        }
+                        set_queryFrom({ ...queryFrom, remarkList: arr })
+                    }}
+                />
+            </Col>
+            <Col>
+                <Button type='primary' onClick={() => getList({ ...queryFrom, pageNum: 1 })}> 搜索</Button>
+            </Col>
+        </Row>
         <TableData
             isCard={false}
             columns={() => tableConfig(onChange, details, handleSave, tableIdClick)}
@@ -220,304 +369,6 @@ const Ad: React.FC<Props> = (props) => {
             config={txAdConfig}
             configName="腾讯广告"
             leftChild={<Space direction='vertical'>
-                <Row gutter={[6, 6]} align='middle'>
-                    <Col>
-                        <Input
-                            placeholder='广告账号'
-                            allowClear
-                            style={{ width: 120 }}
-                            onBlur={(e) => {
-                                let value = e.target.value
-                                let arr: any = []
-                                if (value) {
-                                    value = value.replace(/[,,\s]/g, ',')
-                                    arr = value.split(',').filter(a => a)
-                                }
-                                set_queryFrom({ ...queryFrom, accountIdList: arr })
-                                getList({ ...queryFrom, pageNum: 1, accountIdList: arr })
-                            }}
-                            onKeyDownCapture={(e: any) => {
-                                let key = e.key
-                                if (key === 'Enter') {
-                                    let value = e.target.value
-                                    let arr: any = []
-                                    if (value) {
-                                        value = value.replace(/[,,\s]/g, ',')
-                                        arr = value.split(',').filter((a: any) => a)
-                                    }
-                                    set_queryFrom({ ...queryFrom, accountIdList: arr })
-                                    getList({ ...queryFrom, pageNum: 1, accountIdList: arr })
-                                }
-                            }}
-                            onChange={(e) => {
-                                let value = e.target.value
-                                if (!value) {
-                                    let arr: any = []
-                                    if (value) {
-                                        value = value.replace(/[,,\s]/g, ',')
-                                        arr = value.split(',').filter((a: any) => a)
-                                    }
-                                    set_queryFrom({ ...queryFrom, accountIdList: arr })
-                                    getList({ ...queryFrom, pageNum: 1, accountIdList: arr })
-                                }
-                            }}
-                        />
-                    </Col>
-                    <Col>
-                        <Input
-                            placeholder='广告名称'
-                            allowClear
-                            style={{ width: 120 }}
-                            onBlur={(e) => {
-                                let value = e.target.value
-                                set_queryFrom({ ...queryFrom, adgroupName: value })
-                                getList({ ...queryFrom, pageNum: 1, adgroupName: value })
-                            }}
-                            onKeyDownCapture={(e: any) => {
-                                let key = e.key
-                                if (key === 'Enter') {
-                                    let value = e.target.value
-                                    set_queryFrom({ ...queryFrom, adgroupName: value })
-                                    getList({ ...queryFrom, pageNum: 1, adgroupName: value })
-                                }
-                            }}
-                            onChange={(e) => {
-                                let value = e.target.value
-                                if (!value) {
-                                    set_queryFrom({ ...queryFrom, adgroupName: value })
-                                    getList({ ...queryFrom, pageNum: 1, adgroupName: value })
-                                }
-                            }}
-                        />
-                    </Col>
-                    <Col>
-                        <Input
-                            placeholder='广告ID'
-                            allowClear
-                            style={{ width: 120 }}
-                            onBlur={(e) => {
-                                let value = e.target.value
-                                let arr: any = []
-                                if (value) {
-                                    value = value.replace(/[,,\s]/g, ',')
-                                    arr = value.split(',').filter((a: any) => a)
-                                }
-                                set_queryFrom({ ...queryFrom, adgroupIdList: arr })
-                                getList({ ...queryFrom, pageNum: 1, adgroupIdList: arr })
-                            }}
-                            onKeyDownCapture={(e: any) => {
-                                let key = e.key
-                                if (key === 'Enter') {
-                                    let value = e.target.value
-                                    let arr: any = []
-                                    if (value) {
-                                        value = value.replace(/[,,\s]/g, ',')
-                                        arr = value.split(',').filter((a: any) => a)
-                                    }
-                                    set_queryFrom({ ...queryFrom, adgroupIdList: arr })
-                                    getList({ ...queryFrom, pageNum: 1, adgroupIdList: arr })
-                                }
-                            }}
-                            onChange={(e) => {
-                                let value = e.target.value
-                                if (!value) {
-                                    let arr: any = []
-                                    if (value) {
-                                        value = value.replace(/[,,\s]/g, ',')
-                                        arr = value.split(',').filter((a: any) => a)
-                                    }
-                                    set_queryFrom({ ...queryFrom, adgroupIdList: arr })
-                                    getList({ ...queryFrom, pageNum: 1, adgroupIdList: arr })
-                                }
-                            }}
-                        />
-                    </Col>
-                    <Col>
-                        <Input
-                            placeholder='计划ID'
-                            allowClear
-                            style={{ width: 120 }}
-                            onBlur={(e) => {
-                                let value = e.target.value
-                                let arr: any = []
-                                if (value) {
-                                    value = value.replace(/[,,\s]/g, ',')
-                                    arr = value.split(',').filter((a: any) => a)
-                                }
-                                set_queryFrom({ ...queryFrom, campaignIdList: arr })
-                                getList({ ...queryFrom, pageNum: 1, campaignIdList: arr })
-                            }}
-                            onKeyDownCapture={(e: any) => {
-                                let key = e.key
-                                if (key === 'Enter') {
-                                    let value = e.target.value
-                                    let arr: any = []
-                                    if (value) {
-                                        value = value.replace(/[,,\s]/g, ',')
-                                        arr = value.split(',').filter((a: any) => a)
-                                    }
-                                    set_queryFrom({ ...queryFrom, campaignIdList: arr })
-                                    getList({ ...queryFrom, pageNum: 1, campaignIdList: arr })
-                                }
-                            }}
-                            onChange={(e) => {
-                                let value = e.target.value
-                                if (!value) {
-                                    let arr: any = []
-                                    if (value) {
-                                        value = value.replace(/[,,\s]/g, ',')
-                                        arr = value.split(',').filter((a: any) => a)
-                                    }
-                                    set_queryFrom({ ...queryFrom, campaignIdList: arr })
-                                    getList({ ...queryFrom, pageNum: 1, campaignIdList: arr })
-                                }
-                            }}
-                        />
-                    </Col>
-                    <Col>
-                        <Select
-                            placeholder='推广目标选择'
-                            style={{ width: 120 }}
-                            showSearch
-                            filterOption={(input: any, option: any) =>
-                                (option!.children as unknown as string).toLowerCase().includes(input.toLowerCase())
-                            }
-                            allowClear
-                            onChange={(value: any) => {
-                                set_queryFrom({ ...queryFrom, promotedObjectType: value })
-                                getList({ ...queryFrom, pageNum: 1, promotedObjectType: value })
-                            }}
-                        >
-                            {Object.keys(PromotedObjectType).map(key => {
-                                return <Select.Option value={key} key={key}>{PromotedObjectType[key]}</Select.Option>
-                            })}
-                        </Select>
-                    </Col>
-                    <Col>
-                        <Select
-                            placeholder='是否已删除'
-                            style={{ width: 120 }}
-                            showSearch
-                            filterOption={(input: any, option: any) =>
-                                (option!.children as unknown as string).toLowerCase().includes(input.toLowerCase())
-                            }
-                            allowClear
-                            onChange={(value: any) => {
-                                set_queryFrom({ ...queryFrom, isDeleted: value })
-                                getList({ ...queryFrom, pageNum: 1, isDeleted: value })
-                            }}
-                        >
-                            <Select.Option value={true}>已删除</Select.Option>
-                            <Select.Option value={false}>未删除</Select.Option>
-                        </Select>
-                    </Col>
-                    <Col>
-                        <Select
-                            placeholder='广告状态'
-                            mode="multiple"
-                            style={{ width: 120 }}
-                            showSearch
-                            filterOption={(input: any, option: any) =>
-                                (option!.children as unknown as string).toLowerCase().includes(input.toLowerCase())
-                            }
-                            allowClear
-                            onChange={(value: any) => {
-                                set_queryFrom({ ...queryFrom, statusList: value })
-                                getList({ ...queryFrom, pageNum: 1, statusList: value })
-                            }}
-                        >
-                            {
-                                Object.keys(AdStatusEnum).map(key => {
-                                    return <Select.Option value={key} key={key}>{AdStatusEnum[key]}</Select.Option>
-                                })
-                            }
-                        </Select>
-                    </Col>
-                    <Col>
-                        <Input
-                            placeholder='腾讯备注'
-                            allowClear
-                            style={{ width: 120 }}
-                            onBlur={(e) => {
-                                let value = e.target.value
-                                let arr: any = []
-                                if (value) {
-                                    value = value.replace(/[,,\s]/g, ',')
-                                    arr = value.split(',').filter(a => a)
-                                }
-                                set_queryFrom({ ...queryFrom, memoList: arr })
-                                getList({ ...queryFrom, pageNum: 1, memoList: arr })
-                            }}
-                            onKeyDownCapture={(e: any) => {
-                                let key = e.key
-                                if (key === 'Enter') {
-                                    let value = e.target.value
-                                    let arr: any = []
-                                    if (value) {
-                                        value = value.replace(/[,,\s]/g, ',')
-                                        arr = value.split(',').filter((a: any) => a)
-                                    }
-                                    set_queryFrom({ ...queryFrom, memoList: arr })
-                                    getList({ ...queryFrom, pageNum: 1, memoList: arr })
-                                }
-                            }}
-                            onChange={(e) => {
-                                let value = e.target.value
-                                if (!value) {
-                                    let arr: any = []
-                                    if (value) {
-                                        value = value.replace(/[,,\s]/g, ',')
-                                        arr = value.split(',').filter((a: any) => a)
-                                    }
-                                    set_queryFrom({ ...queryFrom, memoList: arr })
-                                    getList({ ...queryFrom, pageNum: 1, memoList: arr })
-                                }
-                            }}
-                        />
-                    </Col>
-                    <Col>
-                        <Input
-                            placeholder='本地备注'
-                            allowClear
-                            style={{ width: 120 }}
-                            onBlur={(e) => {
-                                let value = e.target.value
-                                let arr: any = []
-                                if (value) {
-                                    value = value.replace(/[,,\s]/g, ',')
-                                    arr = value.split(',').filter(a => a)
-                                }
-                                set_queryFrom({ ...queryFrom, remarkList: arr })
-                                getList({ ...queryFrom, pageNum: 1, remarkList: arr })
-                            }}
-                            onKeyDownCapture={(e: any) => {
-                                let key = e.key
-                                if (key === 'Enter') {
-                                    let value = e.target.value
-                                    let arr: any = []
-                                    if (value) {
-                                        value = value.replace(/[,,\s]/g, ',')
-                                        arr = value.split(',').filter((a: any) => a)
-                                    }
-                                    set_queryFrom({ ...queryFrom, remarkList: arr })
-                                    getList({ ...queryFrom, pageNum: 1, remarkList: arr })
-                                }
-                            }}
-                            onChange={(e) => {
-                                let value = e.target.value
-                                if (!value) {
-                                    let arr: any = []
-                                    if (value) {
-                                        value = value.replace(/[,,\s]/g, ',')
-                                        arr = value.split(',').filter((a: any) => a)
-                                    }
-                                    set_queryFrom({ ...queryFrom, remarkList: arr })
-                                    getList({ ...queryFrom, pageNum: 1, remarkList: arr })
-                                }
-                            }}
-                        />
-                    </Col>
-                </Row>
                 <Row gutter={[10, 10]} align='middle'>
                     <Col>
                         <Switch checkedChildren="普通模式" unCheckedChildren="深度优化" checked={model} onChange={(checked) => { setModel(checked); setSelectedRows([]) }} style={model ? {} : { background: '#67c23a' }} />

+ 7 - 11
src/pages/launchSystemNew/adq/ad/tableConfig.tsx

@@ -45,9 +45,11 @@ function tableConfig(
             ellipsis: true,
             render: (a: string) => {
                 return <Space>
-                    <a onClick={() => copy(a)} style={{color:'#00bcd4'}}><CopyOutlined /></a><a onClick={() => {
+                    <a onClick={() => copy(a)} >{a}</a>
+                    {/* <a onClick={() => {
                         tableIdClick({ activeKey: '1', parma: { accountId: a } })
-                    }}>{a}</a>
+                    }}>{a} */}
+                    {/* </a> */}
                 </Space>
             }
         },
@@ -76,10 +78,7 @@ function tableConfig(
             ellipsis: true,
             render: (a: string, b: any) => {
                 return <Space>
-                    <a onClick={() => copy(a)} style={{color:'#00bcd4'}}><CopyOutlined /></a>
-                    <a onClick={() => {
-                        tableIdClick({ activeKey: '3', parma: { adgroupId: a } })
-                    }}>{a}</a>
+                    <a onClick={() => copy(a)} >{a}</a>
                 </Space>
             }
         },
@@ -92,10 +91,7 @@ function tableConfig(
             ellipsis: true,
             render: (a: string, b: any) => {
                 return <Space >
-                    <a onClick={() => copy(a)} style={{color:'#00bcd4'}}><CopyOutlined /></a>
-                    <a onClick={() => {
-                        tableIdClick({ activeKey: '2', parma: { campaignId: a } })
-                    }}>{a}</a>
+                    <a onClick={() => copy(a)} >{a}</a>
                 </Space>
             }
         },
@@ -106,7 +102,7 @@ function tableConfig(
             width: 280,
             ellipsis: true,
             render: (a: string, b: any) => {
-                return <InputUpdate title={a} dataIndex={'adgroupName'} record={b} handleSave={handleSave}/>
+                return <InputUpdate title={a} dataIndex={'adgroupName'} record={b} handleSave={handleSave} />
             }
         },
         {

+ 15 - 37
src/pages/launchSystemNew/adq/adAccount/index.tsx

@@ -1,6 +1,6 @@
 
 import { useAjax } from '@/Hook/useAjax'
-import { Row, message, Input } from 'antd'
+import { Row, message, Input, Space, Button } from 'antd'
 import React, { useEffect, useState, useCallback } from 'react'
 import TableData from '../../components/TableData'
 import tableConfig from './tableConfig'
@@ -30,25 +30,24 @@ type Props = {
     }) => void
 }
 function AdAccount(props: Props) {
-    let { adAccountId, userId ,tableIdClick} = props
+    let { adAccountId, accountId, userId, tableIdClick, queryParmas } = props
     let [selectedRowKeys, setSelectedRowKeys] = useState<any[]>([])
     const [queryForm, setQueryForm] = useState<{
         pageNum: number;
         pageSize: number;
-        accountIds?: string;
+        accountIds: any[];
         adcreativeName?: string;
-    }>({pageNum: 1, pageSize: 20})
+    }>({ pageNum: 1, pageSize: 20, accountIds: [] })
     // api方法
     const listAjax = useAjax((params) => getAdAccountListApi(params), { formatResult: true })
     const syncAjax = useAjax((params) => putAdqAdAccountSyncByIds(params))
-    console.log('创意=====》')
     useEffect(() => {
-        getList()
-    }, [queryForm, userId])
+        getList(queryForm)
+    }, [accountId])
     // 获取列表
-    const getList = useCallback(() => {
-        listAjax.run({ ...queryForm, putUserId: userId })
-    }, [queryForm, userId, listAjax])
+    const getList = useCallback((params?: any) => {
+        listAjax.run({ ...params, putUserId: userId })
+    }, [userId, listAjax])
     // 同步 
     const sync = useCallback(() => {
         if (selectedRowKeys?.length === 0) {
@@ -74,45 +73,23 @@ function AdAccount(props: Props) {
             page={listAjax?.data?.data?.current}
             pageSize={listAjax?.data?.data?.size}
             leftChild={<>
-                <Row gutter={[10, 10]}>
+                <Space>
                     <Input
                         placeholder='广告账号'
                         allowClear
                         style={{ width: 150 }}
-                        onBlur={(e) => {
+                        onChange={(e) => {
                             let value = e.target.value
                             let arr: any = []
                             if (value) {
                                 value = value.replace(/[,,\s]/g, ',')
-                                arr = value.split(',').filter(a => a)
+                                arr = value.split(',').filter((a: any) => a)
                             }
                             setQueryForm({ ...queryForm, accountIds: arr })
                         }}
-                        onKeyDownCapture={(e: any) => {
-                            let key = e.key
-                            if (key === 'Enter') {
-                                let value = e.target.value
-                                let arr: any = []
-                                if (value) {
-                                    value = value.replace(/[,,\s]/g, ',')
-                                    arr = value.split(',').filter((a: any) => a)
-                                }
-                                setQueryForm({ ...queryForm, accountIds: arr })
-                            }
-                        }}
-                        onChange={(e) => {
-                            let value = e.target.value
-                            if (!value) {
-                                let arr: any = []
-                                if (value) {
-                                    value = value.replace(/[,,\s]/g, ',')
-                                    arr = value.split(',').filter((a: any) => a)
-                                }
-                                setQueryForm({ ...queryForm, accountIds: arr })
-                            }
-                        }}
                     />
-                </Row>
+                    <Button type='primary' onClick={() => { getList({ ...queryForm, pageNum: 1 }) }}>搜索</Button>
+                </Space>
             </>}
             rowSelection={{
                 onChange: (selectedRowKeys: React.Key[], selectedRows: any[]) => {
@@ -123,6 +100,7 @@ function AdAccount(props: Props) {
                 let { sortData, pagination } = props
                 let { current, pageSize } = pagination
                 setQueryForm({ ...queryForm, pageNum: current, pageSize })
+                getList({ ...queryForm, pageNum: current, pageSize })
             }}
         />
     </div>

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

@@ -20,8 +20,7 @@ function tableConfig(tableIdClick: any): any {
             width: 90,
             render: (a: string) => {
                 return <Space>
-                    <a onClick={() => copy(a)} style={{ color: '#00bcd4' }}><CopyOutlined /></a>
-                    <a onClick={() => tableIdClick({ activeKey: '1', parma: { accountId: a } })}>{a}</a>
+                     <a onClick={() => copy(a)} >{a}</a>
                 </Space>
             }
         },

+ 26 - 81
src/pages/launchSystemNew/adq/campaign/index.tsx

@@ -1,7 +1,7 @@
 
 import { useAjax } from '@/Hook/useAjax'
 import { CampaignTypeEnum, ConfiguredStatusEnum, PromotedObjectType } from '@/services/launchAdq/enum'
-import { Col, Row, Input, Select, message } from 'antd'
+import { Col, Row, Input, Select, message, Button } from 'antd'
 import React, { useEffect, useCallback, useState } from 'react'
 import TableData from '../../components/TableData'
 import tableConfig from './tableConfig'
@@ -19,7 +19,8 @@ type Props = {
         targetingId?: string,//定向ID}
     },
     tableIdClick: (props: {
-        activeKey: string, parma: {
+        activeKey: string,
+        parma: {
             accountId?: string,//账户ID
             campaignId?: string,//计划ID
             adgroupId?: string,//广告ID
@@ -36,7 +37,7 @@ function Campaign(props: Props) {
     const listAjax = useAjax((params) => getAdqCampaignList(params), { formatResult: true })
     const syncAjax = useAjax((adAccountId) => putAdqCampaignPage(adAccountId))
     const switchAjax = useAjax((params) => putAdqCampaignConfigStatus(params))
-    const [queryFrom,set_queryFrom]=useState<{
+    const [queryFrom, set_queryFrom] = useState<{
         pageNum: number;
         pageSize: number;
         userId?: string;//用户ID
@@ -46,28 +47,18 @@ function Campaign(props: Props) {
         configuredStatus?: string;//计划状态
         campaignType?: string;//计划类型
         promotedObjectType?: string;//推广目标类型
-    }>({pageNum:1,pageSize:20})
-    console.log('创意=====》')
+    }>({ pageNum: 1, pageSize: 20 })
+    console.log('计划=====》')
     useEffect(() => {
-        getList({ pageNum: 1, pageSize: 20, accountId, ...queryParmas })
-    }, [accountId, userId, queryParmas])
+        getList({ pageSize: 20, pageNum: 1, accountId: queryParmas.accountId, campaignId: queryParmas.campaignId })
+    }, [userId, queryParmas.accountId, queryParmas.campaignId])
     // 获取列表
-    const getList = useCallback((params: {
-        pageNum: number;
-        pageSize: number;
-        userId?: string;//用户ID
-        accountId?: string;//账号本地ID
-        campaignName?: string;//计划名称
-        campaignId?: string;//计划ID
-        configuredStatus?: string;//计划状态
-        campaignType?: string;//计划类型
-        promotedObjectType?: string;//推广目标类型
-    }) => {
-        if (!params.campaignName || params.campaignName !== listAjax?.params[0]?.adcreativeName) {
-            !params.campaignName && delete params.campaignName
-        }
+    const getList = useCallback((params: any) => {
+        // if (!params.campaignName || params.campaignName !== listAjax?.params[0]?.adcreativeName) {
+        //     !params.campaignName && delete params.campaignName
+        // }
         listAjax.run({ ...params, userId })
-    }, [userId, listAjax])
+    }, [userId, listAjax,])
     // 同步 
     const sync = useCallback(() => {
         if (!adAccountId) {
@@ -110,25 +101,10 @@ function Campaign(props: Props) {
                             placeholder='广告账号'
                             allowClear
                             style={{ width: 150 }}
-                            onBlur={(e) => {
-                                let value = e.target.value
-                                set_queryFrom({...queryFrom,accountId: value})
-                                getList({...queryFrom, pageNum: 1,  accountId: value })
-                            }}
-                            onKeyDownCapture={(e: any) => {
-                                let key = e.key
-                                if (key === 'Enter') {
-                                    let value = e.target.value
-                                    set_queryFrom({...queryFrom,accountId: value})
-                                    getList({ ...queryFrom,pageNum: 1, accountId: value })
-                                }
-                            }}
                             onChange={(e) => {
                                 let value = e.target.value
-                                if (!value) {
-                                    set_queryFrom({...queryFrom,accountId: value})
-                                    getList({ ...queryFrom,pageNum: 1,accountId: value })
-                                }
+                                set_queryFrom({ ...queryFrom, accountId: value })
+                                tableIdClick({ activeKey: '1', parma: { accountId: '' } })
                             }}
                         />
                     </Col>
@@ -137,25 +113,9 @@ function Campaign(props: Props) {
                             placeholder='计划名称'
                             allowClear
                             style={{ width: 150 }}
-                            onBlur={(e) => {
-                                let value = e.target.value
-                                set_queryFrom({...queryFrom,campaignName: value})
-                                getList({ ...queryFrom,pageNum: 1, campaignName: value })
-                            }}
-                            onKeyDownCapture={(e: any) => {
-                                let key = e.key
-                                if (key === 'Enter') {
-                                    let value = e.target.value
-                                    set_queryFrom({...queryFrom,campaignName: value})
-                                    getList({ ...queryFrom,pageNum: 1,  campaignName: value })
-                                }
-                            }}
                             onChange={(e) => {
                                 let value = e.target.value
-                                if (!value) {
-                                    set_queryFrom({...queryFrom,campaignName: value})
-                                    getList({ ...queryFrom,pageNum: 1,campaignName: value })
-                                }
+                                set_queryFrom({ ...queryFrom, campaignName: value })
                             }}
                         />
                     </Col>
@@ -164,25 +124,10 @@ function Campaign(props: Props) {
                             placeholder='计划ID'
                             allowClear
                             style={{ width: 150 }}
-                            onBlur={(e) => {
-                                let value = e.target.value
-                                set_queryFrom({...queryFrom,campaignId: value})
-                                getList({...queryFrom, pageNum: 1, campaignId: value })
-                            }}
-                            onKeyDownCapture={(e: any) => {
-                                let key = e.key
-                                if (key === 'Enter') {
-                                    let value = e.target.value
-                                    set_queryFrom({...queryFrom,campaignId: value})
-                                    getList({ ...queryFrom,pageNum: 1,  campaignId: value })
-                                }
-                            }}
                             onChange={(e) => {
                                 let value = e.target.value
-                                if (!value) {
-                                    set_queryFrom({...queryFrom,campaignId: value})
-                                    getList({...queryFrom, pageNum: 1,  campaignId: value })
-                                }
+                                set_queryFrom({ ...queryFrom, campaignId: value })
+                                tableIdClick({ activeKey: '2', parma: { campaignId: '' } })
                             }}
                         />
                     </Col>
@@ -190,8 +135,7 @@ function Campaign(props: Props) {
                         <Select placeholder='推广目标选择' style={{ minWidth: 150 }} showSearch filterOption={(input: any, option: any) =>
                             (option!.children as unknown as string).toLowerCase().includes(input.toLowerCase())
                         } allowClear onChange={(value: any) => {
-                            set_queryFrom({...queryFrom,promotedObjectType: value})
-                            getList({...queryFrom, pageNum: 1, promotedObjectType: value })
+                            set_queryFrom({ ...queryFrom, promotedObjectType: value })
                         }}>
                             {
                                 Object.keys(PromotedObjectType).map(key => {
@@ -205,8 +149,7 @@ function Campaign(props: Props) {
                         <Select placeholder='计划状态' style={{ minWidth: 150 }} showSearch filterOption={(input: any, option: any) =>
                             (option!.children as unknown as string).toLowerCase().includes(input.toLowerCase())
                         } allowClear onChange={(value: any) => {
-                            set_queryFrom({...queryFrom,configuredStatus: value})
-                            getList({ ...queryFrom,pageNum: 1,  configuredStatus: value })
+                            set_queryFrom({ ...queryFrom, configuredStatus: value })
                         }}>
                             {
                                 Object.keys(ConfiguredStatusEnum).map(key => {
@@ -220,8 +163,7 @@ function Campaign(props: Props) {
                         <Select placeholder='计划类型' style={{ minWidth: 150 }} showSearch filterOption={(input: any, option: any) =>
                             (option!.children as unknown as string).toLowerCase().includes(input.toLowerCase())
                         } allowClear onChange={(value: any) => {
-                            set_queryFrom({...queryFrom,campaignType: value})
-                            getList({...queryFrom, pageNum: 1,  campaignType: value })
+                            set_queryFrom({ ...queryFrom, campaignType: value })
                         }}>
                             {
                                 Object.keys(CampaignTypeEnum).map(key => {
@@ -232,13 +174,16 @@ function Campaign(props: Props) {
                             }
                         </Select>
                     </Col>
+                    <Col>
+                        <Button type='primary' onClick={() => { getList({ ...queryFrom, pageNum: 1 }) }}>搜索</Button>
+                    </Col>
                 </Row>
             </>}
             onChange={(props: any) => {
                 let { sortData, pagination } = props
                 let { current, pageSize } = pagination
-                set_queryFrom({...queryFrom,pageNum:current,pageSize})
-                getList({ ...queryFrom,pageNum: current, pageSize })
+                set_queryFrom({ ...queryFrom, pageNum: current, pageSize })
+                getList({ ...queryFrom, pageNum: current, pageSize })
             }}
         />
     </div>

+ 2 - 8
src/pages/launchSystemNew/adq/campaign/tableConfig.tsx

@@ -41,10 +41,7 @@ function tableConfig(
             ellipsis: true,
             render: (a: string) => {
                 return <Space>
-                    <a onClick={() => copy(a)} style={{ color: '#00bcd4' }}><CopyOutlined /></a>
-                    <a onClick={() => {
-                        tableIdClick({ activeKey: '1', parma: { accountId: a } })
-                    }}>{a}</a>
+                   <a onClick={() => copy(a)} >{a}</a>
                 </Space>
             }
         },
@@ -58,10 +55,7 @@ function tableConfig(
             ellipsis: true,
             render: (a: string) => {
                 return <Space>
-                    <a onClick={() => copy(a)} style={{ color: '#00bcd4' }}><CopyOutlined /></a>
-                    <a onClick={() => {
-                        tableIdClick({ activeKey: '2', parma: { campaignId: a } })
-                    }}>{a}</a>
+                   <a onClick={() => copy(a)} >{a}</a>
                 </Space>
             }
         },

+ 11 - 59
src/pages/launchSystemNew/adq/creative/index.tsx

@@ -1,7 +1,7 @@
 
 import { useAjax } from '@/Hook/useAjax'
 import { PromotedObjectType } from '@/services/launchAdq/enum'
-import { Col, Row, Input, Select, message } from 'antd'
+import { Col, Row, Input, Select, message, Button } from 'antd'
 import React, { useEffect, useCallback, useState } from 'react'
 import TableData from '../../components/TableData'
 import tableConfig from './tableConfig'
@@ -40,11 +40,12 @@ function Creative(props: Props) {
         accountId?: string;
         adcreativeName?: string;
         adcreativeId?: string;
+        promotedObjectType?:string
     }>({pageNum:1,pageSize:20})
     console.log('创意=====》')
     useEffect(() => {
-        getList({ pageNum: 1, pageSize: 20, accountId, ...queryParmas })
-    }, [accountId, userId, queryParmas])
+        getList({ pageNum: 1, pageSize: 20 })
+    }, [])
     // 获取列表
     const getList = useCallback((params: {
         pageNum: number;
@@ -53,9 +54,6 @@ function Creative(props: Props) {
         adcreativeName?: string;
         adcreativeId?: string;
     }) => {
-        if (!params.adcreativeName || params.adcreativeName !== listAjax?.params[0]?.adcreativeName) {
-            !params.adcreativeName && delete params.adcreativeName
-        }
         listAjax.run({ ...params, userId })
     }, [userId, listAjax])
     // 同步 
@@ -91,25 +89,9 @@ function Creative(props: Props) {
                             placeholder='广告账号'
                             allowClear
                             style={{ width: 150 }}
-                            onBlur={(e) => {
-                                let value = e.target.value
-                                set_queryFrom({...queryFrom,accountId: value })
-                                getList({...queryFrom, pageNum: 1,  accountId: value })
-                            }}
-                            onKeyDownCapture={(e: any) => {
-                                let key = e.key
-                                if (key === 'Enter') {
-                                    let value = e.target.value
-                                    set_queryFrom({...queryFrom,accountId: value })
-                                    getList({...queryFrom, pageNum: 1,accountId: value })
-                                }
-                            }}
                             onChange={(e) => {
                                 let value = e.target.value
-                                if (!value) {
-                                    set_queryFrom({...queryFrom,accountId: value })
-                                    getList({ ...queryFrom,pageNum: 1, accountId: value })
-                                }
+                                set_queryFrom({...queryFrom,accountId: value })
                             }}
                         />
                     </Col>
@@ -118,25 +100,9 @@ function Creative(props: Props) {
                             placeholder='创意名称'
                             allowClear
                             style={{ width: 150 }}
-                            onBlur={(e) => {
-                                let value = e.target.value
-                                set_queryFrom({...queryFrom,adcreativeName: value })
-                                getList({...queryFrom, pageNum: 1, adcreativeName: value })
-                            }}
-                            onKeyDownCapture={(e: any) => {
-                                let key = e.key
-                                if (key === 'Enter') {
-                                    let value = e.target.value
-                                    set_queryFrom({...queryFrom,adcreativeName: value })
-                                    getList({ ...queryFrom,pageNum: 1,  adcreativeName: value })
-                                }
-                            }}
                             onChange={(e) => {
                                 let value = e.target.value
-                                if (!value) {
-                                    set_queryFrom({...queryFrom,adcreativeName: value })
-                                    getList({ ...queryFrom,pageNum: 1, adcreativeName: value })
-                                }
+                                set_queryFrom({...queryFrom,adcreativeName: value })
                             }}
                         />
                     </Col>
@@ -145,25 +111,9 @@ function Creative(props: Props) {
                             placeholder='创意ID'
                             allowClear
                             style={{ width: 150 }}
-                            onBlur={(e) => {
-                                let value = e.target.value
-                                set_queryFrom({...queryFrom,adcreativeId: value })
-                                getList({...queryFrom, pageNum: 1,  adcreativeId: value })
-                            }}
-                            onKeyDownCapture={(e: any) => {
-                                let key = e.key
-                                if (key === 'Enter') {
-                                    let value = e.target.value
-                                    set_queryFrom({...queryFrom,adcreativeId: value })
-                                    getList({...queryFrom, pageNum: 1,  adcreativeId: value })
-                                }
-                            }}
                             onChange={(e) => {
                                 let value = e.target.value
-                                if (!value) {
-                                    set_queryFrom({...queryFrom,adcreativeId: value })
-                                    getList({...queryFrom, pageNum: 1,  adcreativeId: value })
-                                }
+                                set_queryFrom({...queryFrom,adcreativeId: value })
                             }}
                         />
                     </Col>
@@ -171,8 +121,7 @@ function Creative(props: Props) {
                         <Select placeholder='推广目标选择' style={{ minWidth: 150 }} showSearch filterOption={(input: any, option: any) =>
                             (option!.children as unknown as string).toLowerCase().includes(input.toLowerCase())
                         } allowClear onChange={(value: any) => {
-                            set_queryFrom({...queryFrom,accountId: value })
-                            getList({...queryFrom, pageNum: 1,  accountId:value })
+                            set_queryFrom({...queryFrom,promotedObjectType: value })
                         }}>
                             {
                                 Object.keys(PromotedObjectType).map(key => {
@@ -182,6 +131,9 @@ function Creative(props: Props) {
                             }
                         </Select>
                     </Col>
+                    <Col>
+                            <Button type='primary' onClick={()=>{getList({...queryFrom,pageNum:1})}}>搜索</Button>
+                    </Col>
                 </Row>
             </>}
             onChange={(props: any) => {

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

@@ -24,10 +24,7 @@ function tableConfig(tableIdClick: (props: {
             ellipsis: true,
             render: (a: string) => {
                 return <Space>
-                    <a onClick={() => copy(a)} style={{ color: '#00bcd4' }}><CopyOutlined /></a>
-                    <a onClick={() => {
-                        tableIdClick({ activeKey: '1', parma: { accountId: a } })
-                    }}>{a}</a>
+                     <a onClick={() => copy(a)} >{a}</a>
                 </Space>
             }
         },
@@ -40,10 +37,7 @@ function tableConfig(tableIdClick: (props: {
             ellipsis: true,
             render: (a: string) => {
                 return <Space>
-                    <a onClick={() => copy(a)} style={{ color: '#00bcd4' }}><CopyOutlined /></a>
-                    <a onClick={() => {
-                        tableIdClick({ activeKey: '4', parma: { adcreativeId: a } })
-                    }}>{a}</a>
+                   <a onClick={() => copy(a)} >{a}</a>
                 </Space>
             }
         },
@@ -56,10 +50,7 @@ function tableConfig(tableIdClick: (props: {
             ellipsis: true,
             render: (a: string) => {
                 return <Space>
-                    <a onClick={() => copy(a)} style={{ color: '#00bcd4' }}><CopyOutlined /></a>
-                    <a onClick={() => {
-                        tableIdClick({ activeKey: '2', parma: { campaignId: a } })
-                    }}>{a}</a>
+                    <a onClick={() => copy(a)} >{a}</a>
                 </Space>
             }
         },

+ 4 - 4
src/pages/launchSystemNew/adq/index.tsx

@@ -56,8 +56,8 @@ function Adq() {
         }
     }) => {
         // 暂时注释不开放
-        let { activeKey, parma } = props
-        setQueryParmas({ ...queryParmas, ...parma })
+        // let { activeKey, parma } = props
+        // setQueryParmas({ ...queryParmas, ...parma })
         // setActiveKey(activeKey)
     }, [queryParmas, activeKey])
     // 获取组员
@@ -208,7 +208,7 @@ function Adq() {
                         tabsConfig?.map(item => {
                             return <TabPane tab={item.tab} key={item.key} >
                                 <>
-                                    <Row >
+                                    {/* <Row >
                                         <Col>
                                             {
                                                 Object.keys(queryParmas)?.filter(key => queryParmas[key])?.map(key => {
@@ -242,7 +242,7 @@ function Adq() {
                                                 })
                                             }
                                         </Col>
-                                    </Row>
+                                    </Row> */}
                                     {activeKey === item.key && item.jsx({ ...idS, userId, queryParmas, tableIdClick })}
                                 </>
                             </TabPane>

+ 11 - 40
src/pages/launchSystemNew/adq/landingPage/index.tsx

@@ -1,5 +1,5 @@
 import React, { useEffect, useCallback, useState } from 'react'
-import { Col, Input, message, Row } from 'antd'
+import { Button, Col, Input, message, Row } from 'antd'
 import { useAjax } from '@/Hook/useAjax'
 import { getAdqLandingPageList, putAdqLandingPage } from '@/services/launchAdq/adq'
 import TableData from '../../components/TableData'
@@ -9,7 +9,7 @@ function LandingPage(props: { accountId: string, adAccountId: string, userId: st
     let { accountId, adAccountId, userId, tableIdClick } = props
     const listAjax = useAjax((params) => getAdqLandingPageList(params), { formatResult: true })
     const syncAjax = useAjax((adAccountId) => putAdqLandingPage(adAccountId))
-    const [queryFrom,set_queryFrom]=useState<{
+    const [queryFrom, set_queryFrom] = useState<{
         pageNum: number;
         pageSize: number;
         accountId?: string;
@@ -17,10 +17,10 @@ function LandingPage(props: { accountId: string, adAccountId: string, userId: st
         pageType?: string;
         pageTemplateId?: string;
         pageStatus?: string;
-    }>({pageNum:1,pageSize:20})
+    }>({ pageNum: 1, pageSize: 20 })
     console.log('落地页=====》')
     useEffect(() => {
-        getList({ pageNum: 1, pageSize: 20, accountId })
+        getList({ pageNum: 1, pageSize: 20 })
     }, [accountId])
     // 获取列表
     const getList = useCallback((params: {
@@ -71,25 +71,9 @@ function LandingPage(props: { accountId: string, adAccountId: string, userId: st
                             placeholder='广告账号'
                             allowClear
                             style={{ width: 150 }}
-                            onBlur={(e) => {
-                                let value = e.target.value
-                                set_queryFrom({...queryFrom,accountId: value})
-                                getList({ ...queryFrom,pageNum: 1,  accountId: value })
-                            }}
-                            onKeyDownCapture={(e: any) => {
-                                let key = e.key
-                                if (key === 'Enter') {
-                                    let value = e.target.value
-                                    set_queryFrom({...queryFrom,accountId: value})
-                                    getList({ ...queryFrom,pageNum: 1,  accountId: value })
-                                }
-                            }}
                             onChange={(e) => {
                                 let value = e.target.value
-                                if (!value) {
-                                    set_queryFrom({...queryFrom,accountId: value})
-                                    getList({ ...queryFrom,pageNum: 1,  accountId: value })
-                                }
+                                set_queryFrom({ ...queryFrom, accountId: value })
                             }}
                         />
                     </Col>
@@ -98,25 +82,9 @@ function LandingPage(props: { accountId: string, adAccountId: string, userId: st
                             placeholder='落地页名称'
                             allowClear
                             style={{ width: 150 }}
-                            onBlur={(e) => {
-                                let value = e.target.value
-                                set_queryFrom({...queryFrom,pageName: value})
-                                getList({...queryFrom, pageNum: 1,  pageName: value })
-                            }}
-                            onKeyDownCapture={(e: any) => {
-                                let key = e.key
-                                if (key === 'Enter') {
-                                    let value = e.target.value
-                                    set_queryFrom({...queryFrom,pageName: value})
-                                    getList({ ...queryFrom,pageNum: 1,  pageName: value })
-                                }
-                            }}
                             onChange={(e) => {
                                 let value = e.target.value
-                                if (!value) {
-                                    set_queryFrom({...queryFrom,pageName: value})
-                                    getList({ ...queryFrom,pageNum: 1,  pageName: value })
-                                }
+                                set_queryFrom({ ...queryFrom, pageName: value })
                             }}
                         />
                     </Col>
@@ -134,13 +102,16 @@ function LandingPage(props: { accountId: string, adAccountId: string, userId: st
                             }
                         </Select>
                     </Col> */}
+                    <Col>
+                        <Button type='primary' onClick={() => { getList({ ...queryFrom, pageNum: 1 }) }}>搜索</Button>
+                    </Col>
                 </Row>
             </>}
             onChange={(props: any) => {
                 let { sortData, pagination } = props
                 let { current, pageSize } = pagination
-                set_queryFrom({...queryFrom,pageNum:current,pageSize})
-                getList({...queryFrom, pageNum: current, pageSize })
+                set_queryFrom({ ...queryFrom, pageNum: current, pageSize })
+                getList({ ...queryFrom, pageNum: current, pageSize })
             }}
         />
     </div>

+ 12 - 13
src/pages/launchSystemNew/adq/landingPage/tableConfig.tsx

@@ -1,4 +1,4 @@
-import {  PageStatusEnum, PageTypeEnum, SourceTypeEnum } from '@/services/launchAdq/enum'
+import { PageStatusEnum, PageTypeEnum, SourceTypeEnum } from '@/services/launchAdq/enum'
 import React from 'react'
 import { Badge, Space } from 'antd'
 import { copy } from '@/utils/utils'
@@ -10,12 +10,11 @@ function tableConfig(tableIdClick: any): any {
             dataIndex: 'accountId',
             key: 'accountId',
             align: 'center',
-            width:100,
+            width: 100,
             ellipsis: true,
-            render:(a:string)=>{
+            render: (a: string) => {
                 return <Space>
-                <a onClick={() => copy(a)} style={{ color: '#00bcd4' }}><CopyOutlined /></a>
-                <a onClick={() => tableIdClick({ activeKey: '1', parma: { accountId: a } })}>{a}</a>
+                    <a onClick={() => copy(a)} >{a}</a>
                 </Space>
             }
         },
@@ -24,9 +23,9 @@ function tableConfig(tableIdClick: any): any {
             dataIndex: 'pageId',
             key: 'pageId',
             align: 'center',
-            width:100,
+            width: 100,
             ellipsis: true,
-            render:(a:string)=>{
+            render: (a: string) => {
                 return <a onClick={() => copy(a)}>{a}</a>
             }
         },
@@ -51,7 +50,7 @@ function tableConfig(tableIdClick: any): any {
             dataIndex: 'pageType',
             key: 'pageType',
             align: 'center',
-            width:110,
+            width: 110,
             render: (a: string) => {
                 return PageTypeEnum[a]
             }
@@ -61,9 +60,9 @@ function tableConfig(tableIdClick: any): any {
             dataIndex: 'pageStatus',
             key: 'pageStatus',
             align: 'center',
-            width:90,
-            render:(a: string | number)=>{
-                return  <Badge status={a === 'NORMAL' ? "processing" :"error" } text={PageStatusEnum[a]} />
+            width: 90,
+            render: (a: string | number) => {
+                return <Badge status={a === 'NORMAL' ? "processing" : "error"} text={PageStatusEnum[a]} />
             }
         },
         {
@@ -71,7 +70,7 @@ function tableConfig(tableIdClick: any): any {
             dataIndex: 'sourceType',
             key: 'sourceType',
             align: 'center',
-            width:110,
+            width: 110,
             render: (a: any, b: any) => {
                 return SourceTypeEnum[a]
             }
@@ -91,7 +90,7 @@ function tableConfig(tableIdClick: any): any {
             dataIndex: 'createdTime',
             key: 'createdTime',
             align: 'center',
-            width:160,
+            width: 160,
         },
     ]
 }

+ 11 - 10
src/pages/launchSystemNew/adq/log/index.tsx

@@ -1,7 +1,7 @@
 import { useAjax } from "@/Hook/useAjax"
 import { getLogListApi } from "@/services/launchAdq/adq"
-import { Col, Input, Row } from "antd"
-import React, { useEffect, useState } from "react"
+import { Button, Col, Input, Row } from "antd"
+import React, { useCallback, useEffect, useState } from "react"
 import TableData from "../../components/TableData"
 import tableConfig from "./tableConfig"
 
@@ -36,15 +36,12 @@ const Log: React.FC<Props> = (props) => {
     const getLogList = useAjax((params) => getLogListApi(params), { formatResult: true })
     /**************************/
     useEffect(() => {
-        if (queryParmas?.accountId || queryParmas?.adgroupId || userId) {
-            setQueryparams({ ...queryparams, ...queryParmas, userId })
-        }
-    }, [queryParmas, userId])
-
-    useEffect(() => {
-        getLogList.run(queryparams)
-    }, [queryparams])
+        getList(queryparams)
+    }, [])
 
+    const getList=useCallback((params:any)=>{
+        getLogList.run({...params,userId})
+    },[userId])
     return <div>
         <TableData
             isCard={false}
@@ -123,12 +120,16 @@ const Log: React.FC<Props> = (props) => {
                         />
 
                     </Col>
+                    <Col>
+                            <Button type='primary' onClick={()=>{getList({...queryparams,pageNum:1})}}>搜索</Button>
+                    </Col>
                 </Row>
             </>}
             onChange={(props: any) => {
                 let { sortData, pagination } = props
                 let { current, pageSize } = pagination
                 setQueryparams({ ...queryparams, pageNum: current, pageSize })
+                getList({...queryparams, pageNum: current, pageSize})
             }}
         />
     </div>

+ 3 - 12
src/pages/launchSystemNew/adq/log/tableConfig.tsx

@@ -26,10 +26,7 @@ function tableConfig(tableIdClick: (props: {
             ellipsis: true,
             render: (a: string) => {
                 return <Space>
-                    <a onClick={() => copy(a)} style={{ color: '#00bcd4' }}><CopyOutlined /></a>
-                    <a onClick={() => {
-                        tableIdClick({ activeKey: '1', parma: { accountId: a } })
-                    }}>{a}</a>
+                    <a onClick={() => copy(a)} >{a}</a>
                 </Space>
             }
         },
@@ -43,10 +40,7 @@ function tableConfig(tableIdClick: (props: {
             ellipsis: true,
             render: (a: string) => {
                 return <Space>
-                    <a onClick={() => copy(a)} style={{ color: '#00bcd4' }}><CopyOutlined /></a>
-                    <a onClick={() => {
-                        tableIdClick({ activeKey: '3', parma: { adgroupId: a } })
-                    }}>{a}</a>
+                    <a onClick={() => copy(a)} >{a}</a>
                 </Space>
             }
         },
@@ -60,10 +54,7 @@ function tableConfig(tableIdClick: (props: {
             ellipsis: true,
             render: (a: string) => {
                 return <Space>
-                    <a onClick={() => copy(a)} style={{ color: '#00bcd4' }}><CopyOutlined /></a>
-                    <a onClick={() => {
-                        tableIdClick({ activeKey: '2', parma: { campaignId: a } })
-                    }}>{a}</a>
+                    <a onClick={() => copy(a)} >{a}</a>
                 </Space>
             }
         },

+ 7 - 40
src/pages/launchSystemNew/adq/targeting/index.tsx

@@ -1,5 +1,5 @@
 import React, { useEffect, useCallback, useState } from 'react'
-import { Col, Input, message, Row } from 'antd'
+import { Button, Col, Input, message, Row } from 'antd'
 import { useAjax } from '@/Hook/useAjax'
 import { getAdqTargetingList, putAdqTargetingSyncAll } from '@/services/launchAdq/adq'
 import TableData from '../../components/TableData'
@@ -17,7 +17,7 @@ function Targeting(props: { adAccountId: any, userId: string, accountId: any, ta
     }>({pageNum:1,pageSize:20})
     console.log('定向=====》')
     useEffect(() => {
-        getList({ pageNum: 1, pageSize: 20, accountId })
+        getList({ pageNum: 1, pageSize: 20 })
     }, [userId, accountId])
     // 获取列表
     const getList = useCallback((params: {
@@ -26,10 +26,6 @@ function Targeting(props: { adAccountId: any, userId: string, accountId: any, ta
         accountId?: string;
         targetingName?: string;
     }) => {
-        console.log(accountId)
-        if (!params.targetingName || params.targetingName !== listAjax?.params[0]?.targetingName) {
-            !params.targetingName && delete params.targetingName
-        }
         listAjax.run({ ...params, userId })
     }, [listAjax, userId])
     // 同步 
@@ -65,25 +61,9 @@ function Targeting(props: { adAccountId: any, userId: string, accountId: any, ta
                             placeholder='广告账号'
                             allowClear
                             style={{ width: 150 }}
-                            onBlur={(e) => {
-                                let value = e.target.value
-                                set_queryFrom({...queryFrom, accountId: value})
-                                getList({...queryFrom, pageNum: 1, accountId: value })
-                            }}
-                            onKeyDownCapture={(e: any) => {
-                                let key = e.key
-                                if (key === 'Enter') {
-                                    let value = e.target.value
-                                    set_queryFrom({...queryFrom, accountId: value})
-                                    getList({ ...queryFrom,pageNum: 1, accountId: value })
-                                }
-                            }}
                             onChange={(e) => {
                                 let value = e.target.value
-                                if (!value) {
-                                    set_queryFrom({...queryFrom, accountId: value})
-                                    getList({ ...queryFrom,pageNum: 1,  accountId: value })
-                                }
+                                set_queryFrom({...queryFrom, accountId: value})
                             }}
                         />
                     </Col>
@@ -92,29 +72,16 @@ function Targeting(props: { adAccountId: any, userId: string, accountId: any, ta
                             placeholder='定向名称'
                             allowClear
                             style={{ width: 150 }}
-                            onBlur={(e) => {
-                                let value = e.target.value
-                                set_queryFrom({...queryFrom, targetingName: value})
-                                getList({...queryFrom, pageNum: 1,  targetingName: value })
-                            }}
-                            onKeyDownCapture={(e: any) => {
-                                let key = e.key
-                                if (key === 'Enter') {
-                                    let value = e.target.value
-                                    set_queryFrom({...queryFrom, targetingName: value})
-                                    getList({ ...queryFrom,pageNum: 1, targetingName: value })
-                                }
-                            }}
                             onChange={(e) => {
                                 let value = e.target.value
-                                if (!value) {
-                                    set_queryFrom({...queryFrom, targetingName: value})
-                                    getList({...queryFrom, pageNum: 1,  targetingName: value })
-                                }
+                                set_queryFrom({...queryFrom, targetingName: value})
                             }}
                         />
 
                     </Col>
+                    <Col>
+                            <Button type='primary' onClick={()=>{getList({...queryFrom,pageNum:1})}}>搜索</Button>
+                    </Col>
                 </Row>
             </>}
             onChange={(props: any) => {

+ 1 - 2
src/pages/launchSystemNew/adq/targeting/tableConfig.tsx

@@ -14,8 +14,7 @@ function tableConfig(tableIdClick: any): any {
             ellipsis: true,
             render: (a: string) => {
                 return <Space>
-                    <a onClick={() => copy(a)} style={{ color: '#00bcd4' }}><CopyOutlined /></a>
-                    <a onClick={() => tableIdClick({ activeKey: '1', parma: { accountId: a } })}>{a}</a>
+                    <a onClick={() => copy(a)} >{a}</a>
                 </Space>
             }
         },

+ 44 - 23
src/pages/launchSystemNew/launchManage/createAd/index.tsx

@@ -28,11 +28,12 @@ import CustomerServiceModal from "../../components/customerServiceModal"
 import { getTaskDetailsApi } from "@/services/launchAdq/taskList"
 import CreativeCL from "./creativeCL"
 import { groupBy } from "@/utils/utils"
+import { getAccountListApi, getGroupListApi } from "@/services/launchAdq/subgroup"
 
 const CreateAd: React.FC = () => {
 
     /*************************/
-    const { getAdAccount } = useModel('useLaunchAdq.useAdAuthorize')
+    const { getAllUserAccount } = useModel('useLaunchAdq.useAdAuthorize')
     const [queryForm, setQueryForm] = useState<Partial<CreateAdProps>>({
         campaignName: '',  // 计划名称
         campaignType: 'CAMPAIGN_TYPE_NORMAL', // 计划类型 CAMPAIGN_TYPE_NORMAL CAMPAIGN_TYPE_SEARCH 
@@ -82,8 +83,14 @@ const CreateAd: React.FC = () => {
     const createAdBatch = useAjax((params) => createAdBatchApi(params))
     const getTaskDetails = useAjax((params) => getTaskDetailsApi(params))
     const getAdcreativeTemplate = useAjax((params) => get_adcreative_template(params))
+    const getGroupList = useAjax(() => getGroupListApi())
     /*************************/
 
+    useEffect(() => {
+        getGroupList.run()
+    }, [])
+
+
     /** 判断出价方式,优化目标 “二方包”人群包仅能在出价方式为CPC(包含oCPM点击优化目标)、CPM场景下使用 */
     useEffect(() => {
         if (queryForm?.sysAdgroup && Object.keys(queryForm?.sysAdgroup).length > 0 && (!['BID_MODE_CPC', 'BID_MODE_CPM'].includes(queryForm?.sysAdgroup?.bidMode) || !(queryForm?.sysAdgroup?.bidMode === 'BID_MODE_OCPM' && queryForm?.sysAdgroup?.optimizationGoal === 'OPTIMIZATIONGOAL_CLICK'))) {
@@ -305,7 +312,7 @@ const CreateAd: React.FC = () => {
                     })
                     let groupMaterials: any[] = []
                     let groupTexts: any[] = []
-                    
+
                     if (newMaterials.length > 0 && newMaterials?.every(item => Object.keys(item).length > 0)) {
                         let firstField = Object.keys(newMaterials[0])[0]
                         groupMaterials = groupBy(newMaterials, (item) => [item[firstField]])
@@ -396,16 +403,16 @@ const CreateAd: React.FC = () => {
 
     // 获取账户列表
     useEffect(() => {
-        getAdAccount.run()
+        getAllUserAccount.run()
     }, [])
 
     // 账号对比
     useEffect(() => {
-        if (getAdAccount?.data?.data && accountCreateLogs) {
-            if (accountCreateLogs.some(item => !getAdAccount?.data?.data?.find((item1: { id: number, accountId: number }) => item.id === item1.id && item.adAccountId == item1.accountId))) {
+        if (getAllUserAccount?.data?.data && accountCreateLogs) {
+            if (accountCreateLogs.some(item => !getAllUserAccount?.data?.data?.find((item1: { accountId: number }) => item.adAccountId == item1.accountId))) {
                 let errorData: any[] = []
                 let newAccountCreateLogs = accountCreateLogs.filter(item => {
-                    let data = getAdAccount?.data?.data?.find((item1: { id: number, accountId: number }) => item.id === item1.id && item.adAccountId == item1.accountId)
+                    let data = getAllUserAccount?.data?.data?.find((item1: { accountId: number }) => item.adAccountId == item1.accountId)
                     if (data) {
                         return true
                     } else {
@@ -422,7 +429,7 @@ const CreateAd: React.FC = () => {
                 setQueryForm({ ...queryForm, adqPageList: [], taskMediaMaps: queryForm?.taskMediaMaps?.map(item => ({ ...item, accountPageIdMap: {} })) })
             }
         }
-    }, [getAdAccount?.data, accountCreateLogs, queryForm])
+    }, [getAllUserAccount?.data, accountCreateLogs, queryForm])
 
     /** 获取广告详情 */
     useEffect(() => {
@@ -819,6 +826,32 @@ const CreateAd: React.FC = () => {
         set_targetKey('0')
     }
 
+    /** 获取分组里账号 */
+    const getGroupAccountList = (ids: number[]) => {
+        if (ids.length > 0) {
+            let data = ids.map(id => getAccountListApi(id))
+            Promise.all(data).then(res => {
+                if (res?.length > 0 && res.every((item: { code: number }) => item.code === 200)) {
+                    let userArr: any[] = []
+                    res.forEach((item: { data: { adAccountList: { accountId: number, id: number }[] } }) => {
+                        item.data.adAccountList.forEach(acc => {
+                            let obj = userArr.find((item: { accountId: number }) => item.accountId === acc.accountId)
+                            if (!obj) {
+                                userArr.push(acc)
+                            }
+                        })
+                    })
+                    setAccountCreateLogs(userArr?.map((item) => ({ adAccountId: item?.accountId, id: item.id })))
+                    clearData()
+                } else {
+                    message.error('操作异常')
+                }
+            })
+        } else {
+            setAccountCreateLogs([])
+        }
+    }
+
     return <Space direction="vertical" style={{ width: '100%' }}>
         <Card
             title={<Space>
@@ -834,7 +867,7 @@ const CreateAd: React.FC = () => {
             </Space>}
             className={style.createAd}
             hoverable
-            extra={<AddGroup onChange={usersChange} pitcherData={getAdAccount?.data?.data} />}
+        // extra={<AddGroup onChange={usersChange} pitcherData={getAdAccount?.data?.data} />}
         >
             <Space wrap>
                 <Selector label="媒体账户组">
@@ -848,21 +881,9 @@ const CreateAd: React.FC = () => {
                         filterOption={(input: any, option: any) => {
                             return option!.children?.toString().toLowerCase().includes(input.toLowerCase())
                         }}
-                        onChange={(e, option) => {
-                            console.log(e, option)
-                            let userArr: any[] = []
-                            e.forEach((key: any) => {
-                                let obj = usesArr.find((item: { id: any }) => item.id === key)
-                                if (obj) {
-                                    userArr.push(obj['pitcher'])
-                                }
-                            })
-                            userArr = [...new Set(userArr.flat())]
-                            setAccountCreateLogs(userArr?.map((item: any) => ({ adAccountId: item?.split('_')[1], id: Number(item?.split('_')[0]) })))
-                            clearData()
-                        }}
+                        onChange={(e, option) => { getGroupAccountList(e) }}
                     >
-                        {usesArr?.map((item: any) => <Select.Option value={item.id} key={item.id}>{item.name}</Select.Option>)}
+                        {getGroupList.data?.map((item: any) => <Select.Option value={item.groupId} key={item.groupId}>{item.groupName}</Select.Option>)}
                     </Select>
                 </Selector>
                 <Selector label="媒体账户">
@@ -884,7 +905,7 @@ const CreateAd: React.FC = () => {
                             clearData()
                         }}
                     >
-                        {getAdAccount?.data?.data?.map((item: any) => <Select.Option value={item.id} key={item.id}>{item.remark ? item.accountId + '——' + item.remark : item.accountId}</Select.Option>)}
+                        {getAllUserAccount?.data?.data?.map((item: any) => <Select.Option value={item.id} key={item.id}>{item.remark ? item.accountId + '——' + item.remark : item.accountId}</Select.Option>)}
                     </Select>
                 </Selector>
                 <Selector label="推广目标">

Some files were not shown because too many files changed in this diff