Quellcode durchsuchen

Merge branch 'develop' of http://git.zanxiangnet.com/wjx/ad-manage

wjx vor 1 Jahr
Ursprung
Commit
67eb177944

+ 59 - 38
src/pages/launchSystemNew/adq/ad/index.tsx

@@ -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>
                                         更多

+ 11 - 0
src/pages/launchSystemNew/adq/ad/tableConfig.tsx

@@ -165,6 +165,17 @@ function tableConfig(
                 return `${BidModeEnum[b?.bidMode]} ${a}元/${b?.bidMode === 'BID_MODE_CPM' ? '千次曝光' : b?.bidMode === 'BID_MODE_CPC' ? '点击' : OptimizationGoalEnum[b?.optimizationGoal]}`
             }
         },
+        {
+            title: '首日付费ROI',
+            dataIndex: 'expectedRoi',
+            key: 'expectedRoi',
+            width: 70,
+            align: 'center',
+            ellipsis: true,
+            render: (a: string, b: { deepConversionSpec: any }) => {
+                return b?.deepConversionSpec?.deepConversionWorthSpec?.expectedRoi || '--'
+            }
+        },
         {
             title: '出价类型',
             dataIndex: 'smartBidType',

+ 10 - 9
src/pages/launchSystemNew/adq/config.ts

@@ -15,15 +15,16 @@ const txAdConfig = [
             { title: '投放时间', dataIndex: 'timeSeries', label: '设置信息', default: 10, width: 55 },
             { title: '首日开始投放时间', dataIndex: 'firstDayBeginTime', label: '设置信息', default: 11, width: 70 },
             { title: '出价', dataIndex: 'bidAmount', label: '设置信息', default: 12, width: 140 },
-            { title: '出价类型', dataIndex: 'smartBidType', label: '设置信息', default: 13, width: 80 },
-            { title: '广告组日预算(分)', dataIndex: 'dailyBudget', label: '设置信息', default: 14, width: 70 },
-            { title: '是否开启自动版位功能', dataIndex: 'automaticSiteEnabled', label: '设置信息', default: 15, width: 80 },
-            { title: '创建时间', dataIndex: 'createdTime', label: '设置信息', default: 16, width: 140 },
-            { title: '是否已删除', dataIndex: 'isDeleted', label: '设置信息', default: 17, width: 60 },
-            { title: '广告状态', dataIndex: 'status', label: '设置信息', default: 18, width: 70 },
-            { title: '创意预览', dataIndex: 'creativePreview', label: '设置信息', default: 19, width: 70 },
-            { title: '单位时间消耗速度', dataIndex: 'costSpeed', label: '设置信息', default: 20, width: 80 },
-            { title: '操作', dataIndex: 'cz', label: '设置信息', default: 21, width: 65 },
+            { title: '首日付费ROI', dataIndex: 'expectedRoi', label: '设置信息', default: 13, width: 70 },
+            { title: '出价类型', dataIndex: 'smartBidType', label: '设置信息', default: 14, width: 80 },
+            { title: '广告组日预算(分)', dataIndex: 'dailyBudget', label: '设置信息', default: 15, width: 70 },
+            { title: '是否开启自动版位功能', dataIndex: 'automaticSiteEnabled', label: '设置信息', default: 16, width: 80 },
+            { title: '创建时间', dataIndex: 'createdTime', label: '设置信息', default: 17, width: 140 },
+            { title: '是否已删除', dataIndex: 'isDeleted', label: '设置信息', default: 18, width: 60 },
+            { title: '广告状态', dataIndex: 'status', label: '设置信息', default: 19, width: 70 },
+            { title: '创意预览', dataIndex: 'creativePreview', label: '设置信息', default: 20, width: 70 },
+            { title: '单位时间消耗速度', dataIndex: 'costSpeed', label: '设置信息', default: 21, width: 80 },
+            { title: '操作', dataIndex: 'cz', label: '设置信息', default: 22, width: 65 },
         ]
     }
 ]