Browse Source

外部配置

xiuli.gao 1 year ago
parent
commit
49bfe95ff0

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

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

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

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

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

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
   <el-dialog class="gdt-dialog" v-model="dialogVisible" title="广告基本信息" width="1080px" top="40px"
2
   <el-dialog class="gdt-dialog" v-model="dialogVisible" title="广告基本信息" width="1080px" top="40px"
3
     :before-close="handleClose">
3
     :before-close="handleClose">
4
     <div class="container">
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
         <div class="form-block-title">{{ main_index }}</div>
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
           <MyRadio :info="it_info" @change="radioChange" v-if="it_info.type == 'radio'"
9
           <MyRadio :info="it_info" @change="radioChange" v-if="it_info.type == 'radio'"
10
             :fillBack="props.dataFillBack[it_info.key]">
10
             :fillBack="props.dataFillBack[it_info.key]">
52
           <!-- 特定版位 -->
52
           <!-- 特定版位 -->
53
           <AdPosition v-if="it_info.key == 'automatic_site' && form['automatic_site'] == 2" @change="onChangeAdPosition"
53
           <AdPosition v-if="it_info.key == 'automatic_site' && form['automatic_site'] == 2" @change="onChangeAdPosition"
54
             :fillBack="props.dataFillBack['site_ids']"></AdPosition>
54
             :fillBack="props.dataFillBack['site_ids']"></AdPosition>
55
-        </div>
56
-      </div>
55
+        </template>
56
+      </template>
57
 
57
 
58
       <!-- S 排期与出价 -->
58
       <!-- S 排期与出价 -->
59
       <div class="form-block-title">排期与出价</div>
59
       <div class="form-block-title">排期与出价</div>
340
 const site_ids_arr_2: any = ref([])
340
 const site_ids_arr_2: any = ref([])
341
 const scheduleBidInfo = reactive(scheduleBid)
341
 const scheduleBidInfo = reactive(scheduleBid)
342
 const specificPositionInfo2 = specificPositionAll()
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
 const deep_conversion_behavior_spec: any = reactive({ // 深度目标优化 - 优化转化行为
345
 const deep_conversion_behavior_spec: any = reactive({ // 深度目标优化 - 优化转化行为
347
   target: '',
346
   target: '',
348
   rate: '',
347
   rate: '',
454
         adPresetsSet(data.params).then((res) => {
453
         adPresetsSet(data.params).then((res) => {
455
           loading.value = false;
454
           loading.value = false;
456
           localStorage.setItem('BasicInfo', data.params)
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
       } else { // 本地存储更新
458
       } else { // 本地存储更新
460
         localStorage.setItem('BasicInfo', data.params)
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
   let cj: any = {}
633
   let cj: any = {}
635
   if (site_value == 1) {// 自动版位
634
   if (site_value == 1) {// 自动版位
636
     let idx_arr = positionMapping.automatic_site_1
635
     let idx_arr = positionMapping.automatic_site_1
636
+    console.log(idx_arr)
637
     idx_arr.forEach((item) => {
637
     idx_arr.forEach((item) => {
638
       cj[item] = scene[item]
638
       cj[item] = scene[item]
639
     })
639
     })

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

76
 /**检验单个输入框 */
76
 /**检验单个输入框 */
77
 const inspectNumber = (info, label, min = 200, max = 10000000) => {
77
 const inspectNumber = (info, label, min = 200, max = 10000000) => {
78
   let arr = String(info).split('.')
78
   let arr = String(info).split('.')
79
+  console.log(label,arr,isNaN(Number(info)))
79
   if (isNaN(Number(info)) || (arr.length > 1 && arr[1].length > 2)) {
80
   if (isNaN(Number(info)) || (arr.length > 1 && arr[1].length > 2)) {
80
     ElMessage.error(`${label}请填写数字,最多支持小数点后2位`)
81
     ElMessage.error(`${label}请填写数字,最多支持小数点后2位`)
81
     return false
82
     return false
230
       if (obj && obj != '') {
231
       if (obj && obj != '') {
231
         let objInfo = JSON.parse(obj)
232
         let objInfo = JSON.parse(obj)
232
         if (params.bid_way == '1') {
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
         if (params.bid_way != '1') {
236
         if (params.bid_way != '1') {
236
           if (!inspectMaxMin(`${objInfo.min}-${objInfo.max}`, `${name}范围`)) return
237
           if (!inspectMaxMin(`${objInfo.min}-${objInfo.max}`, `${name}范围`)) return

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

55
       </div>
55
       </div>
56
 
56
 
57
       <div class="btnArea">
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
         <span class="lMarauto">
66
         <span class="lMarauto">
59
           <el-button type="primary">批量预览广告</el-button>
67
           <el-button type="primary">批量预览广告</el-button>
60
           <el-button type="primary" class="lMar10">保存策略组</el-button>
68
           <el-button type="primary" class="lMar10">保存策略组</el-button>
66
   <!--规则配置-->
74
   <!--规则配置-->
67
   <RuleConfig ref="RuleConfigRef"></RuleConfig>
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
 </template>
81
 </template>
73
 <script setup lang="ts">
82
 <script setup lang="ts">
74
 import {getCurrentInstance, nextTick, onMounted, reactive, ref, provide, computed,toRef} from "vue";
83
 import {getCurrentInstance, nextTick, onMounted, reactive, ref, provide, computed,toRef} from "vue";
76
 import Select from '@/components/capsulationMoudle/_select.vue'
85
 import Select from '@/components/capsulationMoudle/_select.vue'
77
 import DirectPacketExhibition from '@/components/businessMoudle/batchGdt/configArea/directPacket/echoIndex.vue'
86
 import DirectPacketExhibition from '@/components/businessMoudle/batchGdt/configArea/directPacket/echoIndex.vue'
78
 import RuleConfig from '@/components/businessMoudle/batchGdt/configArea/ruleConfig/index.vue'
87
 import RuleConfig from '@/components/businessMoudle/batchGdt/configArea/ruleConfig/index.vue'
79
-import basicInfo from "./basicInfo/index.vue";
80
 import {Api} from "@/api/api";
88
 import {Api} from "@/api/api";
81
 import {ElMessage} from "element-plus";
89
 import {ElMessage} from "element-plus";
82
 import {deepCopy} from "@/common/common";
90
 import {deepCopy} from "@/common/common";
83
 import BasicInfo from "./basicInfo/index.vue";
91
 import BasicInfo from "./basicInfo/index.vue";
92
+import ExpandPopulation from './basicInfo/expandPopulation.vue'
84
 import { getAdPresets } from './basicInfo/ts/basicApi'
93
 import { getAdPresets } from './basicInfo/ts/basicApi'
85
 import { FillBackData } from './basicInfo/ts/fillBack'
94
 import { FillBackData } from './basicInfo/ts/fillBack'
86
 
95
 
110
 })
119
 })
111
 
120
 
112
 
121
 
113
-
114
 //获取账号列表
122
 //获取账号列表
115
 const get_account_list = async () => {
123
 const get_account_list = async () => {
116
   const paramsModel = reactive<adqParam>({
124
   const paramsModel = reactive<adqParam>({
136
   })
144
   })
137
 }
145
 }
138
 
146
 
139
-//打开广告基本信息
147
+//广告基本信息
140
 const basicInfoData = reactive({
148
 const basicInfoData = reactive({
141
   visible:false,
149
   visible:false,
142
   copywriting:[],
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
 const basicInfoClose = (obj) => {
225
 const basicInfoClose = (obj) => {
209
   if(obj?.type=='update'){
226
   if(obj?.type=='update'){
210
     basicInfoData.copywriting = obj.copywriting
227
     basicInfoData.copywriting = obj.copywriting
211
-    console.log(obj.copywriting)
228
+    console.log(obj)
229
+    getButtonBasicOuter(obj.params)
212
   }
230
   }
213
   basicInfoData.visible = false
231
   basicInfoData.visible = false
214
 }
232
 }
215
 /**广告预存信息获取 */
233
 /**广告预存信息获取 */
216
 const getAdPresetsInfo = () => {
234
 const getAdPresetsInfo = () => {
217
   getAdPresets({'promoted_object_type': 'PROMOTED_OBJECT_TYPE_LEAD_AD'}).then((res)=>{
235
   getAdPresets({'promoted_object_type': 'PROMOTED_OBJECT_TYPE_LEAD_AD'}).then((res)=>{
236
+    getButtonBasicOuter(res)
218
     FillBackData({data: res, type: 'api', cb: (data: {params: any,copywriting: []}) => {
237
     FillBackData({data: res, type: 'api', cb: (data: {params: any,copywriting: []}) => {
219
       if (data.copywriting && Array.isArray(data.copywriting) && data.copywriting.length > 0) {
238
       if (data.copywriting && Array.isArray(data.copywriting) && data.copywriting.length > 0) {
220
         basicInfoData.copywriting = data.copywriting
239
         basicInfoData.copywriting = data.copywriting
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
 .c-515a6e{
338
 .c-515a6e{
315
   color: #515a6e;
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
 </style>
360
 </style>