|
@@ -1,6 +1,6 @@
|
|
|
-import React, { useContext, useState } from "react"
|
|
|
|
|
|
|
+import React, { useContext, useEffect, useState } from "react"
|
|
|
import style from '../index.less'
|
|
import style from '../index.less'
|
|
|
-import { Button, Typography } from "antd"
|
|
|
|
|
|
|
+import { Button, Radio, Space, Typography } from "antd"
|
|
|
import { PlusCircleOutlined, PlusOutlined, RedoOutlined } from "@ant-design/icons"
|
|
import { PlusCircleOutlined, PlusOutlined, RedoOutlined } from "@ant-design/icons"
|
|
|
import SelectTarget from "./selectTarget"
|
|
import SelectTarget from "./selectTarget"
|
|
|
import { DispatchAddelivery } from ".."
|
|
import { DispatchAddelivery } from ".."
|
|
@@ -20,14 +20,27 @@ const Target: React.FC = () => {
|
|
|
const { geoLocationList, modelList } = useModel('useLaunchV3.useTargeting')
|
|
const { geoLocationList, modelList } = useModel('useLaunchV3.useTargeting')
|
|
|
const { addelivery, setAddelivery, clearData, putInType, setIsDqSubmit } = useContext(DispatchAddelivery)!;
|
|
const { addelivery, setAddelivery, clearData, putInType, setIsDqSubmit } = useContext(DispatchAddelivery)!;
|
|
|
const { targeting, adgroups } = addelivery
|
|
const { targeting, adgroups } = addelivery
|
|
|
|
|
+ const { smartTargetingMode } = adgroups
|
|
|
const [addVisible, setAddVisible] = useState<boolean>(false)
|
|
const [addVisible, setAddVisible] = useState<boolean>(false)
|
|
|
const [addTemVisible, setAddTemVisible] = useState<boolean>(false)
|
|
const [addTemVisible, setAddTemVisible] = useState<boolean>(false)
|
|
|
const [modifyDta, setModifyDta] = useState<any>()
|
|
const [modifyDta, setModifyDta] = useState<any>()
|
|
|
const [modifyLength, setModifyLength] = useState<number>()
|
|
const [modifyLength, setModifyLength] = useState<number>()
|
|
|
const [copyDta, setCopyDta] = useState<any>()
|
|
const [copyDta, setCopyDta] = useState<any>()
|
|
|
const [copyVisible, setCopyVisible] = useState<boolean>(false)
|
|
const [copyVisible, setCopyVisible] = useState<boolean>(false)
|
|
|
|
|
+ const [stm, setStm] = useState<'SMART_TARGETING_OPEN' | 'SMART_TARGETING_MANUAL'>()
|
|
|
/***************************************/
|
|
/***************************************/
|
|
|
|
|
|
|
|
|
|
+ useEffect(() => {
|
|
|
|
|
+ setStm(smartTargetingMode || 'SMART_TARGETING_OPEN')
|
|
|
|
|
+ }, [smartTargetingMode])
|
|
|
|
|
+
|
|
|
|
|
+ const setSmartTargetingMode = (smartTargetingMode: 'SMART_TARGETING_OPEN' | 'SMART_TARGETING_MANUAL') => {
|
|
|
|
|
+ const adgroups = { ...addelivery.adgroups, smartTargetingMode }
|
|
|
|
|
+ if (smartTargetingMode === 'SMART_TARGETING_OPEN') {
|
|
|
|
|
+ delete adgroups?.smartTargetingMode
|
|
|
|
|
+ }
|
|
|
|
|
+ setAddelivery({ ...addelivery, adgroups })
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
return <>
|
|
return <>
|
|
|
<div className={`${style.settingsBody_content_row} ${style.row2}`}>
|
|
<div className={`${style.settingsBody_content_row} ${style.row2}`}>
|
|
@@ -46,7 +59,20 @@ const Target: React.FC = () => {
|
|
|
<div className={style.detail}>
|
|
<div className={style.detail}>
|
|
|
<div className={style.detail_body}>
|
|
<div className={style.detail_body}>
|
|
|
{targeting?.length > 0 && <>
|
|
{targeting?.length > 0 && <>
|
|
|
- <Title level={5} style={{ fontSize: 12 }}>全部相同</Title>
|
|
|
|
|
|
|
+ {<Space style={{ marginBottom: 5 }}>
|
|
|
|
|
+ <Title level={5} style={{ fontSize: 12, marginBottom: 0 }}>全部相同</Title>
|
|
|
|
|
+ <Radio.Group
|
|
|
|
|
+ value={stm}
|
|
|
|
|
+ size="small"
|
|
|
|
|
+ optionType="button"
|
|
|
|
|
+ buttonStyle="solid"
|
|
|
|
|
+ options={[
|
|
|
|
|
+ { label: '智能定向', value: 'SMART_TARGETING_OPEN' },
|
|
|
|
|
+ { label: '手动定向', value: 'SMART_TARGETING_MANUAL' }
|
|
|
|
|
+ ]}
|
|
|
|
|
+ onChange={(e) => setSmartTargetingMode(e.target.value)}
|
|
|
|
|
+ />
|
|
|
|
|
+ </Space>}
|
|
|
{targeting?.map((item: { targetingName: any; targeting: any, taskType: 'NOVEL' | 'GAME', id?: number }, index: number) => <div key={index}>
|
|
{targeting?.map((item: { targetingName: any; targeting: any, taskType: 'NOVEL' | 'GAME', id?: number }, index: number) => <div key={index}>
|
|
|
<DataItem
|
|
<DataItem
|
|
|
geoLocationList={geoLocationList}
|
|
geoLocationList={geoLocationList}
|