Browse Source

创意素材

liuxiaona 1 year ago
parent
commit
ca08b42be8
19 changed files with 717 additions and 489 deletions
  1. 1 1
      src/components/businessMoudle/batchGdt/configArea/creativeMaterial/creativeTeam.vue
  2. 32 42
      src/components/businessMoudle/batchGdt/configArea/creativeMaterial/index.vue
  3. 55 104
      src/components/businessMoudle/batchGdt/configArea/creativeMaterial/libraryDialog.vue
  4. 38 89
      src/components/businessMoudle/batchGdt/configArea/creativeMaterial/testNew.vue
  5. 22 12
      src/components/businessMoudle/batchGdt/configArea/creativeMaterial/ts/searchBox.ts
  6. 101 4
      src/components/businessMoudle/batchGdt/configArea/creativeMaterial/ts/uploadAddGetRes.ts
  7. 35 9
      src/components/businessMoudle/batchGdt/configArea/directPacket/common/Cascader/index.ts
  8. 33 12
      src/components/businessMoudle/batchGdt/configArea/directPacket/common/Cascader/index.vue
  9. 2 3
      src/components/businessMoudle/batchGdt/configArea/directPacket/common/Cascader/subChooseItem.vue
  10. 5 2
      src/components/businessMoudle/batchGdt/configArea/directPacket/common/Cascader/subList.vue
  11. 3 3
      src/components/businessMoudle/batchGdt/configArea/directPacket/common/checkGroup.vue
  12. 30 10
      src/components/businessMoudle/batchGdt/configArea/directPacket/newDirecPacket.vue
  13. 1 0
      src/components/businessMoudle/batchGdt/configArea/directPacket/ts/directDetialPreview.ts
  14. 203 16
      src/components/businessMoudle/batchGdt/configArea/index.vue
  15. 0 46
      src/components/businessMoudle/batchGdt/index.vue
  16. 150 132
      src/components/businessMoudle/batchGdt/previewArea/index.vue
  17. 2 2
      src/components/businessMoudle/materialLibrary/material.vue
  18. 3 1
      src/components/capsulationMoudle/_dialog.vue
  19. 1 1
      src/router/index.ts

+ 1 - 1
src/components/businessMoudle/batchGdt/configArea/creativeMaterial/creativeTeam.vue

@@ -31,7 +31,7 @@
31 31
           </div>
32 32
         </div>
33 33
         <div class="tipsBox">
34
-          尺寸:{{video_tips.width}}px * {{video_tips.height}}px (推荐) ,
34
+          尺寸:{{video_tips.min_width}}px * {{video_tips.min_height}}px (推荐) ,
35 35
           格式: <span v-for="(i,idx) in video_tips.file_format"><span v-if="idx!==0"> / </span>{{i.split('_')[2]}} </span> ,
36 36
           小于{{video_tips.file_size}}MB ,
37 37
           播放时长 {{video_tips.min_duration}} - {{video_tips.max_duration}} s

+ 32 - 42
src/components/businessMoudle/batchGdt/configArea/creativeMaterial/index.vue

@@ -28,7 +28,7 @@
28 28
           <div class="lMarauto">
29 29
             <el-button type="primary" @click="openLibraryDialog(1)">批量添加视频</el-button>
30 30
             <el-button type="primary" v-if="haveCoverFlag" @click="openLibraryDialog(2)">批量添加封面</el-button>
31
-            <el-button type="primary" v-if="haveCoverFlag">一键指定封面</el-button>
31
+<!--            <el-button type="primary" v-if="haveCoverFlag">一键指定封面</el-button>-->
32 32
             <el-button type="primary" @click="openTestNew">一键测新</el-button>
33 33
           </div>
34 34
         </div>
@@ -38,7 +38,7 @@
38 38
             <div class="flex tMar10" style="align-items: flex-start">
39 39
               <div class="TeamBox">
40 40
                 <div class="TeamTitle flex">
41
-                  <div>创意组{{fillZero(idx+1)}} - {{item.id}}</div>
41
+                  <div>创意组{{fillZero(idx+1)}}</div>
42 42
                   <div class="lMarauto">
43 43
                     <el-icon :size="14" color="#999" class="pointer" @click="item.show = !item.show"><i-ep-CaretBottom /></el-icon>
44 44
                     <el-icon :size="14" color="red" class="lMar10 pointer" @click="deleItemEvent(item)"><i-ep-CircleClose /></el-icon>
@@ -51,8 +51,8 @@
51 51
                                   @deleEvent="(type)=>{deleItemUrlEvent(item.id,type)}"
52 52
                                   @openEvent="(type,maxNum)=>{openLibraryDialog(type,maxNum,item.id)}"
53 53
                                   @autoCoverEvent="openAutoCover(item.itemId)"
54
-                                  :video_tips="pageInfo.video_restriction"
55
-                                  :image_tips="pageInfo.image_restriction"></CreativeTeam>
54
+                                  :video_tips="video_tips"
55
+                                  :image_tips="image_tips"></CreativeTeam>
56 56
                   </el-collapse-transition>
57 57
                 </div>
58 58
               </div>
@@ -78,17 +78,18 @@
78 78
     <LibraryDialog ref="LibraryDialogRef"
79 79
                    @assignEvent="assignEvent_LibraryDialog"
80 80
                    :is_generate_cover="coverRadioList.radioVal"
81
-                   :video_tips="pageInfo.video_restriction"
82
-                   :image_tips="pageInfo.image_restriction"></LibraryDialog>
81
+                   :video_tips="video_tips"
82
+                   :image_tips="image_tips"></LibraryDialog>
83 83
     <!--      智能封面-->
84 84
     <AutoCoverDialog ref="AutoCoverDialogRef" @assignEvent="assignEvent_AutoCoverDialog"></AutoCoverDialog>
85 85
     <!--      一件测新-->
86
-    <TestNewDialog ref="TestNewDialogRef" :propInfo="{
87
-                                            testNewType,
88
-                                            is_generate_cover:coverRadioList.radioVal,
89
-                                            video_tips:pageInfo.video_restriction,
90
-                                            image_tips:pageInfo.image_restriction,
91
-                                          }"></TestNewDialog>
86
+    <TestNewDialog ref="TestNewDialogRef"
87
+                   @assignEvent="assignEvent_LibraryDialog"
88
+                   :propInfo="{testNewType,
89
+                              is_generate_cover:coverRadioList.radioVal,
90
+                              video_tips,
91
+                              image_tips
92
+                            }"></TestNewDialog>
92 93
   </div>
93 94
 </template>
94 95
 <script setup lang="ts">
@@ -111,15 +112,19 @@ const { proxy } = getCurrentInstance() as any;
111 112
 const NumberHandle = proxy.$NumberHandle
112 113
 
113 114
 const emit = defineEmits<{
114
-  (event: "assignEvent", val: any): void; //赋值给父组件
115
+  (event: "assignEvent", val: any, resResult:any): void; //赋值给父组件
115 116
 }>();
116 117
 
117 118
 const props = withDefaults(defineProps<{
118 119
   haveCoverFlag:boolean,
120
+  video_tips:any,
121
+  image_tips:any,
119 122
   testNewType?:string,
120 123
 }>(), {
121 124
   haveCoverFlag:false,
122
-  testNewType:'video'
125
+  testNewType:'video',
126
+  video_tips:{},
127
+  image_tips:{},
123 128
 })
124 129
 
125 130
 interface radioFace{
@@ -164,36 +169,12 @@ const pageInfo = reactive<reactiveTableAndAny>({
164 169
     videoName:'',
165 170
     picName:'',
166 171
   }],
167
-  video_restriction: {
168
-    "width": 100,
169
-    "height": 100,
170
-    "min_width": 640,
171
-    "min_height": 360,
172
-    "ratio_width": 16,
173
-    "ratio_height": 9,
174
-    "file_size": 1024000,
175
-    "file_format": [
176
-      "MEDIA_TYPE_MP4",
177
-      "MEDIA_TYPE_MOV",
178
-      "MEDIA_TYPE_AVI"
179
-    ],
180
-    "min_duration": 5,
181
-    "max_duration": 300
182
-  },
183
-  image_restriction:{
184
-    "width": 80,
185
-    "height": 80,
186
-    "file_size": 20,
187
-    "file_format": [
188
-      "IMAGE_TYPE_JPG",
189
-      "IMAGE_TYPE_PNG"
190
-    ]
191
-  },
192 172
   updateKey:1,
193 173
   creativeTeamList_interim: [],//复制份
194 174
   keyUrl:'videoUrl',
195 175
   maxNum:0,//素材库最大可选个数
196 176
   CreativeTeamId:-1,//创意组ID
177
+  resResult:[],//video_id和image_id在里边
197 178
 })
198 179
 
199 180
 //删除创意组的视频或图片
@@ -293,9 +274,10 @@ const openLibraryDialog = (type:number,maxNum?:any,id?:any) => {
293 274
   })
294 275
 }
295 276
 //素材确认返回来的值
296
-const assignEvent_LibraryDialog = (val:any,mType:number) => {
277
+const assignEvent_LibraryDialog = (val:any,mType:number,resResult:any) => {
297 278
   pageInfo.keyUrl = mType==1?'videoUrl':'picUrl'
298 279
   pageInfo.creativeTeamList_interim = _.cloneDeep(val)
280
+  pageInfo.resResult = _.cloneDeep(resResult)
299 281
   pageInfo.updateKey++
300 282
 }
301 283
 
@@ -396,13 +378,21 @@ const confirmEvent = () => {
396 378
     ElMessage.error('请完善素材')
397 379
     return
398 380
   }
399
-  emit('assignEvent',arr)
381
+  emit('assignEvent',arr,pageInfo.resResult)
400 382
   dialogShow.value = false
401 383
 }
402 384
 
385
+//提供给主页面使用
386
+const clearAllEvent = async () => {
387
+  pageInfo.creativeTeamList = []
388
+  pageInfo.creativeTeamList_interim = []
389
+  emit('assignEvent',pageInfo.creativeTeamList,pageInfo.resResult)
390
+}
391
+
403 392
 // 父组件共享值
404 393
 defineExpose({
405
-  switchShow
394
+  switchShow,
395
+  clearAllEvent
406 396
 });
407 397
 
408 398
 </script>

+ 55 - 104
src/components/businessMoudle/batchGdt/configArea/creativeMaterial/libraryDialog.vue

@@ -3,6 +3,7 @@
3 3
       class="library_Dialog"
4 4
       :model-value="dialogShow"
5 5
       :key="updateKey"
6
+      :loading="loading"
6 7
       top="8px"
7 8
       append-to-body
8 9
       width="1200px"
@@ -18,47 +19,45 @@
18 19
         <div class="typeBorlineBox">
19 20
           <div class="item" v-for="item in typeList.list" :key="item.key" :class="item.key == typeAc ? 'itemAc' : ''" @click="switchTypeItem(item.key)">
20 21
             <div>{{item.name}}</div>
21
-            <!--          <div class="borLine"></div>-->
22 22
           </div>
23 23
         </div>
24 24
         <div class="c-theme lMarauto f13 pointer" @click="goMaterialLibrary">管理素材</div>
25 25
       </div>
26 26
     </template>
27
-    <div class="library_body" v-loading="loading">
27
+    <div class="library_body">
28 28
       <template v-if="typeAc == 'video'">
29 29
         <!--      搜索框-->
30 30
         <div class="flexWrap searchBox">
31
-          <Input ref="InputRef_text" title="素材名称" placeholderTxt="素材名称" class="bMar10" @changeEvent="()=>init()" @clearEvent="()=>init()"/>
32
-          <materialCatalog selectWidth="160px" ref="CataRef" title="素材目录" class="bMar10" @changeEvent="()=>init()" :clearableFlag="true"></materialCatalog>
31
+          <Input ref="InputRef_text" title="素材名称" placeholderTxt="素材名称" class="bMar10" @changeEvent="()=>sizeVisibleEvent(typeAc)" @clearEvent="()=>sizeVisibleEvent(typeAc)"/>
32
+          <materialCatalog selectWidth="160px" ref="CataRef" title="素材目录" class="bMar10" @changeEvent="()=>sizeVisibleEvent(typeAc)" :clearableFlag="true"></materialCatalog>
33 33
           <Select ref="sizeTypeRef"
34 34
                   :isMultiple="true"
35 35
                   :clearFlag="true"
36 36
                   :filterFlag="true"
37 37
                   title="尺寸"
38 38
                   selectWidth="160px" class="bMar10"
39
-                  @visibleEvent="(val)=>sizeVisibleEvent(val,typeAc)" @clearEvent="()=>init()"
39
+                  @changeEvent="()=>sizeVisibleEvent(typeAc)" @clearEvent="()=>sizeVisibleEvent(typeAc)"
40 40
                   :options="pageInfo.sizeTypeList"/>
41 41
           <Select ref="ideaManRef"
42 42
                   :clearFlag="true"
43 43
                   title="创意人"
44 44
                   selectWidth="160px" class="bMar10"
45 45
                   :optObj="{k:'id',la:'username',val:'id'}"
46
-                  @changeEvent="()=>init()" @clearEvent="()=>init()"
46
+                  @changeEvent="()=>sizeVisibleEvent(typeAc)" @clearEvent="()=>sizeVisibleEvent(typeAc)"
47 47
                   :options="pageInfo.createrList"/>
48 48
           <Select ref="designerRef"
49 49
                   :clearFlag="true"
50 50
                   title="设计师" class="bMar10"
51 51
                   selectWidth="160px"
52 52
                   :optObj="{k:'id',la:'username',val:'id'}"
53
-                  @changeEvent="()=>init()" @clearEvent="()=>init()"
53
+                  @changeEvent="()=>sizeVisibleEvent(typeAc)" @clearEvent="()=>sizeVisibleEvent(typeAc)"
54 54
                   :options="pageInfo.editorList"/>
55
-
56 55
           <tagBlock ref="tagRef" title="素材标签" selectWidth="240px" :haveNewTag="false" class="bMar10"
57
-                    @handleChange="val=>{pageInfo.tagChooseVal = val}" @hideChange="()=>init()"></tagBlock>
56
+                    @handleChange="val=>{pageInfo.tagChooseVal = val}" @hideChange="()=>sizeVisibleEvent(typeAc)"></tagBlock>
58 57
           <TimeScreen title="时间" selectWidth="260px" :haveQuick="false" :clearFlag="true" :valueIsKong="true"
59 58
                       ref="timeRef"
60 59
                       :shortcuts="pageInfo.shortList"
61
-                      @init="()=>init()"
60
+                      @init="()=>sizeVisibleEvent(typeAc)"
62 61
                       class="bMar10 lMar10"></TimeScreen>
63 62
           <span class="pointer c-theme lMar10 bMar10" @click="init()">刷新</span>
64 63
           <div class="flex bMar10 lMar10">
@@ -74,41 +73,41 @@
74 73
 
75 74
       <template v-if="typeAc == 'cover'">
76 75
         <div class="flexWrap searchBox">
77
-          <Input ref="InputRef_text" title="素材名称" placeholderTxt="素材名称" class="bMar10" @changeEvent="()=>init_collect_list()" @clearEvent="()=>init_collect_list()"/>
78
-          <materialCatalog selectWidth="160px" ref="CataRef" title="素材目录" class="bMar10" @changeEvent="()=>init_collect_list()" :clearableFlag="true"></materialCatalog>
76
+          <Input ref="InputRef_text" title="素材名称" placeholderTxt="素材名称" class="bMar10" @changeEvent="()=>sizeVisibleEvent(typeAc)" @clearEvent="()=>sizeVisibleEvent(typeAc)"/>
77
+          <materialCatalog selectWidth="160px" ref="CataRef" title="素材目录" class="bMar10" @changeEvent="()=>sizeVisibleEvent(typeAc)" :clearableFlag="true"></materialCatalog>
79 78
           <Select ref="sizeTypeRef"
80 79
                   :isMultiple="true"
81 80
                   :clearFlag="true"
82 81
                   :filterFlag="true"
83 82
                   title="尺寸"
84 83
                   selectWidth="160px" class="bMar10"
85
-                  @visibleEvent="(val)=>sizeVisibleEvent(val,typeAc)" @clearEvent="()=>init_collect_list()"
84
+                  @changeEvent="()=>sizeVisibleEvent(typeAc)" @clearEvent="()=>sizeVisibleEvent(typeAc)"
86 85
                   :options="pageInfo.sizeTypeList"/>
87 86
           <Select ref="ideaManRef"
88 87
                   :clearFlag="true"
89 88
                   title="创意人"
90 89
                   selectWidth="160px" class="bMar10"
91 90
                   :optObj="{k:'id',la:'username',val:'id'}"
92
-                  @changeEvent="()=>init_collect_list()" @clearEvent="()=>init_collect_list()"
91
+                  @changeEvent="()=>sizeVisibleEvent(typeAc)" @clearEvent="()=>sizeVisibleEvent(typeAc)"
93 92
                   :options="pageInfo.createrList"/>
94 93
           <Select ref="designerRef"
95 94
                   :clearFlag="true"
96 95
                   title="设计师" class="bMar10"
97 96
                   selectWidth="160px"
98 97
                   :optObj="{k:'id',la:'username',val:'id'}"
99
-                  @changeEvent="()=>init_collect_list()" @clearEvent="()=>init_collect_list()"
98
+                  @changeEvent="()=>sizeVisibleEvent(typeAc)" @clearEvent="()=>sizeVisibleEvent(typeAc)"
100 99
                   :options="pageInfo.editorList"/>
101 100
           <TimeScreen title="时间" selectWidth="260px" :haveQuick="false" :clearFlag="true" :valueIsKong="true"
102 101
                       ref="timeRef"
103 102
                       :shortcuts="pageInfo.shortList"
104
-                      @init="()=>init_collect_list()"
103
+                      @init="()=>sizeVisibleEvent(typeAc)"
105 104
                       class="bMar10 lMar10"></TimeScreen>
106 105
           <Select ref="collectRef"
107 106
                   title="收藏夹"
108 107
                   :clearFlag="false"
109 108
                   selectWidth="160px" class="bMar10"
110 109
                   :optObj="{k:'id',la:'name',val:'id'}"
111
-                  @changeEvent="()=>init_collect_list()" @clearEvent="()=>init_collect_list()"
110
+                  @changeEvent="()=>sizeVisibleEvent(typeAc)" @clearEvent="()=>sizeVisibleEvent(typeAc)"
112 111
                   :options="pageInfo.collectList"/>
113 112
           <span class="pointer c-theme lMar10 bMar10" @click="init_collect_list()">刷新</span>
114 113
         </div>
@@ -123,7 +122,7 @@
123 122
                        :checkShow="true"
124 123
                        :showCreateTimeFlag="true"
125 124
                        :showDetialFlag="false"
126
-                       @init="()=>init()"
125
+                       @init="()=>sizeVisibleEvent(typeAc)"
127 126
                        @checkChange="checkChangeItem"></materialBlock>
128 127
 
129 128
         <noData v-if="(pageInfo.materialList && pageInfo.materialList.length==0) || !pageInfo.materialList"></noData>
@@ -132,7 +131,9 @@
132 131
 <!--      分页区-->
133 132
       <div class="pageBox flex">
134 133
         <el-checkbox v-model="allChecked" @change="allChangeEvent">全选</el-checkbox>
135
-        <div class="c-666 lMar20 f12" v-if="typeAc == 'video'">使用原生页外顶部视频换内功能时,请筛选640*360,640*480,750*1334等尺寸素材</div>
134
+        <div class="c-666 lMar20 f12" v-if="typeAc == 'video'">使用原生页外顶部视频换内功能时,请筛选
135
+          <span v-for="(siz,sizIdx) in pageInfo.sizeTypeList"><i v-if="sizIdx>0">,</i>{{siz.value}}</span>
136
+          等尺寸素材</div>
136 137
         <el-pagination
137 138
             class="lMarauto"
138 139
             :small="true"
@@ -149,13 +150,18 @@
149 150
       <div class="dialog-footer">
150 151
         <div class="flex">
151 152
           <span>已选素材: {{pageInfo.chooseList_Item&&pageInfo.chooseList_Item.length || 0}} / {{ max_num ? max_num : (total || 0)}}</span>
152
-          <Tooltip notes="素材已根据媒体的要求进行过滤(广点通:支持视频格式:mp4、mov、avi,大小不超过100M)" colorCss="c-d3"/>
153
+          <Tooltip :contentSlotFalg="true" colorCss="c-d3">
154
+            <template #content>
155
+              素材已根据媒体的要求进行过滤(广点通:支持视频格式:
156
+              <span v-for="(vi,viIdx) in video_tips.file_format"><i v-if="viIdx>0">,</i>{{vi&&vi.split('_')[2] || '-'}}</span>,大小不超过{{video_tips.file_size||'-'}}M)
157
+            </template>
158
+          </Tooltip>
153 159
         </div>
154 160
 
155 161
         <div class="lMarauto flex">
156 162
           <Tooltip notes="复制创意组" colorCss="c-theme" :iconSlotFalg="true" :contentSlotFalg="true">
157 163
             <template v-slot:content>
158
-              <div>1、<b>素材可投放尺寸</b>:1440x2560;1080x1920;720x1280;<a href="https://thoughts.teambition.com/sharespace/5fc77c211dc1b5004618990a/docs/617b899f0a1306004198c393" target="_blank">详细尺寸>></a></div>
164
+              <div>1、<b>素材可投放尺寸</b>:<span v-for="(siz,sizIdx) in pageInfo.sizeTypeList"><i v-if="sizIdx>0">;</i>{{siz.value}}</span>;<a href="https://thoughts.teambition.com/sharespace/5fc77c211dc1b5004618990a/docs/617b899f0a1306004198c393" target="_blank">详细尺寸>></a></div>
159 165
               <div>2、<b>创量审核状态</b>:只有素材库素材通过审核才可以使用;</div>
160 166
             </template>
161 167
             <template v-slot:iconSlot>
@@ -164,8 +170,8 @@
164 170
               </div>
165 171
             </template>
166 172
           </Tooltip>
167
-          <el-button plain @click="cancelEVent" size="default" class="lMar10">取消</el-button>
168
-          <el-button type="primary" @click="submitEVent" size="default" class="lMar10">提交</el-button>
173
+          <el-button plain @click="cancelEvent" size="default" class="lMar10">取消</el-button>
174
+          <el-button type="primary" @click="submitEVent" size="default" class="lMar10"  v-loading.fullscreen.lock="fullLoading">提交</el-button>
169 175
         </div>
170 176
       </div>
171 177
     </template>
@@ -181,16 +187,17 @@ import materialCatalog from '@/components/businessMoudle/materialLibrary/materia
181 187
 import tagBlock from '@/components/businessMoudle/materialLibrary/block/tagBlock.vue'
182 188
 import noData from '@/components/capsulationMoudle/noData.vue'
183 189
 import materialBlock from '@/components/businessMoudle/materialLibrary/block/materialBlock.vue'
184
-import {searchBoxTs} from '@/components/businessMoudle/batchGdt/configArea/creativeMaterial/ts/searchBox'
190
+import {materialTs} from '@/components/businessMoudle/batchGdt/configArea/creativeMaterial/ts/materialTs'
191
+import {uploadAddGetResTs} from '@/components/businessMoudle/batchGdt/configArea/creativeMaterial/ts/uploadAddGetRes'
185 192
 import {publicSwitchType} from "@/components/businessMoudle/switchType";
186 193
 import { useRouter } from "vue-router";
187 194
 import {ElMessage} from "element-plus";
188 195
 import _ from "lodash";
189
-import {creative} from "@/api/ApiModel";
196
+import {creative, reactiveTableAndAny} from "@/api/ApiModel";
190 197
 import {Api} from "@/api/api";
191 198
 
192 199
 const emit = defineEmits<{
193
-  (event: "assignEvent", val:any,mType:number): void;
200
+  (event: "assignEvent", val:any,mType:number,resResult:any): void;
194 201
 }>();
195 202
 
196 203
 const props = withDefaults(defineProps<{
@@ -235,13 +242,15 @@ const typeListParams = reactive([
235 242
   {name:'收藏夹',key:'cover'},
236 243
 ])
237 244
 const switchTypeItem = async (key:string) => {
245
+  loading.value = true
238 246
   typeAc.value = key
247
+  pageInfo.chooseList_Item = []
239 248
   if(key == 'cover'){
240
-    init_collect_all(m_type_switchShow.value)
249
+    await init_collect_all(m_type_switchShow.value)
241 250
   }else{
242
-    initAll(m_type_switchShow.value)
251
+    await initAll(m_type_switchShow.value)
243 252
   }
244
-
253
+  loading.value = false
245 254
 }
246 255
 const {
247 256
   typeAc,
@@ -259,7 +268,6 @@ const goMaterialLibrary = () => {
259 268
 }
260 269
 
261 270
 // 切换显隐
262
-const dialogShow = ref<boolean>(false)
263 271
 const updateKey = ref<number>(1)
264 272
 const max_num = ref<number>(0) // 允许上传的最大数字 - 用于区分是否可多选
265 273
 const m_type_switchShow = ref<number>(1) // 视频:1还是图片:2
@@ -267,6 +275,8 @@ const switchShow = async (val:boolean,mtype:number,maxNum?:number)=>{
267 275
   //val:弹框显true/隐false ,mtype:视频:1还是图片:2,maxNum:可选的最大值 0=>走素材的总个数,否则传几显示几
268 276
   dialogShow.value = val
269 277
   if(val){
278
+    requestObj.upload_flag = false
279
+    clearTimeout(requestObj.timer_get_upload_res)
270 280
     updateKey.value++
271 281
     max_num.value = maxNum ? maxNum : 0
272 282
     m_type_switchShow.value = mtype
@@ -278,6 +288,7 @@ const switchShow = async (val:boolean,mtype:number,maxNum?:number)=>{
278 288
       obj.min_duration = video_tips.min_duration
279 289
       obj.max_duration = video_tips.max_duration
280 290
       obj.file_types = video_tips.file_format
291
+      pageInfo.ratio_size = video_tips.ratio_width + ':' + video_tips.ratio_height
281 292
     }else if(mtype == 2){ //封面
282 293
       obj.max_size = image_tips.file_size
283 294
       obj.file_types = image_tips.file_format
@@ -293,84 +304,29 @@ const switchShow = async (val:boolean,mtype:number,maxNum?:number)=>{
293 304
 
294 305
 //提交
295 306
 const submitEVent = async () => {
307
+  requestObj.upload_flag = false
308
+  clearTimeout(requestObj.timer_get_upload_res)
296 309
   let arr:any = pageInfo.chooseList_Item
297 310
   if(arr&&arr.length==0){
298 311
     ElMessage.error('请选择素材后再提交!')
299 312
     return
300 313
   }
301
-  await get_up_record_id(arr)
302
-  get_upload_res()
303
-  return
304
-
305
-
306
-  emit('assignEvent',arr,m_type.value)
307
-  dialogShow.value = false
308
-}
309
-//得到上边传来的值
310
-const inject_accountIds = inject('accountIds')
311
-const up_record_id = ref<null|string|number>()
312
-//得到up_record_id
313
-const get_up_record_id = async (targetArr:any) => {
314
-  let arr:any = _.cloneDeep(inject_accountIds)
315
-  let aIds:any = []
316
-  arr._object[arr._key].forEach(a=>{
317
-    aIds.push(a.id)
314
+  fullLoading.value = true
315
+  let ids:any = []
316
+  arr.forEach(a=>{
317
+    ids.push(a.id)
318 318
   })
319
-  if(aIds&&aIds.length==0){
320
-    ElMessage.error('account_ids错误')
321
-    return
322
-  }
323
-  if(targetArr&&targetArr.length==0){
324
-    ElMessage.error('暂无符合条件的素材')
325
-    return
326
-  }
327
-  const paramsModel = reactive<creative>({
328
-    account_ids: aIds,
329
-    target_ids:targetArr,
330
-    type:'material',
331
-    is_generate_cover:props.is_generate_cover == 'On' ? 1 : 0,
332
-  })
333
-  let res:any = await proxy.$http.post(Api.creative_upload,paramsModel)
334
-  if(res&&res.errNo=='0'){
335
-    let resNew:any = res.rst
336
-    if(resNew){
337
-      up_record_id.value = resNew.up_record_id
338
-    }
339
-  }else{
340
-    ElMessage.error(res.errMsg)
341
-  }
319
+  await get_up_record_id(ids)
320
+  await get_upload_res()
342 321
 }
343
-//轮询 - 得到上传结果
344
-const get_upload_res = async () => {
345
-  if(!up_record_id.value){
346
-    return
347
-  }
348
-  const paramsModel = reactive<{up_record_id:null|string|number}>({
349
-    up_record_id: up_record_id.value,
350
-  })
351
-  let res:any = await proxy.$http.get(Api.creative_upload_getRes,paramsModel)
352
-  if(res&&res.errNo=='0'){
353
-    let resNew:any = res.rst
354
-    if(resNew){
355
-      if(!resNew.result){
356
-        pageInfo.requestNum++
357
-        if(pageInfo.requestNum < 30){
358
-          setTimeout(()=>{
359
-            get_upload_res()
360
-          },3000)
361
-        }
362
-      }
363
-    }
364
-  }else{
365
-    ElMessage.error(res.errMsg)
366
-  }
322
+//上传素材成功后 走的代码
323
+const successEvent = (resResult:any) => {
324
+  emit('assignEvent',pageInfo.chooseList_Item,m_type.value,resResult)
367 325
 }
368 326
 
327
+const {get_up_record_id,get_upload_res,requestObj,cancelEvent,dialogShow,fullLoading} =
328
+    uploadAddGetResTs(props.is_generate_cover == 'On' ? 1 : 0,successEvent)
369 329
 
370
-//取消
371
-const cancelEVent = () => {
372
-  dialogShow.value = false
373
-}
374 330
 
375 331
 
376 332
 //是否可投放
@@ -418,7 +374,6 @@ const checkChangeItem = (flag: any,obj:any) => {
418 374
 }
419 375
 
420 376
 
421
-
422 377
 // 父组件共享值
423 378
 defineExpose({
424 379
   switchShow
@@ -451,12 +406,8 @@ const {
451 406
   initAll,
452 407
   sizeVisibleEvent,
453 408
   init_collect_list
454
-} = searchBoxTs(1)
409
+} = materialTs(1)
455 410
 
456
-onMounted(()=>{
457
-  nextTick(()=>{
458
-  })
459
-})
460 411
 </script>
461 412
 <style lang="scss">
462 413
 .library_Dialog{

+ 38 - 89
src/components/businessMoudle/batchGdt/configArea/creativeMaterial/testNew.vue

@@ -2,12 +2,13 @@
2 2
   <Dialog
3 3
       :dialogVisible="dialogShow"
4 4
       @confirm="confirmEvent"
5
-      @close="dialogShow = false"
5
+      :fullLoading="fullLoading"
6
+      @close="cancelEvent"
6 7
       :closeOnModal="false"
7 8
       width="700px"
8 9
       height="400px"
9 10
       dialog-title="一键测新">
10
-    <template v-slot:content v-loading="loading">
11
+    <template v-slot:content>
11 12
       <RadioGroup :id="pageInfo.radioId"
12 13
                   :radioList="cateRadioList.list"
13 14
                   :title="cateRadioList.name">
@@ -54,9 +55,11 @@ import {ElMessage} from "element-plus";
54 55
 import _ from "lodash";
55 56
 import {creative, directPacket, materialManage, reactiveTableAndAny} from "@/api/ApiModel";
56 57
 import {Api} from "@/api/api";
58
+import {uploadAddGetResTs} from '@/components/businessMoudle/batchGdt/configArea/creativeMaterial/ts/uploadAddGetRes'
59
+
57 60
 
58 61
 const emit = defineEmits<{
59
-  (event: "assignEvent", val: any): void; //赋值给父组件
62
+  (event: "assignEvent", val:any,mType:number,resResult:any): void;
60 63
 }>();
61 64
 
62 65
 const props = withDefaults(defineProps<{
@@ -73,7 +76,7 @@ const inject_accountIds = inject('accountIds')
73 76
 
74 77
 const pageInfo = reactive<reactiveTableAndAny>({
75 78
   radioId:1,
76
-  materialList_id:[],
79
+  materialList:[],
77 80
   up_record_id:-1,
78 81
   requestNum:0,
79 82
 })
@@ -123,18 +126,16 @@ const cateRadioList = reactive<radioFace>({
123 126
 
124 127
 
125 128
 // 切换显隐
126
-const dialogShow = ref<boolean>(false)
127 129
 const switchShow = (val:boolean)=>{
128 130
   dialogShow.value = val
129 131
   if(val){
130 132
     nextTick(()=>{
133
+      clearTimeout(requestObj.timer_get_upload_res)
131 134
       CataRef.value!.initAllAlbum()
132 135
     })
133 136
   }
134 137
 }
135 138
 
136
-
137
-const loading = ref<boolean>(false)
138 139
 const canPutOnObj = reactive<reactiveTableAndAny>({
139 140
   is_legal:1,
140 141
   file_types:[],
@@ -142,26 +143,9 @@ const canPutOnObj = reactive<reactiveTableAndAny>({
142 143
   max_size:0,
143 144
   min_duration:0,
144 145
   max_duration:0,
146
+  un_select_today:0,
145 147
 })
146 148
 
147
-//确定
148
-const confirmEvent = async () => {
149
-  //先从接口Api.materialManage_list中中找到numRadioList.value个素材的id
150
-  //将这些素材id走API.creative_upload接口得到up_record_id
151
-  //将up_record_id轮询API.creative_upload_getRes接口得到是否上传完成
152
-  //上传完成 - 将完成的列表push进index.vue的pageInfo.creativeTeamList
153
-  loading.value = true
154
-  await getmaterialList()
155
-  await get_up_record_id()
156
-  //写到准备轮询API.creative_upload_getRes
157
-  get_upload_res()
158
-  if(pageInfo.requestNum >= 30){
159
-    loading.value = false
160
-  }
161
-  return
162
-  emit('assignEvent','')
163
-  dialogShow.value = false
164
-}
165 149
 
166 150
 //处理投放的参数
167 151
 const handle_canPutOnObj = () => {
@@ -176,8 +160,9 @@ const handle_canPutOnObj = () => {
176 160
     obj.max_size = image_tips.file_size
177 161
     obj.file_types = image_tips.file_format
178 162
   }
163
+  obj.un_select_today = numRadioList.subChecked ? 1 : 0
179 164
 }
180
-//找到numRadioList.value个素材的id
165
+//找到numRadioList.value个素材的
181 166
 const getmaterialList = async () => {
182 167
   await handle_canPutOnObj()
183 168
   const paramsModel = reactive<materialManage>({
@@ -186,83 +171,47 @@ const getmaterialList = async () => {
186 171
     page:1,
187 172
     pageSize:numRadioList.value,
188 173
   })
189
-  let res:any = await proxy.$http.get(Api.materialManage_list,Object.assign(paramsModel,canPutOnObj))
190
-  if(res&&res.errNo=='0'){
191
-    let resNew:any = res.rst
192
-    if(resNew.data){
193
-      pageInfo.materialList_id = []
194
-      resNew.data.forEach(item=>{
195
-        pageInfo.materialList_id.push(item.id)
196
-      })
197
-    }
198
-  }else{
199
-    ElMessage.error(res.errMsg)
200
-  }
201
-}
202
-//得到up_record_id
203
-const get_up_record_id = async () => {
204
-  let arr:any = _.cloneDeep(inject_accountIds)
205
-  let aIds:any = []
206
-  arr._object[arr._key].forEach(a=>{
207
-    aIds.push(a.id)
208
-  })
209
-  if(aIds&&aIds.length==0){
210
-    ElMessage.error('account_ids错误')
174
+  if(!CataRef.value!.idVal){
175
+    ElMessage.error('请选择目录')
211 176
     return
212 177
   }
213
-  if(pageInfo.materialList_id&&pageInfo.materialList_id.length==0){
214
-    ElMessage.error('暂无符合条件的素材')
215
-    return
216
-  }
217
-  const paramsModel = reactive<creative>({
218
-    account_ids: aIds,
219
-    target_ids:pageInfo.materialList_id,
220
-    type:'material',
221
-    is_generate_cover:props.propInfo.is_generate_cover == 'On' ? 1 : 0,
222
-  })
223
-  let res:any = await proxy.$http.post(Api.creative_upload,paramsModel)
178
+  let res:any = await proxy.$http.get(Api.materialManage_list,Object.assign(paramsModel,canPutOnObj))
224 179
   if(res&&res.errNo=='0'){
225 180
     let resNew:any = res.rst
226
-    if(resNew){
227
-      pageInfo.up_record_id = resNew.up_record_id
181
+    if(resNew.data){
182
+      pageInfo.materialList = resNew.data
228 183
     }
229 184
   }else{
230 185
     ElMessage.error(res.errMsg)
231 186
   }
232 187
 }
233
-//轮询 - 得到上传结果
234
-const get_upload_res = async () => {
235
-  if(!pageInfo.up_record_id){
236
-    return
237
-  }
238
-  const paramsModel = reactive<creative>({
239
-    up_record_id: pageInfo.up_record_id,
188
+
189
+
190
+//确定
191
+const confirmEvent = async () => {
192
+  //先从接口Api.materialManage_list中中找到numRadioList.value个素材的id
193
+  //将这些素材id走API.creative_upload接口得到up_record_id
194
+  //将up_record_id轮询API.creative_upload_getRes接口得到是否上传完成
195
+  //上传完成 - 将完成的列表push进index.vue的pageInfo.creativeTeamList
196
+  clearTimeout(requestObj.timer_get_upload_res)
197
+  await getmaterialList()
198
+  fullLoading.value = true
199
+  let ids:any = []
200
+  pageInfo.materialList.forEach(item=>{
201
+    ids.push(item.id)
240 202
   })
241
-  let res:any = await proxy.$http.get(Api.creative_upload_getRes,paramsModel)
242
-  if(res&&res.errNo=='0'){
243
-    let resNew:any = res.rst
244
-    if(resNew){
245
-      if(!resNew.result){
246
-        pageInfo.requestNum++
247
-        if(pageInfo.requestNum < 30){
248
-          setTimeout(()=>{
249
-            get_upload_res()
250
-          },3000)
251
-        }
252
-      }
253
-    }
254
-  }else{
255
-    ElMessage.error(res.errMsg)
256
-  }
203
+  await get_up_record_id(ids)
204
+  await get_upload_res()
257 205
 }
258 206
 
207
+//上传成功后走的代码
208
+const successEvent = (resResult:any) => {
209
+  emit('assignEvent',pageInfo.materialList,props.propInfo.testNewType == 'video' ? 1 : 2,resResult)
210
+}
211
+const {get_up_record_id,get_upload_res,requestObj,cancelEvent,dialogShow,fullLoading} =
212
+    uploadAddGetResTs(props.is_generate_cover == 'On' ? 1 : 0,successEvent)
259 213
 
260 214
 
261
-onMounted(()=>{
262
-  nextTick(()=>{
263
-
264
-  })
265
-})
266 215
 // 父组件共享值
267 216
 defineExpose({
268 217
   switchShow

+ 22 - 12
src/components/businessMoudle/batchGdt/configArea/creativeMaterial/ts/searchBox.ts

@@ -2,10 +2,11 @@ import {getCurrentInstance, nextTick, reactive, ref} from "vue";
2 2
 import {fileParam, materialManage, reactiveTableAndAny} from "@/api/ApiModel";
3 3
 import {Api} from "@/api/api";
4 4
 import {ElMessage} from "element-plus";
5
+import {rest} from "lodash";
5 6
 
6 7
 
7 8
 
8
-export function searchBoxTs(mType?:number){
9
+export function materialTs(mType?:number){
9 10
     const { proxy } = getCurrentInstance() as any;
10 11
     // 全局方法定义
11 12
     const NumberHandle = proxy.$NumberHandle
@@ -87,7 +88,8 @@ export function searchBoxTs(mType?:number){
87 88
         ],
88 89
         tasksList:[],
89 90
         chooseList_Item:[],//选中素材的整个obj
90
-        collectList:[]
91
+        collectList:[],
92
+        ratio_size:''
91 93
     })
92 94
 
93 95
     //收藏夹列表
@@ -124,7 +126,13 @@ export function searchBoxTs(mType?:number){
124 126
 
125 127
     //获取尺寸列表
126 128
     const getSizeList = async () => {
127
-        let res:any = await proxy.$http.get(Api.sizeTypeList)
129
+        const paramsModel = reactive<{ratio?:string}>({
130
+            ratio:''
131
+        })
132
+        if(mType){ //弹框
133
+            paramsModel.ratio = pageInfo.ratio_size
134
+        }
135
+        let res:any = await proxy.$http.get(Api.sizeTypeList,paramsModel)
128 136
         if(res&&res.errNo=='0'){
129 137
             let resNew:any = res.rst
130 138
             pageInfo.sizeTypeList = []
@@ -134,6 +142,9 @@ export function searchBoxTs(mType?:number){
134 142
                     value:item
135 143
                 })
136 144
             })
145
+            if(mType){
146
+                sizeTypeRef.value!.value = resNew
147
+            }
137 148
         }else{
138 149
             ElMessage.error(res.errMsg)
139 150
         }
@@ -188,22 +199,21 @@ export function searchBoxTs(mType?:number){
188 199
         }
189 200
     }
190 201
 
191
-    const sizeVisibleEvent = (val:any,type:string) => {
192
-      if(val == false){
193
-          if(type=='cover'){
194
-              init_collect_list()
195
-          }else{
196
-              init()
197
-          }
198
-      }
202
+    const sizeVisibleEvent = async (type:string) => {
203
+        pageInfo.materialList = []
204
+        if(type=='cover'){
205
+            await init_collect_list()
206
+        }else{
207
+            await init()
208
+        }
199 209
     }
200 210
 
201 211
     const initAll = (mType?:number) => {
202 212
         nextTick(async ()=>{
203 213
             // mType : 创意素材弹框 - 1:video  /  2:cover
204 214
             m_type.value = mType || ''
215
+            await getSizeList()
205 216
             init()
206
-            getSizeList()
207 217
             init_createrList()
208 218
             CataRef.value!.initAllAlbum()
209 219
             tagRef.value!.init()

+ 101 - 4
src/components/businessMoudle/batchGdt/configArea/creativeMaterial/ts/uploadAddGetRes.ts

@@ -1,14 +1,111 @@
1
-import {getCurrentInstance, nextTick, reactive, ref} from "vue";
2
-import {fileParam, materialManage, reactiveTableAndAny} from "@/api/ApiModel";
1
+import {getCurrentInstance, inject, reactive, ref} from "vue";
2
+import {creative,reactiveTableAndAny} from "@/api/ApiModel";
3 3
 import {Api} from "@/api/api";
4 4
 import {ElMessage} from "element-plus";
5
+import _ from "lodash";
5 6
 
6 7
 
7 8
 
8
-export function uploadAddGetResTs(){
9
+export function uploadAddGetResTs(generateCoverParams?:number,successEvent?:any){
10
+    const { proxy } = getCurrentInstance() as any;
11
+// 全局方法定义
12
+    const NumberHandle = proxy.$NumberHandle
9 13
 
14
+//得到上边传来的值
15
+    const inject_accountIds = inject('accountIds')
16
+    const up_record_id = ref<null|string|number>()
10 17
 
11
-    return{
18
+    const fullLoading = ref<boolean>(false)
19
+//得到up_record_id
20
+    const get_up_record_id = async (targetArr:any) => {
21
+        let arr:any = _.cloneDeep(inject_accountIds)
22
+        let aIds:any = []
23
+        arr._object[arr._key].forEach(a=>{
24
+            aIds.push(a.id)
25
+        })
26
+        if(aIds&&aIds.length==0){
27
+            fullLoading.value = false
28
+            ElMessage.error('account_ids错误')
29
+            return
30
+        }
31
+        if(targetArr&&targetArr.length==0){
32
+            fullLoading.value = false
33
+            ElMessage.error('暂无符合条件的素材')
34
+            return
35
+        }
36
+        const paramsModel = reactive<creative>({
37
+            account_ids: aIds,
38
+            target_ids:targetArr,
39
+            type:'material',
40
+            is_generate_cover:generateCoverParams,
41
+        })
42
+        let res:any = await proxy.$http.post(Api.creative_upload,paramsModel)
43
+        if(res&&res.errNo=='0'){
44
+            let resNew:any = res.rst
45
+            if(resNew){
46
+                up_record_id.value = resNew.up_record_id
47
+            }
48
+        }else{
49
+            ElMessage.error(res.errMsg)
50
+            fullLoading.value = false
51
+        }
52
+    }
53
+
54
+    const requestObj = reactive<reactiveTableAndAny>({
55
+        requestNum:1,
56
+        timer_get_upload_res:null,
57
+        upload_flag:false
58
+    })
59
+
60
+    //轮询 - 得到上传结果
61
+    const get_upload_res = async () => {
62
+        if(!up_record_id.value){
63
+            fullLoading.value = false
64
+            return
65
+        }
66
+        const paramsModel = reactive<{up_record_id:null|string|number}>({
67
+            up_record_id: up_record_id.value,
68
+        })
69
+        let res:any = await proxy.$http.get(Api.creative_upload_getRes,paramsModel)
70
+        if(res&&res.errNo=='0'){
71
+            let resNew:any = res.rst
72
+            if(resNew){
73
+                if(!resNew.result){
74
+                    requestObj.upload_flag = true
75
+                    requestObj.requestNum++
76
+                    if(requestObj.requestNum <= 100){
77
+                        requestObj.timer_get_upload_res = setTimeout(()=>{
78
+                            get_upload_res()
79
+                        },3000)
80
+                    }
81
+                }else{ //成功获取到数据
82
+                    requestObj.upload_flag = false
83
+                    fullLoading.value = false
84
+                    successEvent(resNew.result)
85
+                    dialogShow.value = false
86
+                }
87
+            }
88
+        }else{
89
+            fullLoading.value = false
90
+            ElMessage.error(res.errMsg)
91
+        }
92
+    }
12 93
 
94
+    const dialogShow = ref<boolean>(false)
95
+    //取消
96
+    const cancelEvent = () => {
97
+        dialogShow.value = false
98
+        clearTimeout(requestObj.timer_get_upload_res)
99
+        requestObj.upload_flag = false
100
+    }
101
+
102
+
103
+    return{
104
+        get_up_record_id,
105
+        get_upload_res,
106
+        requestObj,
107
+        cancelEvent,
108
+        dialogShow,
109
+        fullLoading,
13 110
     }
14 111
 }

+ 35 - 9
src/components/businessMoudle/batchGdt/configArea/directPacket/common/Cascader/index.ts

@@ -1,4 +1,4 @@
1
-import {computed, getCurrentInstance, reactive, ref} from "vue";
1
+import {computed, getCurrentInstance, nextTick, reactive, ref, watch} from "vue";
2 2
 import SubList from '@/components/businessMoudle/batchGdt/configArea/directPacket/common/Cascader/subList.vue'
3 3
 import {reactiveTableAndAny} from "@/api/ApiModel";
4 4
 import _ from "lodash";
@@ -8,13 +8,36 @@ export function cascaderTs(propsParams:any){
8 8
     const { proxy } = getCurrentInstance() as any;
9 9
 // 全局方法定义
10 10
     const NumberHandle = proxy.$NumberHandle
11
-
12
-
13 11
 //列表
14 12
     const opionsList = computed(()=>{
15 13
         return propsParams.list
16 14
     })
17 15
 
16
+//回显值
17
+    const echo_user_os_Event = () => {
18
+        console.log(1);
19
+        const {echoVal} = propsParams
20
+        if(echoVal&&echoVal.length>0){
21
+            echoVal.forEach(a=>{
22
+                opionsList.value.forEach(item=>{
23
+                    if(item.id == a){
24
+                        item.isCheck = true
25
+                    }else{
26
+                        set_check(item.child,true)
27
+                    }
28
+                })
29
+            })
30
+        }
31
+    }
32
+
33
+
34
+
35
+    watch(()=>propsParams.updateKey,()=>{
36
+        echo_user_os_Event()
37
+    },{immediate:true,deep:true})
38
+
39
+
40
+
18 41
     const acIdx = ref<number>(-1)
19 42
 
20 43
     //全选
@@ -38,12 +61,14 @@ export function cascaderTs(propsParams:any){
38 61
 
39 62
     //设置下级是否全选或全不选
40 63
     const set_check = (arr:any,val:boolean) => {
41
-        arr.forEach(item=>{
42
-            item.isCheck = val
43
-            if(item.child&&item.child.length>0){
44
-                set_check(item.child,val)
45
-            }
46
-        })
64
+        if(arr&&arr.length>0){
65
+            arr.forEach(item=>{
66
+                item.isCheck = val
67
+                if(item.child&&item.child.length>0){
68
+                    set_check(item.child,val)
69
+                }
70
+            })
71
+        }
47 72
     }
48 73
 
49 74
 //全选
@@ -94,6 +119,7 @@ export function cascaderTs(propsParams:any){
94 119
         opionsList,
95 120
         allEvent,
96 121
         updateKey,
122
+        set_check,
97 123
         ItemClickShowSubEvent,
98 124
         ItemClickEvent,
99 125
         setParentItemCheckEvent,

+ 33 - 12
src/components/businessMoudle/batchGdt/configArea/directPacket/common/Cascader/index.vue

@@ -1,6 +1,6 @@
1 1
 <template>
2
+  {{echoVal}}
2 3
   <div class="flexWrap" style="align-items: flex-start">
3
-    {{testList.list}}
4 4
     <div class="panel" >
5 5
       <div class="title">{{title||'-'}}</div>
6 6
       <div class="content">
@@ -8,7 +8,7 @@
8 8
           <el-checkbox v-model="isAllCheck" size="default" @change="val=>allEvent(val)">全选</el-checkbox>
9 9
         </div>
10 10
         <div class="cItem" v-for="(item,itemIdx) in opionsList" :class="itemIdx == acIdx ? 'active' : ''" @click.stop="ItemClickShowSubEvent(itemIdx,item)">
11
-          <el-checkbox v-model="item.isCheck" size="default" @change="val=>ItemClickEvent(itemIdx,item)">{{item.name}}</el-checkbox>
11
+          <el-checkbox v-model="item.isCheck" size="default" @change="val=>ItemClickEvent(itemIdx,item)">{{item.name}}-{{item.id}}</el-checkbox>
12 12
           <el-icon class="lMarauto" color="#606266" :size="14" v-if="item.child&&item.child.length>0"><i-ep-ArrowRight/></el-icon>
13 13
         </div>
14 14
       </div>
@@ -21,12 +21,12 @@
21 21
     </template>
22 22
 
23 23
 
24
-    <div class="panel">
24
+    <div class="panel" v-if="chooseNum>0">
25 25
       <div class="title c-000 f12">已选<span>({{chooseNum}})</span></div>
26 26
       <div class="content">
27 27
         <template v-for="(item,idx) in opionsList">
28
-          <div class="cItem active tMar8"  v-if="item.isCheck">
29
-            {{item.name}}-{{item.id}}}
28
+          <div class="cItem active tMar8 f13"  v-if="item.isCheck">
29
+            {{item.name}}-{{item.id}}
30 30
             <el-icon class="lMarauto" color="#606266" :size="14" @click="deleEvent(item)"><i-ep-Close/></el-icon>
31 31
           </div>
32 32
           <template v-else>
@@ -45,41 +45,58 @@
45 45
 import SubChooseItem from '@/components/businessMoudle/batchGdt/configArea/directPacket/common/Cascader/subChooseItem.vue'
46 46
 import {cascaderTs} from "@/components/businessMoudle/batchGdt/configArea/directPacket/common/Cascader/index";
47 47
 import {subChooseTs} from "@/components/businessMoudle/batchGdt/configArea/directPacket/common/Cascader/subChoose";
48
-import {computed, defineProps, withDefaults, watch, reactive} from "vue";
48
+import {computed, defineProps, withDefaults, watch, reactive, nextTick} from "vue";
49
+import {reactiveTableAndAny} from "@/api/ApiModel";
50
+import _ from "lodash";
49 51
 
52
+const emit = defineEmits<{
53
+  (event: "getIds",val:any): void;
54
+}>();
50 55
 
51 56
 const props = withDefaults(defineProps<{
52 57
   title?: string,
53 58
   list?:any,
54 59
   subId?:string|number,
60
+  updateKey?:number,
61
+  echoVal?:any
55 62
 }>(), {
56 63
   title: '',
57 64
   list:[],
58
-  subId:''
65
+  subId:'',
66
+  updateKey:1,
67
+  echoVal:[]
59 68
 })
60 69
 
70
+const chooseObj = reactive<reactiveTableAndAny>({
71
+  ids:[]
72
+})
61 73
 
62 74
 //已选的个数
63 75
 const chooseNum = computed(()=>{
64 76
   let num:number = 0
77
+  chooseObj.ids = []
65 78
   opionsList.value.forEach(item=>{
66 79
     if(item.isCheck){
67 80
       num+=1
81
+      chooseObj.ids.push(item.id)
68 82
     }else{
69 83
       if(item.child&&item.child.length>0){
70 84
         item.child.forEach(sub=>{
71 85
           if(sub.isCheck){
72 86
             num+=1
87
+            chooseObj.ids.push(sub.id)
73 88
           }else{
74 89
             if(sub.child&&sub.child.length>0){
75 90
               sub.child.forEach(sun=>{
76 91
                 if(sun.isCheck){
77 92
                   num+=1
93
+                  chooseObj.ids.push(sun.id)
78 94
                 }else{
79 95
                   if(sun.child&&sun.child.length>0){
80 96
                     sun.child.forEach(cSun=>{
81 97
                       if(cSun.isCheck){
82 98
                         num+=1
99
+                        chooseObj.ids.push(cSun.id)
83 100
                       }
84 101
                     })
85 102
                   }
@@ -91,6 +108,7 @@ const chooseNum = computed(()=>{
91 108
       }
92 109
     }
93 110
   })
111
+  emit('getIds',chooseObj.ids)
94 112
   return num
95 113
 })
96 114
 
@@ -110,8 +128,6 @@ const subChooseNum = (arr:any,numProp:number) => {
110 128
 }
111 129
 
112 130
 
113
-
114
-
115 131
 const {
116 132
   acIdx,
117 133
   isAllCheck,
@@ -121,7 +137,8 @@ const {
121 137
   updateKey,
122 138
   ItemClickShowSubEvent,
123 139
   ItemClickEvent,
124
-  setParentItemCheckEvent
140
+  setParentItemCheckEvent,
141
+  set_check
125 142
 }  = cascaderTs(props)
126 143
 
127 144
 
@@ -143,6 +160,8 @@ const {deleEvent} = subChooseTs()
143 160
 //   }
144 161
 // }
145 162
 
163
+
164
+
146 165
 </script>
147 166
 <style lang="scss" scoped>
148 167
 .panel{
@@ -169,8 +188,10 @@ const {deleEvent} = subChooseTs()
169 188
       align-items: center;
170 189
       cursor: pointer;
171 190
       padding: 0 12px;
172
-      height: 32px;
173
-      line-height: 32px;
191
+      height: 30px;
192
+      :deep(.el-checkbox__label){
193
+        font-size: 13px;
194
+      }
174 195
       &:hover{
175 196
         background-color: #f8f8f8;
176 197
       }

+ 2 - 3
src/components/businessMoudle/batchGdt/configArea/directPacket/common/Cascader/subChooseItem.vue

@@ -1,5 +1,5 @@
1 1
 <template>
2
-  <div class="cItem active tMar8"  v-if="ITEM.isCheck">
2
+  <div class="cItem active tMar8 f13"  v-if="ITEM.isCheck">
3 3
     {{ITEM.name}}-{{ITEM.id}}
4 4
     <el-icon class="lMarauto" color="#606266" :size="14" @click="deleEvent(ITEM)"><i-ep-Close/></el-icon>
5 5
   </div>
@@ -48,8 +48,7 @@ const {deleEvent} = subChooseTs()
48 48
       align-items: center;
49 49
       cursor: pointer;
50 50
       padding: 0 12px;
51
-      height: 32px;
52
-      line-height: 32px;
51
+      height: 30px;
53 52
       &:hover{
54 53
         background-color: #f8f8f8;
55 54
       }

+ 5 - 2
src/components/businessMoudle/batchGdt/configArea/directPacket/common/Cascader/subList.vue

@@ -91,8 +91,11 @@ watch(()=>isAllCheck.value,(val)=>{
91 91
       align-items: center;
92 92
       cursor: pointer;
93 93
       padding: 0 12px;
94
-      height: 32px;
95
-      line-height: 32px;
94
+      height: 30px;
95
+      line-height: 30px;
96
+      :deep(.el-checkbox__label){
97
+        font-size: 13px;
98
+      }
96 99
       &:hover{
97 100
         background-color: #f8f8f8;
98 101
       }

+ 3 - 3
src/components/businessMoudle/batchGdt/configArea/directPacket/common/checkGroup.vue

@@ -32,11 +32,11 @@
32 32
 import { reactive, watch} from "vue";
33 33
 import {reactiveTableAndAny} from "@/api/ApiModel";
34 34
 import _ from "lodash";
35
-interface Emits {
35
+
36
+const emit = defineEmits<{
36 37
   (event: "changeEvent"): void;
37 38
   (event: "returnEvent", val: any): void;
38
-}
39
-const emit = defineEmits<Emits>();
39
+}>();
40 40
 
41 41
 
42 42
 const pageInfo = reactive<reactiveTableAndAny>({

+ 30 - 10
src/components/businessMoudle/batchGdt/configArea/directPacket/newDirecPacket.vue

@@ -10,10 +10,9 @@
10 10
       :dialog-title="(propsInfo.id ? '编辑' : '新建') + '定向包'">
11 11
     <template v-slot:content>
12 12
       <div class="dialogBox affix-container" v-loading="loading">
13
-        <Cascade :list="pageInfo.location_ca_list"></Cascade>
14
-<!--        <div style="height: 200px"></div>-->
15 13
         <Input class="bMar20" ref="InputRef_name" spanTitleWidth="112px" :showTitle="true" title="定向包名称" inputWidth="400px" maxLength="15"/>
16 14
         <template v-for="item in pageInfoTs.jsonInfo">
15
+          {{item}}
17 16
           <CheckGroup v-if="item.isMultiple" :checkList="item.list"
18 17
                       :haveNotes="item.haveNotes"
19 18
                       :haveFlex="item.haveFlex"
@@ -34,6 +33,7 @@
34 33
                       @returnEvent="val=>reEventRadio(val,item)">
35 34
             <template v-if="item.EgName=='geo_location'" v-slot:appoint>
36 35
               <div class="tMar20">
36
+                <Cascade :list="pageInfo.location_ca_list" key="geo_location" @getIds="val=>{pageInfo.location_ca_ids = val}"></Cascade>
37 37
                 <el-checkbox-group v-model="pageInfo.locationCheckList">
38 38
                   <el-checkbox v-for="i in pageInfo.locationList" :label="i.label" >{{i.value}}</el-checkbox>
39 39
                 </el-checkbox-group>
@@ -74,6 +74,12 @@
74 74
               </div>
75 75
             </template>
76 76
 
77
+            <template v-if="item.EgName=='user_os'" v-slot:appoint>
78
+              <div class="tMar20">
79
+                <Cascade :list="pageInfo.user_os_list" key="user_os" :echoVal="item.value" :updateKey="pageInfo.user_os_key" @getIds="val=>{pageInfo.user_os_ids = val}"></Cascade>
80
+              </div>
81
+            </template>
82
+
77 83
           </RadioGroup>
78 84
         </template>
79 85
 
@@ -138,6 +144,9 @@ const pageInfo = reactive<reactiveTableAndAny>({
138 144
   user_os_list:[],
139 145
   estimationObj:{},
140 146
   directPacketParams:{},//确认和获取信息后台需要的参数
147
+  user_os_ids:[],
148
+  location_ca_ids:[],
149
+  user_os_key:1
141 150
 })
142 151
 
143 152
 
@@ -149,7 +158,7 @@ const get_user_os_list = async () => {
149 158
     pageInfo.user_os_list = []
150 159
     if(resNew){
151 160
       for(let i in resNew){
152
-        pageInfo.user_os_list.push({id:i,name:i,children:resNew[i]})
161
+        pageInfo.user_os_list.push({id:i,name:i,child:resNew[i]})
153 162
       }
154 163
     }
155 164
   }else{
@@ -233,7 +242,9 @@ const handledirectPacketParams = async () => {
233 242
           obj[item.EgName] = ''
234 243
         }
235 244
       }else{//单选
236
-        obj[item.EgName] = (r_val == 'unlimited' ? '' : (r_val == 'appoint' ? 1 : r_val))
245
+        if(item.EgName!=='user_os'){
246
+          obj[item.EgName] = (r_val == 'unlimited' ? '' : (r_val == 'appoint' ? 1 : r_val))
247
+        }
237 248
 
238 249
         if(item.EgName=='geo_location' && r_val == 'appoint'){
239 250
           let loList:any = pageInfo.locationCheckList
@@ -256,6 +267,16 @@ const handledirectPacketParams = async () => {
256 267
           obj.custom_audience = list1&&list1.length>0 ? list1.join(',') : ''
257 268
           obj.excluded_custom_audience = list2&&list2.length>0 ? list2.join(',') : ''
258 269
         }
270
+
271
+        if(item.EgName=='user_os' && r_val == 'appoint'){
272
+          let list1:any = pageInfo.user_os_ids
273
+          obj.user_os = list1&&list1.length>0 ? list1.join(',') : ''
274
+        }
275
+
276
+        if(item.EgName=='geo_location' && r_val == 'appoint'){
277
+          let list1:any = pageInfo.location_ca_ids
278
+          obj.regions = list1&&list1.length>0 ? list1.join(',') : ''
279
+        }
259 280
       }
260 281
     })
261 282
   })
@@ -294,7 +315,6 @@ const confirmEvent = async () => {
294 315
   }
295 316
 }
296 317
 
297
-
298 318
 //处理编辑的数据,在刚显示弹框的时候调用
299 319
 const handleEditData = async () => {
300 320
   InputRef_name.value!.value = ''
@@ -304,6 +324,7 @@ const handleEditData = async () => {
304 324
     InputRef_name.value!.value = props.propsInfo.name
305 325
     if(Object.prototype.toString.call(props.propsInfo.echoList) === '[object Object]'){ //有值
306 326
       await editEchoEcent(props.propsInfo.echoList,pageInfoTs.jsonInfo)
327
+      pageInfo.user_os_key++
307 328
       loading.value = false
308 329
     }else{
309 330
       loading.value = false
@@ -321,12 +342,11 @@ const switchShow = (val:boolean)=>{
321 342
       await get_behavior_list()
322 343
       //处理编辑的数据
323 344
       await handleEditData()
324
-      //得到右边人群覆盖的数据
325
-      await getEstimation()
326
-
327
-      // get_user_os_list()
328
-
345
+      //操作系统版本和地区
329 346
       get_location_list()
347
+      get_user_os_list()
348
+      //得到右边人群覆盖的数据
349
+      getEstimation()
330 350
 
331 351
 
332 352
     })

+ 1 - 0
src/components/businessMoudle/batchGdt/configArea/directPacket/ts/directDetialPreview.ts

@@ -199,6 +199,7 @@ export function directDetialPreviewTs(){
199 199
                 })
200 200
             }else{//有值
201 201
                 obj.value = val
202
+
202 203
                 if(!obj.isMultiple && obj.haveAppoint){//单选 并且 有指定
203 204
                     obj.radioVal = 'appoint'
204 205
                 }else if(!obj.isMultiple){//只单选

+ 203 - 16
src/components/businessMoudle/batchGdt/configArea/index.vue

@@ -1,5 +1,7 @@
1 1
 <template>
2
-
2
+  <div class="flex titleBox">
3
+    <span>程序化批量/广点通</span>
4
+  </div>
3 5
   <div class="areaBox">
4 6
     <div class="areaTitle">配置区
5 7
       <span class="smallTitle lMarauto">预览广告数 : <span class="c-theme">{{NumberHandle(pageInfo.adNum)||0}}</span></span>
@@ -25,7 +27,6 @@
25 27
       </div>
26 28
 
27 29
       <div class="configArea">
28
-
29 30
         <div v-for="item in pageInfo.adTitleList" :key="item.id"
30 31
              :style=" {width:item.name == '广告' ? 'calc((100vw - 40px - 32px) / 6 * 2)' : 'calc((100vw - 40px - 32px) / 6 * 4)'}">
31 32
           <div class="bigTitle" :class="item.name == '广告创意' ? 'no_left_boder' : ''">{{item.name}}</div>
@@ -39,7 +40,7 @@
39 40
                 <template v-if="sub.name == '创意文案'">
40 41
                   <Copywriter ref="CopywriterRef" :showFlag="sub.haveContent"></Copywriter>
41 42
                 </template>
42
-                <div class="noData" v-if="!sub.haveContent">暂无数据</div>
43
+                <div class="noData" v-if="!sub.haveContent">暂无数据 </div>
43 44
                 <!-- 定向包展示 -->
44 45
                 <template v-if="sub.name == '定向包'">
45 46
                   <DirectPacketExhibition :showFlag="sub.haveContent" ref="DirectPacketExhibitionRef" @updateHaveContent="updateHaveContent"></DirectPacketExhibition>
@@ -67,10 +68,10 @@
67 68
                 <template v-if="sub.name == '创意素材'">
68 69
                   <div class="flex bMar8" v-for="cItem in cMaterial.list" :key="cItem.id">
69 70
                     <div class="flex" style="width: 100%;justify-content: center">
70
-                      <video :src="cItem.videoUrl" height="76"></video>
71
+                      <video :src="cItem.videoUrl" height="auto" width="100%"></video>
71 72
                     </div>
72 73
                     <div style="width: 100%;justify-content: center" class="lMar10 flex">
73
-                      <img v-if="cMaterial.haveCoverFlag" :src="cItem.picUrl" height="76"/>
74
+                      <img v-if="cMaterial.haveCoverFlag" :src="cItem.picUrl" height="auto" width="100%"/>
74 75
                     </div>
75 76
                   </div>
76 77
                 </template>
@@ -79,7 +80,6 @@
79 80
             </div>
80 81
           </div>
81 82
         </div>
82
-
83 83
       </div>
84 84
 
85 85
       <div class="btnArea">
@@ -92,17 +92,25 @@
92 92
           </template>
93 93
         </span>
94 94
         <span class="lMarauto">
95
-          <el-button type="primary">批量预览广告</el-button>
95
+          <el-button type="primary" @click="openPreAreaEvent">批量预览广告</el-button>
96 96
 <!--          <el-button type="primary" class="lMar10">保存策略组</el-button>-->
97 97
         </span>
98 98
       </div>
99 99
     </div>
100 100
   </div>
101
+  <!--  预览区-->
102
+  <template v-if="previewObj.showPreFlag">
103
+    <PreviewArea :infoObj="previewObj"></PreviewArea>
104
+  </template>
101 105
 
102 106
   <!--规则配置-->
103 107
   <RuleConfig ref="RuleConfigRef" @ExposeEvent="val=>pageInfo.RuleConfigObj = val"></RuleConfig>
104 108
   <!--  创意素材-->
105
-  <CreativeMaterial ref="CreativeMaterialRef" :haveCoverFlag="cMaterial.haveCoverFlag" @assignEvent="assignEvent_CreativeMaterial"></CreativeMaterial>
109
+  <CreativeMaterial ref="CreativeMaterialRef"
110
+                    :haveCoverFlag="cMaterial.haveCoverFlag"
111
+                    :video_tips="cMaterial.video_tips"
112
+                    :image_tips="cMaterial.image_tips"
113
+                    @assignEvent="assignEvent_CreativeMaterial"></CreativeMaterial>
106 114
 
107 115
 
108 116
   <!-- 创意基本信息 -->
@@ -117,14 +125,17 @@
117 125
   <AttributionOuter :visible="basicInfoData.outerConfig.attributionOuter.visible" :accIdsList="pageInfo.accIdsList" :fillback="basicInfoData.outerConfig['attributionOuter'].value" @close="(obj)=>{basicOuterClose({val: obj?.val || null, type: obj?.type || null , key:'attributionOuter'})}"></AttributionOuter>
118 126
   <!-- 优量汇流量包 -->
119 127
   <UnionPosition :visible="basicInfoData.outerConfig.unionPosition.visible" :accIdsList="pageInfo.accIdsList" :infoSelect="basicInfoData.outerConfig.unionPosition.infoSelect" :fillback="basicInfoData.outerConfig['unionPosition'].value"  @close="(obj)=>{basicOuterClose({val: obj?.val || null, type: obj?.type || null , key:'unionPosition'})}"></UnionPosition>
128
+
129
+
120 130
 </template>
121 131
 <script setup lang="ts">
122 132
 import {getCurrentInstance, nextTick, onMounted, reactive, ref, provide, computed,toRef,watch} from "vue";
123
-import {adqParam, reactiveTableAndAny, ruleConfig} from "@/api/ApiModel";
133
+import {adqParam, reactiveTableAndAny} from "@/api/ApiModel";
124 134
 import Select from '@/components/capsulationMoudle/_select.vue'
125 135
 import DirectPacketExhibition from '@/components/businessMoudle/batchGdt/configArea/directPacket/echoIndex.vue'
126 136
 import RuleConfig from '@/components/businessMoudle/batchGdt/configArea/ruleConfig/index.vue'
127 137
 import CreativeMaterial from '@/components/businessMoudle/batchGdt/configArea/creativeMaterial/index.vue'
138
+import PreviewArea from '@/components/businessMoudle/batchGdt/previewArea/index.vue'
128 139
 import {Api} from "@/api/api";
129 140
 import {ElMessage} from "element-plus";
130 141
 import BasicInfo from "./basicInfo/index.vue";
@@ -140,6 +151,11 @@ import _ from "lodash";
140 151
 const { proxy } = getCurrentInstance() as any;
141 152
 // 全局方法定义
142 153
 const NumberHandle = proxy.$NumberHandle
154
+const emit = defineEmits<{
155
+  (event: "openPreEvent", val: boolean,arr:any): void; //打开预览区
156
+}>();
157
+
158
+
143 159
 const targetRef = ref<{value:any}>()
144 160
 const originalityBasicRef = ref()
145 161
 
@@ -165,6 +181,7 @@ const pageInfo = reactive<reactiveTableAndAny>({
165 181
   RuleConfigObj:{},//规则配置的值
166 182
 })
167 183
 
184
+
168 185
 //广告基本信息
169 186
 const basicInfoData = reactive<any>({
170 187
   visible:false,
@@ -251,6 +268,28 @@ const accEvent = () => {
251 268
     basicInfoData.outerConfig[i].value = getCommonValue( basicInfoData.outerConfig[i].value )
252 269
   }
253 270
 }
271
+
272
+// 预览区
273
+const previewObj = reactive<reactiveTableAndAny>({
274
+  showPreFlag:false,
275
+  updateKey:1,
276
+  accVal:[],
277
+  RuleConfigObj:{}
278
+})
279
+const openPreAreaEvent = () => {
280
+  let arr:any = pageInfo.accIdsList
281
+  if(arr&&arr.length<=0){
282
+    ElMessage.error('请选择媒体账户!')
283
+    return
284
+  }
285
+  openPreEvent(arr)
286
+}
287
+const openPreEvent = (arr:any) => {
288
+  previewObj.showPreFlag = true
289
+  previewObj.updateKey++
290
+  previewObj.accVal = _.cloneDeep(arr)
291
+  previewObj.RuleConfigObj = _.cloneDeep(pageInfo.RuleConfigObj)
292
+}
254 293
 const targetChange = () => {
255 294
   pageInfo.targetValue = targetRef.value!.value
256 295
 }
@@ -275,17 +314,53 @@ const get_ruleConfig_info = async () => {
275 314
 }
276 315
 
277 316
 //创意素材
278
-const CreativeMaterialRef = ref<{switchShow:(val:boolean,isEdit:boolean,arr:any)=>void}>()
317
+const CreativeMaterialRef = ref<{switchShow:(val:boolean,isEdit:boolean,arr:any)=>void,clearAllEvent:()=>void}>()
279 318
 const cMaterial = reactive<reactiveTableAndAny>({
280 319
   list:[],
281 320
   list_copy:[],
282 321
   key:1,
283
-  haveCoverFlag:true
322
+  haveCoverFlag:false,
323
+  video_tips:{},
324
+  image_tips:{},
325
+  resResult:[],//提审后台需要的值
284 326
 })
327
+//处理素材返回来的值
328
+const handle_resResult = (resResult:any) => {
329
+  let resArr:any = []
330
+  resResult.forEach(item=>{
331
+    let obj:any = {}
332
+    obj.account_id = item.account_id
333
+    obj.list = []
334
+    for(let i in item){
335
+      if(item[i].material_res&&item[i].material_res.video_id){
336
+        obj.list.push({
337
+          video_id:item[i].material_res.video_id,
338
+          image_id:item[i].material_res.cover.image_id
339
+        })
340
+      }
341
+    }
342
+    resArr.push(obj)
343
+  })
344
+  return resArr
345
+}
285 346
 //创意素材值回显
286
-const assignEvent_CreativeMaterial = (val:any) => {
347
+const assignEvent_CreativeMaterial = async (val:any,resResult:any) => {
287 348
   cMaterial.list_copy = _.cloneDeep(val)
288 349
   cMaterial.key++
350
+  let cloneRes:any = await handle_resResult(_.cloneDeep(resResult))
351
+  let arr:any = cMaterial.resResult // 处理成提审后台需要的值
352
+  originalityBasicInfoData.params.forEach(item=>{
353
+    cloneRes.forEach(cItem=>{
354
+      if(item.account_id == cItem.account_id){
355
+        cItem.list.forEach(c=>{
356
+          item.adcreative_elements = Object.assign(item.adcreative_elements,c)
357
+          arr.push(item)
358
+        })
359
+      }
360
+    })
361
+  })
362
+  cMaterial.resResult = arr
363
+  console.log(cMaterial.resResult);
289 364
 }
290 365
 //监听创意素材点击了确定
291 366
 watch(()=>cMaterial.key,()=>{
@@ -293,12 +368,22 @@ watch(()=>cMaterial.key,()=>{
293 368
   let num = cMaterial.list&&cMaterial.list.length
294 369
   updateHaveContent(6,num)
295 370
 })
371
+//得到是否有封面 , 以及视频和图片尺寸
372
+const get_cover_info = () => {
373
+  let obj:any = originalityBasicInfoData.apiResult.adTemplateItem.adcreative_elements
374
+  cMaterial.video_tips = obj.video.restriction.video_restriction
375
+  if(obj.image){
376
+    cMaterial.haveCoverFlag = true
377
+    cMaterial.image_tips = obj.image.restriction.image_restriction
378
+  }
379
+}
380
+
296 381
 
297 382
 // 定向包
298 383
 const DirectPacketExhibitionRef = ref<{get_echoAcId:()=>void,showDirectPacket:()=>void,clearDirectContent:()=>void}>()
299 384
 
300 385
 // 打开添加 / 编辑
301
-const openDialogEvent = (sub:any) => {
386
+const openDialogEvent = async (sub:any) => {
302 387
   if(pageInfo.accIdsList && pageInfo.accIdsList.length<=0){
303 388
     ElMessage.error('请选择媒体账户!')
304 389
     return
@@ -315,9 +400,6 @@ const openDialogEvent = (sub:any) => {
315 400
       }
316 401
     })
317 402
   }
318
-  if(sub.name == '创意素材'){
319
-      CreativeMaterialRef.value!.switchShow(true,sub.haveContent,cMaterial.list)
320
-  }
321 403
   if(sub.name == '广告基本信息'){
322 404
     basicInfoData.visible = true;
323 405
   }
@@ -332,6 +414,30 @@ const openDialogEvent = (sub:any) => {
332 414
       ElMessage.error('请完善广告基本信息!')
333 415
     }
334 416
   }
417
+
418
+  if(sub.name == '创意素材'){
419
+    let _id:number = 5
420
+    let _haveContent:boolean = false
421
+    pageInfo.adTitleList.forEach(item=>{
422
+      if(item.id == _id){
423
+        _haveContent = item.haveContent
424
+      }else{
425
+        if(item.subList&&item.subList.length>0){
426
+          item.subList.forEach(sub=>{
427
+            if(sub.id == _id){
428
+              _haveContent = sub.haveContent
429
+            }
430
+          })
431
+        }
432
+      }
433
+    })
434
+    if(!_haveContent){
435
+      ElMessage.error('请先完善广告基本信息!')
436
+      return;
437
+    }
438
+    await get_cover_info()
439
+    CreativeMaterialRef.value!.switchShow(true,sub.haveContent,cMaterial.list)
440
+  }
335 441
   if(sub.name == '创意文案'){
336 442
     CopywriterRef.value![0].initFun(true)
337 443
   }
@@ -377,6 +483,78 @@ const originalityBasicClose = (obj) => {
377 483
     originalityBasicInfoData.receiveForm = obj.form
378 484
     originalityBasicInfoData.apiResult = obj.apiResult
379 485
     updateHaveContent(5)
486
+    console.log(obj);
487
+
488
+
489
+    let test:any = _.cloneDeep([
490
+      {
491
+        "account_id": "30159231",
492
+        "100": {
493
+          "material_res": {
494
+            "video_id": 8091724345,
495
+            "cover": {
496
+              "image_id": "8175212937",
497
+              "preview_url": "http://pgdt.gtimg.cn/141/20204/snscosdownload/SZ/reserved/6501625600081dfe08e36f8046908e0b0000008d00004eec?m=f530c6a6a35ada7647f86307631d7edd&ck=f530c6a6a35ada7647f86307631d7edd&sha256=f1b3c94a7b78129b6aa5b08cf1ff28ae5784255d0753441885c52220eb95d6fa",
498
+              "description": "图片-720-1280-1-1694589526",
499
+              "width": 720,
500
+              "height": 1280,
501
+              "file_size": 95869,
502
+              "type": "IMAGE_TYPE_JPG",
503
+              "signature": "f530c6a6a35ada7647f86307631d7edd"
504
+            }
505
+          }
506
+        },
507
+        "115": {
508
+          "material_res": {
509
+            "video_id": 8232178730,
510
+            "cover": {
511
+              "image_id": "8232170993",
512
+              "preview_url": "http://pgdt.gtimg.cn/141/20204/snscosdownload/SZ/reserved/650a5cac000bf0f22c4a9212dd64bc1e0000008d00004eec?m=6096a15874c54f002aa6d889104ad977&ck=6096a15874c54f002aa6d889104ad977&sha256=79735f7cafd80031ca7dd366733427d8e3efbdc56400fc0e91203ff67c5bcb1c",
513
+              "description": "图片-1080-1920-1-1695177900",
514
+              "width": 1080,
515
+              "height": 1920,
516
+              "file_size": 294089,
517
+              "type": "IMAGE_TYPE_JPG",
518
+              "signature": "6096a15874c54f002aa6d889104ad977"
519
+            }
520
+          }
521
+        }
522
+      },
523
+      {
524
+        "account_id": "30159230",
525
+        "100": {
526
+          "material_res": {
527
+            "video_id": 8232170360,
528
+            "cover": {
529
+              "image_id": "8175213109",
530
+              "preview_url": "http://pgdt.gtimg.cn/141/20204/snscosdownload/SZ/reserved/65016257000774e518e6527c464b88090000008d00004eec?m=f530c6a6a35ada7647f86307631d7edd&ck=f530c6a6a35ada7647f86307631d7edd&sha256=f1b3c94a7b78129b6aa5b08cf1ff28ae5784255d0753441885c52220eb95d6fa",
531
+              "description": "图片-720-1280-1-1694589527",
532
+              "width": 720,
533
+              "height": 1280,
534
+              "file_size": 95869,
535
+              "type": "IMAGE_TYPE_JPG",
536
+              "signature": "f530c6a6a35ada7647f86307631d7edd"
537
+            }
538
+          }
539
+        },
540
+        "115": {
541
+          "material_res": {
542
+            "video_id": 8232183918,
543
+            "cover": {
544
+              "image_id": "8232171373",
545
+              "preview_url": "http://pgdt.gtimg.cn/141/20204/snscosdownload/SZ/reserved/650a5caf0003ac9a158d4303616fbc1e0000008d00004eec?m=6096a15874c54f002aa6d889104ad977&ck=6096a15874c54f002aa6d889104ad977&sha256=79735f7cafd80031ca7dd366733427d8e3efbdc56400fc0e91203ff67c5bcb1c",
546
+              "description": "图片-1080-1920-1-1695177903",
547
+              "width": 1080,
548
+              "height": 1920,
549
+              "file_size": 294089,
550
+              "type": "IMAGE_TYPE_JPG",
551
+              "signature": "6096a15874c54f002aa6d889104ad977"
552
+            }
553
+          }
554
+        }
555
+      }
556
+    ])
557
+    handle_resResult(test)
380 558
   }
381 559
 }
382 560
 /**广告基础信息回调 */
@@ -488,6 +666,15 @@ provide('accountIds',toRef(pageInfo,'accIdsList'))
488 666
 </script>
489 667
 <style lang="scss" scoped>
490 668
 @import "src/assets/style/batchGdt.scss";
669
+.titleBox{
670
+  font-size: 14px;
671
+  font-weight: 700;
672
+  line-height: 48px;
673
+  color: #515a6e;
674
+  background-color: #fff;
675
+  box-shadow: 0 2px 4px 0 rgba(0,0,0,.08);
676
+  padding: 0 30px 0 32px;
677
+}
491 678
 .areaCon{
492 679
   .screenArea{
493 680
     display: flex;

+ 0 - 46
src/components/businessMoudle/batchGdt/index.vue

@@ -1,46 +0,0 @@
1
-<template>
2
-  <div class="flex titleBox">
3
-    <span>程序化批量/广点通</span>
4
-<!--    <div class="lMarauto">-->
5
-<!--      <el-button type="primary" >选择策略组</el-button>-->
6
-<!--    </div>-->
7
-  </div>
8
-
9
-  <!--  配置区-->
10
-  <ConfigArea></ConfigArea>
11
-
12
-  <!--  预览区-->
13
-  <PreviewArea></PreviewArea>
14
-
15
-</template>
16
-<script setup lang="ts">
17
-import {getCurrentInstance, nextTick, onMounted, reactive, ref} from "vue";
18
-import ConfigArea from '@/components/businessMoudle/batchGdt/configArea/index.vue'
19
-import PreviewArea from '@/components/businessMoudle/batchGdt/previewArea/index.vue'
20
-
21
-const { proxy } = getCurrentInstance() as any;
22
-// 全局方法定义
23
-const NumberHandle = proxy.$NumberHandle
24
-
25
-
26
-
27
-
28
-
29
-onMounted(()=>{
30
-  nextTick(()=>{
31
-
32
-  })
33
-})
34
-</script>
35
-<style lang="scss" scoped>
36
-@import "src/assets/style/batchGdt.scss";
37
-.titleBox{
38
-  font-size: 14px;
39
-  font-weight: 700;
40
-  line-height: 48px;
41
-  color: #515a6e;
42
-  background-color: #fff;
43
-  box-shadow: 0 2px 4px 0 rgba(0,0,0,.08);
44
-  padding: 0 30px 0 32px;
45
-}
46
-</style>

+ 150 - 132
src/components/businessMoudle/batchGdt/previewArea/index.vue

@@ -1,49 +1,61 @@
1 1
 <template>
2
-  <div class="areaBox">
3
-    <div class="areaTitle flex">
4
-      预览区
5
-      <div class="lMarauto flex f14" style="font-weight: initial">
6
-        <span>推广计划总数 : {{pageInfo.tableList&&pageInfo.tableList.length}}</span>
7
-        <span class="lMar8">广告总数 : {{pageInfo.tableList&&pageInfo.tableList.length}}</span>
8
-        <el-button type="primary" class="lMar20" @click="auditSubmitEvent">全部提交审核</el-button>
9
-      </div>
10
-    </div>
11
-    <div class="areaCon">
12
-      <div class="flex">
13
-        <div class="accItem" v-for="item in pageInfo.accList" :key="item.id" :class="pageInfo.accId == item.id ? 'active' : ''" @click="accItemEvent(item.id)">{{item.name}}</div>
14
-      </div>
15
-      <div class=" flex chooseBox">
16
-        <div>已选 : <span>{{pageInfo.chooseList&&pageInfo.chooseList.length}}</span></div>
17
-        <div class="lMarauto flex">
18
-          <span>推广计划数量 : {{pageInfo.tableList&&pageInfo.tableList.length}}</span>
19
-          <span class="lMar8">广告数量 : {{pageInfo.tableList&&pageInfo.tableList.length}}</span>
20
-          <Dropdown title="批量操作" lMar="10px" :list="pageInfo.moreList" @close="dropdownEvent" :disabledFlag="pageInfo.chooseList&&pageInfo.chooseList.length == 0"></Dropdown>
2
+    <div class="areaBox">
3
+      <div class="areaTitle flex">
4
+        预览区
5
+        <div class="lMarauto flex f14" style="font-weight: initial">
6
+          <span>推广计划总数 : {{pageInfo.tableList&&pageInfo.tableList.length}}</span>
7
+          <span class="lMar8">广告总数 : {{pageInfo.tableList&&pageInfo.tableList.length}}</span>
8
+          <el-button type="primary" class="lMar20" @click="auditSubmitEvent">全部提交审核</el-button>
21 9
         </div>
22 10
       </div>
23
-      <el-table v-loading="loading" ref="tableRef" :data="pageInfo.tableList"
24
-                :header-cell-style="tableHeaderStyle"
25
-                :key="updateKey" style="width: 100%;"
26
-                border empty-text="暂无数据"
27
-                :row-key="rowKeyStr"
28
-                @selection-change="selectionChangeEvent"
29
-                max-height="calc(100vh - 240px)">
30
-        <el-table-column fixed reserve-selection type="selection" width="60" />
31
-        <template v-for="bigItem in pageInfo.descol">
32
-          <el-table-column :label="bigItem.name">
33
-            <template v-for="item in bigItem.list">
34
-              <el-table-column :fixed="item.isfixed" :min-width="item.minWidth ? item.minWidth : '130px'">
35
-                <template #header>
36
-                  <div class="flex" :style="{ justifyContent: item.alignSelf ? item.alignSelf : 'left' }" >
37
-                    {{ item.name }}
38
-                    <el-tooltip v-if="item.notes" effect="dark" :content="item.notes"><i-ep-QuestionFilled class="lMar5 c-999 f14 pointer" /></el-tooltip>
39
-                  </div>
40
-                </template>
41
-                <template #default="scope">
42
-                  <div class="cellDiv" v-if="item.column == 'a1'">
43
-                    <el-select v-model="scope.row.a1_6_val" @change="changeEvent_a1_6">
44
-                      <el-option v-for="i in pageInfo.promoteList" :key="i.k " :label="i.la" :value="i.val"/>
45
-                    </el-select>
46
-                    <div v-if="scope.row.a1_6_val == 'new'">
11
+      <div class="areaCon">
12
+        <div class="flex">
13
+          <div class="accItem" v-for="item in pageInfo.accList" :key="item.id" :class="pageInfo.accId == item.id ? 'active' : ''" @click="accItemEvent(item.id)">{{item.name}}</div>
14
+        </div>
15
+        <div class=" flex chooseBox">
16
+          <div>已选 : <span>{{pageInfo.chooseList&&pageInfo.chooseList.length}}</span></div>
17
+          <div class="lMarauto flex">
18
+            <span>推广计划数量 : {{pageInfo.tableList&&pageInfo.tableList.length}}</span>
19
+            <span class="lMar8">广告数量 : {{pageInfo.tableList&&pageInfo.tableList.length}}</span>
20
+            <!--          <Dropdown title="批量操作" lMar="10px" :list="pageInfo.moreList" @close="dropdownEvent" :disabledFlag="pageInfo.chooseList&&pageInfo.chooseList.length == 0"></Dropdown>-->
21
+          </div>
22
+        </div>
23
+        <el-table v-loading="loading" ref="tableRef" :data="pageInfo.tableList"
24
+                  :header-cell-style="tableHeaderStyle"
25
+                  :key="updateKey" style="width: 100%;"
26
+                  border empty-text="暂无数据"
27
+                  :row-key="rowKeyStr"
28
+                  @selection-change="selectionChangeEvent"
29
+                  max-height="calc(100vh - 240px)">
30
+          <el-table-column fixed reserve-selection type="selection" width="60" />
31
+          <template v-for="bigItem in pageInfo.descol">
32
+            <el-table-column :label="bigItem.name">
33
+              <template v-for="item in bigItem.list">
34
+                <el-table-column :fixed="item.isfixed" :min-width="item.minWidth ? item.minWidth : '130px'">
35
+                  <template #header>
36
+                    <div class="flex" :style="{ justifyContent: item.alignSelf ? item.alignSelf : 'left' }" >
37
+                      {{ item.name }}
38
+                      <el-tooltip v-if="item.notes" effect="dark" :content="item.notes"><i-ep-QuestionFilled class="lMar5 c-999 f14 pointer" /></el-tooltip>
39
+                    </div>
40
+                  </template>
41
+                  <template #default="scope">
42
+                    <div class="cellDiv" v-if="item.column == 'a1'">
43
+                      <!--
44
+                      已有计划先不开发
45
+
46
+                                          <el-select v-model="scope.row.a1_6_val" @change="changeEvent_a1_6">
47
+                                            <el-option v-for="i in pageInfo.promoteList" :key="i.k " :label="i.la" :value="i.val"/>
48
+                                          </el-select>
49
+
50
+                                              <div class="tMar10" v-if="scope.row.a1_6_val == 'edit'">
51
+                                            <el-button type="primary" @click="openSubDialogEvent(scope.row,'choosePlan')">选择推广计划</el-button>
52
+                                            <div v-if="scope.row.choosePlanVal" class="tMar8 c-999">
53
+                                              已选 : {{scope.row.choosePlanVal}}
54
+                                            </div>
55
+                                          </div>
56
+
57
+                      -->
58
+
47 59
                       <div class="clampOne tMar10 flex">名称:
48 60
                         <span>{{scope.row.a1_1 || '-'}}</span>
49 61
                         <el-icon color="#3173FF" class="pointer" @click="openSubDialogEvent(scope.row,'planName')"><i-ep-Edit /></el-icon>
@@ -57,67 +69,59 @@
57 69
                       </div>
58 70
                       <div class="clampOne">推广目标: {{scope.row.a1_5 || '-'}} </div>
59 71
                     </div>
60
-
61
-                    <div class="tMar10" v-if="scope.row.a1_6_val == 'edit'">
62
-                      <el-button type="primary" @click="openSubDialogEvent(scope.row,'choosePlan')">选择推广计划</el-button>
63
-                      <div v-if="scope.row.choosePlanVal" class="tMar8 c-999">
64
-                        已选 : {{scope.row.choosePlanVal}}
65
-                      </div>
72
+                    <div class="cellDiv flex" v-else-if="item.column == 'a2'">
73
+                      <span>{{scope.row.a2 || '-'}}</span>
74
+                      <el-icon color="#3173FF" class="pointer" @click="openSubDialogEvent(scope.row,'adName')"><i-ep-Edit /></el-icon>
66 75
                     </div>
67
-                  </div>
68
-                  <div class="cellDiv flex" v-else-if="item.column == 'a2'">
69
-                    <span>{{scope.row.a2 || '-'}}</span>
70
-                    <el-icon color="#3173FF" class="pointer" @click="openSubDialogEvent(scope.row,'adName')"><i-ep-Edit /></el-icon>
71
-                  </div>
72
-                  <div class="cellDiv flex" v-else-if="item.column == 'a3'">
73
-                    <span>{{scope.row.a3 || 0}}</span>元/下单
74
-                    <el-icon color="#3173FF" class="pointer" @click="openSubDialogEvent(scope.row,'bid')"><i-ep-Edit /></el-icon>
75
-                  </div>
76
-                  <div class="cellDiv pointer" style="color:#3173FF;" v-else-if="item.column == 'a7'" @click="openSubDialogEvent(scope.row,'seeVideoImg')">已选{{scope.row.a7 || 0}}张图片,{{scope.row.a7_1 || 0}}个视频</div>
77
-                  <div class="cellDiv" v-else-if="item.column == 'a8'">文案:已选{{scope.row.a8 || 0}}条文案</div>
78
-                  <div class="cellDiv" v-else-if="item.column == 'a10'">
79
-                    <Popconfirm @confirm="deleTextEvent()"/>
80
-                  </div>
81
-                  <div class="cellDiv" v-else-if="item.column == 'a11'">
82
-                    {{scope.row.a11==1 ? '已提交' : '待提交'}}
83
-                  </div>
84
-                  <div class="cellDiv" :style="{ justifyContent: item.alignSelf ? item.alignSelf : 'left' }" v-else>
85
-                    <el-tooltip :disabled="!(scope.row[item.column] && scope.row[item.column].length >30)" effect="dark" :content="scope.row[item.column]+''">
86
-                      <div class="clampTwo line21" style="flex: 1">
87
-                        {{ scope.row[item.column] || scope.row[item.column]==0 ?
88
-                          (item.cancleForMat ? (scope.row[item.column] ? scope.row[item.column] : '-') : NumberHandle(scope.row[item.column])) : '-'}}
89
-                      </div>
90
-                    </el-tooltip>
91
-                  </div>
92
-                </template>
93
-              </el-table-column>
94
-            </template>
95
-          </el-table-column>
96
-        </template>
97
-      </el-table>
76
+                    <div class="cellDiv flex" v-else-if="item.column == 'a3'">
77
+                      <span>{{scope.row.a3 || 0}}</span>元/下单
78
+                      <el-icon color="#3173FF" class="pointer" @click="openSubDialogEvent(scope.row,'bid')"><i-ep-Edit /></el-icon>
79
+                    </div>
80
+                    <div class="cellDiv pointer" style="color:#3173FF;" v-else-if="item.column == 'a7'" @click="openSubDialogEvent(scope.row,'seeVideoImg')">已选{{scope.row.a7 || 0}}张图片,{{scope.row.a7_1 || 0}}个视频</div>
81
+                    <div class="cellDiv" v-else-if="item.column == 'a8'">文案:已选{{scope.row.a8 || 0}}条文案</div>
82
+                    <div class="cellDiv" v-else-if="item.column == 'a10'">
83
+                      <Popconfirm @confirm="deleTextEvent()"/>
84
+                    </div>
85
+                    <div class="cellDiv" v-else-if="item.column == 'a11'">
86
+                      {{scope.row.a11==1 ? '已提交' : '待提交'}}
87
+                    </div>
88
+                    <div class="cellDiv" :style="{ justifyContent: item.alignSelf ? item.alignSelf : 'left' }" v-else>
89
+                      <el-tooltip :disabled="!(scope.row[item.column] && scope.row[item.column].length >30)" effect="dark" :content="scope.row[item.column]+''">
90
+                        <div class="clampTwo line21" style="flex: 1">
91
+                          {{ scope.row[item.column] || scope.row[item.column]==0 ?
92
+                            (item.cancleForMat ? (scope.row[item.column] ? scope.row[item.column] : '-') : NumberHandle(scope.row[item.column])) : '-'}}
93
+                        </div>
94
+                      </el-tooltip>
95
+                    </div>
96
+                  </template>
97
+                </el-table-column>
98
+              </template>
99
+            </el-table-column>
100
+          </template>
101
+        </el-table>
102
+      </div>
98 103
     </div>
99
-  </div>
100 104
 
101
-  <!--修改推广计划名称-->
102
-  <EditPromotePlanName ref="EditPromotePlanNameRef" :propInfo="pageInfo.planName" @confirm="val=>echoVal(val,'planName')"></EditPromotePlanName>
103
-  <!--选择推广计划-->
104
-  <ChoosePromotePlan ref="ChoosePromotePlanRef" @confirm="val=>echoVal(val,'choosePlan')"></ChoosePromotePlan>
105
-  <!--推广计划日预算-->
106
-  <PromotePlanBudget_day ref="PromotePlanBudget_dayRef" @confirm="val=>echoVal(val,'PromotePlanBudget_day')"></PromotePlanBudget_day>
107
-  <!--推广计划总预算-->
108
-  <PromotePlanBudget_total ref="PromotePlanBudget_totalRef" @confirm="val=>echoVal(val,'PromotePlanBudget_total')"></PromotePlanBudget_total>
109
-  <!--修改广告名称-->
110
-  <EditAdverteName ref="EditAdverteNameRef" :propInfo="pageInfo.adName" @confirm="val=>echoVal(val,'adName')"></EditAdverteName>
111
-  <!--修改出价-->
112
-  <EditBid ref="EditBidRef" :propInfo="pageInfo.bid" @confirm="val=>echoVal(val,'bid')"></EditBid>
113
-  <!--查看视频/图片-->
114
-  <SeeVideoImg ref="SeeVideoImgRef" :propInfo="pageInfo.imgList" @confirm="val=>echoVal(val,'seeVideoImg')"></SeeVideoImg>
115
-  <!--批量修改推广计划名称-->
116
-  <batchChoosePromotePlan ref="batchChoosePromotePlanRef" @confirm="val=>batchEchoVal(val)"></batchChoosePromotePlan>
105
+    <!--修改推广计划名称-->
106
+    <EditPromotePlanName ref="EditPromotePlanNameRef" :propInfo="pageInfo.planName" @confirm="val=>echoVal(val,'planName')"></EditPromotePlanName>
107
+    <!--选择推广计划-->
108
+    <ChoosePromotePlan ref="ChoosePromotePlanRef" @confirm="val=>echoVal(val,'choosePlan')"></ChoosePromotePlan>
109
+    <!--推广计划日预算-->
110
+    <PromotePlanBudget_day ref="PromotePlanBudget_dayRef" @confirm="val=>echoVal(val,'PromotePlanBudget_day')"></PromotePlanBudget_day>
111
+    <!--推广计划总预算-->
112
+    <PromotePlanBudget_total ref="PromotePlanBudget_totalRef" @confirm="val=>echoVal(val,'PromotePlanBudget_total')"></PromotePlanBudget_total>
113
+    <!--修改广告名称-->
114
+    <EditAdverteName ref="EditAdverteNameRef" :propInfo="pageInfo.adName" @confirm="val=>echoVal(val,'adName')"></EditAdverteName>
115
+    <!--修改出价-->
116
+    <EditBid ref="EditBidRef" :propInfo="pageInfo.bid" @confirm="val=>echoVal(val,'bid')"></EditBid>
117
+    <!--查看视频/图片-->
118
+    <SeeVideoImg ref="SeeVideoImgRef" :propInfo="pageInfo.imgList" @confirm="val=>echoVal(val,'seeVideoImg')"></SeeVideoImg>
119
+    <!--批量修改推广计划名称-->
120
+    <!--  <batchChoosePromotePlan ref="batchChoosePromotePlanRef" @confirm="val=>batchEchoVal(val)"></batchChoosePromotePlan>-->
117 121
 </template>
118 122
 <script setup lang="ts">
119 123
 import Popconfirm from '@/components/capsulationMoudle/_popconfirm.vue'
120
-import {getCurrentInstance, nextTick, onMounted, reactive, ref} from "vue";
124
+import {getCurrentInstance, nextTick, onMounted, reactive, ref,watch} from "vue";
121 125
 import Dropdown from '@/components/capsulationMoudle/_dropdown.vue'
122 126
 import EditPromotePlanName from '@/components/businessMoudle/batchGdt/previewArea/dialog/editPromotePlanName.vue'
123 127
 import batchChoosePromotePlan from '@/components/businessMoudle/batchGdt/previewArea/dialog/batchChoosePromotePlan.vue'
@@ -128,12 +132,18 @@ import PromotePlanBudget_day from '@/components/businessMoudle/batchGdt/previewA
128 132
 import PromotePlanBudget_total from '@/components/businessMoudle/batchGdt/previewArea/dialog/PromotePlanBudget_total.vue'
129 133
 import SeeVideoImg from '@/components/businessMoudle/batchGdt/previewArea/dialog/SeeVideoImg.vue'
130 134
 import {reactiveTableAndAny} from "@/api/ApiModel";
131
-
135
+import _ from "lodash";
132 136
 
133 137
 const { proxy } = getCurrentInstance() as any;
134 138
 // 全局方法定义
135 139
 const NumberHandle = proxy.$NumberHandle
136 140
 
141
+const props = withDefaults(defineProps<{
142
+  infoObj:any
143
+}>(), {
144
+  infoObj:{}
145
+})
146
+
137 147
 const loading = ref<boolean>(false)
138 148
 const updateKey = ref<number>(1)
139 149
 const rowKeyStr = ref<string>('id')
@@ -181,10 +191,7 @@ const pageInfo = reactive<reactiveTableAndAny>({
181 191
   ],
182 192
   chooseList:[],
183 193
   moreList:[{label:'修改推广计划',value:'1'}],
184
-  accList:[
185
-    {name:'27384905',id:1},
186
-    {name:'27389205',id:2},
187
-  ],
194
+  accList:[],
188 195
   accId:1,
189 196
   choosePlanObj:{},//选择的计划项
190 197
   planName:'',//推广计划的名称
@@ -208,7 +215,7 @@ const EditBidRef = ref<{switchShow:(val:Boolean)=>void}>()
208 215
 //查看视频/图片
209 216
 const SeeVideoImgRef = ref<{switchShow:(val:Boolean)=>void}>()
210 217
 //批量选择推广计划
211
-const batchChoosePromotePlanRef = ref<{switchShow:(val:Boolean)=>void}>()
218
+// const batchChoosePromotePlanRef = ref<{switchShow:(val:Boolean)=>void}>()
212 219
 
213 220
 //打开相应弹框
214 221
 const openSubDialogEvent = (row:any,val:string) => {
@@ -281,38 +288,38 @@ const echoVal = (echoval:any,val:string) => {
281 288
 }
282 289
 
283 290
 //批量回显
284
-const batchEchoVal = (val:any) => {
285
-  if(pageInfo.tableList&&pageInfo.tableList.length==0){
286
-    return
287
-  }
288
-  if(val){//表示选择了一个计划
289
-    pageInfo.tableList.forEach(item=>{
290
-      pageInfo.chooseList.forEach(cItem=>{
291
-        if(item.id == cItem.id){
292
-          item.a1_6_val = 'edit'
293
-          item.choosePlanVal = val
294
-        }
295
-      })
296
-    })
297
-  }else{//切换到新建推广计划
298
-    pageInfo.tableList.forEach(item=>{
299
-      pageInfo.chooseList.forEach(cItem=>{
300
-        if(item.id == cItem.id){
301
-          item.a1_6_val = 'new'
302
-        }
303
-      })
304
-    })
305
-  }
306
-}
291
+// const batchEchoVal = (val:any) => {
292
+//   if(pageInfo.tableList&&pageInfo.tableList.length==0){
293
+//     return
294
+//   }
295
+//   if(val){//表示选择了一个计划
296
+//     pageInfo.tableList.forEach(item=>{
297
+//       pageInfo.chooseList.forEach(cItem=>{
298
+//         if(item.id == cItem.id){
299
+//           item.a1_6_val = 'edit'
300
+//           item.choosePlanVal = val
301
+//         }
302
+//       })
303
+//     })
304
+//   }else{//切换到新建推广计划
305
+//     pageInfo.tableList.forEach(item=>{
306
+//       pageInfo.chooseList.forEach(cItem=>{
307
+//         if(item.id == cItem.id){
308
+//           item.a1_6_val = 'new'
309
+//         }
310
+//       })
311
+//     })
312
+//   }
313
+// }
307 314
 
308 315
 //全部提交审核
309 316
 const auditSubmitEvent = () => {
310 317
 
311 318
 }
312 319
 
313
-const dropdownEvent = (val: string | number | object) => {
314
-  batchChoosePromotePlanRef.value!.switchShow(true)
315
-}
320
+// const dropdownEvent = (val: string | number | object) => {
321
+//   batchChoosePromotePlanRef.value!.switchShow(true)
322
+// }
316 323
 
317 324
 const accItemEvent = (id:number) => {
318 325
   pageInfo.accId = id
@@ -422,12 +429,23 @@ const init = async (page?:any,pageSize?:any) => {
422 429
   // }
423 430
 }
424 431
 
432
+//推广计划 - 规则配置的值
433
+const get_rule_config = () => {
434
+  const { RuleConfigObj } = props.infoObj
425 435
 
426
-onMounted(()=>{
436
+}
437
+watch(()=>props.infoObj.updateKey,()=>{
427 438
   nextTick(async ()=>{
439
+    //账号
440
+    pageInfo.accList = _.cloneDeep(props.infoObj.accVal)
441
+    accItemEvent(pageInfo.accList[0].id)
442
+
443
+    //推广计划
444
+
428 445
     await init()
429 446
   })
430
-})
447
+},{immediate:true,deep:true})
448
+
431 449
 </script>
432 450
 <style lang="scss" scoped>
433 451
 @import "src/assets/style/batchGdt.scss";

+ 2 - 2
src/components/businessMoudle/materialLibrary/material.vue

@@ -125,7 +125,7 @@ import Select from '@/components/capsulationMoudle/_select.vue'
125 125
 import TimeScreen from '@/components/capsulationMoudle/timeScreen.vue'
126 126
 import Input from '@/components/capsulationMoudle/_input.vue'
127 127
 import Dropdown from '@/components/capsulationMoudle/_dropdown.vue'
128
-import {searchBoxTs} from '@/components/businessMoudle/batchGdt/configArea/creativeMaterial/ts/searchBox'
128
+import {materialTs} from '@/components/businessMoudle/batchGdt/configArea/creativeMaterial/ts/materialTs'
129 129
 import { collectParam, materialManage, reactiveTableAndAny} from "@/api/ApiModel";
130 130
 import {Api} from "@/api/api";
131 131
 import {ElMessage} from "element-plus";
@@ -266,7 +266,7 @@ const {
266 266
   initAll,
267 267
   checkChangeItem,
268 268
   sizeVisibleEvent
269
-} = searchBoxTs()
269
+} = materialTs()
270 270
 
271 271
 onMounted(()=>{
272 272
   initAll()

+ 3 - 1
src/components/capsulationMoudle/_dialog.vue

@@ -29,7 +29,7 @@
29 29
         <template v-else>
30 30
           <slot name="footerBtn"></slot>
31 31
           <el-button @click="closeEVent" size="default">{{cancleText}}</el-button>
32
-          <el-button type="primary" @click="confirmEvent" size="default">{{ confirmText }}</el-button>
32
+          <el-button type="primary" @click="confirmEvent" v-loading.fullscreen.lock="fullLoading" size="default">{{ confirmText }}</el-button>
33 33
         </template>
34 34
       </span>
35 35
     </template>
@@ -45,6 +45,7 @@ const props = withDefaults(defineProps<{
45 45
   dialogTitle?: string,
46 46
   dialogVisible?: boolean,
47 47
   loading?: boolean,
48
+  fullLoading?: boolean,
48 49
   width?: string,
49 50
   height?: string,
50 51
   minheight?: string,
@@ -67,6 +68,7 @@ const props = withDefaults(defineProps<{
67 68
   destroyOnCloseFlag: false,
68 69
   dialogVisible: false,
69 70
   loading: false,
71
+  fullLoading: false,
70 72
   top: '15vh',
71 73
   propsClass:'',
72 74
   closeOnModal:true

+ 1 - 1
src/router/index.ts

@@ -17,7 +17,7 @@ const collectClip = () => import('@/components/businessMoudle/collectClip/index.
17 17
 const taskList = () => import('@/components/businessMoudle/taskList/index.vue')
18 18
 const adqManage = () => import('@/components/businessMoudle/adqManage.vue')
19 19
 const miniprogram = () => import('@/components/businessMoudle/miniprogram/index.vue')
20
-const batchGdt = () => import('@/components/businessMoudle/batchGdt/index.vue')
20
+const batchGdt = () => import('@/components/businessMoudle/batchGdt/configArea/index.vue')
21 21
 const gdtList = () => import('@/components/businessMoudle/gdtList/index.vue')
22 22
 
23 23