|
@@ -1,4 +1,4 @@
|
|
|
-import { Button, Card, Checkbox, Divider, Empty, Modal, Popconfirm, Radio, Select, Space, Spin, Table, Tabs, Tag, Tooltip, message } from "antd"
|
|
|
+import { Button, Card, Checkbox, Divider, Empty, Modal, Popconfirm, Radio, Select, Space, Spin, Table, Tabs, Tag, Tooltip, message, notification } from "antd"
|
|
|
import React, { useEffect, useState } from "react"
|
|
|
import style from './index.less'
|
|
|
import '../index.less'
|
|
@@ -61,6 +61,7 @@ const Create: React.FC = () => {
|
|
|
const [creativeTemplateStyle, setCreativeTemplateStyle] = useState<string>()
|
|
|
const [putInTypeList, setPutInTypeList] = useState<{ label: string, value: string }[]>([])
|
|
|
const [putInType, setPutInType] = useLocalStorageState<'NOVEL' | 'GAME'>('PUTINTYPE');
|
|
|
+ const [copyTask, setCopyTask] = useState<{ copyTaskId?: number, uuid?: string }>({})
|
|
|
|
|
|
const getGroupList = useAjax(() => getGroupListApi())
|
|
|
const createAdgroupTask = useAjax((params) => createAdgroupTaskApi(params))
|
|
@@ -197,6 +198,7 @@ const Create: React.FC = () => {
|
|
|
dynamicCreativesTextDTOS: {},
|
|
|
mediaType: 0
|
|
|
})
|
|
|
+ setCopyTask({})
|
|
|
setTableData({})
|
|
|
}
|
|
|
|
|
@@ -208,7 +210,8 @@ const Create: React.FC = () => {
|
|
|
if (taskId) {
|
|
|
getSelectTaskDetail.run(taskId).then(res => {
|
|
|
if (res) {
|
|
|
- const { adgroupDTO, accountIdParamVOMap, targetings, dynamicCreativesDTO: { mediaType, ...dynamic }, dynamicCreativesTextDTO, dynamicMaterialDTOS, taskType = 'NOVEL' } = res
|
|
|
+ const { adgroupDTO, accountIdParamVOMap, targetings, dynamicCreativesDTO: { mediaType, ...dynamic }, dynamicCreativesTextDTO, dynamicMaterialDTOS, taskType = 'NOVEL', id, uuid } = res
|
|
|
+ setCopyTask({ copyTaskId: id, uuid })
|
|
|
if (putInTypeList.some(item => item.value === taskType)) {
|
|
|
setPutInType(() => taskType)
|
|
|
let beginDate = adgroupDTO.beginDate
|
|
@@ -329,6 +332,18 @@ const Create: React.FC = () => {
|
|
|
return
|
|
|
}
|
|
|
const { adgroups, targeting, dynamic, dynamicMaterialDTos, dynamicCreativesTextDTOS, mediaType } = addelivery
|
|
|
+ if (["OPTIMIZATIONGOAL_FOLLOW", "OPTIMIZATIONGOAL_PAGE_SCAN_CODE"].includes(adgroups?.optimizationGoal)) {
|
|
|
+ if (!adgroups?.depthConversionEnabled) {
|
|
|
+ message.error('应公司要求,”关注和加企微“请开启深度转化优化')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (adgroups?.deepConversionSpec?.deepConversionWorthSpec?.expectedRoi < 0.03) {
|
|
|
+ notification.warning({
|
|
|
+ message: '请注意',
|
|
|
+ description: `当前ROI出价小于0.03,当前${adgroups?.deepConversionSpec?.deepConversionWorthSpec?.expectedRoi}`
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
if (!(adgroups && Object.keys(adgroups).length)) {
|
|
|
message.error('请先配置广告信息')
|
|
|
return
|
|
@@ -779,7 +794,8 @@ const Create: React.FC = () => {
|
|
|
dynamicCreativesTextDTOS,
|
|
|
dynamicMaterialDTOS,
|
|
|
accountIdParamDTOMap,
|
|
|
- taskType: putInType
|
|
|
+ taskType: putInType,
|
|
|
+ ...copyTask
|
|
|
}
|
|
|
createAdgroupTask.run(params).then(res => {
|
|
|
if (res) {
|