zhengxy 7 月之前
父节点
当前提交
5edd43db6d
共有 54 个文件被更改,包括 397 次插入83 次删除
  1. 1 1
      dist/assets/index.d1d4cefc.css
  2. 1 1
      dist/assets/index.8d4062fa.js
  3. 1 1
      dist/index.html
  4. 1 1
      dist/js/Home/index.b1f3ee88.js
  5. 1 1
      dist/js/_dialog/_dialog.f7a719dc.js
  6. 1 1
      dist/js/_input/_input.ba5ddb42.js
  7. 1 1
      dist/js/_inputAppend/_inputAppend.f593f890.js
  8. 1 1
      dist/js/_select/_select.4e36cfac.js
  9. 1 1
      dist/js/acStatement/index.85426bad.js
  10. 1 1
      dist/js/adTask/index.92eb994c.js
  11. 1 1
      dist/js/adTask3/index.58471205.js
  12. 1 1
      dist/js/adqManage/index.5692f7d7.js
  13. 1 1
      dist/js/adqManage3/index.4a5a83f1.js
  14. 1 1
      dist/js/api/api.ce60e2e9.js
  15. 1 1
      dist/js/api/api.43014780.js
  16. 1 1
      dist/js/basisMoudle/error.be1f0539.js
  17. 1 1
      dist/js/basisMoudle/login.d144dc6e.js
  18. 1 1
      dist/js/checkboxDefault/checkboxDefault.1dfacea7.js
  19. 1 1
      dist/js/collectClip/index.be3ec8c3.js
  20. 0 7
      dist/js/configArea/index.114c3c60.js
  21. 1 1
      dist/js/configArea/index.6bfca40c.js
  22. 7 0
      dist/js/configArea/index.46ba276f.js
  23. 1 1
      dist/js/define/define.9aebe656.js
  24. 1 1
      dist/js/gdtList/index.c9595cbf.js
  25. 1 1
      dist/js/gdtList3/index.2b93cf85.js
  26. 1 1
      dist/js/index/index.29d638c6.js
  27. 1 1
      dist/js/index/index.597fee26.js
  28. 1 1
      dist/js/index/index.071e2c54.js
  29. 1 1
      dist/js/index/index.f67687cd.js
  30. 1 1
      dist/js/layout/index.ea6014b9.js
  31. 1 1
      dist/js/layout/index_head.548413a6.js
  32. 1 1
      dist/js/limitManage/index.be6050be.js
  33. 1 1
      dist/js/materialBlock/materialBlock.88277963.js
  34. 1 1
      dist/js/materialData/index.727c8046.js
  35. 1 1
      dist/js/materialLibrary/index.05162043.js
  36. 1 1
      dist/js/memberManage/index.29a0f388.js
  37. 1 1
      dist/js/menu/index.7483e977.js
  38. 1 1
      dist/js/miniprogram/index.2d44804f.js
  39. 1 1
      dist/js/projectManage/index.e43b6627.js
  40. 1 1
      dist/js/radioGroup/radioGroup.434cb6c4.js
  41. 1 1
      dist/js/tableInfo/tableInfo.457e0e1b.js
  42. 1 1
      dist/js/tagBlock/tagBlock.083711a6.js
  43. 1 1
      dist/js/taskList/index.e6303708.js
  44. 1 1
      dist/js/teamManage/index.78e7de01.js
  45. 1 1
      dist/js/timeScreen/timeScreen.f2bb57f3.js
  46. 1 1
      dist/js/warning/warning.9a4eb44b.js
  47. 1 1
      dist/js/wechatPage/index.e92f211a.js
  48. 1 1
      dist/js/weekTime/weekTime.0b4647c6.js
  49. 1 1
      dist/js/weekTime/weekTime.508b8729.js
  50. 26 9
      src/components/businessMoudle/batchGdt3/configArea/copywriter/index.vue
  51. 167 11
      src/components/businessMoudle/batchGdt3/configArea/copywriter/writerDialog.vue
  52. 18 5
      src/components/businessMoudle/batchGdt3/configArea/index.vue
  53. 126 2
      src/components/businessMoudle/batchGdt3/previewArea/index.vue
  54. 6 2
      src/components/businessMoudle/textLibrary/index.vue

文件差异内容过多而无法显示
+ 1 - 1
dist/assets/index.d1d4cefc.css


文件差异内容过多而无法显示
+ 1 - 1
dist/assets/index.8d4062fa.js


+ 1 - 1
dist/index.html

@@ -12,7 +12,7 @@
12 12
 			document.write('<script src="' + src + '"><\/script>');
13 13
 			})();
14 14
     </script>
15
-    <script type="module" crossorigin src="./assets/index.8d4062fa.js"></script>
15
+    <script type="module" crossorigin src="./assets/index.ed2c8e72.js"></script>
16 16
     <link rel="modulepreload" href="./js/@vue/@vue.5bfcce30.js">
17 17
     <link rel="modulepreload" href="./js/vue-router/vue-router.ccba075e.js">
18 18
     <link rel="modulepreload" href="./js/vue-demi/vue-demi.4f3c4c97.js">

文件差异内容过多而无法显示
+ 1 - 1
dist/js/Home/index.b1f3ee88.js


文件差异内容过多而无法显示
+ 1 - 1
dist/js/_dialog/_dialog.f7a719dc.js


文件差异内容过多而无法显示
+ 1 - 1
dist/js/_input/_input.ba5ddb42.js


文件差异内容过多而无法显示
+ 1 - 1
dist/js/_inputAppend/_inputAppend.f593f890.js


文件差异内容过多而无法显示
+ 1 - 1
dist/js/_select/_select.4e36cfac.js


文件差异内容过多而无法显示
+ 1 - 1
dist/js/acStatement/index.85426bad.js


文件差异内容过多而无法显示
+ 1 - 1
dist/js/adTask/index.92eb994c.js


文件差异内容过多而无法显示
+ 1 - 1
dist/js/adTask3/index.58471205.js


文件差异内容过多而无法显示
+ 1 - 1
dist/js/adqManage/index.5692f7d7.js


文件差异内容过多而无法显示
+ 1 - 1
dist/js/adqManage3/index.4a5a83f1.js


文件差异内容过多而无法显示
+ 1 - 1
dist/js/api/api.ce60e2e9.js


文件差异内容过多而无法显示
+ 1 - 1
dist/js/api/api.43014780.js


文件差异内容过多而无法显示
+ 1 - 1
dist/js/basisMoudle/error.be1f0539.js


文件差异内容过多而无法显示
+ 1 - 1
dist/js/basisMoudle/login.d144dc6e.js


文件差异内容过多而无法显示
+ 1 - 1
dist/js/checkboxDefault/checkboxDefault.1dfacea7.js


文件差异内容过多而无法显示
+ 1 - 1
dist/js/collectClip/index.be3ec8c3.js


文件差异内容过多而无法显示
+ 0 - 7
dist/js/configArea/index.114c3c60.js


文件差异内容过多而无法显示
+ 1 - 1
dist/js/configArea/index.6bfca40c.js


文件差异内容过多而无法显示
+ 7 - 0
dist/js/configArea/index.46ba276f.js


文件差异内容过多而无法显示
+ 1 - 1
dist/js/define/define.9aebe656.js


文件差异内容过多而无法显示
+ 1 - 1
dist/js/gdtList/index.c9595cbf.js


文件差异内容过多而无法显示
+ 1 - 1
dist/js/gdtList3/index.2b93cf85.js


文件差异内容过多而无法显示
+ 1 - 1
dist/js/index/index.29d638c6.js


文件差异内容过多而无法显示
+ 1 - 1
dist/js/index/index.597fee26.js


文件差异内容过多而无法显示
+ 1 - 1
dist/js/index/index.071e2c54.js


文件差异内容过多而无法显示
+ 1 - 1
dist/js/index/index.f67687cd.js


文件差异内容过多而无法显示
+ 1 - 1
dist/js/layout/index.ea6014b9.js


文件差异内容过多而无法显示
+ 1 - 1
dist/js/layout/index_head.548413a6.js


文件差异内容过多而无法显示
+ 1 - 1
dist/js/limitManage/index.be6050be.js


文件差异内容过多而无法显示
+ 1 - 1
dist/js/materialBlock/materialBlock.88277963.js


文件差异内容过多而无法显示
+ 1 - 1
dist/js/materialData/index.727c8046.js


文件差异内容过多而无法显示
+ 1 - 1
dist/js/materialLibrary/index.05162043.js


文件差异内容过多而无法显示
+ 1 - 1
dist/js/memberManage/index.29a0f388.js


文件差异内容过多而无法显示
+ 1 - 1
dist/js/menu/index.7483e977.js


文件差异内容过多而无法显示
+ 1 - 1
dist/js/miniprogram/index.2d44804f.js


文件差异内容过多而无法显示
+ 1 - 1
dist/js/projectManage/index.e43b6627.js


文件差异内容过多而无法显示
+ 1 - 1
dist/js/radioGroup/radioGroup.434cb6c4.js


文件差异内容过多而无法显示
+ 1 - 1
dist/js/tableInfo/tableInfo.457e0e1b.js


文件差异内容过多而无法显示
+ 1 - 1
dist/js/tagBlock/tagBlock.083711a6.js


文件差异内容过多而无法显示
+ 1 - 1
dist/js/taskList/index.e6303708.js


文件差异内容过多而无法显示
+ 1 - 1
dist/js/teamManage/index.78e7de01.js


文件差异内容过多而无法显示
+ 1 - 1
dist/js/timeScreen/timeScreen.f2bb57f3.js


文件差异内容过多而无法显示
+ 1 - 1
dist/js/warning/warning.9a4eb44b.js


文件差异内容过多而无法显示
+ 1 - 1
dist/js/wechatPage/index.e92f211a.js


文件差异内容过多而无法显示
+ 1 - 1
dist/js/weekTime/weekTime.0b4647c6.js


文件差异内容过多而无法显示
+ 1 - 1
dist/js/weekTime/weekTime.508b8729.js


+ 26 - 9
src/components/businessMoudle/batchGdt3/configArea/copywriter/index.vue

@@ -1,5 +1,5 @@
1 1
 <template>
2
-  <div class="flex">
2
+  <!-- <div class="flex">
3 3
     <el-select v-model="selectValue" placeholder="请选择" @change="selectValueChange">
4 4
       <el-option
5 5
         v-for="item in selectOptions"
@@ -12,18 +12,21 @@
12 12
       <template #content><span v-html="tooltip"></span></template>
13 13
       <span><el-icon class="questionFilled"><QuestionFilled /></el-icon></span>
14 14
     </el-tooltip>
15
-  </div>
15
+  </div> -->
16 16
   <div class="add-sec" v-if="writer_list?.length > 0">
17 17
     <p class="add-sec-title">文案:</p>
18 18
     <div class="add-sec-span" v-for="item in writer_list">
19 19
       <div class="add-sec-con">{{ item }}</div>
20
-      <el-icon :size="14" color="#bfc4d0" class="pointer lMarauto" @click="delItem(item)"><i-ep-Close /></el-icon>
20
+      <!-- <el-icon :size="14" color="#bfc4d0" class="pointer lMarauto" @click="delItem(item)"><i-ep-Close /></el-icon> -->
21 21
     </div>
22 22
   </div>
23
-  <WriterDialog ref="WriterDialogRef" :basicInfoData="basicInfoData" :adTemplateItem="adTemplateItem" :count_info="selectValue == 1 ? num_total : {}" @close="closeWriterDialog"></WriterDialog>
23
+  <div class="add-sec" v-else>
24
+    <p class="add-sec-title">暂无数据</p>
25
+  </div>
26
+  <WriterDialog ref="WriterDialogRef" :basicInfoData="basicInfoData" :adTemplateItem="adTemplateItem" :count_info="selectValue == 1 ? num_total : {}" :cMaterial="props.cMaterial" :directObj="props.directObj" :accIdsList="props.accIdsList" @close="closeWriterDialog"></WriterDialog>
24 27
 </template>
25 28
 <script setup lang="ts">
26
-import { nextTick, reactive, ref } from 'vue';
29
+import { nextTick, reactive, ref, watch } from 'vue';
27 30
 import WriterDialog from './writerDialog.vue'
28 31
 const selectOptions = [
29 32
   { label: '自动分配', value: 1 },
@@ -43,13 +46,25 @@ const props = defineProps({
43 46
   adTemplateItem: {
44 47
     type:Object,
45 48
     default: () => {}
46
-  }
49
+  },
50
+  cMaterial: {
51
+    type:Object,
52
+    default: () => ({})
53
+  },
54
+  directObj: {
55
+    type:Object,
56
+    default: () => ({})
57
+  },
58
+  accIdsList: {
59
+    type:Array,
60
+    default: () => ([])
61
+  },
47 62
 })
48 63
 const emit = defineEmits<{
49 64
   (event: "writerCallBack", val?: any): void;
50 65
 }>();
51 66
 const WriterDialogRef = ref()
52
-const selectValue = ref(1)
67
+const selectValue = ref(2)
53 68
 const tooltip = `自动匹配:将文案组分配至广告或创意中。<br/>程序化测试:文案组与定向和创意进行叉乘测试。`
54 69
 const multiCopyTesting = ref()
55 70
 
@@ -63,7 +78,9 @@ const closeWriterDialog = (obj) => {
63 78
   emit('writerCallBack',{
64 79
     writer: obj.text_list,
65 80
     multiCopyTesting: obj.multiCopyTesting,
66
-    allocation_type: selectValue.value
81
+    allocation_type: selectValue.value,
82
+    writerShareRadioList: obj.writerShareRadioList,
83
+    writerRuleRadioList: obj.writerRuleRadioList,
67 84
   })
68 85
 }
69 86
 /**删除单条信息 */
@@ -102,7 +119,7 @@ const feedbackEvent = (obj) => {
102 119
 }
103 120
 /**清空 */
104 121
 const clearEvent = () => {
105
-  selectValue.value = 1;
122
+  selectValue.value = 2;
106 123
   closeWriterDialog([])
107 124
 }
108 125
 // 暴露自己的属性供父组件使用

+ 167 - 11
src/components/businessMoudle/batchGdt3/configArea/copywriter/writerDialog.vue

@@ -1,13 +1,13 @@
1 1
 <template>
2 2
   <el-dialog class="gdt-dialog" :close-on-click-modal="false" :destroy-on-close="true" key="copywriterDialog"
3 3
     v-model="visible" title="选择文案" width="1000px" top="40px" :before-close="handleClose">
4
-    <div v-loading="loading">
4
+    <div v-loading="loading" style="overflow-y: auto; max-height: 75vh;">
5 5
       <div class="flex marT15">
6 6
         <label class="form-block-item-title">多文案测试</label>
7 7
         <div class="flex">
8
-          <el-radio-group v-model="multiCopyTesting" size="default" @change="multiCopyTestingChange">
9
-            <el-radio-button :label="0">不开启</el-radio-button>
10
-            <el-radio-button :label="1">文案(1-30字)</el-radio-button>
8
+          <el-radio-group v-model="multiCopyTesting" size="small" @change="multiCopyTestingChange">
9
+            <el-radio-button :label="0"  size="small">不开启</el-radio-button>
10
+            <el-radio-button :label="1"  size="small">文案(1-30字)</el-radio-button>
11 11
           </el-radio-group>
12 12
           <el-tooltip placement="right" effect="light">
13 13
             <template #content><span v-html="tooltip"></span></template>
@@ -43,18 +43,40 @@
43 43
         </div>
44 44
         <div style="color:#999;line-height: 26px;margin-top: 2px;" class="flex" v-if="multiCopyTesting == 1">已选择 {{
45 45
           text_list?.length || 0 }} 条,将合并为 {{ text_list?.length || 0 }} 组
46
-          <template v-if="count_info && JSON.stringify(count_info) != '{}'">
46
+          <template v-if="maxLength > 0 && maxLength != -1">
47
+            <span style="color:#555">(上限:{{ maxLength }}组)</span>
48
+          </template>
49
+          <!-- <template v-if="count_info && JSON.stringify(count_info) != '{}'">
47 50
             <span style="color:#555">(上限:{{ count_info?.adNum }}组)</span>
48 51
             <el-tooltip placement="right" content="上限:自动分配文案组时,文案组上限=已有广告数" effect="light">
49 52
               <span><el-icon class="questionFilled" style="margin-top:6px;">
50 53
                   <QuestionFilled />
51 54
                 </el-icon></span>
52 55
             </el-tooltip>
53
-          </template>
56
+          </template> -->
54 57
         </div>
55 58
       </div>
59
+      <div class="marT25" v-if="multiCopyTesting == 1">
60
+        <RadioGroup
61
+            class="rule-wrap"
62
+            :radioList="writerShareRadioList.list"
63
+            :echoVal="writerShareRadioList.radioVal"
64
+            :title="writerShareRadioList.name"
65
+            :haveNotes="writerShareRadioList.haveNotes"
66
+            @returnEvent="onChangeWriterShare"></RadioGroup>
67
+
68
+        <template v-if="writerShareRadioList.radioVal == 2">
69
+          <RadioGroup
70
+              class="rule-wrap"
71
+              :radioList="writerRuleRadioList.list"
72
+              :echoVal="writerRuleRadioList.radioVal"
73
+              :title="writerRuleRadioList.name"
74
+              :haveNotes="writerRuleRadioList.haveNotes"
75
+              @returnEvent="onChangeWriterRule"></RadioGroup>
76
+        </template>
77
+      </div>
56 78
       <div class="fix-table" v-if="multiCopyTesting == 1">
57
-        <TextLibrary ref="TextLibraryRef" immobilizationHeight="40vh" tableSize="small" source="writerHelper" :select_num="count_info?.adNum" @select="selectEvent"></TextLibrary>
79
+        <TextLibrary ref="TextLibraryRef" immobilizationHeight="40vh" tableSize="small" source="writerHelper" :select_num="maxLength" @select="selectEvent"></TextLibrary>
58 80
       </div>
59 81
 
60 82
     </div>
@@ -68,15 +90,25 @@
68 90
   <WriterHelper ref="WriterHelperRef" @close="writerHelperClose"></WriterHelper>
69 91
 </template>
70 92
 <script setup lang="ts">
71
-import { nextTick, onBeforeMount, ref } from 'vue';
93
+import { nextTick, onBeforeMount, ref, reactive } from 'vue';
72 94
 import { emojiList } from "@/common/emoji";
73 95
 import TextLibrary from '@/components/businessMoudle/textLibrary/index.vue'
74 96
 import WriterHelper from './writerHelper.vue'
75 97
 import { ElMessage } from 'element-plus';
76 98
 import _ from 'lodash';
99
+import RadioGroup from '@/components/businessMoudle/batchGdt3/configArea/directPacket/common/radioGroup.vue'
100
+
101
+interface radioFace{
102
+  value:number | string,
103
+  name:string,
104
+  EgName:string,
105
+  radioVal:any,
106
+  haveNotes:boolean,
107
+  list:any
108
+}
77 109
 const props = defineProps({
78 110
   accIdsList: {
79
-    type: Array<{ id: string, name: string }>,
111
+    type: Array,
80 112
     default: () => []
81 113
   },
82 114
   count_info: {
@@ -90,7 +122,15 @@ const props = defineProps({
90 122
   adTemplateItem: {
91 123
     type: Object,
92 124
     default: () => { }
93
-  }
125
+  },
126
+  cMaterial: {
127
+    type:Object,
128
+    default: () => ({})
129
+  },
130
+  directObj: {
131
+    type:Object,
132
+    default: () => ({})
133
+  },
94 134
 })
95 135
 const emit = defineEmits<{
96 136
   (event: "close", val?: any): void;
@@ -107,6 +147,34 @@ const WriterHelperRef = ref()
107 147
 const TextLibraryRef = ref()
108 148
 const allocation = ref(1) // 创意文案分配方式 1自动分配 2程序化测试
109 149
 const tooltip = `您可以选择某一种文案,进行多条文案测试;<br/>测试文案为变量,将会出现在最下方,以列表形式多选;<br/>非测试文案为常量,会保持在上方;`
150
+
151
+const writerShareRadioList = reactive<radioFace>({
152
+  value:'1',
153
+  name:'文案分配方式',
154
+  EgName:'writerShare',
155
+  radioVal:'1',
156
+  haveNotes:true,
157
+  list:[
158
+    {name:'按广告分配',value:'1', notes: '按广告分配:一个广告一组文案,选择的文案数量不超过广告总数,当文案数量小于广告数量时,进行轮询分配;'},
159
+    {name:'按创意分配',value:'2', notes: '按创意分配:一个创意一组文案,选择的文案数量不超过创意总数,当文案数量小于创意数量时,进行轮询分配;'},
160
+  ]
161
+})
162
+const writerRuleRadioList = reactive<radioFace>({
163
+  value:'1',
164
+  name:'分配规则',
165
+  EgName:'writerRule',
166
+  radioVal:'1',
167
+  haveNotes:true,
168
+  list:[
169
+    {name:'自动分配',value:'1', notes: '自动匹配:将文案组自动分配至广告或创意中。'},
170
+    {name:'程序化分配',value:'2', notes: '程序化测试:文案组与创意组进行叉乘测试,生成更多的创意。'},
171
+  ]
172
+})
173
+const maxLength = ref(-1)
174
+
175
+
176
+
177
+
110 178
 onBeforeMount(() => {
111 179
   init()
112 180
 })
@@ -201,7 +269,9 @@ const submitEvent = () => {
201 269
   }
202 270
   emit('close', {
203 271
     'multiCopyTesting': multiCopyTesting.value,
204
-    'text_list': text_list.value
272
+    'text_list': text_list.value,
273
+    'writerShareRadioList': writerShareRadioList.radioVal,
274
+    'writerRuleRadioList': writerRuleRadioList.radioVal,
205 275
   })
206 276
   visible.value = false
207 277
 }
@@ -252,7 +322,84 @@ const initFun = (flag, obj) => {
252 322
       }
253 323
     }
254 324
   })
325
+  handleSetMaxLength()
255 326
 }
327
+
328
+const handleSetMaxLength = async () => { // 计算可选数量上限
329
+  const accountLength = props.accIdsList.length
330
+  const directObj = props.directObj
331
+  const { accountShareRule, creativeRule, list: cMaterialList } = props.cMaterial
332
+  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)
341
+
342
+  if (writerShareVal == 1) { // 按广告分配 数量上限为广告数(定向包数)
343
+    let maxL = 0
344
+    directObj.chooseList.forEach((direct) => {
345
+      maxL = maxL + direct.chooseList.length
346
+    })
347
+    maxLength.value = maxL
348
+  } else if (writerShareVal == 2 && writerRuleVal == 1) { // 按创意分配 && 自动分配 上限为创意数
349
+    if (accountShareRule == 1 && creativeRule == 1) { // 创意素材分配方式:按账号全部复用 && 按创意全部相同
350
+      const materialLength = cMaterialList.length // 素材数
351
+      let directLength = 0 // 广告数(定向包数)
352
+      directObj.chooseList.forEach((direct) => {
353
+        directLength = directLength + direct.chooseList.length
354
+      })
355
+      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)
379
+        }
380
+        let maxL = 0
381
+        directObj.chooseList.forEach((direct, idx) => {
382
+          maxL = maxL + direct.chooseList.length * arr[idx]
383
+        })
384
+        maxLength.value = maxL
385
+      }
386
+    }
387
+  } else if (writerShareVal == 2 && writerRuleVal == 2) { // 按创意分配 && 程序化分配 无上限
388
+    maxLength.value = -1
389
+  }
390
+
391
+  await nextTick()
392
+  TextLibraryRef.value.tableListRef.clearSelected()
393
+}
394
+const onChangeWriterShare = (val) => {
395
+  writerShareRadioList.radioVal = val
396
+  handleSetMaxLength()
397
+}
398
+const onChangeWriterRule = (val) => {
399
+  writerRuleRadioList.radioVal = val
400
+  handleSetMaxLength()
401
+}
402
+
256 403
 // 暴露自己的属性供父组件使用
257 404
 defineExpose({
258 405
   initFun
@@ -296,4 +443,13 @@ defineExpose({
296 443
   left: 430px;
297 444
   width: 40px;
298 445
 }
446
+
447
+.rule-wrap {
448
+  margin-top: 10px;
449
+  :deep(.spanTitle) {
450
+    color: #515a6e;
451
+    font-size: 14px;
452
+    width: 135px !important;
453
+  }
454
+}
299 455
 </style>

+ 18 - 5
src/components/businessMoudle/batchGdt3/configArea/index.vue

@@ -58,6 +58,9 @@
58 58
                 <template v-if="sub.name == '创意文案'">
59 59
                   <Copywriter ref="CopywriterRef" :num_total="pageInfo.num_total" :basicInfoData="basicInfoData.fillBack"
60 60
                     :adTemplateItem="originalityBasicInfoData?.apiResult?.adTemplateItem || {}"
61
+                    :cMaterial="cMaterial"
62
+                    :directObj="pageInfo.directObj"
63
+                    :accIdsList="pageInfo.accIdsList"
61 64
                     @writerCallBack="writerCallBack"></Copywriter>
62 65
                 </template>
63 66
                 <template v-if="sub.name == '落地页'">
@@ -153,7 +156,7 @@
153 156
   <CreativeMaterial ref="CreativeMaterialRef" :haveCoverOrVideo="cMaterial.haveCoverOrVideo"
154 157
     :haveShowVideoObj="cMaterial.haveShowVideoObj" :video_tips="cMaterial.video_tips" :image_tips="cMaterial.image_tips" :directPacketChooseNum="pageInfo.directPacketChooseNum"
155 158
     @closeLoading="close_reuse_loading" :maxNum_imageList="cMaterial.array_property?.max_number || 1"
156
-    @assignEvent="assignEvent_CreativeMaterial"></CreativeMaterial>
159
+    @assignEvent="onChangeMaterial"></CreativeMaterial>
157 160
 
158 161
 
159 162
   <!-- 创意基本信息 -->
@@ -327,6 +330,8 @@ const pageInfo = reactive<reactiveTableAndAny>({
327 330
     multiCopyTesting: 0,
328 331
     data: [],
329 332
     allocation_type: '',//分配形式 1自动分配 2程序化相乘分配
333
+    writerShareRadioList: '1',// 分配方式 1按广告 2按创意
334
+    writerRuleRadioList: '1', // 分配规则 1自动分配 2程序化分配
330 335
   },
331 336
   copyLandPageInfoData: {//落地页
332 337
     data: [],
@@ -516,9 +521,6 @@ const updateHaveContent = ({ id, chooseNum, minusFlag, clearFlag, type }: IUpdat
516 521
       })
517 522
     } else {
518 523
       if (id == 3) {
519
-        console.log('updateHaveContent => id ', id)
520
-        console.log('updateHaveContent => chooseNum ', chooseNum)
521
-        console.log('updateHaveContent => type ', type)
522 524
         if (DirectPacketExhibitionRef.value) {
523 525
           pageInfo.directObj = DirectPacketExhibitionRef.value[0]?.getObjValue()
524 526
         }
@@ -531,6 +533,8 @@ const updateHaveContent = ({ id, chooseNum, minusFlag, clearFlag, type }: IUpdat
531 533
         }
532 534
         computeCount()
533 535
 
536
+        // 定向包变化 => 清空创意文案
537
+        CopywriterRef?.value[0]?.clearEvent()
534 538
         // 定向包变化 => 清空售卖策略配置
535 539
         sellStrategyRef?.value?.handleClear()
536 540
         // 定向包变化 => 清空推广产品配置
@@ -594,6 +598,8 @@ const writerCallBack = (obj) => {
594 598
   pageInfo.copywriterInfoData.multiCopyTesting = obj.multiCopyTesting;
595 599
   pageInfo.copywriterInfoData.data = obj.writer;
596 600
   pageInfo.copywriterInfoData.allocation_type = obj.allocation_type;
601
+  pageInfo.copywriterInfoData.writerShareRadioList = obj.writerShareRadioList;
602
+  pageInfo.copywriterInfoData.writerRuleRadioList = obj.writerRuleRadioList;
597 603
   if (obj.writer && Array.isArray(obj.writer)) {
598 604
     updateHaveContent({
599 605
       id: 7,
@@ -736,7 +742,8 @@ const {
736 742
   ResuseConfigRef,
737 743
   computeCount,
738 744
   cMaterial,
739
-  close_reuse_loading
745
+  close_reuse_loading,
746
+
740 747
 })
741 748
 // E 创意素材
742 749
 
@@ -857,6 +864,12 @@ onMounted(() => {
857 864
   })
858 865
 })
859 866
 
867
+const onChangeMaterial = (val: any, videoOnPuse: any, options: any) => {
868
+  assignEvent_CreativeMaterial(val, videoOnPuse, options)
869
+  // 素材变化 => 清空创意文案
870
+  CopywriterRef?.value[0]?.clearEvent()
871
+}
872
+
860 873
 //传值
861 874
 provide('accountIds', toRef(pageInfo, 'accIdsList'))
862 875
 

+ 126 - 2
src/components/businessMoudle/batchGdt3/previewArea/index.vue

@@ -877,6 +877,13 @@ const initEvent = (infoObj_c) => {
877 877
       materialItemIds: infoObj.copyInfo.cMaterial.list.map((l) => l.list[0].itemId),
878 878
     })
879 879
 
880
+    //创意文案 按广告分配 & 按创意分配
881
+    handleSetWriterRule({
882
+      writerShare: infoObj.copyInfo.pageInfo.copywriterInfoData.writerShareRadioList,
883
+      writerRule: infoObj.copyInfo.pageInfo.copywriterInfoData.writerRuleRadioList,
884
+      writerList: infoObj.copyInfo.pageInfo.copywriterInfoData.data,
885
+    })
886
+
880 887
     accItemEvent(pageInfo.accList[0].id)
881 888
   })
882 889
 }
@@ -913,7 +920,6 @@ const handleSetMaterialRule = ({accountShareRule, creativeRule, materialItemIds
913 920
       let idx = base + (i<rest?1:0)
914 921
       arr.push(idx)
915 922
     }
916
-    console.log('arr => ', arr)
917 923
 
918 924
     _campaign_list.forEach((account) => {
919 925
       account.materialItemIds = []
@@ -973,7 +979,6 @@ const handleSetMaterialRule = ({accountShareRule, creativeRule, materialItemIds
973 979
         let idx = base + (i<rest?1:0)
974 980
         arr.push(idx)
975 981
       }
976
-      console.log('arr => ', arr)
977 982
 
978 983
       campaign.chooseList.forEach((item) => {
979 984
         item.materialItemIds = []
@@ -1000,6 +1005,125 @@ const handleSetMaterialRule = ({accountShareRule, creativeRule, materialItemIds
1000 1005
   }
1001 1006
 }
1002 1007
 
1008
+const handleSetWriterRule = ({writerShare, writerRule, writerList = []}) => {
1009
+  console.log('writerShare => ', writerShare)
1010
+  console.log('writerRule => ', writerRule)
1011
+  console.log('writerList => ', writerList)
1012
+  console.log('pageInfo.campaign_list => ', JSON.parse(JSON.stringify(pageInfo.campaign_list)))
1013
+
1014
+  if (writerShare == 1) { // 所选文案按广告(定向包)平均分配 删除重复素材
1015
+    const _campaign_list = _.cloneDeep(pageInfo.campaign_list)
1016
+
1017
+    let _writerList = []
1018
+    for (let i = 0; i < 99; i++) {
1019
+      _writerList = [..._writerList, ...writerList]
1020
+    }
1021
+
1022
+    let adIds: any = []
1023
+    _campaign_list.forEach((campaign) => {
1024
+      campaign.chooseList.forEach((choose) => {
1025
+        choose.ad_list.forEach(ad => {
1026
+          ad.account_id = choose.account_id
1027
+          ad.adId = `${choose.account_id}&&&${ad.targeting_id}`
1028
+          adIds.push(ad.adId)
1029
+        })
1030
+      })
1031
+    })
1032
+    adIds = _.uniq(adIds)
1033
+    console.log('adIds => ', adIds)
1034
+    console.log('_writerList => ', _writerList)
1035
+    console.log('_campaign_list => ', _campaign_list)
1036
+
1037
+    let total:any = writerList.length
1038
+    let count:any = adIds.length;
1039
+    let base:any = Math.floor(total / count);
1040
+    let rest:any = total % count;
1041
+    let arr:any = []; // 记录每个账号分多少个素材
1042
+    for(let i=0; i<count; i++) {
1043
+      let idx = base + (i<rest?1:0)
1044
+      arr.push(idx)
1045
+    }
1046
+    console.log('arr => ', arr)
1047
+
1048
+    adIds = adIds.map(adId => ({
1049
+      adId: adId,
1050
+      writerList: [],
1051
+    }))
1052
+
1053
+    let startIdx = 0
1054
+    arr.forEach((length, idx) => {
1055
+      let _length = length || 1
1056
+      adIds[idx].writerList = _writerList.slice(startIdx, startIdx+_length)
1057
+      startIdx = startIdx + _length
1058
+    })
1059
+
1060
+    console.log('adIds => ', adIds)
1061
+
1062
+    _campaign_list.forEach((campaign) => {
1063
+      campaign.chooseList.forEach((choose) => {
1064
+        choose.ad_list.forEach(ad => {
1065
+          const crtAdId = ad.adId
1066
+          const res = adIds.find(ad => ad.adId === crtAdId)
1067
+          if (res && !res.writerList.includes(ad.adcreatives_info.adcreative_elements.description)) {
1068
+            ad.delFlag = true
1069
+          }
1070
+        })
1071
+        choose.ad_list = choose.ad_list.filter(ad => !ad.delFlag)
1072
+      })
1073
+    })
1074
+    pageInfo.campaign_list = _.cloneDeep(_campaign_list)
1075
+  } else if (writerShare == 2 && writerRule == 1) { // 所选文案按创意平均分配 删除重复素材
1076
+    const _campaign_list = _.cloneDeep(pageInfo.campaign_list)
1077
+    let _writerList = []
1078
+    for (let i = 0; i < 99; i++) {
1079
+      _writerList = [..._writerList, ...writerList]
1080
+    }
1081
+    let adIds: any = []
1082
+    _campaign_list.forEach((campaign) => {
1083
+      campaign.chooseList.forEach((choose) => {
1084
+        choose.ad_list.forEach(ad => {
1085
+          ad.account_id = choose.account_id
1086
+          ad.adId = `${choose.account_id}&&&${ad.targeting_id}`
1087
+          adIds.push(ad.adId)
1088
+        })
1089
+      })
1090
+    })
1091
+    adIds = _.uniq(adIds)
1092
+    let total:any = writerList.length
1093
+    let count:any = adIds.length;
1094
+    let base:any = Math.floor(total / count);
1095
+    let rest:any = total % count;
1096
+    let arr:any = []; // 记录每个账号分多少个素材
1097
+    for(let i=0; i<count; i++) {
1098
+      let idx = base + (i<rest?1:0)
1099
+      arr.push(idx)
1100
+    }
1101
+    adIds = adIds.map(adId => ({
1102
+      adId: adId,
1103
+      writerList: [],
1104
+    }))
1105
+    let startIdx = 0
1106
+    arr.forEach((length, idx) => {
1107
+      let _length = length || 1
1108
+      adIds[idx].writerList = _writerList.slice(startIdx, startIdx+_length)
1109
+      startIdx = startIdx + _length
1110
+    })
1111
+    _campaign_list.forEach((campaign) => {
1112
+      campaign.chooseList.forEach((choose) => {
1113
+        choose.ad_list.forEach(ad => {
1114
+          const crtAdId = ad.adId
1115
+          const res = adIds.find(ad => ad.adId === crtAdId)
1116
+          if (res && !res.writerList.includes(ad.adcreatives_info.adcreative_elements.description)) {
1117
+            ad.delFlag = true
1118
+          }
1119
+        })
1120
+        choose.ad_list = choose.ad_list.filter(ad => !ad.delFlag)
1121
+      })
1122
+    })
1123
+    pageInfo.campaign_list = _.cloneDeep(_campaign_list)
1124
+  }
1125
+}
1126
+
1003 1127
 
1004 1128
 
1005 1129
 

+ 6 - 2
src/components/businessMoudle/textLibrary/index.vue

@@ -278,7 +278,7 @@ const selectableEvent = (row) => {
278 278
   if(pageInfo.chooseList.includes(row.id)){
279 279
     return true
280 280
   }
281
-  if( props.select_num > 0 && pageInfo.chooseList >= props.select_num){
281
+  if( props.select_num > 0 && pageInfo.chooseList.length >= props.select_num){
282 282
     return false
283 283
   }else{
284 284
     return true
@@ -286,6 +286,7 @@ const selectableEvent = (row) => {
286 286
 }
287 287
 /**点击全选 */
288 288
 const handleSelectionAllChange = (selection) => {
289
+  console.log('handleSelectionAllChange selection => ', selection)
289 290
   if (selection.length > props.select_num && props.select_num != -1) {
290 291
     selection.length = props.select_num
291 292
   }
@@ -315,7 +316,10 @@ const writ_toggle_selected = async (list) => {
315 316
 
316 317
 // 父组件共享值
317 318
 defineExpose({
318
-  writ_toggle_selected
319
+  writ_toggle_selected,
320
+  handleSelectionAllChange,
321
+  tableInfo,
322
+  tableListRef,
319 323
 });
320 324
 </script>
321 325
 <style lang="scss" scoped>