wjx 10 ヶ月 前
コミット
1e611941d2

+ 1 - 2
src/pages/launchSystemNew/components/selectCloud/index.tsx

@@ -70,9 +70,8 @@ const SelectCloud: React.FC<Props> = (props) => {
                                 <CloseCircleFilled className={style.clear} onClick={() => { clearImg(item?.id) }} />
                                 <Image
                                     className={style.imgAnt}
-                                    width={30}
-                                    height={30}
                                     src={item?.url}
+                                    style={{ maxWidth: 30, maxHeight: 30, minHeight: 20 }}
                                 />
                             </div>))}
                         </Image.PreviewGroup>

+ 1 - 1
src/pages/launchSystemV3/tencentAdPutIn/create/Dynamic/creativeTemplateContent.tsx

@@ -100,7 +100,7 @@ const CreativeTemplateContent: React.FC<{ automaticSiteEnabled: boolean }> = ({
                                             >
                                                 <Radio.Group>
                                                     {deliveryMode === 'DELIVERY_MODE_CUSTOMIZE' && <Radio value="OPTION_KEEP_DIFFERENT">不替换原生推广页顶部素材</Radio>}
-                                                    <Radio value="OPTION_CREATIVE_OVERRIDE_CANVAS">使用外层创意素材替换原生推广页顶部素材</Radio>
+                                                    <Radio disabled={deliveryMode === 'DELIVERY_MODE_COMPONENT'} value="OPTION_CREATIVE_OVERRIDE_CANVAS">使用外层创意素材替换原生推广页顶部素材</Radio>
                                                 </Radio.Group>
                                             </Form.Item>
                                         </div>}

+ 7 - 3
src/pages/launchSystemV3/tencentAdPutIn/create/Dynamic/newDynamic.tsx

@@ -29,7 +29,7 @@ interface Props {
  * @param param0 
  * @returns 
  */
-const NewDynamic: React.FC<Props> = ({ value, visible, onClose, onChange, creativeTemplateStyle: oldCreativeTemplateStyle }) => {
+const NewDynamic: React.FC<Props> = ({ value: newValue, visible, onClose, onChange, creativeTemplateStyle: oldCreativeTemplateStyle }) => {
 
     /**********************************/
     const { addelivery, setMaterialData, setTextData } = useContext(DispatchAddelivery)!;
@@ -46,6 +46,7 @@ const NewDynamic: React.FC<Props> = ({ value, visible, onClose, onChange, creati
 
     const [newMaterialData, setNewMaterialData] = useState<any>({}) // 素材数据
     const [newTextData, setNewTextData] = useState<any>({})
+    const [value, setValue] = useState<any>(newValue)
 
     const getCreativeTemplateList = useAjax((params) => getCreativeTemplateListApi(params))
     const getCreativeDetails = useAjax((params) => getCreativeDetailsApi(params))
@@ -397,7 +398,7 @@ const NewDynamic: React.FC<Props> = ({ value, visible, onClose, onChange, creati
             if (value.deliveryMode === 'DELIVERY_MODE_CUSTOMIZE') {
                 getTemplate(value.creativeTemplateId)
                 dynamicValues.creativeTemplateStyle = oldCreativeTemplateStyle === '视频' ? 'video' : 'image'
-            } 
+            }
             // else getTemplate()
             // 卡片广告
             let isCardDynamic = dynamicValues?.creativeTemplateId && [1707, 1708].includes(dynamicValues.creativeTemplateId)
@@ -503,7 +504,10 @@ const NewDynamic: React.FC<Props> = ({ value, visible, onClose, onChange, creati
                             className="cardResetCss"
                         >
                             <Form.Item name="deliveryMode" label={<strong>投放模式</strong>} rules={[{ required: true, message: '请选择投放模式!' }]}>
-                                <Radio.Group onChange={() => setTimeout(() => { setIsUpdate(true) }, 50)}>
+                                <Radio.Group onChange={() => {
+                                    setTimeout(() => { setIsUpdate(true) }, 50)
+                                    setValue(undefined)
+                                }}>
                                     {Object.keys(DELIVERY_MODE_ENUM).map(key => <Radio value={key} key={key}>{DELIVERY_MODE_ENUM[key]}</Radio>)}
                                 </Radio.Group>
                             </Form.Item>

+ 163 - 159
src/pages/launchSystemV3/tencentAdPutIn/create/Material/addMaterial.tsx

@@ -162,7 +162,7 @@ const AddMaterial: React.FC<Props> = ({ creativeTemplateId, materialData, delive
             labelAlign='left'
             layout="vertical"
             colon={false}
-            style={{ backgroundColor: '#f1f4fc', maxHeight: 650, overflow: 'hidden', overflowY: 'auto', padding: '0 10px 10px', borderRadius: '0 0 8px 8px' }}
+            style={{ backgroundColor: '#f1f4fc', maxHeight: 650, overflow: 'hidden', overflowY: 'auto', padding: 10, borderRadius: '0 0 8px 8px' }}
             scrollToFirstError={{
                 behavior: 'smooth',
                 block: 'center'
@@ -177,108 +177,80 @@ const AddMaterial: React.FC<Props> = ({ creativeTemplateId, materialData, delive
         >
             <Form.List name="dynamicGroup">
                 {(fields, { add, remove }) => (<>
-                    {fields.map((field, num) => (<Card
-                        title={<Space>
-                            <strong style={{ fontSize: 18 }}>创意组{num + 1}</strong>
-                            {deliveryMode === 'DELIVERY_MODE_COMPONENT' && <>
-                                <Dropdown
-                                    overlay={<Menu>
-                                        <Menu.Item onClick={() => { console.log('添加9:16视频') }}>添加9:16视频</Menu.Item>
-                                        <Menu.Item onClick={() => { console.log('添加16:9视频') }}>添加16:9视频</Menu.Item>
-                                        <Menu.Item onClick={() => { console.log('添加9:16(720*1280)图片') }}>添加9:16(720*1280)图片</Menu.Item>
-                                        <Menu.Item onClick={() => { console.log('添加16:9(1280*720)图片') }}>添加16:9(1280*720)图片</Menu.Item>
-                                        <Menu.Item onClick={() => { console.log('添加1:1(800*800)图片') }}>添加1:1(800*800)图片</Menu.Item>
-                                        <Menu.Item onClick={() => { console.log('添加20:7(960*334)图片') }}>添加20:7(960*334)图片</Menu.Item>
-                                        <Menu.Item onClick={() => {
-                                            init({ mediaType: 'IMG', num: 15, cloudSize: [[
-                                                { relation: '=', width: 800, height: 800 },
-                                                { relation: '=', width: 1280, height: 720 },
-                                                { relation: '=', width: 720, height: 1280 },
-                                                { relation: '=', width: 960, height: 334 },
-                                                { relation: '=', width: 480, height: 320 },
-                                            ]], maxSize: 400 * 1024 })
-                                            setMaterialConfig({
-                                                ...materialConfig,
-                                                type: 'image',
-                                                max: 15,
-                                                index: 99999,
-                                                adcreativeTemplateId: creativeTemplateId
-                                            })
-                                            setTimeout(() => {
-                                                setSelectVideoVisible(true)
-                                            }, 100)
-                                        }}>添加3:2(480*320)图片</Menu.Item>
-                                    </Menu>}
-                                    placement="bottomLeft"
-                                    arrow
-                                >
-                                    <Button type="primary">添加图片/视频</Button>
-                                </Dropdown>
-                                <Dropdown
-                                    overlay={<Menu>
-                                        <Menu.Item onClick={() => { console.log('1:1 六图') }}>1:1 六图</Menu.Item>
-                                        <Menu.Item onClick={() => { console.log('1:1 三图') }}>1:1 三图</Menu.Item>
-                                        <Menu.Item onClick={() => { console.log('1:1 四图') }}>1:1 四图</Menu.Item>
-                                    </Menu>}
-                                    placement="bottomLeft"
-                                    arrow
-                                >
-                                    <Button type="primary">上传组图</Button>
-                                </Dropdown>
-                            </>}
-                        </Space>}
-                        className="cardResetCss"
-                        key={field.key}
-                        style={{ marginTop: 10, marginBottom: 10 }}
-                    >
-                        <Space size={30} style={{ width: '100%' }} className={styles.space}>
-                            {deliveryMode === 'DELIVERY_MODE_CUSTOMIZE' ? Object.keys(materialData)?.map(key => {
-                                let m = materialData[key]
-                                let children = m.children
-
-                                return Object.keys(children).map(k => {
-                                    let item = children[k]
-                                    if (k === 'short_video1' || k === 'video_id') {
-                                        return <Form.Item
-                                            {...field}
-                                            label={<strong>{item.description}</strong>}
-                                            rules={[{ required: true, message: '请选择素材!' }]}
-                                            name={[field.name, item.name]}
-                                            key={k}
-                                        >
-                                            <div className={`${styles.box} ${styles.video}`} style={{ width: 300, height: 160 }} onClick={() => {
-                                                init({ mediaType: 'VIDEO', cloudSize: creativeTemplateId === 1708 ? [[{ relation: '=', width: 1280, height: 720 }]] : [[{ relation: '=', width: item.restriction.videoRestriction.minWidth, height: item.restriction.videoRestriction.minHeight }]], maxSize: item.restriction.videoRestriction.fileSize * 1024 })
+                    <div style={{ display: 'flex', flexWrap: 'wrap', gap: 10 }}>
+                        {fields.map((field, num) => (<Card
+                            title={<Space>
+                                <strong style={{ fontSize: 18 }}>创意组{num + 1}</strong>
+                                {deliveryMode === 'DELIVERY_MODE_COMPONENT' && <>
+                                    <Dropdown
+                                        overlay={<Menu>
+                                            <Menu.Item onClick={() => { console.log('添加9:16视频') }}>添加9:16视频</Menu.Item>
+                                            <Menu.Item onClick={() => { console.log('添加16:9视频') }}>添加16:9视频</Menu.Item>
+                                            <Menu.Item onClick={() => { console.log('添加9:16(720*1280)图片') }}>添加9:16(720*1280)图片</Menu.Item>
+                                            <Menu.Item onClick={() => { console.log('添加16:9(1280*720)图片') }}>添加16:9(1280*720)图片</Menu.Item>
+                                            <Menu.Item onClick={() => { console.log('添加1:1(800*800)图片') }}>添加1:1(800*800)图片</Menu.Item>
+                                            <Menu.Item onClick={() => { console.log('添加20:7(960*334)图片') }}>添加20:7(960*334)图片</Menu.Item>
+                                            <Menu.Item onClick={() => {
+                                                init({
+                                                    mediaType: 'IMG', num: 15, cloudSize: [[
+                                                        { relation: '=', width: 800, height: 800 },
+                                                        { relation: '=', width: 1280, height: 720 },
+                                                        { relation: '=', width: 720, height: 1280 },
+                                                        { relation: '=', width: 960, height: 334 },
+                                                        { relation: '=', width: 480, height: 320 },
+                                                    ]], maxSize: 400 * 1024
+                                                })
                                                 setMaterialConfig({
                                                     ...materialConfig,
-                                                    type: item.name,
-                                                    max: 1,
-                                                    index: num,
+                                                    type: 'image',
+                                                    max: 15,
+                                                    index: 99999,
                                                     adcreativeTemplateId: creativeTemplateId
                                                 })
                                                 setTimeout(() => {
                                                     setSelectVideoVisible(true)
                                                 }, 100)
-                                            }}>
-                                                <div className={styles.p}>
-                                                    {dynamicGroup?.length > 0 && dynamicGroup[num] && Object.keys(dynamicGroup[num])?.includes(item.name) ? <VideoNews src={dynamicGroup[num][item.name]['url']} style={{ display: 'block', width: 'auto', margin: 0, height: '100%' }} maskImgStyle={{ position: 'absolute', top: '50%', left: '50%', width: 40, height: 40, transform: 'translate(-50%, -50%)', zIndex: 10 }} /> : <>
-                                                        <span>{`推荐尺寸(${creativeTemplateId === 1708 ? 1280 : item.restriction.videoRestriction.minWidth} x ${creativeTemplateId === 1708 ? 720 : item.restriction.videoRestriction.minHeight})`}</span>
-                                                        <span>{`${item.restriction.videoRestriction.fileFormat?.map((str: any) => str?.replace('MEDIA_TYPE_', ''))};< ${item.restriction.videoRestriction.fileSize / 1024}M;时长 ≥ ${item.restriction.videoRestriction.minDuration}s,≤ ${item.restriction.videoRestriction.maxDuration}s,必须带有声音`}</span>
-                                                    </>}
-                                                </div>
-                                            </div>
-                                        </Form.Item>
-                                    }
-                                    if (item.name === 'image_id' || item.name === 'cover_id') {
-                                        return <Form.Item
-                                            {...field}
-                                            label={<strong>{item.description}</strong>}
-                                            rules={[{ required: true, message: '请选择素材!' }]}
-                                            name={[field.name, item.name]}
-                                            key={key}
-                                        >
-                                            <Space align="end">
-                                                <div className={`${styles.box} ${styles.image}`} style={{ width: 300, height: 160 }} onClick={() => {
-                                                    init({ mediaType: 'IMG', cloudSize: [[{ relation: '=', width: item.restriction.imageRestriction.width, height: item.restriction.imageRestriction.height }]], maxSize: item.restriction.imageRestriction.fileSize * 1024 })
+                                            }}>添加3:2(480*320)图片</Menu.Item>
+                                        </Menu>}
+                                        placement="bottomLeft"
+                                        arrow
+                                    >
+                                        <Button type="primary">添加图片/视频</Button>
+                                    </Dropdown>
+                                    <Dropdown
+                                        overlay={<Menu>
+                                            <Menu.Item onClick={() => { console.log('1:1 六图') }}>1:1 六图</Menu.Item>
+                                            <Menu.Item onClick={() => { console.log('1:1 三图') }}>1:1 三图</Menu.Item>
+                                            <Menu.Item onClick={() => { console.log('1:1 四图') }}>1:1 四图</Menu.Item>
+                                        </Menu>}
+                                        placement="bottomLeft"
+                                        arrow
+                                    >
+                                        <Button type="primary">上传组图</Button>
+                                    </Dropdown>
+                                </>}
+                            </Space>}
+                            className="cardResetCss"
+                            key={field.key}
+                            style={{ width: ([641, 642, 643, 720, 721, 722, 1529, 618].includes(creativeTemplateId) || dynamicGroup?.length === 1) ? '100%' : '49%' }}
+                        >
+                            <Space size={30} style={{ width: '100%' }} className={styles.space}>
+                                {deliveryMode === 'DELIVERY_MODE_CUSTOMIZE' ? Object.keys(materialData)?.map(key => {
+                                    let m = materialData[key]
+                                    let children = m.children
+
+                                    return Object.keys(children).map(k => {
+                                        let item = children[k]
+                                        if (k === 'short_video1' || k === 'video_id') {
+                                            return <Form.Item
+                                                {...field}
+                                                label={<strong>{item.description}</strong>}
+                                                rules={[{ required: true, message: '请选择素材!' }]}
+                                                name={[field.name, item.name]}
+                                                key={k}
+                                            >
+                                                <div className={`${styles.box} ${styles.video}`} style={{ width: 300, height: 160 }} onClick={() => {
+                                                    init({ mediaType: 'VIDEO', cloudSize: creativeTemplateId === 1708 ? [[{ relation: '=', width: 1280, height: 720 }]] : [[{ relation: '=', width: item.restriction.videoRestriction.minWidth, height: item.restriction.videoRestriction.minHeight }]], maxSize: item.restriction.videoRestriction.fileSize * 1024 })
                                                     setMaterialConfig({
                                                         ...materialConfig,
                                                         type: item.name,
@@ -290,75 +262,107 @@ const AddMaterial: React.FC<Props> = ({ creativeTemplateId, materialData, delive
                                                         setSelectVideoVisible(true)
                                                     }, 100)
                                                 }}>
-                                                    <p>
-                                                        {dynamicGroup?.length > 0 && dynamicGroup[num] && Object.keys(dynamicGroup[num])?.includes(item.name) ? <img src={dynamicGroup[num][item.name]['url']} /> : <>
-                                                            <span>{`推荐尺寸(${item.restriction.imageRestriction.width} x ${item.restriction.imageRestriction.height})`}</span>
-                                                            <span>{`${item.restriction.imageRestriction.fileFormat?.map((str: any) => str?.replace('IMAGE_TYPE_', ''))};小于 ${item.restriction.imageRestriction.fileSize}KB`}</span>
+                                                    <div className={styles.p}>
+                                                        {dynamicGroup?.length > 0 && dynamicGroup[num] && Object.keys(dynamicGroup[num])?.includes(item.name) ? <VideoNews src={dynamicGroup[num][item.name]['url']} style={{ display: 'block', width: 'auto', margin: 0, height: '100%' }} maskImgStyle={{ position: 'absolute', top: '50%', left: '50%', width: 40, height: 40, transform: 'translate(-50%, -50%)', zIndex: 10 }} /> : <>
+                                                            <span>{`推荐尺寸(${creativeTemplateId === 1708 ? 1280 : item.restriction.videoRestriction.minWidth} x ${creativeTemplateId === 1708 ? 720 : item.restriction.videoRestriction.minHeight})`}</span>
+                                                            <span>{`${item.restriction.videoRestriction.fileFormat?.map((str: any) => str?.replace('MEDIA_TYPE_', ''))};< ${item.restriction.videoRestriction.fileSize / 1024}M;时长 ≥ ${item.restriction.videoRestriction.minDuration}s,≤ ${item.restriction.videoRestriction.maxDuration}s,必须带有声音`}</span>
                                                         </>}
-                                                    </p>
+                                                    </div>
                                                 </div>
-                                                {videoUploads && Object.keys(videoUploads)?.length > 0 && <div style={{ width: 32 }}>
-                                                    {dynamicGroup?.length > 0 && dynamicGroup[num] && (Object.keys(dynamicGroup[num])?.includes('video_id') || Object.keys(dynamicGroup[num])?.includes('short_video1')) && <VideoFrameSelect onChange={(e) => setFrame(e, num, item.name)} url={dynamicGroup[num]?.['video_id']?.['url'] || dynamicGroup[num]?.['short_video1']?.['url']} />}
-                                                </div>}
-                                            </Space>
-                                        </Form.Item>
-                                    }
+                                            </Form.Item>
+                                        }
+                                        if (item.name === 'image_id' || item.name === 'cover_id') {
+                                            return <Form.Item
+                                                {...field}
+                                                label={<strong>{item.description}</strong>}
+                                                rules={[{ required: true, message: '请选择素材!' }]}
+                                                name={[field.name, item.name]}
+                                                key={key}
+                                            >
+                                                <Space align="end">
+                                                    <div className={`${styles.box} ${styles.image}`} style={{ width: 300, height: 160 }} onClick={() => {
+                                                        init({ mediaType: 'IMG', cloudSize: [[{ relation: '=', width: item.restriction.imageRestriction.width, height: item.restriction.imageRestriction.height }]], maxSize: item.restriction.imageRestriction.fileSize * 1024 })
+                                                        setMaterialConfig({
+                                                            ...materialConfig,
+                                                            type: item.name,
+                                                            max: 1,
+                                                            index: num,
+                                                            adcreativeTemplateId: creativeTemplateId
+                                                        })
+                                                        setTimeout(() => {
+                                                            setSelectVideoVisible(true)
+                                                        }, 100)
+                                                    }}>
+                                                        <p>
+                                                            {dynamicGroup?.length > 0 && dynamicGroup[num] && Object.keys(dynamicGroup[num])?.includes(item.name) ? <img src={dynamicGroup[num][item.name]['url']} /> : <>
+                                                                <span>{`推荐尺寸(${item.restriction.imageRestriction.width} x ${item.restriction.imageRestriction.height})`}</span>
+                                                                <span>{`${item.restriction.imageRestriction.fileFormat?.map((str: any) => str?.replace('IMAGE_TYPE_', ''))};小于 ${item.restriction.imageRestriction.fileSize}KB`}</span>
+                                                            </>}
+                                                        </p>
+                                                    </div>
+                                                    {videoUploads && Object.keys(videoUploads)?.length > 0 && <div style={{ width: 32 }}>
+                                                        {dynamicGroup?.length > 0 && dynamicGroup[num] && (Object.keys(dynamicGroup[num])?.includes('video_id') || Object.keys(dynamicGroup[num])?.includes('short_video1')) && <VideoFrameSelect onChange={(e) => setFrame(e, num, item.name)} url={dynamicGroup[num]?.['video_id']?.['url'] || dynamicGroup[num]?.['short_video1']?.['url']} />}
+                                                    </div>}
+                                                </Space>
+                                            </Form.Item>
+                                        }
 
-                                    if (item.name === 'list') {
-                                        let name = ''
-                                        let imageData: any = {}
-                                        if (key === 'image_list') {
-                                            imageData = item.children.image_id
-                                            name = 'image_list';
-                                        } else if (key === 'element_story') {
-                                            imageData = item.children.image
-                                            name = 'element_story'
+                                        if (item.name === 'list') {
+                                            let name = ''
+                                            let imageData: any = {}
+                                            if (key === 'image_list') {
+                                                imageData = item.children.image_id
+                                                name = 'image_list';
+                                            } else if (key === 'element_story') {
+                                                imageData = item.children.image
+                                                name = 'element_story'
+                                            }
+                                            return <Form.Item
+                                                {...field}
+                                                label={<strong>{imageData.description}</strong>}
+                                                rules={[
+                                                    { required: true, type: 'array', len: minNumber || item.arrayProperty.maxNumber, message: '素材数量不对!' },
+                                                    { required: true, message: '请选择素材!' },
+                                                ]}
+                                                name={[field.name, name]}
+                                                key={key}
+                                            >
+                                                <div className={`${styles.box} ${item.arrayProperty.maxNumber >= 3 ? styles.image_list : styles.imageMater}`} style={item.arrayProperty.maxNumber >= 3 ? { flexFlow: 'row', width: '100%', gap: 2 } : {}} onClick={() => {
+                                                    init({ mediaType: 'IMG', num: item.arrayProperty.maxNumber, cloudSize: [[{ relation: '=', width: imageData.restriction.imageRestriction.width, height: imageData.restriction.imageRestriction.height }]], maxSize: imageData.restriction.imageRestriction.fileSize * 1024 })
+                                                    setMaterialConfig({
+                                                        ...materialConfig,
+                                                        type: name,
+                                                        max: item.arrayProperty.maxNumber,
+                                                        index: num,
+                                                        adcreativeTemplateId: creativeTemplateId
+                                                    })
+                                                    setTimeout(() => {
+                                                        setSelectVideoVisible(true)
+                                                    }, 100)
+                                                }}>
+                                                    {Array(item.arrayProperty.maxNumber).fill('').map((arr, index1) => {
+                                                        return <p key={index1} style={item.arrayProperty.maxNumber >= 3 ? { width: 130, height: 130 } : { justifyContent: 'center' }}>
+                                                            {dynamicGroup?.length > 0 && dynamicGroup[num] && Object.keys(dynamicGroup[num])?.includes(name) && dynamicGroup[num][name][index1] ? <img src={dynamicGroup[num][name][index1]['url']} /> : <>
+                                                                <span>{`推荐尺寸(${imageData.restriction.imageRestriction.width} x ${imageData.restriction.imageRestriction.height})`}</span>
+                                                                <span>{`${imageData.restriction.imageRestriction.fileFormat?.map((str: any) => str?.replace('IMAGE_TYPE_', ''))};小于 ${imageData.restriction.imageRestriction.fileSize}KB`}</span>
+                                                            </>}
+                                                        </p>
+                                                    })}
+                                                </div>
+                                            </Form.Item>
                                         }
-                                        return <Form.Item
-                                            {...field}
-                                            label={<strong>{imageData.description}</strong>}
-                                            rules={[
-                                                { required: true, type: 'array', len: minNumber || item.arrayProperty.maxNumber, message: '素材数量不对!' },
-                                                { required: true, message: '请选择素材!' },
-                                            ]}
-                                            name={[field.name, name]}
-                                            key={key}
-                                        >
-                                            <div className={`${styles.box} ${item.arrayProperty.maxNumber >= 3 ? styles.image_list : styles.imageMater}`} style={item.arrayProperty.maxNumber >= 3 ? { flexFlow: 'row', width: '100%', gap: 2 } : {}} onClick={() => {
-                                                init({ mediaType: 'IMG', num: item.arrayProperty.maxNumber, cloudSize: [[{ relation: '=', width: imageData.restriction.imageRestriction.width, height: imageData.restriction.imageRestriction.height }]], maxSize: imageData.restriction.imageRestriction.fileSize * 1024 })
-                                                setMaterialConfig({
-                                                    ...materialConfig,
-                                                    type: name,
-                                                    max: item.arrayProperty.maxNumber,
-                                                    index: num,
-                                                    adcreativeTemplateId: creativeTemplateId
-                                                })
-                                                setTimeout(() => {
-                                                    setSelectVideoVisible(true)
-                                                }, 100)
-                                            }}>
-                                                {Array(item.arrayProperty.maxNumber).fill('').map((arr, index1) => {
-                                                    return <p key={index1} style={item.arrayProperty.maxNumber >= 3 ? { width: 130, height: 130 } : { justifyContent: 'center' }}>
-                                                        {dynamicGroup?.length > 0 && dynamicGroup[num] && Object.keys(dynamicGroup[num])?.includes(name) && dynamicGroup[num][name][index1] ? <img src={dynamicGroup[num][name][index1]['url']} /> : <>
-                                                            <span>{`推荐尺寸(${imageData.restriction.imageRestriction.width} x ${imageData.restriction.imageRestriction.height})`}</span>
-                                                            <span>{`${imageData.restriction.imageRestriction.fileFormat?.map((str: any) => str?.replace('IMAGE_TYPE_', ''))};小于 ${imageData.restriction.imageRestriction.fileSize}KB`}</span>
-                                                        </>}
-                                                    </p>
-                                                })}
-                                            </div>
-                                        </Form.Item>
-                                    }
 
-                                    return null
-                                })
-                            }) : <div>
-                                11111111111111
-                            </div>}
-                            {fields?.length > 1 && <MinusCircleOutlined className={styles.clear} onClick={() => remove(field.name)} style={{ marginBottom: 24, color: 'red' }} />}
-                        </Space>
-                    </Card>))}
+                                        return null
+                                    })
+                                }) : <div>
+                                    11111111111111
+                                </div>}
+                                {fields?.length > 1 && <MinusCircleOutlined className={styles.clear} onClick={() => remove(field.name)} style={{ marginBottom: 24, color: 'red' }} />}
+                            </Space>
+                        </Card>))}
+                    </div>
 
-                    <Form.Item style={{ marginBottom: 0 }}>
+                    <Form.Item style={{ marginBottom: 0, marginTop: 10 }}>
                         <Button type="dashed" style={{ color: '#1890ff' }} onClick={() => add()} block icon={<PlusOutlined />}>添加创意组</Button>
                     </Form.Item>
                 </>)}

+ 1 - 1
src/pages/launchSystemV3/tencentAdPutIn/create/Material/index.tsx

@@ -35,7 +35,7 @@ const Material: React.FC = () => {
                 {(dynamicMaterialDTos && Object.keys(dynamicMaterialDTos).length > 0) ?
                     <div className={style.detail_body_m}>
                         {dynamicMaterialDTos.dynamicGroup.map((item: any, index: number) => {
-                            return <div key={index}>
+                            return <div key={index} style={{ width: deliveryMode === 'DELIVERY_MODE_CUSTOMIZE' ? [641, 642, 643].includes(creativeTemplateId) ? '100%' : [720, 721, 722, 1529, 618].includes(creativeTemplateId) ? '50%' : '25%' : '100%' }}>
                                 <Title level={5} style={{ fontSize: 12 }}>创意组{index + 1}</Title>
                                 {mType ? ['short_video', 'video'].includes(mType) ? <div className={style.video}>
                                     <VideoNews src={item?.video_id?.url || item?.short_video1?.url} />

+ 1 - 1
src/pages/launchSystemV3/tencentAdPutIn/create/MaterialText/newText.tsx

@@ -176,7 +176,7 @@ const NewText: React.FC<Props> = ({ visible, onClose, onChange, value, textData,
                         </Card>
                     ))}
                     {[3,2].includes(type) && !(type === 2 && textDto.length >= dynamicMaterialDTos.dynamicGroup.length) && <Form.Item style={{ marginTop: 10, marginBottom: 0 }}>
-                        <Button type="dashed" onClick={() => add({})} block icon={<PlusOutlined />} disabled={type === 3 && textDto.length >= 5}>
+                        <Button type="dashed" onClick={() => add({})} block icon={<PlusOutlined />} disabled={type === 3 && textDto.length >= 30}>
                             新增
                         </Button>
                     </Form.Item>}

+ 8 - 2
src/pages/launchSystemV3/tencentAdPutIn/create/index.less

@@ -178,12 +178,18 @@
 
 .detail_body_m {
     display: flex;
-    flex-direction: column;
-    gap: 10px;
+    // flex-direction: column;
+    flex-wrap: wrap;
+    row-gap: 10px;
+
+    >div {
+        min-width: 90px;
+    }
 
     .video {
         display: flex;
         justify-content: space-between;
+        padding-right: 15px;
 
         >div {
             max-width: 80px;

+ 89 - 21
src/pages/launchSystemV3/tencentAdPutIn/create/index.tsx

@@ -16,10 +16,10 @@ import Dynamic from "./Dynamic"
 import Material from "./Material"
 import MaterialText from "./MaterialText"
 import PageList from "./PageList"
-import { cartesianProduct } from "@/utils/utils"
+import { cartesianProduct, randomString } from "@/utils/utils"
 import columns from "./tableConfig"
 import SubmitModal from "./submitModal"
-import { createAdgroupTaskApi } from "@/services/adqV3"
+import { createAdgroupTaskApi, getSelectTaskDetailApi } from "@/services/adqV3"
 import WechatAccount from "../../components/WechatAccount"
 
 export const DispatchAddelivery = React.createContext<PULLIN.DispatchAddelivery | null>(null);
@@ -50,6 +50,7 @@ const Create: React.FC = () => {
 
     const getGroupList = useAjax(() => getGroupListApi())
     const createAdgroupTask = useAjax((params) => createAdgroupTaskApi(params))
+    const getSelectTaskDetail = useAjax((params) => getSelectTaskDetailApi(params))
     /*******************************************/
 
     useEffect(() => {
@@ -118,8 +119,74 @@ const Create: React.FC = () => {
 
     /**数据回填 */
     useEffect(() => {
+        let taskId = sessionStorage.getItem('TASKID3.0')
         let adqAdData = localStorage.getItem('ADQADV3')
-        if (adqAdData) {
+        if (taskId) {
+            getSelectTaskDetail.run(taskId).then(res => {
+                console.log(res)
+                if (res) {
+                    const { adgroupDTO, accountIdParamVOMap, targetings, dynamicCreativesDTO, dynamicCreativesTextDTO, dynamicMaterialDTOS } = res
+                    let beginDate = adgroupDTO.beginDate
+                    let endDate = adgroupDTO.endDate
+                    if (beginDate && moment(beginDate) < moment()) {
+                        beginDate = moment().format('YYYY-MM-DD')
+                        endDate = moment().add(7, 'day').format('YYYY-MM-DD')
+                        message.warning('请注意,检测投放开始日期小于今天,已自动改成今天,如需修改,请重新设置')
+                    }
+                    let dynamicGroup: any[] = []
+                    if (dynamicCreativesDTO.deliveryMode === 'DELIVERY_MODE_CUSTOMIZE') {
+                        dynamicGroup = dynamicMaterialDTOS?.map((item: any[]) => {
+                            let { type, valueJson } = item[0]
+                            let value = JSON.parse(valueJson).value
+                            if (type === 'image') {
+                                return { image_id: { id: value.imageId, url: value.imageUrl, materialType: value.materialType } }
+                            } else if (type === 'image_list' || type === 'element_story') {
+                                return { [type]: value.list.map((l: { imageUrl: any; imageId: any; materialType: any }) => ({ url: l.imageUrl, id: l.imageId, materialType: l.materialType })) }
+                            } else if (type === 'short_video' || type === 'video') {
+                                let field = type === 'video' ? 'video_id' : 'short_video1'
+                                let videoData: any = {}
+                                videoData[field] = { materialType: value.materialType, url: value.videoUrl, id: value.videoId }
+                                if (value.imageUrl) {
+                                    videoData['cover_id'] = { materialCoverType: value.materialType, url: value.imageUrl, id: value.iamgeId }
+                                }
+                                return videoData
+                            } else {
+                                return {}
+                            }
+                        })
+                    }
+                    console.log(dynamicGroup)
+
+                    setAddelivery({
+                        adgroups: { ...adgroupDTO, adgroupName: adgroupDTO.adgroupName + '_副本' + randomString(true, 3, 5), endDate, beginDate },
+                        targeting: targetings.map((item: any) => {
+                            const { targetingName, ...targeting } = item
+                            return { targetingName, targeting }
+                        }),
+                        dynamic: dynamicCreativesDTO,
+                        dynamicMaterialDTos: dynamicGroup.length > 0 ? { dynamicGroup } : {},
+                        dynamicCreativesTextDTOS: dynamicCreativesTextDTO
+                    })
+                    setAccountCreateLogs(Object.keys(accountIdParamVOMap || {}).map(accountId => {
+                        const { productDTOS, wechatOfficialAccountsVO, pageList, userActionSetsList } = accountIdParamVOMap[accountId]
+                        let data: PULLIN.AccountCreateLogsProps = {
+                            accountId: Number(accountId),
+                            productList: productDTOS
+                        }
+                        if (wechatOfficialAccountsVO) {
+                            data.wechatChannelList = [wechatOfficialAccountsVO]
+                        }
+                        if (pageList) {
+                            data.pageList = pageList
+                        }
+                        if (userActionSetsList) {
+                            data.userActionSetsList = userActionSetsList
+                        }
+                        return data
+                    }))
+                }
+            })
+        } else if (adqAdData) {
             const { addelivery, accountCreateLogs, materialData, textData } = JSON.parse(adqAdData)
             if (addelivery?.adgroups) {
                 if (addelivery?.adgroups?.beginDate && moment(addelivery?.adgroups?.beginDate) < moment()) {
@@ -366,24 +433,25 @@ const Create: React.FC = () => {
             dynamicMaterialDTOS,
             accountIdParamDTOMap
         }
+        console.log('----->', params)
         // setSubVisible(false)
-        createAdgroupTask.run(params).then(res => {
-            if (res) {
-                Modal.success({
-                    content: '任务提交成功',
-                    bodyStyle: { fontWeight: 700 },
-                    okText: '跳转任务列表',
-                    closable: true,
-                    onOk: () => {
-                        sessionStorage.setItem('CAMPV3', values?.taskName)
-                        window.location.href = '/#/launchSystemV3/tencentAdPutIn/taskList'
-                    },
-                    onCancel: () => {
-                        setSubVisible(false)
-                    }
-                })
-            }
-        })
+        // createAdgroupTask.run(params).then(res => {
+        //     if (res) {
+        //         Modal.success({
+        //             content: '任务提交成功',
+        //             bodyStyle: { fontWeight: 700 },
+        //             okText: '跳转任务列表',
+        //             closable: true,
+        //             onOk: () => {
+        //                 sessionStorage.setItem('CAMPV3', values?.taskName)
+        //                 window.location.href = '/#/launchSystemV3/tencentAdPutIn/taskList'
+        //             },
+        //             onCancel: () => {
+        //                 setSubVisible(false)
+        //             }
+        //         })
+        //     }
+        // })
     }
 
     const clearData = () => {
@@ -391,7 +459,7 @@ const Create: React.FC = () => {
     }
 
     return <Space direction="vertical" style={{ width: '100%' }}>
-        <Spin spinning={createAdgroupTask.loading}>
+        <Spin spinning={createAdgroupTask.loading || getSelectTaskDetail.loading}>
             <Card
                 size="small"
                 title={

+ 2 - 4
src/pages/launchSystemV3/tencentAdPutIn/taskList/index.tsx

@@ -44,10 +44,8 @@ const TaskList: React.FC = () => {
                 setLogVisible(true)
                 break
             case 'copy':
-                console.log('111111111111--->', data);
-                // sessionStorage.setItem('TASKID', data.taskId)
-                // sessionStorage.setItem('LAUNCHMODE', data.putModel)
-                // window.location.href = '/#/launchSystemNew/launchManage/createAd'
+                sessionStorage.setItem('TASKID3.0', data.id)
+                window.location.href = '/#/launchSystemV3/tencentAdPutIn/create'
                 break
         }
     }

+ 1 - 1
src/pages/launchSystemV3/tencentAdPutIn/taskList/tableConfig.tsx

@@ -21,7 +21,7 @@ const columns = (geoLocationList: any, modelList: any, callback: (data: any, typ
             render: (_, records) => {
                 return <Space>
                     <a style={{ color: '#1890ff', fontSize: 12 }} onClick={() => { callback(records, 'log', records) }}>日志</a>
-                    {/* <a style={{ color: '#1890ff', fontSize: 12 }} onClick={() => { callback({ taskId: b.id, campaignName: b.campaignName,putModel:b.putModel }, 'copy') }}>复制</a> */}
+                    <a style={{ color: '#1890ff', fontSize: 12 }} onClick={() => { callback(records, 'copy') }}>复制</a>
                 </Space>
             }
         },

+ 11 - 0
src/services/adqV3/index.ts

@@ -100,6 +100,17 @@ export async function getTaskV3ListApi(data: PULLIN.GetTaskV3Props) {
     })
 }
 
+/**
+ * 获取详情
+ * @param id 
+ * @returns 
+ */
+export async function getSelectTaskDetailApi(id: number) {
+    return request(api + `/adq/v3/adgroup/selectTaskDetail/${id}`, {
+        method: 'GET'
+    })
+}
+
 /**
  * 任务日志
  * @param data