|
@@ -1,6 +1,6 @@
|
|
|
|
|
|
import { useAjax } from '@/Hook/useAjax'
|
|
|
-import { PromotedObjectType } from '@/services/launchAdq/enum'
|
|
|
+import { AdStatusEnum, PromotedObjectType } from '@/services/launchAdq/enum'
|
|
|
import { Col, Row, Input, Select, message, Space, Button, Popconfirm, Switch, notification } from 'antd'
|
|
|
import React, { useEffect, useCallback, useState } from 'react'
|
|
|
import TableData from '../../components/TableData'
|
|
@@ -9,6 +9,7 @@ import { putAdqAdgroupsSync, getAdqAdgroupsList, delListAdqAdgroupsApi, editAdqA
|
|
|
import { CopyOutlined, DeleteOutlined, FieldTimeOutlined, PauseCircleOutlined, PlayCircleOutlined, TransactionOutlined } from '@ant-design/icons'
|
|
|
import UpdateAd from './updateAd'
|
|
|
import Copy from './copy'
|
|
|
+
|
|
|
type Props = {
|
|
|
accountId: string,
|
|
|
adAccountId: string,
|
|
@@ -49,19 +50,27 @@ const Ad: React.FC<Props> = (props) => {
|
|
|
/************************/
|
|
|
|
|
|
useEffect(() => {
|
|
|
- getList({ pageNum: 1, pageSize: 20, accountId, ...queryParmas })
|
|
|
+ let {accountId,campaignId,adgroupId,...obj} = queryParmas
|
|
|
+ let new_queryParmas = {
|
|
|
+ ...obj,
|
|
|
+ accountIdList:accountId?[accountId]:[],
|
|
|
+ campaignIdList:campaignId?[campaignId]:[],
|
|
|
+ adgroupIdList:adgroupId?[adgroupId]:[]
|
|
|
+ }
|
|
|
+ getList({ pageNum: 1, pageSize: 20, ...new_queryParmas,accountIdList:accountId?[accountId]:[] })
|
|
|
}, [accountId, userId, queryParmas])
|
|
|
|
|
|
// 获取列表
|
|
|
const getList = useCallback((params: {
|
|
|
pageNum: number;
|
|
|
pageSize: number;
|
|
|
- accountId?: string;
|
|
|
+ accountIdList?: any[];
|
|
|
adgroupName?: string;
|
|
|
- adgroupId?: string;
|
|
|
+ adgroupIdList?: any[];
|
|
|
promotedObjectType?: string;
|
|
|
isDeleted?: boolean
|
|
|
- campaignId?: string
|
|
|
+ campaignIdList?: any[]
|
|
|
+ statusList?:any[]
|
|
|
}) => {
|
|
|
if (!params.adgroupName || params.adgroupName !== listAjax?.params[0]?.adgroupName) {
|
|
|
!params.adgroupName && delete params.adgroupName
|
|
@@ -119,7 +128,7 @@ const Ad: React.FC<Props> = (props) => {
|
|
|
return
|
|
|
}
|
|
|
editAdqAdgroupsData.run(params).then(res => {
|
|
|
- message.success(`${type === 'play' ? '启动' : '暂停'}完成.成功: ${res.success},失败: ${res.fail}`)
|
|
|
+ message.success(`${type === 'play' ? '启动' : '暂停'}操作完成.结果请在操作记录查询!`)//成功: ${res.success},失败: ${res.fail}
|
|
|
if (res?.fail) {
|
|
|
notification.error({
|
|
|
message: `${type === 'play' ? '启动' : '暂停'}失败`,
|
|
@@ -172,19 +181,34 @@ const Ad: React.FC<Props> = (props) => {
|
|
|
style={{ width: 150 }}
|
|
|
onBlur={(e) => {
|
|
|
let value = e.target.value
|
|
|
- getList({ pageNum: 1, pageSize: 20, accountId: value })
|
|
|
+ let arr:any = []
|
|
|
+ if(value){
|
|
|
+ value = value.replace(/[,,\s]/g,',')
|
|
|
+ arr = value.split(',').filter(a=>a)
|
|
|
+ }
|
|
|
+ getList({ pageNum: 1, pageSize: 20, accountIdList: arr })
|
|
|
}}
|
|
|
onKeyDownCapture={(e: any) => {
|
|
|
let key = e.key
|
|
|
if (key === 'Enter') {
|
|
|
let value = e.target.value
|
|
|
- getList({ pageNum: 1, pageSize: 20, accountId: value })
|
|
|
+ let arr:any = []
|
|
|
+ if(value){
|
|
|
+ value = value.replace(/[,,\s]/g,',')
|
|
|
+ arr = value.split(',').filter((a: any)=>a)
|
|
|
+ }
|
|
|
+ getList({ pageNum: 1, pageSize: 20, accountIdList: arr })
|
|
|
}
|
|
|
}}
|
|
|
onChange={(e) => {
|
|
|
let value = e.target.value
|
|
|
if (!value) {
|
|
|
- getList({ pageNum: 1, pageSize: 20, accountId: value })
|
|
|
+ let arr:any = []
|
|
|
+ if(value){
|
|
|
+ value = value.replace(/[,,\s]/g,',')
|
|
|
+ arr = value.split(',').filter((a: any)=>a)
|
|
|
+ }
|
|
|
+ getList({ pageNum: 1, pageSize: 20, accountIdList: arr })
|
|
|
}
|
|
|
}}
|
|
|
/>
|
|
@@ -220,19 +244,34 @@ const Ad: React.FC<Props> = (props) => {
|
|
|
style={{ width: 150 }}
|
|
|
onBlur={(e) => {
|
|
|
let value = e.target.value
|
|
|
- getList({ pageNum: 1, pageSize: 20, adgroupId: value })
|
|
|
+ let arr:any = []
|
|
|
+ if(value){
|
|
|
+ value = value.replace(/[,,\s]/g,',')
|
|
|
+ arr = value.split(',').filter((a: any)=>a)
|
|
|
+ }
|
|
|
+ getList({ pageNum: 1, pageSize: 20, adgroupIdList: arr })
|
|
|
}}
|
|
|
onKeyDownCapture={(e: any) => {
|
|
|
let key = e.key
|
|
|
if (key === 'Enter') {
|
|
|
let value = e.target.value
|
|
|
- getList({ pageNum: 1, pageSize: 20, adgroupId: value })
|
|
|
+ let arr:any = []
|
|
|
+ if(value){
|
|
|
+ value = value.replace(/[,,\s]/g,',')
|
|
|
+ arr = value.split(',').filter((a: any)=>a)
|
|
|
+ }
|
|
|
+ getList({ pageNum: 1, pageSize: 20, adgroupIdList: arr })
|
|
|
}
|
|
|
}}
|
|
|
onChange={(e) => {
|
|
|
let value = e.target.value
|
|
|
if (!value) {
|
|
|
- getList({ pageNum: 1, pageSize: 20, adgroupId: value })
|
|
|
+ let arr:any = []
|
|
|
+ if(value){
|
|
|
+ value = value.replace(/[,,\s]/g,',')
|
|
|
+ arr = value.split(',').filter((a: any)=>a)
|
|
|
+ }
|
|
|
+ getList({ pageNum: 1, pageSize: 20, adgroupIdList: arr })
|
|
|
}
|
|
|
}}
|
|
|
/>
|
|
@@ -244,19 +283,34 @@ const Ad: React.FC<Props> = (props) => {
|
|
|
style={{ width: 150 }}
|
|
|
onBlur={(e) => {
|
|
|
let value = e.target.value
|
|
|
- getList({ pageNum: 1, pageSize: 20, campaignId: value })
|
|
|
+ let arr:any = []
|
|
|
+ if(value){
|
|
|
+ value = value.replace(/[,,\s]/g,',')
|
|
|
+ arr = value.split(',').filter((a: any)=>a)
|
|
|
+ }
|
|
|
+ getList({ pageNum: 1, pageSize: 20, campaignIdList: arr })
|
|
|
}}
|
|
|
onKeyDownCapture={(e: any) => {
|
|
|
let key = e.key
|
|
|
if (key === 'Enter') {
|
|
|
let value = e.target.value
|
|
|
- getList({ pageNum: 1, pageSize: 20, campaignId: value })
|
|
|
+ let arr:any = []
|
|
|
+ if(value){
|
|
|
+ value = value.replace(/[,,\s]/g,',')
|
|
|
+ arr = value.split(',').filter((a: any)=>a)
|
|
|
+ }
|
|
|
+ getList({ pageNum: 1, pageSize: 20, campaignIdList: arr })
|
|
|
}
|
|
|
}}
|
|
|
onChange={(e) => {
|
|
|
let value = e.target.value
|
|
|
if (!value) {
|
|
|
- getList({ pageNum: 1, pageSize: 20, campaignId: value })
|
|
|
+ let arr:any = []
|
|
|
+ if(value){
|
|
|
+ value = value.replace(/[,,\s]/g,',')
|
|
|
+ arr = value.split(',').filter((a: any)=>a)
|
|
|
+ }
|
|
|
+ getList({ pageNum: 1, pageSize: 20, campaignIdList: arr })
|
|
|
}
|
|
|
}}
|
|
|
/>
|
|
@@ -296,6 +350,27 @@ const Ad: React.FC<Props> = (props) => {
|
|
|
<Select.Option value={false}>未删除</Select.Option>
|
|
|
</Select>
|
|
|
</Col>
|
|
|
+ <Col>
|
|
|
+ <Select
|
|
|
+ placeholder='广告状态'
|
|
|
+ mode="multiple"
|
|
|
+ style={{ width: 200 }}
|
|
|
+ showSearch
|
|
|
+ filterOption={(input: any, option: any) =>
|
|
|
+ (option!.children as unknown as string).toLowerCase().includes(input.toLowerCase())
|
|
|
+ }
|
|
|
+ allowClear
|
|
|
+ onChange={(value: any) => {
|
|
|
+ getList({ pageNum: 1, pageSize: 20, statusList: value })
|
|
|
+ }}
|
|
|
+ >
|
|
|
+ {
|
|
|
+ Object.keys(AdStatusEnum).map(key=>{
|
|
|
+ return <Select.Option value={key} key={key}>{AdStatusEnum[key]}</Select.Option>
|
|
|
+ })
|
|
|
+ }
|
|
|
+ </Select>
|
|
|
+ </Col>
|
|
|
</Row>
|
|
|
<Row gutter={[10, 10]} align='middle'>
|
|
|
<Col>
|