|
@@ -7,7 +7,7 @@ import { getTagsList, get_adcreative_template } from "@/services/launchAdq/globa
|
|
|
import { getSysAdgroupsInfo } from "@/services/launchAdq/localAd"
|
|
|
import { getsysTargetingInfo } from "@/services/launchAdq/targeting"
|
|
|
import { CheckOutlined, CloseOutlined, SearchOutlined } from "@ant-design/icons"
|
|
|
-import { Button, Card, Col, Empty, Row, Select, Space, Spin, Tooltip, Image, message, Tabs, Popconfirm, notification, Divider, Checkbox, Modal } from "antd"
|
|
|
+import { Button, Card, Col, Empty, Row, Select, Space, Spin, Tooltip, Image, message, Tabs, Popconfirm, notification, Divider, Checkbox, Modal, Tag } from "antd"
|
|
|
import React, { useCallback, useEffect, useState } from "react"
|
|
|
import { useModel } from "umi"
|
|
|
import Ad from "./ad"
|
|
@@ -23,13 +23,14 @@ import SubmitModal from "./submitModal"
|
|
|
import columns from "./tableConfig"
|
|
|
import TargetIng from './targeting'
|
|
|
import Creative from './creative'
|
|
|
-import AddGroup from '../../components/addGroup'
|
|
|
import CustomerServiceModal from "../../components/customerServiceModal"
|
|
|
import { getTaskDetailsApi } from "@/services/launchAdq/taskList"
|
|
|
import CreativeCL from "./creativeCL"
|
|
|
import { groupBy } from "@/utils/utils"
|
|
|
import moment from "moment"
|
|
|
import { getAccountListApi, getGroupListApi } from "@/services/launchAdq/subgroup"
|
|
|
+import TacticsS from "./tacticsS"
|
|
|
+import UserTactics from "./tacticsS/userTactics"
|
|
|
|
|
|
const CreateAd: React.FC = () => {
|
|
|
|
|
@@ -56,7 +57,6 @@ const CreateAd: React.FC = () => {
|
|
|
})
|
|
|
const [launchMode, setLaunchMode] = useState<number>(Number(localStorage.getItem('LAUNCHMODE')) || 1) // 投放模式 1 现在投放模式 2 创量模式
|
|
|
const [accountCreateLogs, setAccountCreateLogs] = useState<{ adAccountId: number, id: number, userActionSetsList?: any[], productList?: any, conversionList?: any, customAudienceList?: any, excludedCustomAudienceList?: any, pageList?: any, coldStartAudienceList?: any[] }[]>([]) // 账户
|
|
|
- const { currentUser: { userId } }: any = useModel('@@initialState', model => ({ currentUser: model.initialState?.currentUser }))
|
|
|
|
|
|
const [goodsVisible, setGoodsVisible] = useState<boolean>(false) // 选择商品弹窗控制
|
|
|
const [sourceVisible, setSourceVisible] = useState<boolean>(false) // 选择数据源弹窗控制
|
|
@@ -71,7 +71,6 @@ const CreateAd: React.FC = () => {
|
|
|
const [modelList, setModelList] = useState<any>({}) // 所有品牌手机
|
|
|
const [targetKey, set_targetKey] = useState('0')//创意key
|
|
|
const [page_checked, set_page_checked] = useState(false)//创意key
|
|
|
- const [usesArr, setUsersArr] = useState<any>(localStorage.getItem('ADQUSERS' + userId) ? JSON.parse(localStorage.getItem('ADQUSERS' + userId) as any) : [])
|
|
|
const { init, get } = useModel('useLaunchAdq.useBdMediaPup')
|
|
|
const [cloudParams, setCloudParams] = useState<{ adcreativeTemplateId?: number }>({})
|
|
|
const [accSearch, setAccSearch] = useState<string>()
|
|
@@ -87,7 +86,7 @@ const CreateAd: React.FC = () => {
|
|
|
const getAdcreativeTemplate = useAjax((params) => get_adcreative_template(params))
|
|
|
const getGroupList = useAjax(() => getGroupListApi())
|
|
|
/*************************/
|
|
|
-
|
|
|
+
|
|
|
useEffect(() => {
|
|
|
getGroupList.run()
|
|
|
}, [])
|
|
@@ -843,11 +842,6 @@ const CreateAd: React.FC = () => {
|
|
|
}
|
|
|
}
|
|
|
}, [queryForm, targetKey])
|
|
|
- // 媒体组更新通知
|
|
|
- const usersChange = useCallback(() => {
|
|
|
- let data = JSON.parse(localStorage.getItem('ADQUSERS' + userId) as any)
|
|
|
- setUsersArr(data)
|
|
|
- }, [])
|
|
|
|
|
|
// 切换投放模式
|
|
|
const switchLaunchMode = () => {
|
|
@@ -889,7 +883,6 @@ const CreateAd: React.FC = () => {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-
|
|
|
return <Space direction="vertical" style={{ width: '100%' }}>
|
|
|
<Card
|
|
|
title={<Space>
|
|
@@ -905,7 +898,7 @@ const CreateAd: React.FC = () => {
|
|
|
</Space>}
|
|
|
className={style.createAd}
|
|
|
hoverable
|
|
|
- // extra={<AddGroup onChange={usersChange} pitcherData={getAdAccount?.data?.data} />}
|
|
|
+ extra={<UserTactics setQueryForm={setQueryForm} setAccountCreateLogs={setAccountCreateLogs} setLaunchMode={setLaunchMode} />}
|
|
|
>
|
|
|
<Space wrap>
|
|
|
<Selector label="媒体账户组">
|
|
@@ -932,9 +925,25 @@ const CreateAd: React.FC = () => {
|
|
|
maxTagCount={1}
|
|
|
allowClear
|
|
|
bordered={false}
|
|
|
- maxTagPlaceholder={<Tooltip color="#FFF" title={<span style={{ color: '#000' }}>{accountCreateLogs?.filter((item, index) => index !== 0)?.map(item => item.adAccountId).toString()}</span>}>
|
|
|
- <span>+{accountCreateLogs?.length > 1 ? accountCreateLogs.length - 1 : 0}</span>
|
|
|
- </Tooltip>}
|
|
|
+ maxTagPlaceholder={
|
|
|
+ <Tooltip
|
|
|
+ color="#FFF"
|
|
|
+ title={<span style={{ color: '#000' }}>
|
|
|
+ {accountCreateLogs?.filter((item, index) => index !== 0)
|
|
|
+ ?.map((item, index) => <Tag
|
|
|
+ key={index}
|
|
|
+ closable
|
|
|
+ onClose={() => {
|
|
|
+ setAccountCreateLogs(accountCreateLogs?.filter(item1 => item1.adAccountId !== item.adAccountId))
|
|
|
+ setQueryForm({ ...queryForm, adqPageList: [], pageList: [], taskMediaMaps: queryForm?.taskMediaMaps?.map((item: { sysPageId: number }) => ({ ...item, sysPageId: '', accountPageIdMap: {}, cropUserGroupMap: [] })) })
|
|
|
+ clearData()
|
|
|
+ }}
|
|
|
+ >{item.adAccountId}</Tag>)}</span>
|
|
|
+ }
|
|
|
+ >
|
|
|
+ <span>+{accountCreateLogs?.length > 1 ? accountCreateLogs.length - 1 : 0}</span>
|
|
|
+ </Tooltip>
|
|
|
+ }
|
|
|
dropdownMatchSelectWidth={false}
|
|
|
autoClearSearchValue={false}
|
|
|
filterOption={(input: any, option: any) => {
|
|
@@ -1258,6 +1267,7 @@ const CreateAd: React.FC = () => {
|
|
|
</Row>
|
|
|
{/* =============广告底部按钮=========== */}
|
|
|
<Space className={style.bts}>
|
|
|
+ <TacticsS queryForm={queryForm} accountCreateLogs={accountCreateLogs} launchMode={launchMode} />
|
|
|
<Button type='primary' onClick={severBd}>存为预设</Button>
|
|
|
<Button type='primary' onClick={preview}><SearchOutlined /> 批量预览广告</Button>
|
|
|
<Button onClick={delBdPlan}>清空配置/预设</Button>
|