|
@@ -42,7 +42,19 @@ const Ad: React.FC<Props> = (props) => {
|
|
|
const [update, setUpdate] = useState<{ visible: boolean, title: string }>({ visible: false, title: '' })
|
|
|
const [model, setModel] = useState(true)
|
|
|
const [copyData, setCopyData] = useState<{ visible: boolean }>({ visible: false })
|
|
|
-
|
|
|
+ const [queryFrom,set_queryFrom]=useState<{
|
|
|
+ pageNum: number;
|
|
|
+ pageSize: number;
|
|
|
+ accountIdList?: any[];
|
|
|
+ adgroupName?: string;
|
|
|
+ adgroupIdList?: any[];
|
|
|
+ promotedObjectType?: string;
|
|
|
+ isDeleted?: boolean
|
|
|
+ campaignIdList?: any[]
|
|
|
+ statusList?:any[],
|
|
|
+ memoList?:any[]
|
|
|
+ remarkList?:any[]
|
|
|
+ }>({pageNum:1,pageSize:20})
|
|
|
const listAjax = useAjax((params) => getAdqAdgroupsList(params), { formatResult: true })
|
|
|
const syncAjax = useAjax((adAccountId) => putAdqAdgroupsSync(adAccountId))
|
|
|
const delListAdqAdgroups = useAjax((params) => delListAdqAdgroupsApi(params))
|
|
@@ -70,7 +82,9 @@ const Ad: React.FC<Props> = (props) => {
|
|
|
promotedObjectType?: string;
|
|
|
isDeleted?: boolean
|
|
|
campaignIdList?: any[]
|
|
|
- statusList?:any[]
|
|
|
+ statusList?:any[],
|
|
|
+ memoList?:any[]
|
|
|
+ remarkList?:any[]
|
|
|
}) => {
|
|
|
if (!params.adgroupName || params.adgroupName !== listAjax?.params[0]?.adgroupName) {
|
|
|
!params.adgroupName && delete params.adgroupName
|
|
@@ -186,7 +200,8 @@ const Ad: React.FC<Props> = (props) => {
|
|
|
value = value.replace(/[,,\s]/g,',')
|
|
|
arr = value.split(',').filter(a=>a)
|
|
|
}
|
|
|
- getList({ pageNum: 1, pageSize: 20, accountIdList: arr })
|
|
|
+ set_queryFrom({...queryFrom,accountIdList: arr})
|
|
|
+ getList({ ...queryFrom,pageNum: 1, accountIdList: arr })
|
|
|
}}
|
|
|
onKeyDownCapture={(e: any) => {
|
|
|
let key = e.key
|
|
@@ -197,7 +212,8 @@ const Ad: React.FC<Props> = (props) => {
|
|
|
value = value.replace(/[,,\s]/g,',')
|
|
|
arr = value.split(',').filter((a: any)=>a)
|
|
|
}
|
|
|
- getList({ pageNum: 1, pageSize: 20, accountIdList: arr })
|
|
|
+ set_queryFrom({...queryFrom,accountIdList: arr})
|
|
|
+ getList({...queryFrom, pageNum: 1, accountIdList: arr })
|
|
|
}
|
|
|
}}
|
|
|
onChange={(e) => {
|
|
@@ -208,7 +224,8 @@ const Ad: React.FC<Props> = (props) => {
|
|
|
value = value.replace(/[,,\s]/g,',')
|
|
|
arr = value.split(',').filter((a: any)=>a)
|
|
|
}
|
|
|
- getList({ pageNum: 1, pageSize: 20, accountIdList: arr })
|
|
|
+ set_queryFrom({...queryFrom,accountIdList: arr})
|
|
|
+ getList({...queryFrom, pageNum: 1, accountIdList: arr })
|
|
|
}
|
|
|
}}
|
|
|
/>
|
|
@@ -220,19 +237,22 @@ const Ad: React.FC<Props> = (props) => {
|
|
|
style={{ width: 150 }}
|
|
|
onBlur={(e) => {
|
|
|
let value = e.target.value
|
|
|
- getList({ pageNum: 1, pageSize: 20, adgroupName: 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
|
|
|
- getList({ pageNum: 1, pageSize: 20, adgroupName: value })
|
|
|
+ set_queryFrom({...queryFrom,adgroupName: value })
|
|
|
+ getList({ ...queryFrom,pageNum: 1, adgroupName: value })
|
|
|
}
|
|
|
}}
|
|
|
onChange={(e) => {
|
|
|
let value = e.target.value
|
|
|
if (!value) {
|
|
|
- getList({ pageNum: 1, pageSize: 20, adgroupName: value })
|
|
|
+ set_queryFrom({...queryFrom,adgroupName: value })
|
|
|
+ getList({...queryFrom, pageNum: 1, adgroupName: value })
|
|
|
}
|
|
|
}}
|
|
|
/>
|
|
@@ -249,7 +269,8 @@ const Ad: React.FC<Props> = (props) => {
|
|
|
value = value.replace(/[,,\s]/g,',')
|
|
|
arr = value.split(',').filter((a: any)=>a)
|
|
|
}
|
|
|
- getList({ pageNum: 1, pageSize: 20, adgroupIdList: arr })
|
|
|
+ set_queryFrom({...queryFrom,adgroupIdList: arr })
|
|
|
+ getList({...queryFrom, pageNum: 1, adgroupIdList: arr })
|
|
|
}}
|
|
|
onKeyDownCapture={(e: any) => {
|
|
|
let key = e.key
|
|
@@ -260,7 +281,8 @@ const Ad: React.FC<Props> = (props) => {
|
|
|
value = value.replace(/[,,\s]/g,',')
|
|
|
arr = value.split(',').filter((a: any)=>a)
|
|
|
}
|
|
|
- getList({ pageNum: 1, pageSize: 20, adgroupIdList: arr })
|
|
|
+ set_queryFrom({...queryFrom,adgroupIdList: arr })
|
|
|
+ getList({...queryFrom, pageNum: 1, adgroupIdList: arr })
|
|
|
}
|
|
|
}}
|
|
|
onChange={(e) => {
|
|
@@ -271,7 +293,8 @@ const Ad: React.FC<Props> = (props) => {
|
|
|
value = value.replace(/[,,\s]/g,',')
|
|
|
arr = value.split(',').filter((a: any)=>a)
|
|
|
}
|
|
|
- getList({ pageNum: 1, pageSize: 20, adgroupIdList: arr })
|
|
|
+ set_queryFrom({...queryFrom,adgroupIdList: arr })
|
|
|
+ getList({...queryFrom, pageNum: 1, adgroupIdList: arr })
|
|
|
}
|
|
|
}}
|
|
|
/>
|
|
@@ -288,7 +311,8 @@ const Ad: React.FC<Props> = (props) => {
|
|
|
value = value.replace(/[,,\s]/g,',')
|
|
|
arr = value.split(',').filter((a: any)=>a)
|
|
|
}
|
|
|
- getList({ pageNum: 1, pageSize: 20, campaignIdList: arr })
|
|
|
+ set_queryFrom({...queryFrom,campaignIdList: arr })
|
|
|
+ getList({ ...queryFrom,pageNum: 1, campaignIdList: arr })
|
|
|
}}
|
|
|
onKeyDownCapture={(e: any) => {
|
|
|
let key = e.key
|
|
@@ -299,7 +323,8 @@ const Ad: React.FC<Props> = (props) => {
|
|
|
value = value.replace(/[,,\s]/g,',')
|
|
|
arr = value.split(',').filter((a: any)=>a)
|
|
|
}
|
|
|
- getList({ pageNum: 1, pageSize: 20, campaignIdList: arr })
|
|
|
+ set_queryFrom({...queryFrom,campaignIdList: arr })
|
|
|
+ getList({ ...queryFrom,pageNum: 1, campaignIdList: arr })
|
|
|
}
|
|
|
}}
|
|
|
onChange={(e) => {
|
|
@@ -310,7 +335,8 @@ const Ad: React.FC<Props> = (props) => {
|
|
|
value = value.replace(/[,,\s]/g,',')
|
|
|
arr = value.split(',').filter((a: any)=>a)
|
|
|
}
|
|
|
- getList({ pageNum: 1, pageSize: 20, campaignIdList: arr })
|
|
|
+ set_queryFrom({...queryFrom,campaignIdList: arr })
|
|
|
+ getList({ ...queryFrom,pageNum: 1, campaignIdList: arr })
|
|
|
}
|
|
|
}}
|
|
|
/>
|
|
@@ -325,7 +351,8 @@ const Ad: React.FC<Props> = (props) => {
|
|
|
}
|
|
|
allowClear
|
|
|
onChange={(value: any) => {
|
|
|
- getList({ pageNum: 1, pageSize: 20, promotedObjectType: value })
|
|
|
+ set_queryFrom({...queryFrom,promotedObjectType: value })
|
|
|
+ getList({ ...queryFrom,pageNum: 1, promotedObjectType: value })
|
|
|
}}
|
|
|
>
|
|
|
{Object.keys(PromotedObjectType).map(key => {
|
|
@@ -343,7 +370,8 @@ const Ad: React.FC<Props> = (props) => {
|
|
|
}
|
|
|
allowClear
|
|
|
onChange={(value: any) => {
|
|
|
- getList({ pageNum: 1, pageSize: 20, isDeleted: value })
|
|
|
+ set_queryFrom({...queryFrom,isDeleted: value })
|
|
|
+ getList({ ...queryFrom,pageNum: 1, isDeleted: value })
|
|
|
}}
|
|
|
>
|
|
|
<Select.Option value={true}>已删除</Select.Option>
|
|
@@ -361,7 +389,8 @@ const Ad: React.FC<Props> = (props) => {
|
|
|
}
|
|
|
allowClear
|
|
|
onChange={(value: any) => {
|
|
|
- getList({ pageNum: 1, pageSize: 20, statusList: value })
|
|
|
+ set_queryFrom({...queryFrom,statusList: value })
|
|
|
+ getList({...queryFrom, pageNum: 1, statusList: value })
|
|
|
}}
|
|
|
>
|
|
|
{
|
|
@@ -371,6 +400,90 @@ const Ad: React.FC<Props> = (props) => {
|
|
|
}
|
|
|
</Select>
|
|
|
</Col>
|
|
|
+ <Col>
|
|
|
+ <Input
|
|
|
+ placeholder='腾讯备注'
|
|
|
+ allowClear
|
|
|
+ style={{ width: 150 }}
|
|
|
+ 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: 150 }}
|
|
|
+ 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>
|
|
@@ -414,7 +527,8 @@ const Ad: React.FC<Props> = (props) => {
|
|
|
onChange={(props: any) => {
|
|
|
let { sortData, pagination } = props
|
|
|
let { current, pageSize } = pagination
|
|
|
- getList({ pageNum: current, pageSize })
|
|
|
+ set_queryFrom({...queryFrom,pageNum:current,pageSize})
|
|
|
+ getList({...queryFrom, pageNum: current, pageSize })
|
|
|
}}
|
|
|
/>
|
|
|
</div>
|