|
@@ -1,7 +1,7 @@
|
|
|
|
|
|
import { useAjax } from '@/Hook/useAjax'
|
|
import { useAjax } from '@/Hook/useAjax'
|
|
import { AdStatusEnum, 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 { Col, Row, Input, Select, message, Space, Button, Popconfirm, Switch, notification, Modal } from 'antd'
|
|
import React, { useEffect, useCallback, useState } from 'react'
|
|
import React, { useEffect, useCallback, useState } from 'react'
|
|
import TableData from '../../components/TableData'
|
|
import TableData from '../../components/TableData'
|
|
import tableConfig from './tableConfig'
|
|
import tableConfig from './tableConfig'
|
|
@@ -11,6 +11,7 @@ import UpdateAd from './updateAd'
|
|
import Copy from './copy'
|
|
import Copy from './copy'
|
|
import PlanDetail from '@/pages/adMonitor/adMonitorList/components/planDetail'
|
|
import PlanDetail from '@/pages/adMonitor/adMonitorList/components/planDetail'
|
|
import { txAdConfig } from '../config'
|
|
import { txAdConfig } from '../config'
|
|
|
|
+import Log from '../log'
|
|
|
|
|
|
type Props = {
|
|
type Props = {
|
|
accountId?: string,
|
|
accountId?: string,
|
|
@@ -47,6 +48,7 @@ const Ad: React.FC<Props> = (props) => {
|
|
const [copyData, setCopyData] = useState<{ visible: boolean }>({ visible: false })
|
|
const [copyData, setCopyData] = useState<{ visible: boolean }>({ visible: false })
|
|
const [detailShow, setDetailShow] = useState<boolean>(false)
|
|
const [detailShow, setDetailShow] = useState<boolean>(false)
|
|
const [detailData, setDetailData] = useState<any>({})
|
|
const [detailData, setDetailData] = useState<any>({})
|
|
|
|
+ const [czjlShow, setCzjlShow] = useState(false)
|
|
const [queryFrom, set_queryFrom] = useState<{
|
|
const [queryFrom, set_queryFrom] = useState<{
|
|
pageNum: number;
|
|
pageNum: number;
|
|
pageSize: number;
|
|
pageSize: number;
|
|
@@ -97,16 +99,17 @@ const Ad: React.FC<Props> = (props) => {
|
|
}, [userId, listAjax])
|
|
}, [userId, listAjax])
|
|
// 同步
|
|
// 同步
|
|
const sync = useCallback(() => {
|
|
const sync = useCallback(() => {
|
|
- if (!adAccountId) {
|
|
|
|
- message.error('请先选择要同步的广点通账号!')
|
|
|
|
|
|
+ if (selectedRows?.length === 0) {
|
|
|
|
+ message.error('请先勾选要同步的广点通账号!')
|
|
return
|
|
return
|
|
}
|
|
}
|
|
- syncAjax.run({ adAccountId }).then(res => {
|
|
|
|
|
|
+ let arr = [...new Set(selectedRows?.map(item=>item.accountId))]
|
|
|
|
+ syncAjax.run({ accountIdList:arr }).then(res => {
|
|
res && listAjax.refresh()
|
|
res && listAjax.refresh()
|
|
res ? message.success('同步成功!') : message.error('同步失败!')
|
|
res ? message.success('同步成功!') : message.error('同步失败!')
|
|
|
|
|
|
})
|
|
})
|
|
- }, [adAccountId, listAjax])
|
|
|
|
|
|
+ }, [listAjax,selectedRows])
|
|
|
|
|
|
/** 删除 */
|
|
/** 删除 */
|
|
const deleteHandle = (type: 0 | 1, adgroupId?: number) => {
|
|
const deleteHandle = (type: 0 | 1, adgroupId?: number) => {
|
|
@@ -203,9 +206,6 @@ const Ad: React.FC<Props> = (props) => {
|
|
{/* 复制广告 */}
|
|
{/* 复制广告 */}
|
|
{copyData.visible && <Copy selectedRows={selectedRows} {...copyData} onClose={() => setCopyData({ visible: false })} onChange={() => { setCopyData({ visible: false }); listAjax.refresh(); setSelectedRows([]) }} />}
|
|
{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 }}>
|
|
<Row gutter={[6, 6]} align='middle' style={{ marginBottom: 15 }}>
|
|
- <Col>
|
|
|
|
- {Ts && Ts()}
|
|
|
|
- </Col>
|
|
|
|
<Col>
|
|
<Col>
|
|
<Input
|
|
<Input
|
|
placeholder='广告账号'
|
|
placeholder='广告账号'
|
|
@@ -397,6 +397,9 @@ const Ad: React.FC<Props> = (props) => {
|
|
</Popconfirm>
|
|
</Popconfirm>
|
|
</Col>
|
|
</Col>
|
|
</> : <Col><Button type='primary' icon={<TransactionOutlined />} disabled={selectedRows.length === 0} onClick={editDeepConversion}>修改深度优化ROI</Button></Col>}
|
|
</> : <Col><Button type='primary' icon={<TransactionOutlined />} disabled={selectedRows.length === 0} onClick={editDeepConversion}>修改深度优化ROI</Button></Col>}
|
|
|
|
+ <Col>
|
|
|
|
+ <Button type='dashed' onClick={() => { setCzjlShow(true) }}>操作记录</Button>
|
|
|
|
+ </Col>
|
|
</Row>
|
|
</Row>
|
|
</Space>}
|
|
</Space>}
|
|
rowSelection={{
|
|
rowSelection={{
|
|
@@ -425,6 +428,16 @@ const Ad: React.FC<Props> = (props) => {
|
|
}}
|
|
}}
|
|
/>
|
|
/>
|
|
{detailShow && <PlanDetail visible={detailShow} onClose={() => { setDetailShow(false) }} data={detailData} />}
|
|
{detailShow && <PlanDetail visible={detailShow} onClose={() => { setDetailShow(false) }} data={detailData} />}
|
|
|
|
+ {czjlShow && <Modal
|
|
|
|
+ visible={czjlShow}
|
|
|
|
+ onCancel={()=>{setCzjlShow(false)}}
|
|
|
|
+ onOk={()=>{setCzjlShow(false)}}
|
|
|
|
+ width={1200}
|
|
|
|
+ footer={null}
|
|
|
|
+ title={"广告操作记录"}
|
|
|
|
+ >
|
|
|
|
+ <Log {...props} />
|
|
|
|
+ </Modal>}
|
|
</div>
|
|
</div>
|
|
}
|
|
}
|
|
export default Ad
|
|
export default Ad
|