xiuli.gao 1 rok temu
rodzic
commit
49bfe95ff0

+ 1 - 0
src/assets/style/element/index.scss

@@ -31,6 +31,7 @@
31 31
     border-bottom: 1px solid #e8eaec;
32 32
     padding: 20px;
33 33
     margin-right: 0;
34
+    margin-left: 0;
34 35
     .el-dialog__title{
35 36
       font-size: 16px;
36 37
       font-weight: bold;

+ 0 - 2
src/components/businessMoudle/batchGdt/configArea/basicInfo/components/radio.vue

@@ -1,5 +1,4 @@
1 1
 <template>
2
-<div>
3 2
   <div class="flex-baseline marB15">
4 3
     <div class="form-block-item-title">{{ title && title!='' ? title : info.name }}</div>
5 4
     <div style="flex:1">
@@ -40,7 +39,6 @@
40 39
     </div>
41 40
   </div>
42 41
   <slot></slot>
43
-</div>
44 42
 </template>
45 43
 <script setup lang="ts">
46 44
 /**

+ 36 - 0
src/components/businessMoudle/batchGdt/configArea/basicInfo/expandPopulation.vue

@@ -0,0 +1,36 @@
1
+<template>
2
+  <el-dialog class="gdt-dialog" v-model="dialogVisible" title="扩量种子人群(选填)" width="1080px" top="40px"
3
+    :before-close="handleClose">
4
+    <div class="container">
5
+      jkkkk
6
+    </div>
7
+    <template #footer>
8
+    <div class="dialog-footer flex-center">
9
+        <el-button type="primary"> 确 定 </el-button>
10
+    </div>
11
+  </template>
12
+</el-dialog>
13
+</template>
14
+<script setup lang="ts">
15
+import { ref } from 'vue';
16
+
17
+const props = defineProps({
18
+  visible: {
19
+    type: Boolean,
20
+    default: false
21
+  },
22
+  dataFillBack: {
23
+    type: Object,
24
+    default: () => { }
25
+  }
26
+})
27
+const emit = defineEmits<{
28
+  (event: "close", val?: any): void;
29
+}>();
30
+
31
+const dialogVisible = ref(props.visible)
32
+
33
+const handleClose = () => {
34
+
35
+}
36
+</script>

+ 9 - 9
src/components/businessMoudle/batchGdt/configArea/basicInfo/index.vue

@@ -2,9 +2,9 @@
2 2
   <el-dialog class="gdt-dialog" v-model="dialogVisible" title="广告基本信息" width="1080px" top="40px"
3 3
     :before-close="handleClose">
4 4
     <div class="container">
5
-      <div v-for="(item, main_index) in basicInfoJsonInfo" :key="main_index + 'basicInfoJsonInfo'">
5
+      <template v-for="(item, main_index) in basicInfoJsonInfo" :key="main_index + 'basicInfoJsonInfo'">
6 6
         <div class="form-block-title">{{ main_index }}</div>
7
-        <div v-for="(it_info, it_info_index) in item" :key="it_info_index + 'basicInfoJsonInfoItem'">
7
+        <template v-for="(it_info, it_info_index) in item" :key="it_info_index + 'basicInfoJsonInfoItem'">
8 8
           <!-- 单选框 -->
9 9
           <MyRadio :info="it_info" @change="radioChange" v-if="it_info.type == 'radio'"
10 10
             :fillBack="props.dataFillBack[it_info.key]">
@@ -52,8 +52,8 @@
52 52
           <!-- 特定版位 -->
53 53
           <AdPosition v-if="it_info.key == 'automatic_site' && form['automatic_site'] == 2" @change="onChangeAdPosition"
54 54
             :fillBack="props.dataFillBack['site_ids']"></AdPosition>
55
-        </div>
56
-      </div>
55
+        </template>
56
+      </template>
57 57
 
58 58
       <!-- S 排期与出价 -->
59 59
       <div class="form-block-title">排期与出价</div>
@@ -340,9 +340,8 @@ const site_ids_arr_1: any = ref([])
340 340
 const site_ids_arr_2: any = ref([])
341 341
 const scheduleBidInfo = reactive(scheduleBid)
342 342
 const specificPositionInfo2 = specificPositionAll()
343
-// const defaultAdPositionList = ['SITE_SET_KANDIAN', 'SITE_SET_QQ_MUSIC_GAME', 'SITE_SET_TENCENT_NEWS', 'SITE_SET_TENCENT_VIDEO', 'SITE_SET_MOBILE_UNION']
344
-const defaultAdPositionList = []
345
-let adPositionList: any = ref(JSON.parse(JSON.stringify(defaultAdPositionList)));// 广告版位默认列表
343
+const defaultAdPositionList = ['SITE_SET_KANDIAN', 'SITE_SET_QQ_MUSIC_GAME', 'SITE_SET_TENCENT_NEWS', 'SITE_SET_TENCENT_VIDEO', 'SITE_SET_MOBILE_UNION']
344
+let adPositionList: any = ref([]);// 广告版位默认列表
346 345
 const deep_conversion_behavior_spec: any = reactive({ // 深度目标优化 - 优化转化行为
347 346
   target: '',
348 347
   rate: '',
@@ -454,11 +453,11 @@ const submitEvent = () => {
454 453
         adPresetsSet(data.params).then((res) => {
455 454
           loading.value = false;
456 455
           localStorage.setItem('BasicInfo', data.params)
457
-          emit('close', { type: 'update', copywriting: data.copywriting })
456
+          emit('close', { type: 'update', copywriting: data.copywriting, params: data.params })
458 457
         })
459 458
       } else { // 本地存储更新
460 459
         localStorage.setItem('BasicInfo', data.params)
461
-        emit('close', { type: 'update', copywriting: data.copywriting })
460
+        emit('close', { type: 'update', copywriting: data.copywriting, params: data.params })
462 461
       }
463 462
     }
464 463
   })
@@ -634,6 +633,7 @@ const watchSiteIds = () => {
634 633
   let cj: any = {}
635 634
   if (site_value == 1) {// 自动版位
636 635
     let idx_arr = positionMapping.automatic_site_1
636
+    console.log(idx_arr)
637 637
     idx_arr.forEach((item) => {
638 638
       cj[item] = scene[item]
639 639
     })

+ 2 - 1
src/components/businessMoudle/batchGdt/configArea/basicInfo/ts/fillBack.ts

@@ -76,6 +76,7 @@ const inspectMaxMin = (info, label) => {
76 76
 /**检验单个输入框 */
77 77
 const inspectNumber = (info, label, min = 200, max = 10000000) => {
78 78
   let arr = String(info).split('.')
79
+  console.log(label,arr,isNaN(Number(info)))
79 80
   if (isNaN(Number(info)) || (arr.length > 1 && arr[1].length > 2)) {
80 81
     ElMessage.error(`${label}请填写数字,最多支持小数点后2位`)
81 82
     return false
@@ -230,7 +231,7 @@ export const FillBackData = ({ data, type, updateScene = {}, cb }: IFillBackData
230 231
       if (obj && obj != '') {
231 232
         let objInfo = JSON.parse(obj)
232 233
         if (params.bid_way == '1') {
233
-          if (!inspectNumber(objInfo.price, name, 0.01, 20000000)) return
234
+          if (!inspectNumber(params.deep_conversion_type == 'DEEP_CONVERSION_BEHAVIOR' ? objInfo.price : objInfo.roi, name, 0.01, 20000000)) return
234 235
         }
235 236
         if (params.bid_way != '1') {
236 237
           if (!inspectMaxMin(`${objInfo.min}-${objInfo.max}`, `${name}范围`)) return

+ 52 - 9
src/components/businessMoudle/batchGdt/configArea/index.vue

@@ -55,6 +55,14 @@
55 55
       </div>
56 56
 
57 57
       <div class="btnArea">
58
+        <span class="">
59
+          <template v-for="item in basicInfoData.outerConfig">
60
+            <el-button plain class="rMar10 outerButton" v-if="item.enabled">
61
+              <el-icon :class="['outerIcon', !item.value || item.value == '' || 'outerIconActive']"><CircleCheck v-if="!item.value || item.value == ''" /><SuccessFilled v-else/></el-icon>
62
+              {{item.name}}
63
+            </el-button>
64
+          </template>
65
+        </span>
58 66
         <span class="lMarauto">
59 67
           <el-button type="primary">批量预览广告</el-button>
60 68
           <el-button type="primary" class="lMar10">保存策略组</el-button>
@@ -66,9 +74,10 @@
66 74
   <!--规则配置-->
67 75
   <RuleConfig ref="RuleConfigRef"></RuleConfig>
68 76
 
69
-<!-- 广告基本信息 -->
70
-<BasicInfo :visible="basicInfoData.visible" :dataFillBack="basicInfoData.fillBack" @close="basicInfoClose"></BasicInfo>
71
-
77
+  <!-- 广告基本信息 -->
78
+  <BasicInfo :visible="basicInfoData.visible" :dataFillBack="basicInfoData.fillBack" @close="basicInfoClose"></BasicInfo>
79
+  <!-- 扩量种子人群 -->
80
+  <ExpandPopulation :visible="basicInfoData.outerConfig.expandPopulation.visible"></ExpandPopulation>
72 81
 </template>
73 82
 <script setup lang="ts">
74 83
 import {getCurrentInstance, nextTick, onMounted, reactive, ref, provide, computed,toRef} from "vue";
@@ -76,11 +85,11 @@ import {adqParam, reactiveTableAndAny} from "@/api/ApiModel";
76 85
 import Select from '@/components/capsulationMoudle/_select.vue'
77 86
 import DirectPacketExhibition from '@/components/businessMoudle/batchGdt/configArea/directPacket/echoIndex.vue'
78 87
 import RuleConfig from '@/components/businessMoudle/batchGdt/configArea/ruleConfig/index.vue'
79
-import basicInfo from "./basicInfo/index.vue";
80 88
 import {Api} from "@/api/api";
81 89
 import {ElMessage} from "element-plus";
82 90
 import {deepCopy} from "@/common/common";
83 91
 import BasicInfo from "./basicInfo/index.vue";
92
+import ExpandPopulation from './basicInfo/expandPopulation.vue'
84 93
 import { getAdPresets } from './basicInfo/ts/basicApi'
85 94
 import { FillBackData } from './basicInfo/ts/fillBack'
86 95
 
@@ -110,7 +119,6 @@ const pageInfo = reactive<reactiveTableAndAny>({
110 119
 })
111 120
 
112 121
 
113
-
114 122
 //获取账号列表
115 123
 const get_account_list = async () => {
116 124
   const paramsModel = reactive<adqParam>({
@@ -136,11 +144,20 @@ const accEvent = () => {
136 144
   })
137 145
 }
138 146
 
139
-//打开广告基本信息
147
+//广告基本信息
140 148
 const basicInfoData = reactive({
141 149
   visible:false,
142 150
   copywriting:[],
143
-  fillBack: {}
151
+  fillBack: {},
152
+  outerConfig: { //外层配置
153
+    expandPopulation: {
154
+      enabled: false, //是否需要配置
155
+      visible:false,
156
+      name: '扩量种子人群(选填)',
157
+      value: '',
158
+    }
159
+
160
+  }
144 161
 })
145 162
 
146 163
 //打开规则配置
@@ -208,13 +225,15 @@ onMounted(()=>{
208 225
 const basicInfoClose = (obj) => {
209 226
   if(obj?.type=='update'){
210 227
     basicInfoData.copywriting = obj.copywriting
211
-    console.log(obj.copywriting)
228
+    console.log(obj)
229
+    getButtonBasicOuter(obj.params)
212 230
   }
213 231
   basicInfoData.visible = false
214 232
 }
215 233
 /**广告预存信息获取 */
216 234
 const getAdPresetsInfo = () => {
217 235
   getAdPresets({'promoted_object_type': 'PROMOTED_OBJECT_TYPE_LEAD_AD'}).then((res)=>{
236
+    getButtonBasicOuter(res)
218 237
     FillBackData({data: res, type: 'api', cb: (data: {params: any,copywriting: []}) => {
219 238
       if (data.copywriting && Array.isArray(data.copywriting) && data.copywriting.length > 0) {
220 239
         basicInfoData.copywriting = data.copywriting
@@ -224,7 +243,12 @@ const getAdPresetsInfo = () => {
224 243
     }})
225 244
   })
226 245
 }
227
-
246
+/**广告信息外部配置获取 */
247
+const getButtonBasicOuter = (res) => {
248
+  if(res?.expand_enabled == 1) { // 扩量种子人群
249
+    basicInfoData.outerConfig.expandPopulation.enabled = true;
250
+  }
251
+}
228 252
 
229 253
 
230 254
 //传值
@@ -314,4 +338,23 @@ provide('accountIds',toRef(pageInfo,'accIdsList'))
314 338
 .c-515a6e{
315 339
   color: #515a6e;
316 340
 }
341
+.outerButton{
342
+  &:hover{
343
+    .outerIcon{
344
+      color: #3173FF
345
+    }
346
+    .outerIconActive{
347
+      color: #00b697;
348
+    }
349
+  }
350
+  
351
+}
352
+.outerIcon{
353
+  color: #888;
354
+  margin: 0 10px;
355
+  font-size: 16px;
356
+}
357
+.outerIconActive{
358
+  color: #00b697;
359
+}
317 360
 </style>