|
@@ -1,6 +1,6 @@
|
|
|
import { CloseCircleOutlined, DeleteOutlined, PlusOutlined, RetweetOutlined } from "@ant-design/icons"
|
|
|
import { Button, Card, Dropdown, Empty, Form, InputNumber, Modal, Popconfirm, Space, Tooltip, message } from "antd"
|
|
|
-import React, { useEffect, useState } from "react"
|
|
|
+import React, { useEffect, useMemo, useState } from "react"
|
|
|
import styles from './index.less'
|
|
|
import VideoNews from "@/pages/launchSystemNew/components/newsModal/videoNews"
|
|
|
import { chunkArray1, getVideoImgUrl } from "@/utils/utils"
|
|
@@ -70,22 +70,23 @@ const AddMaterial: React.FC<Props> = ({ creativeTemplateId, materialData, delive
|
|
|
|
|
|
useEffect(() => {
|
|
|
if (materialData && Object.keys(materialData).length > 0) {
|
|
|
- let fKey = Object.keys(materialData)[0];
|
|
|
- let children = materialData[fKey]?.children
|
|
|
- let childrenKey = Object.keys(children)
|
|
|
+ console.log('materialData', materialData)
|
|
|
+ const fKey = Object.keys(materialData)[0];
|
|
|
+ const children = materialData[fKey]?.children
|
|
|
+ const childrenKey = Object.keys(children)
|
|
|
setMLength(childrenKey?.length)
|
|
|
|
|
|
- let videoData = childrenKey?.find(item => item === 'short_video1' || item === 'video_id')
|
|
|
+ const videoData = childrenKey?.find(item => item === 'short_video1' || item === 'video_id')
|
|
|
if (videoData) {
|
|
|
setVideoUploads(children[videoData])
|
|
|
}
|
|
|
- let imageData = childrenKey?.find(item => item === 'cover_id' || item === 'image_id')
|
|
|
+ const imageData = childrenKey?.find(item => item === 'cover_id' || item === 'image_id')
|
|
|
if (imageData) {
|
|
|
setImgUploads(children[imageData])
|
|
|
}
|
|
|
- let imageListData = childrenKey?.find(item => item === 'list')
|
|
|
+ const imageListData = childrenKey?.find(item => item === 'list')
|
|
|
if (imageListData) {
|
|
|
- let data = children[imageListData]
|
|
|
+ const data = children[imageListData]
|
|
|
if (fKey === 'image_list') {
|
|
|
setMinNumber(data.arrayProperty.mixNumber)
|
|
|
setImgUploads({ ...data['children']['image_id'], arrayProperty: data.arrayProperty, name: 'image_list' })
|
|
@@ -194,10 +195,146 @@ const AddMaterial: React.FC<Props> = ({ creativeTemplateId, materialData, delive
|
|
|
return `${imageCount}张图片,${videoCount}个视频,${arrayImgCount}个组图`
|
|
|
}
|
|
|
|
|
|
+ // 按钮
|
|
|
+ const renderDynamicSwitch = (num: number, isAll?: boolean) => {
|
|
|
+ return Object.keys(materialData)?.map(key => {
|
|
|
+ const m = materialData[key]
|
|
|
+ const children = m.children
|
|
|
+ if (isAll) {
|
|
|
+ return Object.keys(children).map(k => {
|
|
|
+ const item = children[k]
|
|
|
+ if (k === 'short_video1' || k === 'video_id') {
|
|
|
+ return <Button
|
|
|
+ type="primary"
|
|
|
+ onClick={() => {
|
|
|
+ setSelectCloudData({
|
|
|
+ num: 500,
|
|
|
+ defaultParams: {
|
|
|
+ materialType: 'video',
|
|
|
+ sizeQueries: creativeTemplateId === 1708 ? [{ relation: '=', width: 1280, height: 720 }] : [{ relation: item.restriction.videoRestriction.minWidth > item.restriction.videoRestriction.minHeight ? '=' : '>=', width: item.restriction.videoRestriction.minWidth, height: item.restriction.videoRestriction.minHeight }],
|
|
|
+ fileSize: item.restriction.videoRestriction.fileSize * 1024
|
|
|
+ }
|
|
|
+ })
|
|
|
+ setMaterialConfig({
|
|
|
+ ...materialConfig,
|
|
|
+ type: item.name,
|
|
|
+ max: 500,
|
|
|
+ index: 20000,
|
|
|
+ adcreativeTemplateId: creativeTemplateId,
|
|
|
+ isGroup: false
|
|
|
+ })
|
|
|
+ setTimeout(() => {
|
|
|
+ setSelectVideoVisible(true)
|
|
|
+ }, 100)
|
|
|
+ }}
|
|
|
+ >批量添加视频</Button>
|
|
|
+ } else if (item.name === 'image_id') {
|
|
|
+ return <Button
|
|
|
+ type="primary"
|
|
|
+ onClick={() => {
|
|
|
+ setSelectCloudData({
|
|
|
+ num: 500,
|
|
|
+ defaultParams: {
|
|
|
+ materialType: 'image',
|
|
|
+ sizeQueries: [{ relation: '=', width: item.restriction.imageRestriction.width, height: item.restriction.imageRestriction.height }],
|
|
|
+ fileSize: item.restriction.imageRestriction.fileSize * 1024
|
|
|
+ }
|
|
|
+ })
|
|
|
+ setMaterialConfig({
|
|
|
+ ...materialConfig,
|
|
|
+ type: item.name,
|
|
|
+ max: 500,
|
|
|
+ index: 20000,
|
|
|
+ adcreativeTemplateId: creativeTemplateId,
|
|
|
+ isGroup: false
|
|
|
+ })
|
|
|
+ setTimeout(() => {
|
|
|
+ setSelectVideoVisible(true)
|
|
|
+ }, 100)
|
|
|
+ }}
|
|
|
+ >批量添加图片</Button>
|
|
|
+ } else if (item.name === 'list') {
|
|
|
+ return <Button
|
|
|
+ type="primary"
|
|
|
+ onClick={() => {
|
|
|
+ selectGroupListImg(item.arrayProperty.maxNumber)
|
|
|
+ }}
|
|
|
+ >批量添加业务单元{item.arrayProperty.maxNumber}图</Button>
|
|
|
+ }
|
|
|
+ return null
|
|
|
+ })
|
|
|
+ }
|
|
|
+ return Object.keys(children).map(k => {
|
|
|
+ const item = children[k]
|
|
|
+ if (k === 'short_video1' || k === 'video_id') {
|
|
|
+ return <Button
|
|
|
+ type="primary"
|
|
|
+ onClick={() => {
|
|
|
+ setSelectCloudData({
|
|
|
+ num: 15 - (dynamicGroup?.[num]?.['list']?.length || 0),
|
|
|
+ defaultParams: {
|
|
|
+ materialType: 'video',
|
|
|
+ sizeQueries: creativeTemplateId === 1708 ? [{ relation: '=', width: 1280, height: 720 }] : [{ relation: item.restriction.videoRestriction.minWidth > item.restriction.videoRestriction.minHeight ? '=' : '>=', width: item.restriction.videoRestriction.minWidth, height: item.restriction.videoRestriction.minHeight }],
|
|
|
+ fileSize: item.restriction.videoRestriction.fileSize * 1024
|
|
|
+ }
|
|
|
+ })
|
|
|
+ setMaterialConfig({
|
|
|
+ ...materialConfig,
|
|
|
+ type: item.name,
|
|
|
+ max: 15 - (dynamicGroup?.[num]?.['list']?.length || 0),
|
|
|
+ index: num,
|
|
|
+ adcreativeTemplateId: creativeTemplateId,
|
|
|
+ isGroup: false
|
|
|
+ })
|
|
|
+ setTimeout(() => {
|
|
|
+ setSelectVideoVisible(true)
|
|
|
+ }, 100)
|
|
|
+ }}
|
|
|
+ >添加视频</Button>
|
|
|
+ } else if (item.name === 'image_id') {
|
|
|
+ return <Button
|
|
|
+ type="primary"
|
|
|
+ onClick={() => {
|
|
|
+ setSelectCloudData({
|
|
|
+ num: 15 - (dynamicGroup?.[num]?.['list']?.length || 0),
|
|
|
+ defaultParams: {
|
|
|
+ materialType: 'image',
|
|
|
+ sizeQueries: [{ relation: '=', width: item.restriction.imageRestriction.width, height: item.restriction.imageRestriction.height }],
|
|
|
+ fileSize: item.restriction.imageRestriction.fileSize * 1024
|
|
|
+ }
|
|
|
+ })
|
|
|
+ setMaterialConfig({
|
|
|
+ ...materialConfig,
|
|
|
+ type: item.name,
|
|
|
+ max: 15 - (dynamicGroup?.[num]?.['list']?.length || 0),
|
|
|
+ index: num,
|
|
|
+ adcreativeTemplateId: creativeTemplateId,
|
|
|
+ isGroup: false
|
|
|
+ })
|
|
|
+ setTimeout(() => {
|
|
|
+ setSelectVideoVisible(true)
|
|
|
+ }, 100)
|
|
|
+ }}
|
|
|
+ >添加图片</Button>
|
|
|
+ } else if (item.name === 'list') {
|
|
|
+ return <Button
|
|
|
+ type="primary"
|
|
|
+ disabled={dynamicGroup?.[num]?.['list']?.length >= 15}
|
|
|
+ onClick={() => {
|
|
|
+ selectGroupImg(num, item.arrayProperty.maxNumber, 15 - (dynamicGroup?.[num]?.['list']?.length || 0))
|
|
|
+ }}
|
|
|
+ >添加{item.arrayProperty.maxNumber}图</Button>
|
|
|
+ }
|
|
|
+ return null
|
|
|
+ })
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
return <Modal
|
|
|
title={<Space>
|
|
|
<strong style={{ fontSize: 20 }}>创意素材</strong>
|
|
|
- {(deliveryMode === 'DELIVERY_MODE_CUSTOMIZE' || dynamicCreativeSwitch) ? <>
|
|
|
+ {/* {(deliveryMode === 'DELIVERY_MODE_CUSTOMIZE' || dynamicCreativeSwitch) ? <> */}
|
|
|
+ {(deliveryMode === 'DELIVERY_MODE_CUSTOMIZE') ? <>
|
|
|
{videoUploads && Object.keys(videoUploads)?.length > 0 && <Button type="link" onClick={() => {
|
|
|
setSelectCloudData({ defaultParams: { sizeQueries: creativeTemplateId === 1708 ? [{ relation: '>=', width: 1280, height: 720 }] : [{ relation: '>=', width: videoUploads.restriction.videoRestriction.minWidth, height: videoUploads.restriction.videoRestriction.minHeight }], fileSize: videoUploads.restriction.videoRestriction.fileSize * 1024, materialType: 'video' }, num: 500 })
|
|
|
setMaterialConfig({
|
|
@@ -239,26 +376,54 @@ const AddMaterial: React.FC<Props> = ({ creativeTemplateId, materialData, delive
|
|
|
}}><RetweetOutlined /></a>
|
|
|
</Tooltip>}
|
|
|
</Space>
|
|
|
- <Button
|
|
|
- type="link"
|
|
|
- onClick={() => {
|
|
|
+ {dynamicCreativeSwitch ? <>
|
|
|
+ {renderDynamicSwitch(0, true)}
|
|
|
+ </> : <>
|
|
|
+ <Button
|
|
|
+ type="link"
|
|
|
+ onClick={() => {
|
|
|
+ setSelectCloudData({
|
|
|
+ num: 500,
|
|
|
+ defaultParams: {
|
|
|
+ materialType: 'image',
|
|
|
+ sizeQueries: [
|
|
|
+ { relation: '=', width: 800, height: 800 },
|
|
|
+ { relation: '=', width: 1280, height: 720 },
|
|
|
+ { relation: '=', width: 960, height: 334 },
|
|
|
+ { relation: '=', width: 480, height: 320 },
|
|
|
+ { relation: '=', width: 1080, height: 1920 }
|
|
|
+ ],
|
|
|
+ fileSize: 400 * 1024
|
|
|
+ }
|
|
|
+ })
|
|
|
+ setMaterialConfig({
|
|
|
+ ...materialConfig,
|
|
|
+ type: 'image',
|
|
|
+ max: 500,
|
|
|
+ index: 20000,
|
|
|
+ adcreativeTemplateId: creativeTemplateId,
|
|
|
+ isGroup: false
|
|
|
+ })
|
|
|
+ setTimeout(() => {
|
|
|
+ setSelectVideoVisible(true)
|
|
|
+ }, 100)
|
|
|
+ }}
|
|
|
+ >批量添加图片素材</Button>
|
|
|
+ <Button type="link" onClick={() => {
|
|
|
setSelectCloudData({
|
|
|
num: 500,
|
|
|
defaultParams: {
|
|
|
- materialType: 'image',
|
|
|
+ materialType: 'video',
|
|
|
sizeQueries: [
|
|
|
- { relation: '=', width: 800, height: 800 },
|
|
|
- { relation: '=', width: 1280, height: 720 },
|
|
|
- { relation: '=', width: 960, height: 334 },
|
|
|
- { relation: '=', width: 480, height: 320 },
|
|
|
- { relation: '=', width: 1080, height: 1920 }
|
|
|
+ { relation: '>=', width: 1280, height: 720 },
|
|
|
+ { relation: '>=', width: 720, height: 1280 }
|
|
|
],
|
|
|
- fileSize: 400 * 1024
|
|
|
+ fileSize: 512000 * 1024
|
|
|
}
|
|
|
})
|
|
|
setMaterialConfig({
|
|
|
...materialConfig,
|
|
|
- type: 'image',
|
|
|
+ type: 'video',
|
|
|
max: 500,
|
|
|
index: 20000,
|
|
|
adcreativeTemplateId: creativeTemplateId,
|
|
@@ -267,45 +432,22 @@ const AddMaterial: React.FC<Props> = ({ creativeTemplateId, materialData, delive
|
|
|
setTimeout(() => {
|
|
|
setSelectVideoVisible(true)
|
|
|
}, 100)
|
|
|
- }}>批量添加图片素材</Button>
|
|
|
- <Button type="link" onClick={() => {
|
|
|
- setSelectCloudData({
|
|
|
- num: 500,
|
|
|
- defaultParams: {
|
|
|
- materialType: 'video',
|
|
|
- sizeQueries: [
|
|
|
- { relation: '>=', width: 1280, height: 720 },
|
|
|
- { relation: '>=', width: 720, height: 1280 }
|
|
|
- ],
|
|
|
- fileSize: 512000 * 1024
|
|
|
- }
|
|
|
- })
|
|
|
- setMaterialConfig({
|
|
|
- ...materialConfig,
|
|
|
- type: 'video',
|
|
|
- max: 500,
|
|
|
- index: 20000,
|
|
|
- adcreativeTemplateId: creativeTemplateId,
|
|
|
- isGroup: false
|
|
|
- })
|
|
|
- setTimeout(() => {
|
|
|
- setSelectVideoVisible(true)
|
|
|
- }, 100)
|
|
|
- }}>批量添加视频素材</Button>
|
|
|
- {deliveryMode === 'DELIVERY_MODE_COMPONENT' && <Dropdown
|
|
|
- menu={{
|
|
|
- items: [
|
|
|
- { label: '1:1 九图', key: '4', onClick: () => { selectGroupListImg(9) } },
|
|
|
- { label: '1:1 六图', key: '1', onClick: () => { selectGroupListImg(6) } },
|
|
|
- { label: '1:1 三图', key: '2', onClick: () => { selectGroupListImg(3) } },
|
|
|
- { label: '1:1 四图', key: '3', onClick: () => { selectGroupListImg(4) } },
|
|
|
- ]
|
|
|
- }}
|
|
|
- placement="bottomLeft"
|
|
|
- arrow
|
|
|
- >
|
|
|
- <Button type="link">批量添加业务单元组图</Button>
|
|
|
- </Dropdown>}
|
|
|
+ }}>批量添加视频素材</Button>
|
|
|
+ {deliveryMode === 'DELIVERY_MODE_COMPONENT' && <Dropdown
|
|
|
+ menu={{
|
|
|
+ items: [
|
|
|
+ { label: '1:1 九图', key: '4', onClick: () => { selectGroupListImg(9) } },
|
|
|
+ { label: '1:1 六图', key: '1', onClick: () => { selectGroupListImg(6) } },
|
|
|
+ { label: '1:1 三图', key: '2', onClick: () => { selectGroupListImg(3) } },
|
|
|
+ { label: '1:1 四图', key: '3', onClick: () => { selectGroupListImg(4) } },
|
|
|
+ ]
|
|
|
+ }}
|
|
|
+ placement="bottomLeft"
|
|
|
+ arrow
|
|
|
+ >
|
|
|
+ <Button type="link">批量添加业务单元组图</Button>
|
|
|
+ </Dropdown>}
|
|
|
+ </>}
|
|
|
</>}
|
|
|
{(dynamicGroup && dynamicGroup?.length > 1) && <Popconfirm
|
|
|
title="是否清空?"
|
|
@@ -361,104 +503,111 @@ const AddMaterial: React.FC<Props> = ({ creativeTemplateId, materialData, delive
|
|
|
{fields.map((field, num) => (<Card
|
|
|
title={<Space>
|
|
|
<strong style={{ fontSize: 18 }}>创意组{num + 1}</strong>
|
|
|
- {(deliveryMode === 'DELIVERY_MODE_COMPONENT' && !dynamicCreativeSwitch) && <>
|
|
|
- <Dropdown
|
|
|
- menu={{
|
|
|
- items: [
|
|
|
- {
|
|
|
- label: '添加视频',
|
|
|
- key: 'addVideo',
|
|
|
- onClick: () => {
|
|
|
- setSelectCloudData({
|
|
|
- num: 15 - (dynamicGroup?.[num]?.['list']?.length || 0),
|
|
|
- defaultParams: {
|
|
|
- materialType: 'video',
|
|
|
- sizeQueries: [
|
|
|
- { relation: '>=', width: 1280, height: 720 },
|
|
|
- { relation: '>=', width: 720, height: 1280 }
|
|
|
- ],
|
|
|
- fileSize: 512000 * 1024
|
|
|
- }
|
|
|
- })
|
|
|
- setMaterialConfig({
|
|
|
- ...materialConfig,
|
|
|
- type: 'video',
|
|
|
- max: 15 - (dynamicGroup?.[num]?.['list']?.length || 0),
|
|
|
- index: num,
|
|
|
- adcreativeTemplateId: creativeTemplateId,
|
|
|
- isGroup: false
|
|
|
- })
|
|
|
- setTimeout(() => {
|
|
|
- setSelectVideoVisible(true)
|
|
|
- }, 100)
|
|
|
- }
|
|
|
- },
|
|
|
- {
|
|
|
- label: '添加图片',
|
|
|
- key: 'addImg',
|
|
|
- onClick: () => {
|
|
|
- setSelectCloudData({
|
|
|
- num: 15 - (dynamicGroup?.[num]?.['list']?.length || 0),
|
|
|
- defaultParams: {
|
|
|
- materialType: 'image',
|
|
|
- sizeQueries: [
|
|
|
- { relation: '=', width: 800, height: 800 },
|
|
|
- { relation: '=', width: 1280, height: 720 },
|
|
|
- { relation: '=', width: 960, height: 334 },
|
|
|
- { relation: '=', width: 480, height: 320 },
|
|
|
- { relation: '=', width: 1080, height: 1920 }
|
|
|
- ],
|
|
|
- fileSize: 400 * 1024
|
|
|
- }
|
|
|
- })
|
|
|
- setMaterialConfig({
|
|
|
- ...materialConfig,
|
|
|
- type: 'image',
|
|
|
- max: 15 - (dynamicGroup?.[num]?.['list']?.length || 0),
|
|
|
- index: num,
|
|
|
- adcreativeTemplateId: creativeTemplateId,
|
|
|
- isGroup: false
|
|
|
- })
|
|
|
- setTimeout(() => {
|
|
|
- setSelectVideoVisible(true)
|
|
|
- }, 100)
|
|
|
+ {/* {(deliveryMode === 'DELIVERY_MODE_COMPONENT' && !dynamicCreativeSwitch) && <> */}
|
|
|
+ {(deliveryMode === 'DELIVERY_MODE_COMPONENT') && <>
|
|
|
+ {dynamicCreativeSwitch ? <>
|
|
|
+ {renderDynamicSwitch(num)}
|
|
|
+ </> : <>
|
|
|
+ <Dropdown
|
|
|
+ menu={{
|
|
|
+ items: [
|
|
|
+ {
|
|
|
+ label: '添加视频',
|
|
|
+ key: 'addVideo',
|
|
|
+ onClick: () => {
|
|
|
+ setSelectCloudData({
|
|
|
+ num: 15 - (dynamicGroup?.[num]?.['list']?.length || 0),
|
|
|
+ defaultParams: {
|
|
|
+ materialType: 'video',
|
|
|
+ sizeQueries: [
|
|
|
+ { relation: '>=', width: 1280, height: 720 },
|
|
|
+ { relation: '>=', width: 720, height: 1280 }
|
|
|
+ ],
|
|
|
+ fileSize: 512000 * 1024
|
|
|
+ }
|
|
|
+ })
|
|
|
+ setMaterialConfig({
|
|
|
+ ...materialConfig,
|
|
|
+ type: 'video',
|
|
|
+ max: 15 - (dynamicGroup?.[num]?.['list']?.length || 0),
|
|
|
+ index: num,
|
|
|
+ adcreativeTemplateId: creativeTemplateId,
|
|
|
+ isGroup: false
|
|
|
+ })
|
|
|
+ setTimeout(() => {
|
|
|
+ setSelectVideoVisible(true)
|
|
|
+ }, 100)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '添加图片',
|
|
|
+ key: 'addImg',
|
|
|
+ onClick: () => {
|
|
|
+ setSelectCloudData({
|
|
|
+ num: 15 - (dynamicGroup?.[num]?.['list']?.length || 0),
|
|
|
+ defaultParams: {
|
|
|
+ materialType: 'image',
|
|
|
+ sizeQueries: [
|
|
|
+ { relation: '=', width: 800, height: 800 },
|
|
|
+ { relation: '=', width: 1280, height: 720 },
|
|
|
+ { relation: '=', width: 960, height: 334 },
|
|
|
+ { relation: '=', width: 480, height: 320 },
|
|
|
+ { relation: '=', width: 1080, height: 1920 }
|
|
|
+ ],
|
|
|
+ fileSize: 400 * 1024
|
|
|
+ }
|
|
|
+ })
|
|
|
+ setMaterialConfig({
|
|
|
+ ...materialConfig,
|
|
|
+ type: 'image',
|
|
|
+ max: 15 - (dynamicGroup?.[num]?.['list']?.length || 0),
|
|
|
+ index: num,
|
|
|
+ adcreativeTemplateId: creativeTemplateId,
|
|
|
+ isGroup: false
|
|
|
+ })
|
|
|
+ setTimeout(() => {
|
|
|
+ setSelectVideoVisible(true)
|
|
|
+ }, 100)
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
- ]
|
|
|
- }}
|
|
|
- placement="bottomLeft"
|
|
|
- arrow
|
|
|
- >
|
|
|
- <Button type="primary">添加图片/视频</Button>
|
|
|
- </Dropdown>
|
|
|
- <Dropdown
|
|
|
- menu={{
|
|
|
- items: [
|
|
|
- { label: '1:1 九图', key: '4', disabled: dynamicGroup?.[num]?.['list']?.length >= 15, onClick: () => { selectGroupImg(num, 9, 15 - (dynamicGroup?.[num]?.['list']?.length || 0)) } },
|
|
|
- { label: '1:1 六图', key: '1', disabled: dynamicGroup?.[num]?.['list']?.length >= 15, onClick: () => { selectGroupImg(num, 6, 15 - (dynamicGroup?.[num]?.['list']?.length || 0)) } },
|
|
|
- { label: '1:1 三图', key: '2', disabled: dynamicGroup?.[num]?.['list']?.length >= 15, onClick: () => { selectGroupImg(num, 3, 15 - (dynamicGroup?.[num]?.['list']?.length || 0)) } },
|
|
|
- { label: '1:1 四图', key: '3', disabled: dynamicGroup?.[num]?.['list']?.length >= 15, onClick: () => { selectGroupImg(num, 4, 15 - (dynamicGroup?.[num]?.['list']?.length || 0)) } },
|
|
|
- ]
|
|
|
- }}
|
|
|
- placement="bottomLeft"
|
|
|
- arrow
|
|
|
- >
|
|
|
- <Button type="primary">上传组图</Button>
|
|
|
- </Dropdown>
|
|
|
+ ]
|
|
|
+ }}
|
|
|
+ placement="bottomLeft"
|
|
|
+ arrow
|
|
|
+ >
|
|
|
+ <Button type="primary">添加图片/视频</Button>
|
|
|
+ </Dropdown>
|
|
|
+ <Dropdown
|
|
|
+ menu={{
|
|
|
+ items: [
|
|
|
+ { label: '1:1 九图', key: '4', disabled: dynamicGroup?.[num]?.['list']?.length >= 15, onClick: () => { selectGroupImg(num, 9, 15 - (dynamicGroup?.[num]?.['list']?.length || 0)) } },
|
|
|
+ { label: '1:1 六图', key: '1', disabled: dynamicGroup?.[num]?.['list']?.length >= 15, onClick: () => { selectGroupImg(num, 6, 15 - (dynamicGroup?.[num]?.['list']?.length || 0)) } },
|
|
|
+ { label: '1:1 三图', key: '2', disabled: dynamicGroup?.[num]?.['list']?.length >= 15, onClick: () => { selectGroupImg(num, 3, 15 - (dynamicGroup?.[num]?.['list']?.length || 0)) } },
|
|
|
+ { label: '1:1 四图', key: '3', disabled: dynamicGroup?.[num]?.['list']?.length >= 15, onClick: () => { selectGroupImg(num, 4, 15 - (dynamicGroup?.[num]?.['list']?.length || 0)) } },
|
|
|
+ ]
|
|
|
+ }}
|
|
|
+ placement="bottomLeft"
|
|
|
+ arrow
|
|
|
+ >
|
|
|
+ <Button type="primary">上传组图</Button>
|
|
|
+ </Dropdown>
|
|
|
+ </>}
|
|
|
</>}
|
|
|
</Space>}
|
|
|
className="cardResetCss"
|
|
|
key={field.key}
|
|
|
- style={{ width: (deliveryMode === 'DELIVERY_MODE_CUSTOMIZE' || dynamicCreativeSwitch) ? ([641, 642, 643, 2277, 720, 721, 722, 1529, 618].includes(creativeTemplateId) || dynamicGroup?.length === 1) ? '100%' : 'calc(50% - 5px)' : '100%' }}
|
|
|
+ // style={{ width: (deliveryMode === 'DELIVERY_MODE_CUSTOMIZE' || dynamicCreativeSwitch) ? ([641, 642, 643, 2277, 720, 721, 722, 1529, 618].includes(creativeTemplateId) || dynamicGroup?.length === 1) ? '100%' : 'calc(50% - 5px)' : '100%' }}
|
|
|
+ style={{ width: (deliveryMode === 'DELIVERY_MODE_CUSTOMIZE') ? ([641, 642, 643, 2277, 720, 721, 722, 1529, 618].includes(creativeTemplateId) || dynamicGroup?.length === 1) ? '100%' : 'calc(50% - 5px)' : '100%' }}
|
|
|
extra={fields?.length > 1 && <DeleteOutlined className={styles.clear} onClick={() => remove(field.name)} style={{ color: 'red' }} />}
|
|
|
>
|
|
|
- {(deliveryMode === 'DELIVERY_MODE_CUSTOMIZE' || dynamicCreativeSwitch) ? <Space size={30} style={{ width: '100%' }} className={styles.space}>
|
|
|
+ {/* {(deliveryMode === 'DELIVERY_MODE_CUSTOMIZE' || dynamicCreativeSwitch) ? <Space size={30} style={{ width: '100%' }} className={styles.space}> */}
|
|
|
+ {(deliveryMode === 'DELIVERY_MODE_CUSTOMIZE') ? <Space size={30} style={{ width: '100%' }} className={styles.space}>
|
|
|
{Object.keys(materialData)?.map(key => {
|
|
|
- let m = materialData[key]
|
|
|
- let children = m.children
|
|
|
+ const m = materialData[key]
|
|
|
+ const children = m.children
|
|
|
|
|
|
return Object.keys(children).map(k => {
|
|
|
- let item = children[k]
|
|
|
+ const item = children[k]
|
|
|
if (k === 'short_video1' || k === 'video_id') {
|
|
|
return <Form.Item
|
|
|
{...field}
|
|
@@ -690,7 +839,8 @@ const AddMaterial: React.FC<Props> = ({ creativeTemplateId, materialData, delive
|
|
|
deliveryMode={deliveryMode}
|
|
|
onChange={(content: any) => {
|
|
|
if (content.length > 0) {
|
|
|
- if (deliveryMode === 'DELIVERY_MODE_COMPONENT' && !dynamicCreativeSwitch) { // 组件化创意
|
|
|
+ // if (deliveryMode === 'DELIVERY_MODE_COMPONENT' && !dynamicCreativeSwitch) { // 组件化创意
|
|
|
+ if (deliveryMode === 'DELIVERY_MODE_COMPONENT') { // 组件化创意
|
|
|
if (materialConfig.index === 20000) {
|
|
|
const aContent = content.map((m: any) => {
|
|
|
if (m?.materialType === 4) { // 组件库
|