|  | @@ -154,6 +154,21 @@ const AddMaterial: React.FC<Props> = ({ creativeTemplateId, materialData, delive
 | 
	
		
			
				|  |  |          }, 100)
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +    // 获取组件化创意素材数量
 | 
	
		
			
				|  |  | +    const getComponentCount = (list: any[]): string => {
 | 
	
		
			
				|  |  | +        let arrayImgCount = 0, imageCount = 0, videoCount = 0
 | 
	
		
			
				|  |  | +        list?.forEach((item: any) => {
 | 
	
		
			
				|  |  | +            if (Array.isArray(item)) {
 | 
	
		
			
				|  |  | +                arrayImgCount++
 | 
	
		
			
				|  |  | +            } else if (item?.url?.includes('mp4')) {
 | 
	
		
			
				|  |  | +                videoCount++
 | 
	
		
			
				|  |  | +            } else {
 | 
	
		
			
				|  |  | +                imageCount++
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +        })
 | 
	
		
			
				|  |  | +        return `${imageCount}张图片,${videoCount}个视频,${arrayImgCount}个组图`
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |      return <Modal
 | 
	
		
			
				|  |  |          title={<Space>
 | 
	
		
			
				|  |  |              <strong style={{ fontSize: 20 }}>创意素材</strong>
 | 
	
	
		
			
				|  | @@ -185,7 +200,7 @@ const AddMaterial: React.FC<Props> = ({ creativeTemplateId, materialData, delive
 | 
	
		
			
				|  |  |                      }, 100)
 | 
	
		
			
				|  |  |                  }}>批量添加图片素材</Button>}
 | 
	
		
			
				|  |  |              </> : <>
 | 
	
		
			
				|  |  | -                <InputNumber placeholder="分配数量" value={mCount} max={15} onChange={(e) => setMCount(e)} />
 | 
	
		
			
				|  |  | +                <InputNumber size="small" min={1} style={{ width: 50 }} value={mCount} max={15} onChange={(e) => setMCount(e)} />
 | 
	
		
			
				|  |  |                  <Button type="link" onClick={() => {
 | 
	
		
			
				|  |  |                      init({
 | 
	
		
			
				|  |  |                          mediaType: 'IMG', num: 100, cloudSize: [[
 | 
	
	
		
			
				|  | @@ -481,7 +496,7 @@ const AddMaterial: React.FC<Props> = ({ creativeTemplateId, materialData, delive
 | 
	
		
			
				|  |  |                                  <div className={`${styles.box} ${styles.video}`} style={{ width: '100%', height: 'auto', backgroundColor: 'rgb(247, 249, 252)' }}>
 | 
	
		
			
				|  |  |                                      {dynamicGroup?.length && dynamicGroup?.[num]?.['list']?.length > 0 ? <div className={styles.boxList}>
 | 
	
		
			
				|  |  |                                          <div className={styles.boxList_title}>
 | 
	
		
			
				|  |  | -                                            <span>上传素材</span>
 | 
	
		
			
				|  |  | +                                            <span>上传素材 <span style={{ marginLeft: 5, color: '#999', fontWeight: 'normal' }}>已选:{getComponentCount(dynamicGroup?.[num]?.['list'])}</span></span>
 | 
	
		
			
				|  |  |                                              <a onClick={() => {
 | 
	
		
			
				|  |  |                                                  let newDynamicGroup = dynamicGroup?.map((item: any, i: number) => {
 | 
	
		
			
				|  |  |                                                      if (i === num) {
 | 
	
	
		
			
				|  | @@ -558,11 +573,23 @@ const AddMaterial: React.FC<Props> = ({ creativeTemplateId, materialData, delive
 | 
	
		
			
				|  |  |                              if (materialConfig.isGroup) {
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |                              } else {
 | 
	
		
			
				|  |  | -                                let newSc = chunkArray1(content.map((m: any) => ({ id: m?.id, url: m?.url, materialType: 0 })), mCount)
 | 
	
		
			
				|  |  | -                                let newList: any[] = newSc.map((item: any) => {
 | 
	
		
			
				|  |  | -                                    return { list: item }
 | 
	
		
			
				|  |  | +                                const aContent = content.map((m: any) => ({ id: m?.id, url: m?.url, materialType: 0 }))
 | 
	
		
			
				|  |  | +                                let newDynamicGroup = dynamicGroup?.map((item: any) => {
 | 
	
		
			
				|  |  | +                                    let oldList = item?.list || []
 | 
	
		
			
				|  |  | +                                    if (oldList.length < mCount) {
 | 
	
		
			
				|  |  | +                                        let diffCount = mCount - oldList.length
 | 
	
		
			
				|  |  | +                                        let cLength = aContent.length
 | 
	
		
			
				|  |  | +                                        oldList = oldList.concat(aContent.splice(0, cLength > diffCount ? diffCount : cLength))
 | 
	
		
			
				|  |  | +                                    }
 | 
	
		
			
				|  |  | +                                    return { list: oldList }
 | 
	
		
			
				|  |  |                                  })
 | 
	
		
			
				|  |  | -                                let newDynamicGroup = (dynamicGroup || []).concat(newList)
 | 
	
		
			
				|  |  | +                                if (aContent.length) {
 | 
	
		
			
				|  |  | +                                    let newSc = chunkArray1(aContent, mCount)
 | 
	
		
			
				|  |  | +                                    let newList: any[] = newSc.map((item: any) => {
 | 
	
		
			
				|  |  | +                                        return { list: item }
 | 
	
		
			
				|  |  | +                                    })
 | 
	
		
			
				|  |  | +                                    newDynamicGroup = (newDynamicGroup || []).concat(newList)
 | 
	
		
			
				|  |  | +                                }
 | 
	
		
			
				|  |  |                                  form.setFieldsValue({ dynamicGroup: newDynamicGroup })
 | 
	
		
			
				|  |  |                              }
 | 
	
		
			
				|  |  |                          } else {
 |