|
@@ -30,9 +30,14 @@
|
30
|
30
|
<div class="title">创意内容</div>
|
31
|
31
|
<div class="smallTitle lMar20">创意组数量: {{pageInfo.creativeTeamList&&pageInfo.creativeTeamList.length}}组</div>
|
32
|
32
|
<div class="lMarauto">
|
33
|
|
- <el-button type="primary" v-if="haveCoverOrVideo == 1 || haveCoverOrVideo == 2" @click="openLibraryDialog(1)">批量添加视频</el-button>
|
34
|
|
- <el-button type="primary" v-if="haveCoverOrVideo == 1 || haveCoverOrVideo == 3" @click="openLibraryDialog(2)">批量添加封面</el-button>
|
35
|
|
- <el-button type="primary" @click="openTestNew">一键测新</el-button>
|
|
33
|
+ <el-button type="primary"
|
|
34
|
+ :disabled="pageInfo.creativeTeamList?.length >= max_creative_num"
|
|
35
|
+ v-if="haveCoverOrVideo == 1 || haveCoverOrVideo == 2" @click="openLibraryDialog(1)">批量添加视频</el-button>
|
|
36
|
+ <el-button type="primary"
|
|
37
|
+ :disabled="pageInfo.creativeTeamList?.length >= max_creative_num"
|
|
38
|
+ v-if="haveCoverOrVideo == 1 || haveCoverOrVideo == 3" @click="openLibraryDialog(2)">批量添加封面</el-button>
|
|
39
|
+ <el-button type="primary"
|
|
40
|
+ :disabled="pageInfo.creativeTeamList?.length >= max_creative_num" @click="openTestNew">一键测新</el-button>
|
36
|
41
|
</div>
|
37
|
42
|
</div>
|
38
|
43
|
|
|
@@ -137,6 +142,7 @@ const props = withDefaults(defineProps<{
|
137
|
142
|
haveShowVideoObj?:any,
|
138
|
143
|
minNum_imageList?:number,
|
139
|
144
|
maxNum_imageList?:number,
|
|
145
|
+ max_creative_num?:any
|
140
|
146
|
}>(), {
|
141
|
147
|
haveCoverOrVideo:1,
|
142
|
148
|
video_tips:{},
|
|
@@ -144,6 +150,7 @@ const props = withDefaults(defineProps<{
|
144
|
150
|
haveShowVideoObj:{},
|
145
|
151
|
minNum_imageList:1,
|
146
|
152
|
maxNum_imageList:1,
|
|
153
|
+ max_creative_num:0
|
147
|
154
|
})
|
148
|
155
|
|
149
|
156
|
interface radioFace{
|
|
@@ -232,6 +239,13 @@ const deleItemUrlEvent = (item: any,type:string,subId:number) => {
|
232
|
239
|
//添加创意组
|
233
|
240
|
const addItemEvent = () => {
|
234
|
241
|
let arr:any = pageInfo.creativeTeamList
|
|
242
|
+ if(props.max_creative_num){
|
|
243
|
+ if(arr?.length >= props.max_creative_num){
|
|
244
|
+ ElMessage.error('创意组内素材数上限为:' + props.max_creative_num )
|
|
245
|
+ return
|
|
246
|
+ }
|
|
247
|
+ }
|
|
248
|
+
|
235
|
249
|
let _id:number = arr[arr.length-1].id
|
236
|
250
|
arr.push({
|
237
|
251
|
id:_id+1,
|
|
@@ -253,6 +267,12 @@ const deleItemEvent = (item:any) => {
|
253
|
267
|
//复制创意组
|
254
|
268
|
const copyItemEvent = async (item:any) => {
|
255
|
269
|
let arr:any = pageInfo.creativeTeamList
|
|
270
|
+ if(props.max_creative_num){
|
|
271
|
+ if(arr?.length >= props.max_creative_num){
|
|
272
|
+ ElMessage.error('创意组内素材数上限为:' + props.max_creative_num )
|
|
273
|
+ return
|
|
274
|
+ }
|
|
275
|
+ }
|
256
|
276
|
let idx:number = arr.findIndex(n=>n.id== item.id)
|
257
|
277
|
let _id:number = arr[arr.length-1].id
|
258
|
278
|
let obj:any = _.cloneDeep(arr[idx])
|
|
@@ -296,10 +316,23 @@ const clearEvent = () => {
|
296
|
316
|
}
|
297
|
317
|
|
298
|
318
|
//一件测新
|
299
|
|
-const TestNewDialogRef = ref<{switchShow:(val:boolean)=>void}>()
|
|
319
|
+const TestNewDialogRef = ref<{switchShow:(val:boolean,creativeNum:any)=>void}>()
|
300
|
320
|
const openTestNew = () => {
|
301
|
321
|
nextTick(()=>{
|
302
|
|
- TestNewDialogRef.value!.switchShow(true)
|
|
322
|
+ let arr:any = pageInfo.creativeTeamList
|
|
323
|
+ let satisfyLen:number = 0 // 创意组列表中 满足条件的个数
|
|
324
|
+ arr.forEach(async (item,idx)=>{
|
|
325
|
+ if(update_haveCoverOrVideoFlag2(item.list)){ //还有空白格
|
|
326
|
+ }else{
|
|
327
|
+ satisfyLen += 1
|
|
328
|
+ }
|
|
329
|
+ })
|
|
330
|
+ let newMaxLen:any = props.max_creative_num - satisfyLen // 最大创意组个数 - 满足的 = 还可以上传的创意组个数
|
|
331
|
+ if(newMaxLen <= 0){
|
|
332
|
+ ElMessage.error('所选素材已达上线,请删除素材后再来操作')
|
|
333
|
+ return
|
|
334
|
+ }
|
|
335
|
+ TestNewDialogRef.value!.switchShow(true,newMaxLen)
|
303
|
336
|
})
|
304
|
337
|
}
|
305
|
338
|
|