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