|
@@ -1,5 +1,5 @@
|
|
|
import React, { useCallback, useEffect, useMemo, useState } from 'react'
|
|
|
-import { Modal, Form, Input, Divider, Select, Radio, Switch, Spin, List, Checkbox, Space, Button, message, Image, Empty } from 'antd'
|
|
|
+import { Modal, Form, Input, Divider, Select, Radio, Switch, Spin, List, Checkbox, Space, Button, message, Image, Empty, Tooltip, Popconfirm } from 'antd'
|
|
|
import styles from './index.less'
|
|
|
import { useAjax } from '@/Hook/useAjax'
|
|
|
import { getText, get_adcreative_template, get_adcreative_template_list, get_tools_video_capture } from '@/services/launchAdq/global'
|
|
@@ -18,6 +18,7 @@ import moment from 'moment'
|
|
|
import { getVideoImgUrl, txtLength } from '@/utils/utils'
|
|
|
import VideoNews from '@/pages/launchSystemNew/components/newsModal/videoNews'
|
|
|
import VideoFrame from '@/pages/launchSystemNew/components/videoFrame'
|
|
|
+import { QuestionCircleOutlined } from '@ant-design/icons'
|
|
|
interface Props {
|
|
|
queryForm: Partial<CreateAdProps>,
|
|
|
title?: string,
|
|
@@ -134,7 +135,7 @@ function CreativePup(props: Props) {
|
|
|
let video = Form.useWatch('video', form)
|
|
|
|
|
|
// 确定事件
|
|
|
- const handleOk = useCallback(() => {
|
|
|
+ const handleOk = useCallback((newAd?:boolean) => {
|
|
|
form.validateFields().then(values => {
|
|
|
console.log('values=>1', values)
|
|
|
let newValues = JSON.parse(JSON.stringify(values))
|
|
@@ -291,6 +292,11 @@ function CreativePup(props: Props) {
|
|
|
})
|
|
|
}
|
|
|
console.log('newValues=>2', newValues)
|
|
|
+ if(newAd){
|
|
|
+ console.log("将模板变成新创意")
|
|
|
+ delete newValues.id
|
|
|
+ delete newValues.sysAdcreativeId
|
|
|
+ }
|
|
|
newValues['isTemplate'] = template_checked
|
|
|
// // 开启存为模板开关执行
|
|
|
callback(newValues)
|
|
@@ -671,7 +677,6 @@ function CreativePup(props: Props) {
|
|
|
message.warning('请先选择视频文件!!!')
|
|
|
}
|
|
|
}, [videoMaterialConfig.list])
|
|
|
-
|
|
|
return <Modal
|
|
|
visible={visible}
|
|
|
title={type === 'add' ? '新建创意' : type === 'look' ? '创意详情' : '编辑创意'}
|
|
@@ -681,11 +686,20 @@ function CreativePup(props: Props) {
|
|
|
confirmLoading={confirmLoading}
|
|
|
footer={<Space>
|
|
|
<Button onClick={() => { PupFn({ visible: false, dataInfo: null, type: 'add' }) }}>取消</Button>
|
|
|
- <Button type='primary' onClick={handleOk}>确定</Button>
|
|
|
+ {
|
|
|
+ dataInfo.id ? <Popconfirm
|
|
|
+ title='当前创意为模板点击确定后将变为新创意!如无更改需求请直接取消关闭编辑创意窗口!'
|
|
|
+ onConfirm={()=>{
|
|
|
+ handleOk(true)
|
|
|
+ }}
|
|
|
+ >
|
|
|
+ <Button type='primary' >确定</Button>
|
|
|
+ </Popconfirm>: <Button type='primary' onClick={()=>handleOk(false)}>确定</Button>
|
|
|
+ }
|
|
|
{<Checkbox checked={template_checked} onChange={(e) => {
|
|
|
let checked = e.target.checked
|
|
|
settemplate_checked(checked)
|
|
|
- }}>存为模板</Checkbox>}
|
|
|
+ }}>存为模板<Tooltip title="勾选此选项后提交计划后此创意将被存为模板,使用模板创建无每天20条限制"><QuestionCircleOutlined /></Tooltip></Checkbox>}
|
|
|
</Space>}
|
|
|
className='myModal'
|
|
|
{...arg}
|