Browse Source

复用问题修复 - 小问题修复

liuxiaona 1 year ago
parent
commit
9a1b5b75db

+ 89 - 88
src/components/businessMoudle/batchGdt/configArea/creativeMaterial/index.vue

@@ -646,104 +646,105 @@ const clearAllEvent = async () => {
646 646
 }
647 647
 
648 648
 //删除一些账号的数据
649
-const deleAcEvent = (arr:any,haveAssign:boolean) => {
650
-  //arr空 就清空数据
651
-  console.log(arr,pageInfo.creativeTeamList)
652
-  if(arr&&arr.length>0){
653
-    arr.forEach(obj=>{
654
-      if(pageInfo.creativeTeamList&&pageInfo.creativeTeamList.length>0){
655
-        pageInfo.creativeTeamList.forEach((dir,dirIdx)=>{
656
-          if(dir.resResult && Array.isArray(dir.resResult)) {
657
-            dir.resResult.forEach((sub,subIdx)=>{
658
-              if(sub.account_id == obj.id){}else{
659
-                dir.resResult.splice(subIdx,1)
649
+              const deleAcEvent = (arr: any, haveAssign: boolean) => {
650
+                //arr空 就清空数据
651
+                if (arr && arr.length > 0) {
652
+                  arr.forEach(obj => {
653
+                    if (pageInfo.creativeTeamList && pageInfo.creativeTeamList.length > 0) {
654
+                      pageInfo.creativeTeamList.forEach((dir, dirIdx) => {
655
+                        dir.list.forEach(sub=>{
656
+                          sub.resResult.forEach((sun,sunIdx)=>{
657
+                            if (sun.account_id == obj.id) {
658
+                            } else {
659
+                              sub.resResult.splice(sunIdx, 1)
660
+                            }
661
+                          })
662
+                        })
663
+                      })
664
+                    }
665
+                  })
666
+                  if (haveAssign) {
667
+                    emit('assignEvent', pageInfo.creativeTeamList)
668
+                  }
669
+                } else {
670
+                  clearAllEvent()
671
+                }
660 672
               }
661
-            })
662
-          }
663
-        })
664
-      }
665
-    })
666
-    if(haveAssign){
667
-      emit('assignEvent',pageInfo.creativeTeamList)
668
-    }
669
-  }else{
670
-    clearAllEvent()
671
-  }
672
-}
673 673
 
674 674
 //复用 - 将选中的素材重新上传一遍到新账号 - 得到返回值 - 抛给主页面
675
-const get_new_ac_ids = () => {
676
-  let arr:any = _.cloneDeep(inject_accountIds)
677
-  let new_ac_ids:any = []
678
-  let all_ac_ids:any = []
679
-  console.log(pageInfo.creativeTeamList);
680
-  pageInfo.creativeTeamList.forEach(pcItem=>{
681
-    pcItem.resResult.forEach(sub=>{
682
-      let ids_nn:number = all_ac_ids.findIndex(nn=>nn==sub.account_id)
683
-      if(ids_nn==-1){
684
-        all_ac_ids.push(sub.account_id)
685
-      }
686
-    })
687
-  })
688
-  arr._object[arr._key].forEach(a=>{
689
-    let idx:number = all_ac_ids.findIndex(n=>n == a.id)
690
-    if(idx==-1){
691
-      new_ac_ids.push(a)
692
-    }
693
-  })
694
-  console.log(new_ac_ids,'new_ac_ids');
695
-  console.log(arr,'arr');
696
-  return new_ac_ids
697
-}
698
-const get_new_target_ids = () => {
699
-  let new_target_ids:any = []
700
-  pageInfo.creativeTeamList.forEach(item=>{
701
-    let ids_nn:number = new_target_ids.findIndex(nn=>nn==item.itemId)
702
-    if(ids_nn==-1){
703
-      new_target_ids.push(item.itemId)
704
-    }
705
-  })
706
-  console.log(new_target_ids,'new_target_ids');
707
-  return new_target_ids
708
-}
675
+              const get_new_ac_ids = () => {
676
+                let arr: any = _.cloneDeep(inject_accountIds)
677
+                let new_ac_ids: any = []
678
+                let all_ac_ids: any = []
679
+                pageInfo.creativeTeamList[0].list[0].resResult.forEach(sub => {
680
+                  let ids_nn: number = all_ac_ids.findIndex(nn => nn == sub.account_id)
681
+                  if (ids_nn == -1) {
682
+                    all_ac_ids.push(sub.account_id)
683
+                  }
684
+                })
685
+                arr._object[arr._key].forEach(a => {
686
+                  let idx: number = all_ac_ids.findIndex(n => n == a.id)
687
+                  if (idx == -1) {
688
+                    new_ac_ids.push(a)
689
+                  }
690
+                })
691
+                return new_ac_ids
692
+              }
693
+              const get_new_target_ids = () => {
694
+                let new_target_ids: any = []
695
+                pageInfo.creativeTeamList.forEach(item => {
696
+                  item.list.forEach(sub => {
697
+                    let ids_nn: number = new_target_ids.findIndex(nn => nn == sub.itemId)
698
+                    if (ids_nn == -1) {
699
+                      new_target_ids.push(sub.itemId)
700
+                    }
701
+                  })
702
+                })
703
+                console.log(new_target_ids, 'new_target_ids');
704
+                return new_target_ids
705
+              }
709 706
 
710 707
 
711
-const creatice_reuseEvent = async () => {
712
-  requestObj.upload_flag = false
713
-  clearTimeout(requestObj.timer_get_upload_res)
714
-  let acArr:any = await get_new_ac_ids()
715
-  let targetArr:any = await get_new_target_ids()
716
-  if(targetArr&&targetArr.length==0){
717
-    emit('closeLoading')
718
-    return
719
-  }
720
-  if(acArr&&acArr.length==0){
721
-    emit('closeLoading')
722
-    return
723
-  }
724
-  await get_up_record_id(targetArr,acArr)
725
-  await get_upload_res()
726
-}
708
+
709
+              const creatice_reuseEvent = async () => {
710
+                requestObj.upload_flag = false
711
+                clearTimeout(requestObj.timer_get_upload_res)
712
+                let acArr: any = await get_new_ac_ids()
713
+                let targetArr: any = await get_new_target_ids()
714
+                if (targetArr && targetArr.length == 0) {
715
+                  emit('closeLoading')
716
+                  return
717
+                }
718
+                if (acArr && acArr.length == 0) {
719
+                  emit('closeLoading')
720
+                  return
721
+                }
722
+                await get_up_record_id(targetArr, acArr)
723
+                await get_upload_res()
724
+              }
727 725
 //上传素材成功后 走的代码
728
-const successEvent = (resResult:any) => {
729
-  pageInfo.resResult = _.cloneDeep(resResult)
730
-  pageInfo.creativeTeamList.forEach(item=>{
731
-    item.resResult = item.resResult.concat(resResult_to_creativeTeamList(item.itemId))
732
-  })
733
-  emit('assignEvent',pageInfo.creativeTeamList)
734
-}
726
+              const successEvent = (resResult: any) => {
727
+                pageInfo.resResult = _.cloneDeep(resResult)
728
+                pageInfo.creativeTeamList.forEach(item => {
729
+                  item.list.forEach(sub => {
730
+                    sub.resResult = sub.resResult.concat(resResult_to_creativeTeamList(sub.itemId))
731
+                  })
732
+                })
733
+                emit('assignEvent', pageInfo.creativeTeamList)
734
+              }
735 735
 
736
-const {get_up_record_id,get_upload_res,requestObj} =
737
-    uploadAddGetResTs(coverRadioList.radioVal == 'On' ? 1 : 0,successEvent)
736
+              const {get_up_record_id, get_upload_res, requestObj} =
737
+                  uploadAddGetResTs(coverRadioList.radioVal == 'On' ? 1 : 0, successEvent)
738 738
 
739 739
 
740 740
 // 父组件共享值
741
-defineExpose({
742
-  switchShow,
743
-  clearAllEvent,
744
-  creatice_reuseEvent,
745
-  deleAcEvent
746
-});
741
+              defineExpose({
742
+                             switchShow,
743
+                             clearAllEvent,
744
+                             creatice_reuseEvent,
745
+                             deleAcEvent
746
+                           });
747
+
747 748
 
748 749
 </script>
749 750
 <style lang="scss" scoped>

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

@@ -91,14 +91,16 @@ export function uploadAddGetResTs(generateCoverParams?:number,successEvent?:any)
91 91
                         clearTimeout(requestObj.timer_get_upload_res)
92 92
                     }
93 93
                 }else{ //成功获取到数据
94
-                    fullLoading.value = false
95
-                    requestObj.upload_flag = false
96 94
                     if(resNew?.result?.length>0){
97 95
                         await successEvent(resNew.result)
98 96
                         dialogShow.value = false
97
+                        fullLoading.value = false
98
+                        requestObj.upload_flag = false
99 99
                     }else{
100 100
                         console.log(resNew?.err_msg,'err_msg');
101 101
                         ElMessage.error(resNew?.err_msg)
102
+                        fullLoading.value = false
103
+                        requestObj.upload_flag = false
102 104
                     }
103 105
                 }
104 106
             }

+ 2 - 19
src/components/businessMoudle/gdtList/advert.vue

@@ -27,7 +27,7 @@
27 27
                   :disabledFlag="tableInfo.multipleSelection&&tableInfo.multipleSelection.length == 0"></Dropdown>
28 28
         <div>已选 : <span>{{tableInfo.multipleSelection&&tableInfo.multipleSelection.length}}</span></div>
29 29
         <div  class="lMarauto">
30
-          <Indicators type="campaign_base" @refresh="init"></Indicators>
30
+          <Indicators type="ad_base" @refresh="init"></Indicators>
31 31
         </div>
32 32
       </div>
33 33
 
@@ -105,12 +105,11 @@
105 105
                           <span class="c-theme pointer lMar10" @click="goDetial(scope.row)">详情</span>
106 106
                         </div>
107 107
                       </div>
108
-                      <div class="flex c-theme pointer" v-else-if="item.key_value == 'daily_budget'" @click="editPlanEvent(scope.row)">
108
+                      <div class="flex c-theme" v-else-if="item.key_value == 'daily_budget'">
109 109
                         {{scope.row[item.key_value] ? NumberHandle(scope.row[item.key_value]) : '不限'}}
110 110
                       </div>
111 111
                       <div class="flex c-theme pointer" v-else-if="item.key_value == 'site_set'">
112 112
                         {{scope.row[item.key_value]}}
113
-                        <!--                  {{siteIdtoText(scope.row[item.key_value])}}-->
114 113
                       </div>
115 114
 
116 115
 
@@ -142,8 +141,6 @@
142 141
       </template>
143 142
     </div>
144 143
 
145
-    <EditIpt ref="planEditIptRef" title="推广计划" @confirm="planEditConfirm"></EditIpt>
146
-    <TargetEdit ref="TargetEditRef" title="计划设置" @confirm="init"></TargetEdit>
147 144
     <Detial ref="detialRef" @confirm="init"></Detial>
148 145
 
149 146
     <EditPutTime ref="EditPutTimeRef" title="批量修改投放时间" @confirm = "batchEventApi"></EditPutTime>
@@ -161,7 +158,6 @@ import Select from '@/components/capsulationMoudle/_select.vue'
161 158
 import TimeScreen from '@/components/capsulationMoudle/timeScreen.vue'
162 159
 import Input from '@/components/capsulationMoudle/_input.vue'
163 160
 import EditIpt from '@/components/businessMoudle/gdtList/dialog/editIpt.vue'
164
-import TargetEdit from '@/components/businessMoudle/gdtList/dialog/target.vue'
165 161
 import EditPutTime from '@/components/businessMoudle/gdtList/advertBatch/editPutTime.vue'
166 162
 import OneClickMeasure from '@/components/businessMoudle/gdtList/advertBatch/oneClickMeasure.vue'
167 163
 import BatchEditDayBudget from '@/components/businessMoudle/gdtList/advertBatch/batchEditDayBudget.vue'
@@ -319,16 +315,6 @@ const goDetial = (row:any) => {
319 315
   detialRef.value!.switchShow(true,row)
320 316
 }
321 317
 
322
-const {siteIdtoText,get_siteSet_list} = commonlistTs()
323
-
324
-
325
-
326
-//修改计划
327
-const editPlanEvent = (row:any) => {
328
-  nextTick(()=>{
329
-    TargetEditRef.value!.switchShow(true,row)
330
-  })
331
-}
332 318
 //修改计划名称
333 319
 //推广计划 - 确定
334 320
 const planEditConfirm = () => {
@@ -459,8 +445,6 @@ const {
459 445
   InputRef_text,
460 446
   clearEvent,
461 447
   tableHeaderStyle,
462
-  planEditIptRef,
463
-  TargetEditRef,
464 448
   init_ad_statusList
465 449
 } = listTs()
466 450
 
@@ -468,7 +452,6 @@ const {
468 452
 const initAll = () => {
469 453
   nextTick(async ()=>{
470 454
     await init_acList()
471
-    // await get_siteSet_list()
472 455
     await init()
473 456
     init_ad_statusList()
474 457
   })

+ 4 - 4
src/components/businessMoudle/gdtList/detial/basicInfo.vue

@@ -187,15 +187,15 @@ const init = async () => {
187 187
             }else{
188 188
               sub.value = '长期投放(开始日期:'  + pageInfo.infoRst.begin_date + ')'
189 189
             }
190
-          }else if(sub.key == 'site_set'){
191
-            // sub.value = siteIdtoText(val)
192
-            sub.value = ''
193 190
           }else{
194 191
             sub.value = val
195 192
           }
196 193
         })
197 194
       })
198
-
195
+    // else if(sub.key == 'site_set'){
196
+    //     // sub.value = siteIdtoText(val)
197
+    //     sub.value = ''
198
+    //   }
199 199
     })
200 200
   }else{
201 201
     ElMessage.error(res.errMsg)

+ 5 - 2
src/components/businessMoudle/gdtList/detial/creativeInfo.vue

@@ -8,9 +8,12 @@
8 8
           <div class="flex">
9 9
             <span class="smallTitle">{{sub.title}}</span>
10 10
             <div v-if="item.title == '创意素材'">
11
-              <template v-if="sub.value.video_url || sub.value.image_url">
12
-                <video :src="sub.value.video_url" v-if="sub.value.video_url" style="width: 176px" class="rMar10"></video>
11
+              <template v-if="sub.value.video_url || sub.value.image_url || sub.value?.image_url_list?.length>0">
12
+                <video :src="sub.value.video_url" controls v-if="sub.value.video_url" style="width: 176px" class="rMar10"></video>
13 13
                 <img :src="sub.value.image_url" alt="" v-if="sub.value.image_url" style="width: 176px" class="rMar10"/>
14
+                <template v-if="sub.value?.image_url_list?.length>0">
15
+                  <img  v-for="im in sub.value.image_url_list" :src="im" alt="" style="width: 176px" class="rMar10"/>
16
+                </template>
14 17
               </template>
15 18
               <template v-else>-</template>
16 19
             </div>

+ 1 - 1
src/components/businessMoudle/gdtList/detial/index.vue

@@ -102,7 +102,7 @@ const switchShow = (val:boolean,row:any)=>{
102 102
     typeAc.value = 'basicInfo'
103 103
     pageInfo.info = row
104 104
     nextTick(async ()=>{
105
-      await get_siteSet_list()
105
+      // await get_siteSet_list()
106 106
        get_behavior_list()
107 107
        get_user_os_list()
108 108
        get_location_list()

+ 4 - 2
src/components/businessMoudle/gdtList/dialog/target.vue

@@ -28,7 +28,7 @@
28 28
                     :echoVal="putOn_way_List.radioVal"
29 29
                     :title="putOn_way_List.name"
30 30
                     @returnEvent="val=>{putOn_way_List.radioVal = val}"></RadioGroup>
31
-        <Input ref="nameRef" title="推广计划名称" spanTitleWidth="112px" :placeholderTxt="title" maxLength="40"/>
31
+        <Input ref="nameRef" title="推广计划名称" spanTitleWidth="120px" spanFS="14px" :placeholderTxt="title" maxLength="40"/>
32 32
       </div>
33 33
     </template>
34 34
   </Dialog>
@@ -136,5 +136,7 @@ defineExpose({
136 136
 
137 137
 </script>
138 138
 <style lang="scss" scoped>
139
-
139
+.spanTitle{
140
+  font-size: 14px!important;
141
+}
140 142
 </style>

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

@@ -1,7 +1,7 @@
1 1
 <template>
2 2
   <div class="flex" :class="haverMar15 ? 'rMar15' : ''">
3 3
     <span class="spanTitle" v-if="showTitle"
4
-          :style="{width:spanTitleWidth?spanTitleWidth:'auto'}"><span v-if="haveTag" class="tag">*</span>{{title}}</span>
4
+          :style="{width:spanTitleWidth?spanTitleWidth:'auto',fontSize:spanFS ? spanFS : ''}"><span v-if="haveTag" class="tag">*</span>{{title}}</span>
5 5
     <el-input v-model="value"
6 6
               :style="{width:inputWidth}"
7 7
               :disabled="disabledFlag"
@@ -33,6 +33,7 @@ defineExpose({
33 33
 const props = withDefaults(defineProps<{
34 34
   showTitle?: boolean,
35 35
   haveTag?: boolean,
36
+  spanFS?: string,
36 37
   spanTitleWidth?: string,
37 38
   inputWidth?: string,
38 39
   title?: string,
@@ -44,6 +45,7 @@ const props = withDefaults(defineProps<{
44 45
   placeholderTxt?:string
45 46
   maxLength?:string
46 47
 }>(),{
48
+  spanFS: '',
47 49
   spanTitleWidth: '',
48 50
   inputWidth: '100%',
49 51
   title: '',