|
@@ -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 })
|
|
@@ -226,40 +223,14 @@ const Ad: React.FC<Props> = (props) => {
|
|
|
placeholder='广告账号'
|
|
|
allowClear
|
|
|
style={{ width: 120 }}
|
|
|
- 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)
|
|
|
}
|
|
|
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>
|
|
@@ -268,25 +239,9 @@ const Ad: React.FC<Props> = (props) => {
|
|
|
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 })
|
|
|
- }
|
|
|
+ set_queryFrom({ ...queryFrom, adgroupName: value })
|
|
|
}}
|
|
|
/>
|
|
|
</Col>
|
|
@@ -295,7 +250,7 @@ const Ad: React.FC<Props> = (props) => {
|
|
|
placeholder='广告ID'
|
|
|
allowClear
|
|
|
style={{ width: 120 }}
|
|
|
- onBlur={(e) => {
|
|
|
+ onChange={(e) => {
|
|
|
let value = e.target.value
|
|
|
let arr: any = []
|
|
|
if (value) {
|
|
@@ -303,32 +258,6 @@ const Ad: React.FC<Props> = (props) => {
|
|
|
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>
|
|
@@ -337,7 +266,7 @@ const Ad: React.FC<Props> = (props) => {
|
|
|
placeholder='计划ID'
|
|
|
allowClear
|
|
|
style={{ width: 120 }}
|
|
|
- onBlur={(e) => {
|
|
|
+ onChange={(e) => {
|
|
|
let value = e.target.value
|
|
|
let arr: any = []
|
|
|
if (value) {
|
|
@@ -345,32 +274,6 @@ const Ad: React.FC<Props> = (props) => {
|
|
|
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>
|
|
@@ -385,7 +288,6 @@ const Ad: React.FC<Props> = (props) => {
|
|
|
allowClear
|
|
|
onChange={(value: any) => {
|
|
|
set_queryFrom({ ...queryFrom, promotedObjectType: value })
|
|
|
- getList({ ...queryFrom, pageNum: 1, promotedObjectType: value })
|
|
|
}}
|
|
|
>
|
|
|
{Object.keys(PromotedObjectType).map(key => {
|
|
@@ -404,7 +306,6 @@ const Ad: React.FC<Props> = (props) => {
|
|
|
allowClear
|
|
|
onChange={(value: any) => {
|
|
|
set_queryFrom({ ...queryFrom, isDeleted: value })
|
|
|
- getList({ ...queryFrom, pageNum: 1, isDeleted: value })
|
|
|
}}
|
|
|
>
|
|
|
<Select.Option value={true}>已删除</Select.Option>
|
|
@@ -423,7 +324,6 @@ const Ad: React.FC<Props> = (props) => {
|
|
|
allowClear
|
|
|
onChange={(value: any) => {
|
|
|
set_queryFrom({ ...queryFrom, statusList: value })
|
|
|
- getList({ ...queryFrom, pageNum: 1, statusList: value })
|
|
|
}}
|
|
|
>
|
|
|
{
|
|
@@ -438,40 +338,14 @@ const Ad: React.FC<Props> = (props) => {
|
|
|
placeholder='腾讯备注'
|
|
|
allowClear
|
|
|
style={{ width: 120 }}
|
|
|
- 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)
|
|
|
}
|
|
|
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>
|
|
@@ -480,43 +354,20 @@ const Ad: React.FC<Props> = (props) => {
|
|
|
placeholder='本地备注'
|
|
|
allowClear
|
|
|
style={{ width: 120 }}
|
|
|
- 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)
|
|
|
}
|
|
|
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>
|
|
|
+ <Col>
|
|
|
+ <Button type='primary' onClick={() => getList({...queryFrom,pageNum:1})}> 搜索</Button>
|
|
|
+ </Col>
|
|
|
</Row>
|
|
|
<Row gutter={[10, 10]} align='middle'>
|
|
|
<Col>
|