|  | @@ -248,9 +248,11 @@ const Create: React.FC = () => {
 | 
											
												
													
														|  |                                  dynamicGroup = dynamicMaterialDTOS?.map((item: any[]) => {
 |  |                                  dynamicGroup = dynamicMaterialDTOS?.map((item: any[]) => {
 | 
											
												
													
														|  |                                      return {
 |  |                                      return {
 | 
											
												
													
														|  |                                          list: item?.map((i: any) => {
 |  |                                          list: item?.map((i: any) => {
 | 
											
												
													
														|  | -                                            let { type, valueJson } = i
 |  | 
 | 
											
												
													
														|  | -                                            let value = JSON.parse(valueJson).value
 |  | 
 | 
											
												
													
														|  | -                                            if (type === 'image') {
 |  | 
 | 
											
												
													
														|  | 
 |  | +                                            const { type, valueJson } = i
 | 
											
												
													
														|  | 
 |  | +                                            const { value, componentId, componentValue } = JSON.parse(valueJson)
 | 
											
												
													
														|  | 
 |  | +                                            if (componentId) {
 | 
											
												
													
														|  | 
 |  | +                                                return componentValue
 | 
											
												
													
														|  | 
 |  | +                                            } else if (type === 'image') {
 | 
											
												
													
														|  |                                                  return { id: value.imageId, url: value.imageUrl, materialType: value.materialType, accountId: value?.accountId }
 |  |                                                  return { id: value.imageId, url: value.imageUrl, materialType: value.materialType, accountId: value?.accountId }
 | 
											
												
													
														|  |                                              } else if (type === 'image_list') {
 |  |                                              } else if (type === 'image_list') {
 | 
											
												
													
														|  |                                                  return value.list.map((l: { imageUrl: any; imageId: any; materialType: any, accountId: any }) => ({ url: l.imageUrl, id: l.imageId, materialType: l.materialType, accountId: l?.accountId }))
 |  |                                                  return value.list.map((l: { imageUrl: any; imageId: any; materialType: any, accountId: any }) => ({ url: l.imageUrl, id: l.imageId, materialType: l.materialType, accountId: l?.accountId }))
 | 
											
										
											
												
													
														|  | @@ -428,7 +430,7 @@ const Create: React.FC = () => {
 | 
											
												
													
														|  |                      newDynamicGroup = newDynamicGroup.map((item: any, index: number) => ({ ...item, textDto: textDto?.[index % textDtoLenth] }))
 |  |                      newDynamicGroup = newDynamicGroup.map((item: any, index: number) => ({ ...item, textDto: textDto?.[index % textDtoLenth] }))
 | 
											
												
													
														|  |                  } else if ((textType === 3 && mediaType === 0) || (textType === 4 && mediaType === 1) || (textType === 4 && mediaType === 3)) {
 |  |                  } else if ((textType === 3 && mediaType === 0) || (textType === 4 && mediaType === 1) || (textType === 4 && mediaType === 3)) {
 | 
											
												
													
														|  |                      newDynamicGroup = cartesianProduct(newDynamicGroup, textDto || [{}]).map((item) => {
 |  |                      newDynamicGroup = cartesianProduct(newDynamicGroup, textDto || [{}]).map((item) => {
 | 
											
												
													
														|  | -                        let [dynamicGroup, textDtoData] = item
 |  | 
 | 
											
												
													
														|  | 
 |  | +                        const [dynamicGroup, textDtoData] = item
 | 
											
												
													
														|  |                          return {
 |  |                          return {
 | 
											
												
													
														|  |                              ...dynamicGroup as any,
 |  |                              ...dynamicGroup as any,
 | 
											
												
													
														|  |                              textDto: textDtoData
 |  |                              textDto: textDtoData
 | 
											
										
											
												
													
														|  | @@ -510,11 +512,11 @@ const Create: React.FC = () => {
 | 
											
												
													
														|  |          }
 |  |          }
 | 
											
												
													
														|  |          // 落地页平均分配判断数量
 |  |          // 落地页平均分配判断数量
 | 
											
												
													
														|  |          if ([910].includes(dynamic.creativeTemplateId) && dynamic?.landingPageType === 1) {
 |  |          if ([910].includes(dynamic.creativeTemplateId) && dynamic?.landingPageType === 1) {
 | 
											
												
													
														|  | -            let targetingLength = targeting.length
 |  | 
 | 
											
												
													
														|  | 
 |  | +            const targetingLength = targeting.length
 | 
											
												
													
														|  |              if (accountCreateLogs.some(item => {
 |  |              if (accountCreateLogs.some(item => {
 | 
											
												
													
														|  | -                let productListLength = item?.productList?.length || 1
 |  | 
 | 
											
												
													
														|  | -                let total = targetingLength * productListLength
 |  | 
 | 
											
												
													
														|  | -                let pageLength = item.pageList.length
 |  | 
 | 
											
												
													
														|  | 
 |  | +                const productListLength = item?.productList?.length || 1
 | 
											
												
													
														|  | 
 |  | +                const total = targetingLength * productListLength
 | 
											
												
													
														|  | 
 |  | +                const pageLength = item.pageList.length
 | 
											
												
													
														|  |                  if (total > pageLength) {
 |  |                  if (total > pageLength) {
 | 
											
												
													
														|  |                      message.error(`当前${item.accountId}下的广告总数(${total})大于落地页总数(${pageLength}),平均分配需要落地页总数大于广告总数`)
 |  |                      message.error(`当前${item.accountId}下的广告总数(${total})大于落地页总数(${pageLength}),平均分配需要落地页总数大于广告总数`)
 | 
											
												
													
														|  |                      return true
 |  |                      return true
 | 
											
										
											
												
													
														|  | @@ -541,11 +543,11 @@ const Create: React.FC = () => {
 | 
											
												
													
														|  |                  }
 |  |                  }
 | 
											
												
													
														|  |              }
 |  |              }
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  | -            let data = cartesianProduct(productList, targeting).map((newD, dindex) => {
 |  | 
 | 
											
												
													
														|  | -                let [productDto, targetDto, index] = newD
 |  | 
 | 
											
												
													
														|  | -                let suffix = '_' + item.accountId + '_' + index
 |  | 
 | 
											
												
													
														|  | -                let averageAdDynamic = (mediaType === 3 ? averageAdDynamicList?.[dindex] : averageAdDynamicList?.[accountIndex]) || []
 |  | 
 | 
											
												
													
														|  | -                let dat: any = {
 |  | 
 | 
											
												
													
														|  | 
 |  | +            const data = cartesianProduct(productList, targeting).map((newD, dindex) => {
 | 
											
												
													
														|  | 
 |  | +                const [productDto, targetDto, index] = newD
 | 
											
												
													
														|  | 
 |  | +                const suffix = '_' + item.accountId + '_' + index
 | 
											
												
													
														|  | 
 |  | +                const averageAdDynamic = (mediaType === 3 ? averageAdDynamicList?.[dindex] : averageAdDynamicList?.[accountIndex]) || []
 | 
											
												
													
														|  | 
 |  | +                const dat: any = {
 | 
											
												
													
														|  |                      id: item.accountId + '_' + index,
 |  |                      id: item.accountId + '_' + index,
 | 
											
												
													
														|  |                      accountId: item.accountId,                    // 账户
 |  |                      accountId: item.accountId,                    // 账户
 | 
											
												
													
														|  |                      userActionSetsList: item.userActionSetsList,  // 数据源
 |  |                      userActionSetsList: item.userActionSetsList,  // 数据源
 | 
											
										
											
												
													
														|  | @@ -576,9 +578,9 @@ const Create: React.FC = () => {
 | 
											
												
													
														|  |              // 激励
 |  |              // 激励
 | 
											
												
													
														|  |              if ([910].includes(dynamic.creativeTemplateId)) {
 |  |              if ([910].includes(dynamic.creativeTemplateId)) {
 | 
											
												
													
														|  |                  if (dynamic?.landingPageType === 1) {
 |  |                  if (dynamic?.landingPageType === 1) {
 | 
											
												
													
														|  | -                    let averageAdPageList: any[] = distributeArray(item.pageList, productList.length * targeting.length)
 |  | 
 | 
											
												
													
														|  | 
 |  | +                    const averageAdPageList: any[] = distributeArray(item.pageList, productList.length * targeting.length)
 | 
											
												
													
														|  |                      data.forEach((item, aIndex) => {
 |  |                      data.forEach((item, aIndex) => {
 | 
											
												
													
														|  | -                        let aPageList: any[] = averageAdPageList[aIndex]
 |  | 
 | 
											
												
													
														|  | 
 |  | +                        const aPageList: any[] = averageAdPageList[aIndex]
 | 
											
												
													
														|  |                          aPageList.forEach((page, index) => {
 |  |                          aPageList.forEach((page, index) => {
 | 
											
												
													
														|  |                              newData.push({
 |  |                              newData.push({
 | 
											
												
													
														|  |                                  ...item,
 |  |                                  ...item,
 | 
											
										
											
												
													
														|  | @@ -597,7 +599,7 @@ const Create: React.FC = () => {
 | 
											
												
													
														|  |                      })
 |  |                      })
 | 
											
												
													
														|  |                  } else {
 |  |                  } else {
 | 
											
												
													
														|  |                      newData = cartesianProduct(data, item.pageList).map((item, index) => {
 |  |                      newData = cartesianProduct(data, item.pageList).map((item, index) => {
 | 
											
												
													
														|  | -                        let [d1, pageList, num] = item
 |  | 
 | 
											
												
													
														|  | 
 |  | +                        const [d1, pageList, num] = item
 | 
											
												
													
														|  |                          return {
 |  |                          return {
 | 
											
												
													
														|  |                              ...d1,
 |  |                              ...d1,
 | 
											
												
													
														|  |                              id: d1.id + '_' + index,
 |  |                              id: d1.id + '_' + index,
 | 
											
										
											
												
													
														|  | @@ -614,9 +616,9 @@ const Create: React.FC = () => {
 | 
											
												
													
														|  |                      data.forEach(item => {
 |  |                      data.forEach(item => {
 | 
											
												
													
														|  |                          const { averageAdDynamic, ...ad } = item
 |  |                          const { averageAdDynamic, ...ad } = item
 | 
											
												
													
														|  |                          if (textType === 3) {
 |  |                          if (textType === 3) {
 | 
											
												
													
														|  | -                            let rowSpan = textDtoLenth * averageAdDynamic.length
 |  | 
 | 
											
												
													
														|  | 
 |  | +                            const rowSpan = textDtoLenth * averageAdDynamic.length
 | 
											
												
													
														|  |                              cartesianProduct(textDto, averageAdDynamic).forEach((taad: any, index) => {
 |  |                              cartesianProduct(textDto, averageAdDynamic).forEach((taad: any, index) => {
 | 
											
												
													
														|  | -                                let [textValue, aad] = taad
 |  | 
 | 
											
												
													
														|  | 
 |  | +                                const [textValue, aad] = taad
 | 
											
												
													
														|  |                                  newData.push({
 |  |                                  newData.push({
 | 
											
												
													
														|  |                                      ...ad,
 |  |                                      ...ad,
 | 
											
												
													
														|  |                                      id: ad.id + '_' + index,
 |  |                                      id: ad.id + '_' + index,
 | 
											
										
											
												
													
														|  | @@ -661,7 +663,7 @@ const Create: React.FC = () => {
 | 
											
												
													
														|  |                          const { averageAdDynamic, ...ad } = item
 |  |                          const { averageAdDynamic, ...ad } = item
 | 
											
												
													
														|  |                          if (textType === 3) {
 |  |                          if (textType === 3) {
 | 
											
												
													
														|  |                              cartesianProduct(textDto, [newDynamicGroup[accountIndex1 % newDynamicGroup.length]]).forEach((taad: any, i) => {
 |  |                              cartesianProduct(textDto, [newDynamicGroup[accountIndex1 % newDynamicGroup.length]]).forEach((taad: any, i) => {
 | 
											
												
													
														|  | -                                let [textValue, aad, index] = taad
 |  | 
 | 
											
												
													
														|  | 
 |  | +                                const [textValue, aad, index] = taad
 | 
											
												
													
														|  |                                  newData.push({
 |  |                                  newData.push({
 | 
											
												
													
														|  |                                      ...ad,
 |  |                                      ...ad,
 | 
											
												
													
														|  |                                      id: ad.id + '_' + index,
 |  |                                      id: ad.id + '_' + index,
 | 
											
										
											
												
													
														|  | @@ -673,7 +675,7 @@ const Create: React.FC = () => {
 | 
											
												
													
														|  |                                  })
 |  |                                  })
 | 
											
												
													
														|  |                              })
 |  |                              })
 | 
											
												
													
														|  |                          } else {
 |  |                          } else {
 | 
											
												
													
														|  | -                            let { textDto: nowTextDto, ...dynamicGroup } = newDynamicGroup[accountIndex1 % newDynamicGroup.length]
 |  | 
 | 
											
												
													
														|  | 
 |  | +                            const { textDto: nowTextDto, ...dynamicGroup } = newDynamicGroup[accountIndex1 % newDynamicGroup.length]
 | 
											
												
													
														|  |                              newData.push({
 |  |                              newData.push({
 | 
											
												
													
														|  |                                  ...ad,
 |  |                                  ...ad,
 | 
											
												
													
														|  |                                  dynamicGroup,
 |  |                                  dynamicGroup,
 | 
											
										
											
												
													
														|  | @@ -715,7 +717,7 @@ const Create: React.FC = () => {
 | 
											
												
													
														|  |          let dynamicMaterialDTOS = []
 |  |          let dynamicMaterialDTOS = []
 | 
											
												
													
														|  |          if (dynamic.deliveryMode === 'DELIVERY_MODE_CUSTOMIZE' || dynamic?.dynamicCreativeSwitch) {
 |  |          if (dynamic.deliveryMode === 'DELIVERY_MODE_CUSTOMIZE' || dynamic?.dynamicCreativeSwitch) {
 | 
											
												
													
														|  |              if ((materialData && Object.keys(materialData).length && dynamicMaterialDTos && Object.keys(dynamicMaterialDTos).length)) {
 |  |              if ((materialData && Object.keys(materialData).length && dynamicMaterialDTos && Object.keys(dynamicMaterialDTos).length)) {
 | 
											
												
													
														|  | -                let mType = Object.keys(materialData)[0];
 |  | 
 | 
											
												
													
														|  | 
 |  | +                const mType = Object.keys(materialData)[0];
 | 
											
												
													
														|  |                  dynamicMaterialDTOS = dynamicMaterialDTos.dynamicGroup?.map((item: any) => {
 |  |                  dynamicMaterialDTOS = dynamicMaterialDTos.dynamicGroup?.map((item: any) => {
 | 
											
												
													
														|  |                      if (mType === 'image') {
 |  |                      if (mType === 'image') {
 | 
											
												
													
														|  |                          return [{
 |  |                          return [{
 | 
											
										
											
												
													
														|  | @@ -734,7 +736,7 @@ const Create: React.FC = () => {
 | 
											
												
													
														|  |                          if (mType === 'element_story') {
 |  |                          if (mType === 'element_story') {
 | 
											
												
													
														|  |                              key = 'element_story'
 |  |                              key = 'element_story'
 | 
											
												
													
														|  |                          }
 |  |                          }
 | 
											
												
													
														|  | -                        let list = item?.[key]?.map((l: any) => {
 |  | 
 | 
											
												
													
														|  | 
 |  | +                        const list = item?.[key]?.map((l: any) => {
 | 
											
												
													
														|  |                              return {
 |  |                              return {
 | 
											
												
													
														|  |                                  imageUrl: l?.url,
 |  |                                  imageUrl: l?.url,
 | 
											
												
													
														|  |                                  imageId: l?.id,
 |  |                                  imageId: l?.id,
 | 
											
										
											
												
													
														|  | @@ -751,7 +753,7 @@ const Create: React.FC = () => {
 | 
											
												
													
														|  |                              })
 |  |                              })
 | 
											
												
													
														|  |                          }]
 |  |                          }]
 | 
											
												
													
														|  |                      } else if (['short_video', 'video'].includes(mType)) {
 |  |                      } else if (['short_video', 'video'].includes(mType)) {
 | 
											
												
													
														|  | -                        let value: any = {
 |  | 
 | 
											
												
													
														|  | 
 |  | +                        const value: any = {
 | 
											
												
													
														|  |                              materialType: item?.video_id?.materialType || item?.short_video1?.materialType || 0,
 |  |                              materialType: item?.video_id?.materialType || item?.short_video1?.materialType || 0,
 | 
											
												
													
														|  |                              videoUrl: item?.video_id?.url || item?.short_video1?.url,
 |  |                              videoUrl: item?.video_id?.url || item?.short_video1?.url,
 | 
											
												
													
														|  |                              videoId: item?.video_id?.id || item?.short_video1?.id,
 |  |                              videoId: item?.video_id?.id || item?.short_video1?.id,
 | 
											
										
											
												
													
														|  | @@ -781,6 +783,15 @@ const Create: React.FC = () => {
 | 
											
												
													
														|  |              if (dynamicMaterialDTos && Object.keys(dynamicMaterialDTos).length) {
 |  |              if (dynamicMaterialDTos && Object.keys(dynamicMaterialDTos).length) {
 | 
											
												
													
														|  |                  dynamicMaterialDTOS = dynamicMaterialDTos.dynamicGroup?.map((item: { list: any[] }) => {
 |  |                  dynamicMaterialDTOS = dynamicMaterialDTos.dynamicGroup?.map((item: { list: any[] }) => {
 | 
											
												
													
														|  |                      return item.list.map(l => {
 |  |                      return item.list.map(l => {
 | 
											
												
													
														|  | 
 |  | +                        if (l.materialType === 4) {
 | 
											
												
													
														|  | 
 |  | +                            return {
 | 
											
												
													
														|  | 
 |  | +                                type: l?.componentSubType?.includes('IMAGE_LIST') ? 'image_list' : l?.keyFrameImageUrl ? 'video' : 'image',
 | 
											
												
													
														|  | 
 |  | +                                valueJson: JSON.stringify({ 
 | 
											
												
													
														|  | 
 |  | +                                    componentId: l.id,
 | 
											
												
													
														|  | 
 |  | +                                    componentValue: l
 | 
											
												
													
														|  | 
 |  | +                                })
 | 
											
												
													
														|  | 
 |  | +                            }
 | 
											
												
													
														|  | 
 |  | +                        }
 | 
											
												
													
														|  |                          if (Array.isArray(l)) {
 |  |                          if (Array.isArray(l)) {
 | 
											
												
													
														|  |                              return {
 |  |                              return {
 | 
											
												
													
														|  |                                  type: 'image_list',
 |  |                                  type: 'image_list',
 | 
											
										
											
												
													
														|  | @@ -878,8 +889,6 @@ const Create: React.FC = () => {
 | 
											
												
													
														|  |              taskType: putInType,
 |  |              taskType: putInType,
 | 
											
												
													
														|  |              ...copyTask
 |  |              ...copyTask
 | 
											
												
													
														|  |          }
 |  |          }
 | 
											
												
													
														|  | -        console.log('2222222222---->', params)
 |  | 
 | 
											
												
													
														|  | -        return
 |  | 
 | 
											
												
													
														|  |          if (values?.submitRule !== 0) {
 |  |          if (values?.submitRule !== 0) {
 | 
											
												
													
														|  |              createAdgroupTaskV2.run(params).then(res => {
 |  |              createAdgroupTaskV2.run(params).then(res => {
 | 
											
												
													
														|  |                  if (res) {
 |  |                  if (res) {
 |