|
@@ -6,7 +6,7 @@ import React, { useEffect, useCallback, useState } from 'react'
|
|
|
import TableData from '../../components/TableData'
|
|
|
import tableConfig from './tableConfig'
|
|
|
import { putAdqAdgroupsSync, getAdqAdgroupsList, delListAdqAdgroupsApi, newEditAdqAdgroupsDataApi, editAdqAdgroupsDataApi, putAdqAdgroupsSyncBatch, putModifyCustomAudienceApi } from '@/services/launchAdq/adq'
|
|
|
-import { CopyOutlined, DeleteOutlined, DownOutlined, FieldTimeOutlined, PauseCircleOutlined, PlayCircleOutlined, QuestionCircleOutlined, SyncOutlined, TransactionOutlined } from '@ant-design/icons'
|
|
|
+import { CopyOutlined, DeleteOutlined, DownOutlined, ExclamationCircleOutlined, FieldTimeOutlined, FormOutlined, PauseCircleOutlined, PlayCircleOutlined, QuestionCircleOutlined, SyncOutlined, TransactionOutlined } from '@ant-design/icons'
|
|
|
import UpdateAd from './updateAd'
|
|
|
import Copy from './copy'
|
|
|
import PlanDetail from '@/pages/adMonitor/adMonitorList/components/planDetail'
|
|
@@ -120,11 +120,13 @@ const Ad: React.FC<Props> = (props) => {
|
|
|
|
|
|
/** 删除 */
|
|
|
const deleteHandle = (type: 0 | 1, adgroupId?: number) => {
|
|
|
+ const hide = message.loading('删除中。。。', 0)
|
|
|
delListAdqAdgroups.run({ adgroupIds: type === 1 ? selectedRows.map(item => item.adgroupId) : [adgroupId] }).then(res => {
|
|
|
+ hide()
|
|
|
message.success('删除成功')
|
|
|
setSelectedRows([])
|
|
|
listAjax.refresh()
|
|
|
- })
|
|
|
+ }).catch(() => hide())
|
|
|
}
|
|
|
|
|
|
/** 修改排期出价 */
|
|
@@ -170,12 +172,14 @@ const Ad: React.FC<Props> = (props) => {
|
|
|
}
|
|
|
//同步广告
|
|
|
const syncAd = useCallback(() => {
|
|
|
+ const hide = message.loading('同步中。。。', 0)
|
|
|
putAdqAdgroupsSyncBatchApi.run({ adgroupIds: selectedRows?.map(item => item.adgroupId) }).then(res => {
|
|
|
+ hide()
|
|
|
if (res) {
|
|
|
message.success('同步成功!')
|
|
|
listAjax.refresh()
|
|
|
}
|
|
|
- })
|
|
|
+ }).catch(() => hide())
|
|
|
}, [selectedRows])
|
|
|
// 批量复制
|
|
|
const copyHandle = () => {
|
|
@@ -453,41 +457,58 @@ const Ad: React.FC<Props> = (props) => {
|
|
|
<Col><Button type='primary' style={{ background: '#e6a23c', borderColor: '#e6a23c' }} loading={editAdqAdgroupsData.loading} icon={<PauseCircleOutlined />} disabled={selectedRows.length === 0} onClick={() => adStatus('suspend')}>暂停</Button></Col>
|
|
|
<Col><SetEarlyWarning selectedRows={selectedRows} onChange={() => listAjax.refresh()} /></Col>
|
|
|
<Col>
|
|
|
- <Dropdown overlay={<Menu items={[
|
|
|
- {
|
|
|
- key: '1',
|
|
|
- disabled: selectedRows.length === 0,
|
|
|
- label: <Button type="link" size='small' style={{ padding: 0 }} icon={<FieldTimeOutlined />} disabled={selectedRows.length === 0} onClick={editScheduling}>修改排期出价名称</Button>,
|
|
|
- },
|
|
|
- {
|
|
|
- key: '2',
|
|
|
- disabled: selectedRows.length > 0 ? !selectedRows.every((item: { accountId: number }) => item.accountId === selectedRows[0].accountId) : true,
|
|
|
- label: <Button type="link" size='small' style={{ padding: 0 }} loading={putModifyCustomAudience.loading} disabled={selectedRows.length > 0 ? !selectedRows.every((item: { accountId: number }) => item.accountId === selectedRows[0].accountId) : true} onClick={() => setRqb()}>
|
|
|
- 修改人群包
|
|
|
- <Tooltip title="2023/4/20 16:20:00刷新页面后平台创建的广告可修改,或者其它平台使用定向包创建广告可用">
|
|
|
- <QuestionCircleOutlined />
|
|
|
- </Tooltip>
|
|
|
- </Button>,
|
|
|
- },
|
|
|
- {
|
|
|
- key: '3',
|
|
|
- disabled: selectedRows.length === 0,
|
|
|
- label: <Button type="link" size='small' style={{ padding: 0 }} loading={putAdqAdgroupsSyncBatchApi.loading} icon={<SyncOutlined />} disabled={selectedRows.length === 0} onClick={syncAd}>同步广告</Button>,
|
|
|
- },
|
|
|
- {
|
|
|
- key: '4',
|
|
|
- disabled: selectedRows.length === 0,
|
|
|
- label: <Popconfirm
|
|
|
- title="确定删除?"
|
|
|
- onConfirm={() => deleteHandle(1)}
|
|
|
- okText="是"
|
|
|
- cancelText="否"
|
|
|
- disabled={selectedRows.length === 0}
|
|
|
- >
|
|
|
- <Button danger type="link" size='small' style={{ padding: 0 }} loading={delListAdqAdgroups.loading} icon={<DeleteOutlined />} disabled={selectedRows.length === 0}>删除</Button>
|
|
|
- </Popconfirm>,
|
|
|
- },
|
|
|
- ]} />}>
|
|
|
+ <Dropdown overlay={<Menu
|
|
|
+ onClick={(e) => {
|
|
|
+ switch (e.key) {
|
|
|
+ case '1':
|
|
|
+ editScheduling()
|
|
|
+ break
|
|
|
+ case '2':
|
|
|
+ setRqb()
|
|
|
+ break
|
|
|
+ case '3':
|
|
|
+ syncAd()
|
|
|
+ break
|
|
|
+ case '4':
|
|
|
+ Modal.confirm({
|
|
|
+ title: '删除',
|
|
|
+ content: '确定删除?',
|
|
|
+ icon: <ExclamationCircleOutlined />,
|
|
|
+ okType: 'danger',
|
|
|
+ onOk() {
|
|
|
+ deleteHandle(1)
|
|
|
+ }
|
|
|
+ });
|
|
|
+ break
|
|
|
+ }
|
|
|
+ }}
|
|
|
+ items={[
|
|
|
+ {
|
|
|
+ key: '1',
|
|
|
+ disabled: selectedRows.length === 0,
|
|
|
+ label: <Button type="link" size='small' style={{ padding: 0 }} icon={<FieldTimeOutlined />} disabled={selectedRows.length === 0}>修改排期出价名称</Button>,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ key: '2',
|
|
|
+ disabled: selectedRows.length > 0 ? !selectedRows.every((item: { accountId: number }) => item.accountId === selectedRows[0].accountId) : true,
|
|
|
+ label: <Button type="link" size='small' style={{ padding: 0 }} icon={<FormOutlined />} loading={putModifyCustomAudience.loading} disabled={selectedRows.length > 0 ? !selectedRows.every((item: { accountId: number }) => item.accountId === selectedRows[0].accountId) : true}>
|
|
|
+ 修改人群包
|
|
|
+ <Tooltip title="2023/4/20 16:20:00刷新页面后平台创建的广告可修改,或者其它平台使用定向包创建广告可用">
|
|
|
+ <QuestionCircleOutlined />
|
|
|
+ </Tooltip>
|
|
|
+ </Button>,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ key: '3',
|
|
|
+ disabled: selectedRows.length === 0,
|
|
|
+ label: <Button type="link" size='small' style={{ padding: 0 }} loading={putAdqAdgroupsSyncBatchApi.loading} icon={<SyncOutlined />} disabled={selectedRows.length === 0}>同步广告</Button>,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ key: '4',
|
|
|
+ disabled: selectedRows.length === 0,
|
|
|
+ label: <Button danger type="link" size='small' style={{ padding: 0 }} loading={delListAdqAdgroups.loading} icon={<DeleteOutlined />} disabled={selectedRows.length === 0}>删除</Button>,
|
|
|
+ },
|
|
|
+ ]} />}>
|
|
|
<a onClick={(e) => e.preventDefault()}>
|
|
|
<Space>
|
|
|
更多
|