shensong00 7 月之前
父節點
當前提交
22c819c5bc

+ 52 - 38
src/components/businessMoudle/batchGdt3/configArea/copywriter/writerDialog.vue

@@ -74,6 +74,11 @@
74 74
               :haveNotes="writerRuleRadioList.haveNotes"
75 75
               @returnEvent="onChangeWriterRule"></RadioGroup>
76 76
         </template>
77
+
78
+        <div class="flex_start marT15" v-if="writerShareRadioList.radioVal == 2 && deliveryModel == 1">
79
+          <label class="form-block-item-title">创意文案上限</label>
80
+          <div class="flex"><el-input-number v-model="max_count" @change="handleChange" :min="1" :max="3"></el-input-number></div>
81
+        </div>
77 82
       </div>
78 83
       <div class="fix-table" v-if="multiCopyTesting == 1">
79 84
         <TextLibrary ref="TextLibraryRef" immobilizationHeight="40vh" tableSize="small" source="writerHelper" :select_num="maxLength" @select="selectEvent"></TextLibrary>
@@ -131,6 +136,9 @@ const props = defineProps({
131 136
     type:Object,
132 137
     default: () => ({})
133 138
   },
139
+  originalityBasicInfoData: {
140
+    type:Object
141
+  }
134 142
 })
135 143
 const emit = defineEmits<{
136 144
   (event: "close", val?: any): void;
@@ -147,6 +155,7 @@ const WriterHelperRef = ref()
147 155
 const TextLibraryRef = ref()
148 156
 const allocation = ref(1) // 创意文案分配方式 1自动分配 2程序化测试
149 157
 const tooltip = `您可以选择某一种文案,进行多条文案测试;<br/>测试文案为变量,将会出现在最下方,以列表形式多选;<br/>非测试文案为常量,会保持在上方;`
158
+const max_count = ref(1)// 选择组件化创意时,单创意可以选择的最大文案数
150 159
 
151 160
 const writerShareRadioList = reactive<radioFace>({
152 161
   value:'1',
@@ -171,8 +180,11 @@ const writerRuleRadioList = reactive<radioFace>({
171 180
   ]
172 181
 })
173 182
 const maxLength = ref(-1)
183
+const deliveryModel = ref(0) //0 自定义创意 1组件化创意
174 184
 
175
-
185
+const handleChange = (value) => {
186
+        console.log(value);
187
+      }
176 188
 
177 189
 
178 190
 onBeforeMount(() => {
@@ -204,6 +216,7 @@ const writerHelperClose = (obj) => {
204 216
 }
205 217
 const multiCopyTestingChange = () => {
206 218
   text_list.value = []
219
+  deliveryModel.value = props.originalityBasicInfoData.receiveForm.is_dynamic_creative.api_value.is_dynamic_creative
207 220
 }
208 221
 const handleClose = () => {
209 222
   visible.value = false
@@ -330,14 +343,7 @@ const handleSetMaxLength = async () => { // 计算可选数量上限
330 343
   const directObj = props.directObj
331 344
   const { accountShareRule, creativeRule, list: cMaterialList } = props.cMaterial
332 345
   const { radioVal: writerShareVal } = writerShareRadioList
333
-  const { radioVal: writerRuleVal } = writerRuleRadioList
334
-  console.log('accountLength => ', accountLength)
335
-  console.log('directObj => ', directObj)
336
-  console.log('accountShareRule => ', accountShareRule)
337
-  console.log('creativeRule => ', creativeRule)
338
-  console.log('cMaterialList => ', cMaterialList)
339
-  console.log('writerShareVal => ', writerShareVal)
340
-  console.log('writerRuleVal => ', writerRuleVal)
346
+  const { radioVal: writerRuleVal } = writerRuleRadioList 
341 347
 
342 348
   if (writerShareVal == 1) { // 按广告分配 数量上限为广告数(定向包数)
343 349
     let maxL = 0
@@ -346,43 +352,51 @@ const handleSetMaxLength = async () => { // 计算可选数量上限
346 352
     })
347 353
     maxLength.value = maxL
348 354
   } else if (writerShareVal == 2 && writerRuleVal == 1) { // 按创意分配 && 自动分配 上限为创意数
349
-    if (accountShareRule == 1 && creativeRule == 1) { // 创意素材分配方式:按账号全部复用 && 按创意全部相同
355
+    if(0 == deliveryModel.value) {
356
+      if (accountShareRule == 1 && creativeRule == 1) { // 创意素材分配方式:按账号全部复用 && 按创意全部相同
350 357
       const materialLength = cMaterialList.length // 素材数
351 358
       let directLength = 0 // 广告数(定向包数)
352 359
       directObj.chooseList.forEach((direct) => {
353 360
         directLength = directLength + direct.chooseList.length
354 361
       })
355 362
       maxLength.value = materialLength * directLength
356
-    } else if (accountShareRule == 1 && creativeRule == 2) { // 创意素材分配方式:按账号全部复用 && 按创意平均分配
357
-      const materialLength = cMaterialList.length // 素材数
358
-      maxLength.value = materialLength * accountLength
359
-    } else if (accountShareRule == 2 && creativeRule == 2) { // 创意素材分配方式:按账号平均分配 && 按创意平均分配
360
-      const materialLength = cMaterialList.length // 素材数
361
-      maxLength.value = materialLength
362
-    } else if (accountShareRule == 2 && creativeRule == 1) { // 创意素材分配方式:按账号平均分配 && 按创意全部相同
363
-      const materialLength = cMaterialList.length // 素材数
364
-      if (materialLength < accountLength) { // 素材数 < 账号数
365
-        let maxL = 0
366
-        directObj.chooseList.forEach((direct) => {
367
-          maxL = maxL + direct.chooseList.length
368
-        })
369
-        maxLength.value = maxL
370
-      } else {
371
-        let total:any = materialLength // 要分配的素材数
372
-        let count:any = accountLength // 分给几个账号
373
-        let base:any = Math.floor(total / count);
374
-        let rest:any = total % count;
375
-        let arr:any = []; // 记录每个账号分多少个素材
376
-        for(let i=0; i<count; i++) {
377
-          let idx = base + (i<rest?1:0)
378
-          arr.push(idx)
363
+      } else if (accountShareRule == 1 && creativeRule == 2) { // 创意素材分配方式:按账号全部复用 && 按创意平均分配
364
+        const materialLength = cMaterialList.length // 素材数
365
+        maxLength.value = materialLength * accountLength
366
+      } else if (accountShareRule == 2 && creativeRule == 2) { // 创意素材分配方式:按账号平均分配 && 按创意平均分配
367
+        const materialLength = cMaterialList.length // 素材数
368
+        maxLength.value = materialLength
369
+      } else if (accountShareRule == 2 && creativeRule == 1) { // 创意素材分配方式:按账号平均分配 && 按创意全部相同
370
+        const materialLength = cMaterialList.length // 素材数
371
+        if (materialLength < accountLength) { // 素材数 < 账号数
372
+          let maxL = 0
373
+          directObj.chooseList.forEach((direct) => {
374
+            maxL = maxL + direct.chooseList.length
375
+          })
376
+          maxLength.value = maxL
377
+        } else {
378
+          let total:any = materialLength // 要分配的素材数
379
+          let count:any = accountLength // 分给几个账号
380
+          let base:any = Math.floor(total / count);
381
+          let rest:any = total % count;
382
+          let arr:any = []; // 记录每个账号分多少个素材
383
+          for(let i=0; i<count; i++) {
384
+            let idx = base + (i<rest?1:0)
385
+            arr.push(idx)
386
+          }
387
+          let maxL = 0
388
+          directObj.chooseList.forEach((direct, idx) => {
389
+            maxL = maxL + direct.chooseList.length * arr[idx]
390
+          })
391
+          maxLength.value = maxL
379 392
         }
380
-        let maxL = 0
381
-        directObj.chooseList.forEach((direct, idx) => {
382
-          maxL = maxL + direct.chooseList.length * arr[idx]
383
-        })
384
-        maxLength.value = maxL
385 393
       }
394
+    } else {
395
+      let maxL = 0
396
+      directObj.chooseList.forEach((direct) => {
397
+        maxL = maxL + direct.chooseList.length * 3
398
+      })
399
+      maxLength.value = maxL
386 400
     }
387 401
   } else if (writerShareVal == 2 && writerRuleVal == 2) { // 按创意分配 && 程序化分配 无上限
388 402
     maxLength.value = -1

+ 1 - 1
src/components/businessMoudle/batchGdt3/configArea/originalityBasic/components/buttonText.vue

@@ -3,7 +3,7 @@
3 3
     <div class="form-block-item-title">行动按钮</div>
4 4
     <div class="marT15">
5 5
       <el-tooltip placement="top" content="此创意形式必须使用行动按钮" :disabled="!button_text.required" effect="light">
6
-        <el-switch v-model="switchValue" :disabled="button_text.required" @change="radioChange"/>
6
+        <el-switch v-model="switchValue" :disabled="button_text?.required" @change="radioChange"/>
7 7
       </el-tooltip>
8 8
       <template v-if="switchValue">
9 9
         <div class="flex marT15">