|
@@ -0,0 +1,630 @@
|
|
1
|
+<template>
|
|
2
|
+ <div class="areaBox" :key="`previewAreaTable_${updateKey}`">
|
|
3
|
+ <div class="empty-block"
|
|
4
|
+ v-if="!infoObj || !infoObj.campaign_list || !pageInfo.campaign_list || pageInfo.campaign_list.length == 0">
|
|
5
|
+ <h3 class="empty-title">预览区</h3>
|
|
6
|
+ <img src="@/assets/img/mobgi_ic_addata_nodata.png">
|
|
7
|
+ <p class="empty-description">请先完成相应模块配置后,再预览内容</p>
|
|
8
|
+ </div>
|
|
9
|
+ <div v-else>
|
|
10
|
+ <div class="areaTitle flex">
|
|
11
|
+ 预览区
|
|
12
|
+ <div class="lMarauto flex f14" style="font-weight: initial">
|
|
13
|
+ <span>推广计划总数 : {{ pageInfo.num_total?.planNum }}</span>
|
|
14
|
+ <span class="lMar8">广告总数 : {{ pageInfo.num_total?.adNum }}</span>
|
|
15
|
+ <el-button type="primary" class="lMar20" @click="auditSubmitBtn"
|
|
16
|
+ v-loading.fullscreen.lock="submitLoading">全部提交审核</el-button>
|
|
17
|
+ </div>
|
|
18
|
+ </div>
|
|
19
|
+ <div class="areaCon">
|
|
20
|
+ <div class="flex">
|
|
21
|
+ <div class="accItem" v-for="item in pageInfo.accList" :key="item.id"
|
|
22
|
+ :class="pageInfo.accId == item.id ? 'active' : ''" @click="accItemEvent(item.id)">{{ item.name }}</div>
|
|
23
|
+ </div>
|
|
24
|
+ <div class=" flex chooseBox">
|
|
25
|
+ <!-- <div>已选 : <span>{{pageInfo.chooseList&&pageInfo.chooseList.length}}</span></div> -->
|
|
26
|
+ <div class="lMarauto flex">
|
|
27
|
+ <span>推广计划数量 : {{ pageInfo.accPlanAd.planNum }}</span>
|
|
28
|
+ <span class="lMar8">广告数量 : {{ pageInfo.accPlanAd.adNum }}</span>
|
|
29
|
+ <!-- <Dropdown title="批量操作" lMar="10px" :list="pageInfo.moreList" @close="dropdownEvent" :disabledFlag="pageInfo.chooseList&&pageInfo.chooseList.length == 0"></Dropdown>-->
|
|
30
|
+ </div>
|
|
31
|
+ </div>
|
|
32
|
+ <!-- <el-table :data="pageInfo.tableList" :header-cell-style="tableHeaderStyle"
|
|
33
|
+ style="width: 100%;" border empty-text="暂无数据" :row-key="rowKeyStr" @selection-change="selectionChangeEvent"
|
|
34
|
+ :span-method="objectSpanMethod" max-height="calc(100vh - 240px)">
|
|
35
|
+ <template v-for="bigItem in pageInfo.descol">
|
|
36
|
+ <el-table-column :label="bigItem.name">
|
|
37
|
+ <template v-for="item in bigItem.list">
|
|
38
|
+ <el-table-column v-if="item.column!='promoted_object_name' || (item.column=='promoted_object_name' && pageInfo.basicInfoData?.outerConfig?.weChatVideoAccount?.isComplete)" :fixed="item.isfixed" :min-width="item.minWidth ? item.minWidth : '130px'">
|
|
39
|
+ <template #header>
|
|
40
|
+ <div class="flex" :style="{ justifyContent: item.alignSelf ? item.alignSelf : 'left' }">
|
|
41
|
+ {{ item.name }}
|
|
42
|
+ <el-tooltip v-if="item.notes" effect="dark" :content="item.notes"><i-ep-QuestionFilled
|
|
43
|
+ class="lMar5 c-999 f14 pointer" /></el-tooltip>
|
|
44
|
+ </div>
|
|
45
|
+ </template>
|
|
46
|
+ <template #default="scope">
|
|
47
|
+ <div class="cellDiv" v-if="item.column == 'a1'">
|
|
48
|
+ <div class="clampOne tMar10 flex">名称:
|
|
49
|
+ <el-tooltip placement="top" :content="scope.row.main_info.campaign_name"
|
|
50
|
+ :disabled="scope.row.main_info.campaign_name ? false : true">
|
|
51
|
+ <div class="ellipsis">{{ scope.row.main_info.campaign_name || '-' }}</div>
|
|
52
|
+ </el-tooltip>
|
|
53
|
+ <el-icon color="#3173FF" class="pointer"
|
|
54
|
+ @click="openSubDialogEvent(scope.row, 'campaign_name')"><i-ep-Edit /></el-icon>
|
|
55
|
+ </div>
|
|
56
|
+ <div class="clampOne">推广目标: {{ pageInfo?.target?.desc || '-' }} </div>
|
|
57
|
+ <div class="clampOne flex">推广计划日预算:{{ scope.row.main_info.daily_budget == '' ||
|
|
58
|
+ scope.row.main_info.daily_budget <= 0 ? '不限' : scope.row.main_info.daily_budget + '元' }} <el-icon
|
|
59
|
+ color="#3173FF" class="pointer" @click="openSubDialogEvent(scope.row, 'PromotePlanBudget_day')">
|
|
60
|
+ <i-ep-Edit /></el-icon>
|
|
61
|
+ </div>
|
|
62
|
+ <div class="clampOne flex">推广计划总预算:{{ scope.row.main_info.total_budget == '' ||
|
|
63
|
+ scope.row.main_info.total_budget <= 0 ? '不限' : scope.row.main_info.total_budget }} <el-icon
|
|
64
|
+ color="#3173FF" class="pointer"
|
|
65
|
+ @click="openSubDialogEvent(scope.row, 'PromotePlanBudget_total')"><i-ep-Edit /></el-icon>
|
|
66
|
+ </div>
|
|
67
|
+ <div class="clampOne">投放方式:{{ scope.row.main_info.speed_mode == 'SPEED_MODE_FAST' ? '加速投放' :
|
|
68
|
+ scope.row.main_info.speed_mode == 'SPEED_MODE_STANDARD' ? '标准投放' : '-' }} </div>
|
|
69
|
+ </div>
|
|
70
|
+ <div class="cellDiv flex" v-else-if="item.column == 'ad_name'">
|
|
71
|
+ <el-tooltip placement="top" :content="scope.row.ad_name"
|
|
72
|
+ :disabled="scope.row.ad_name ? false : true">
|
|
73
|
+ <div class="ellipsis">{{ scope.row.ad_name || '-' }}</div>
|
|
74
|
+ </el-tooltip>
|
|
75
|
+ <el-icon color="#3173FF" class="pointer"
|
|
76
|
+ @click="openSubDialogEvent(scope.row, 'ad_name')"><i-ep-Edit /></el-icon>
|
|
77
|
+ </div>
|
|
78
|
+ <div class="cellDiv flex" v-else-if="item.column == 'bid_amount'">
|
|
79
|
+ <span>{{ scope.row.bid_amount || 0 }}元/{{ scope.row.optimization_goal_name || '千次曝光' }}</span>
|
|
80
|
+ <el-icon color="#3173FF" class="pointer"
|
|
81
|
+ @click="openSubDialogEvent(scope.row, 'bid_amount')"><i-ep-Edit /></el-icon>
|
|
82
|
+ </div>
|
|
83
|
+ <div class="cellDiv flex" v-else-if="item.column == 'adcreative_name'">
|
|
84
|
+ <el-tooltip placement="top" :content="scope.row.adcreatives_info.adcreative_name"
|
|
85
|
+ :disabled="scope.row.adcreatives_info.adcreative_name ? false : true">
|
|
86
|
+ <div class="ellipsis">{{ scope.row.adcreatives_info.adcreative_name || '-' }}</div>
|
|
87
|
+ </el-tooltip>
|
|
88
|
+ </div>
|
|
89
|
+ <div class="cellDiv flex" v-else-if="item.column == 'a5'">
|
|
90
|
+ <span>暂未配置</span>
|
|
91
|
+ </div>
|
|
92
|
+ <div class="cellDiv pointer" style="color:#3173FF;" v-else-if="item.column == 'a7'"
|
|
93
|
+ @click="openSubDialogEvent(scope.row, 'seeVideoImg')">已选
|
|
94
|
+ <span>{{scope.row?.adcreatives_info.adcreative_elements.self_image_count != 'self_image_count' ? scope.row?.adcreatives_info.adcreative_elements.self_image_count : 0}}张图片,</span>
|
|
95
|
+ <span>{{scope.row?.adcreatives_info.adcreative_elements.self_video_count != 'self_video_count' ? scope.row?.adcreatives_info.adcreative_elements.self_video_count : 0}}个视频</span>
|
|
96
|
+ </div>
|
|
97
|
+ <div class="cellDiv" v-else-if="item.column == 'description'">
|
|
98
|
+ <el-tooltip placement="top"
|
|
99
|
+ :content="scope.row?.adcreatives_info.adcreative_elements.description"
|
|
100
|
+ :disabled="scope.row?.adcreatives_info.adcreative_elements.description ? false : true">
|
|
101
|
+ <span>文案:已选{{ (scope.row?.adcreatives_info.adcreative_elements.description && 1) ||
|
|
102
|
+ 0 }}条文案</span>
|
|
103
|
+ </el-tooltip>
|
|
104
|
+ </div>
|
|
105
|
+ <div class="cellDiv flex" v-else-if="item.column == 'page_spec'">
|
|
106
|
+ <span>{{ scope.row.adcreatives_info.page_spec.page_name || '-' }}</span>
|
|
107
|
+ </div>
|
|
108
|
+ <div class="cellDiv" v-else-if="item.column == 'a10'">
|
|
109
|
+ <Popconfirm @confirm="deleTextEvent(scope.row, scope.$index)" />
|
|
110
|
+ </div>
|
|
111
|
+ <div class="cellDiv" v-else-if="item.column == 'a11'">
|
|
112
|
+ {{ scope.row.a11 == 1 ? '已提交' : '待提交' }}
|
|
113
|
+ </div>
|
|
114
|
+ <div class="cellDiv" v-else-if="item.column == 'promoted_object_name'">
|
|
115
|
+ {{ scope.row?.adcreatives_info.adcreative_elements.self_promoted_object_name || '暂未配置' }}
|
|
116
|
+ </div>
|
|
117
|
+ <div class="cellDiv" :style="{ justifyContent: item.alignSelf ? item.alignSelf : 'left' }" v-else>
|
|
118
|
+ <el-tooltip :disabled="!(scope.row[item.column] && scope.row[item.column].length > 30)"
|
|
119
|
+ effect="dark" :content="scope.row[item.column] + ''">
|
|
120
|
+ <div class="clampTwo line21" style="flex: 1">
|
|
121
|
+ {{ scope.row[item.column] || scope.row[item.column] == 0 ?
|
|
122
|
+ (item.cancleForMat ? (scope.row[item.column] ? scope.row[item.column] : '-') :
|
|
123
|
+ NumberHandle(scope.row[item.column], 2)) : '-' }}
|
|
124
|
+ </div>
|
|
125
|
+ </el-tooltip>
|
|
126
|
+ </div>
|
|
127
|
+ </template>
|
|
128
|
+ </el-table-column>
|
|
129
|
+ </template>
|
|
130
|
+ </el-table-column>
|
|
131
|
+ </template>
|
|
132
|
+ </el-table> -->
|
|
133
|
+ </div>
|
|
134
|
+ </div>
|
|
135
|
+ </div>
|
|
136
|
+ <!--修改推广计划名称-->
|
|
137
|
+ <EditPromotePlanName ref="EditPromotePlanNameRef" @confirm="val => echoVal(val, 'campaign_name')"></EditPromotePlanName>
|
|
138
|
+ <!--推广计划日预算-->
|
|
139
|
+ <PromotePlanBudget_day ref="PromotePlanBudget_dayRef" @confirm="val => echoVal(val, 'PromotePlanBudget_day')"></PromotePlanBudget_day>
|
|
140
|
+ <!--推广计划总预算-->
|
|
141
|
+ <PromotePlanBudget_total ref="PromotePlanBudget_totalRef" @confirm="val => echoVal(val, 'PromotePlanBudget_total')"></PromotePlanBudget_total>
|
|
142
|
+ <!--修改广告名称-->
|
|
143
|
+ <EditAdverteName ref="EditAdverteNameRef" @confirm="val => echoVal(val, 'ad_name')"></EditAdverteName>
|
|
144
|
+ <!--修改出价-->
|
|
145
|
+ <EditBid ref="EditBidRef" @confirm="val => echoVal(val, 'bid_amount')"></EditBid>
|
|
146
|
+ <!--查看视频/图片-->
|
|
147
|
+ <SeeVideoImg ref="SeeVideoImgRef" @confirm="val => echoVal(val, 'seeVideoImg')"></SeeVideoImg>
|
|
148
|
+ <!-- 提交审核弹框 -->
|
|
149
|
+ <AdCreateDialog ref="AdCreateDialogRef" @confirm="auditSubmitEvent"></AdCreateDialog>
|
|
150
|
+ <!-- loading -->
|
|
151
|
+ <LoadingMask ref="LoadingMaskRef" @confirm="loadingMaskConfirm"></LoadingMask>
|
|
152
|
+</template>
|
|
153
|
+<script setup lang="ts">
|
|
154
|
+import Popconfirm from '@/components/capsulationMoudle/_popconfirm.vue'
|
|
155
|
+import { nextTick, reactive, ref, watch } from "vue";
|
|
156
|
+import EditPromotePlanName from '@/components/businessMoudle/batchGdt/previewArea/dialog/editPromotePlanName.vue'
|
|
157
|
+import EditAdverteName from '@/components/businessMoudle/batchGdt/previewArea/dialog/EditAdverteName.vue'
|
|
158
|
+import EditBid from '@/components/businessMoudle/batchGdt/previewArea/dialog/editBid.vue'
|
|
159
|
+import PromotePlanBudget_day from '@/components/businessMoudle/batchGdt/previewArea/dialog/PromotePlanBudget_day.vue'
|
|
160
|
+import PromotePlanBudget_total from '@/components/businessMoudle/batchGdt/previewArea/dialog/PromotePlanBudget_total.vue'
|
|
161
|
+import SeeVideoImg from '@/components/businessMoudle/batchGdt/previewArea/dialog/SeeVideoImg.vue'
|
|
162
|
+import AdCreateDialog from '@/components/businessMoudle/batchGdt/previewArea/dialog/adCreate.vue'
|
|
163
|
+import LoadingMask from '@/components/businessMoudle/batchGdt/previewArea/dialog/loadingMask.vue'
|
|
164
|
+import { reactiveTableAndAny } from "@/api/ApiModel";
|
|
165
|
+import _ from "lodash";
|
|
166
|
+import { ElMessage, ElMessageBox } from 'element-plus';
|
|
167
|
+import { adsCreate } from './api'
|
|
168
|
+import { NumberHandle } from '@/common/common'
|
|
169
|
+import { useRouter } from "vue-router";
|
|
170
|
+import { taskRecord } from "@/components/businessMoudle/adTask/ts/api"
|
|
171
|
+const router = useRouter();
|
|
172
|
+
|
|
173
|
+const props = withDefaults(defineProps<{
|
|
174
|
+ infoObj: any
|
|
175
|
+}>(), {
|
|
176
|
+ infoObj: {}
|
|
177
|
+})
|
|
178
|
+
|
|
179
|
+const submitLoading = ref<boolean>(false)
|
|
180
|
+const updateKey = ref<number>(1)
|
|
181
|
+const rowKeyStr = ref<string>('id')
|
|
182
|
+const pageInfo = reactive<reactiveTableAndAny>({
|
|
183
|
+ accId: 1,
|
|
184
|
+ tableList: [],
|
|
185
|
+ descol: [
|
|
186
|
+ {
|
|
187
|
+ name: '推广计划',
|
|
188
|
+ list: [{ name: '推广计划信息', column: 'a1', minWidth: '240px', isfixed: 'left' }]
|
|
189
|
+ },
|
|
190
|
+ {
|
|
191
|
+ name: '广告',
|
|
192
|
+ list: [
|
|
193
|
+ { name: '广告名称', column: 'ad_name' },
|
|
194
|
+ { name: '出价', column: 'bid_amount' },
|
|
195
|
+ { name: '定向', column: 'targeting_name' },
|
|
196
|
+ { name: '转化归因', column: 'a5' },
|
|
197
|
+ ]
|
|
198
|
+ },
|
|
199
|
+ {
|
|
200
|
+ name: '广告创意',
|
|
201
|
+ list: [
|
|
202
|
+ { name: '创意名称', column: 'adcreative_name' },
|
|
203
|
+ { name: '创意素材', column: 'a7' },
|
|
204
|
+ { name: '创意文案', column: 'description' },
|
|
205
|
+ { name: '落地页', column: 'page_spec' },
|
|
206
|
+ { name: '微信视频号', column: 'promoted_object_name' },
|
|
207
|
+ ]
|
|
208
|
+ },
|
|
209
|
+ {
|
|
210
|
+ name: '操作',
|
|
211
|
+ list: [
|
|
212
|
+ { name: '操作', column: 'a10' },
|
|
213
|
+ { name: '提交状态', column: 'a11' }
|
|
214
|
+ ]
|
|
215
|
+ },
|
|
216
|
+ ],
|
|
217
|
+ expandArrs: [],
|
|
218
|
+ promoteList: [
|
|
219
|
+ { k: 'new', la: '新建推广计划', val: 'new' },
|
|
220
|
+ { k: 'edit', la: '已有推广计划', val: 'edit' },
|
|
221
|
+ ],
|
|
222
|
+ chooseList: [],
|
|
223
|
+ moreList: [{ label: '修改推广计划', value: '1' }],
|
|
224
|
+ accList: [],
|
|
225
|
+ RuleConfigObj: {},//规则配置
|
|
226
|
+ choosePlanObj: {},//选择的计划项
|
|
227
|
+ planName: '',//推广计划的名称
|
|
228
|
+ adName: '',//广告名称
|
|
229
|
+ bid: '',//出价
|
|
230
|
+ imgList: [],//预览的图片
|
|
231
|
+ campaign_list: [],//广告
|
|
232
|
+ target: {},//推广目标
|
|
233
|
+ basicInfoData: {},//广告基本信息
|
|
234
|
+ accPlanAd: {//账号下的计划及广告数
|
|
235
|
+ planNum: 0,
|
|
236
|
+ adNum: 0,
|
|
237
|
+ }
|
|
238
|
+})
|
|
239
|
+
|
|
240
|
+//定时器
|
|
241
|
+let timer:any = null;
|
|
242
|
+
|
|
243
|
+//loading
|
|
244
|
+const LoadingMaskRef = ref<{ switchShow: (val: Boolean) => void }>()
|
|
245
|
+//提交广告弹框
|
|
246
|
+const AdCreateDialogRef = ref<{ switchShow: (val: Boolean) => void }>()
|
|
247
|
+//修改推广计划名称
|
|
248
|
+const EditPromotePlanNameRef = ref<{ switchShow: (val: Boolean, campaign_name: string) => void }>()
|
|
249
|
+//推广计划日预算
|
|
250
|
+const PromotePlanBudget_dayRef = ref<{ switchShow: (val: Boolean, daily_budget: string) => void }>()
|
|
251
|
+//推广计划总预算
|
|
252
|
+const PromotePlanBudget_totalRef = ref<{ switchShow: (val: Boolean, total_budget: string) => void }>()
|
|
253
|
+//修改广告名称
|
|
254
|
+const EditAdverteNameRef = ref<{ switchShow: (val: Boolean, ad_name: string) => void }>()
|
|
255
|
+//修改出价
|
|
256
|
+const EditBidRef = ref<{ switchShow: (val: Boolean, bid_amount: string) => void }>()
|
|
257
|
+//查看视频/图片
|
|
258
|
+const SeeVideoImgRef = ref<{ switchShow: (val: Boolean, imgList: string) => void }>()
|
|
259
|
+//批量选择推广计划
|
|
260
|
+// const batchChoosePromotePlanRef = ref<{switchShow:(val:Boolean)=>void}>()
|
|
261
|
+
|
|
262
|
+//打开相应弹框
|
|
263
|
+const openSubDialogEvent = (row: any, val: string) => {
|
|
264
|
+ pageInfo.choosePlanObj = row
|
|
265
|
+ if (val == 'campaign_name') {//推广计划名称
|
|
266
|
+ EditPromotePlanNameRef.value?.switchShow(true, row.main_info.campaign_name)
|
|
267
|
+ } else if (val == 'ad_name') {//广告名称
|
|
268
|
+ EditAdverteNameRef.value?.switchShow(true, row.ad_name)
|
|
269
|
+ } else if (val == 'bid_amount') {//出价
|
|
270
|
+ EditBidRef.value?.switchShow(true, row.bid_amount)
|
|
271
|
+ } else if (val == 'seeVideoImg') {//查看视频/图片
|
|
272
|
+ SeeVideoImgRef.value?.switchShow(true, row.adcreatives_info.adcreative_elements.self_info)
|
|
273
|
+ } else if (val == 'PromotePlanBudget_day') {//推广日预算
|
|
274
|
+ PromotePlanBudget_dayRef.value?.switchShow(true, row.main_info.daily_budget)
|
|
275
|
+ } else if (val == 'PromotePlanBudget_total') {//推广总预算
|
|
276
|
+ PromotePlanBudget_totalRef.value?.switchShow(true, row.main_info.total_budget)
|
|
277
|
+ // }else if(val == 'choosePlan'){
|
|
278
|
+ // ChoosePromotePlanRef.value?.switchShow(true)
|
|
279
|
+ }
|
|
280
|
+}
|
|
281
|
+//弹框值回显
|
|
282
|
+const echoVal = (echoval: any, val: string) => {
|
|
283
|
+ if (!pageInfo.choosePlanObj) {
|
|
284
|
+ return
|
|
285
|
+ }
|
|
286
|
+ let list = pageInfo.campaign_list.filter((v) => {
|
|
287
|
+ return v.id == pageInfo.accId
|
|
288
|
+ })
|
|
289
|
+ if (list.length > 0) {
|
|
290
|
+ let info = list[0].chooseList[pageInfo.choosePlanObj.main_index]
|
|
291
|
+ if (val == 'campaign_name') {//推广计划名称
|
|
292
|
+ info.campaign_name = echoval
|
|
293
|
+ } else if (val == 'ad_name') {//广告名称
|
|
294
|
+ info.ad_list[pageInfo.choosePlanObj.ad_index].ad_name = echoval
|
|
295
|
+ } else if (val == 'bid_amount') {//出价
|
|
296
|
+ info.ad_list[pageInfo.choosePlanObj.ad_index].bid_amount = echoval
|
|
297
|
+ } else if (val == 'PromotePlanBudget_day') {//推广日预算
|
|
298
|
+ info.daily_budget = echoval
|
|
299
|
+ } else if (val == 'PromotePlanBudget_total') {//推广总预算
|
|
300
|
+ info.total_budget = echoval
|
|
301
|
+ // }else if(val == 'choosePlan'){
|
|
302
|
+ // pageInfo.tableList.forEach(item=>{
|
|
303
|
+ // if(item.id == pageInfo.choosePlanObj.id){
|
|
304
|
+ // item.choosePlanVal = echoval
|
|
305
|
+ // }
|
|
306
|
+ // })
|
|
307
|
+ }
|
|
308
|
+ getPlanAdNum()
|
|
309
|
+ } else {
|
|
310
|
+ ElMessage.warning('删除失败!')
|
|
311
|
+ }
|
|
312
|
+}
|
|
313
|
+
|
|
314
|
+//点击全部提交按钮
|
|
315
|
+const auditSubmitBtn = () => {
|
|
316
|
+ AdCreateDialogRef.value?.switchShow(true)
|
|
317
|
+}
|
|
318
|
+//全部提交审核
|
|
319
|
+const auditSubmitEvent = (dialogInfo) => {
|
|
320
|
+ let campaign_list = [];
|
|
321
|
+ pageInfo.campaign_list.forEach((item) => {
|
|
322
|
+ campaign_list = campaign_list.concat(_.cloneDeep(item.chooseList))
|
|
323
|
+ })
|
|
324
|
+ //删除多余字段
|
|
325
|
+ campaign_list.forEach((main:any)=>{
|
|
326
|
+ for(let i = 0; i < main.ad_list.length; i++) {
|
|
327
|
+ let item = main.ad_list[i]
|
|
328
|
+ delete item.adcreatives_info.page_spec.page_name;
|
|
329
|
+ delete item.adcreatives_info.adcreative_elements.self_info;
|
|
330
|
+ delete item.adcreatives_info.adcreative_elements.self_image_count;
|
|
331
|
+ delete item.adcreatives_info.adcreative_elements.self_video_count;
|
|
332
|
+ delete item.adcreatives_info.adcreative_elements.self_promoted_object_name;
|
|
333
|
+ }
|
|
334
|
+ })
|
|
335
|
+ let ad_common = {}
|
|
336
|
+ ad_common = Object.assign(pageInfo.basicInfoData.fillBack, { ad_status: pageInfo.RuleConfigObj.ad_status, promoted_object_type: pageInfo.target.name })
|
|
337
|
+ let ad_outer = {
|
|
338
|
+ user_action_sets: {},//数据源
|
|
339
|
+ cold_start_audience: {},//扩量种子
|
|
340
|
+ start_audience: {},//一方助攻人群包
|
|
341
|
+ union_position_package: {},//优量汇流量包定投
|
|
342
|
+ exclude_union_position_package: {},//优量汇流量包屏蔽
|
|
343
|
+ }
|
|
344
|
+ for (let i in pageInfo.basicInfoData.outerConfig) {
|
|
345
|
+ if (pageInfo.basicInfoData.outerConfig[i].enabled && pageInfo.basicInfoData.outerConfig[i].value && JSON.stringify(pageInfo.basicInfoData.outerConfig[i].value != '{}')) {
|
|
346
|
+ let obj = {}
|
|
347
|
+ for (let j in pageInfo.basicInfoData.outerConfig[i].value) {
|
|
348
|
+ let item = pageInfo.basicInfoData.outerConfig[i].value[j]
|
|
349
|
+ if (i == 'attributionOuter') {//精准匹配归因
|
|
350
|
+ obj[j] = [{ "type": `USER_ACTION_SET_TYPE_${item?.type}`, "id": item.user_action_set_id }]
|
|
351
|
+ } else if (i == 'expandPopulation' || i == 'targetingPartyData') { // 扩量种子人群、一方数据助攻
|
|
352
|
+ obj[j] = item.join(',')
|
|
353
|
+ } else if (i == 'unionPosition') {//优量汇流量包
|
|
354
|
+ let unionObj = {}
|
|
355
|
+ for (let k in item) {
|
|
356
|
+ unionObj[k] = item[k].map((v) => { return v.union_package_id }).join(',')
|
|
357
|
+ }
|
|
358
|
+ obj[j] = unionObj
|
|
359
|
+ }
|
|
360
|
+ }
|
|
361
|
+ if (i == 'attributionOuter') {//精准匹配归因
|
|
362
|
+ ad_outer.user_action_sets = obj
|
|
363
|
+ } else if (i == 'expandPopulation') { // 扩量种子人群
|
|
364
|
+ ad_outer.cold_start_audience = obj
|
|
365
|
+ } else if (i == 'targetingPartyData') {//一方数据助攻
|
|
366
|
+ ad_outer.start_audience = obj
|
|
367
|
+ } else if (i == 'unionPosition') {//优量汇优量包
|
|
368
|
+ let union_package = {}
|
|
369
|
+ let exclude_union_package = {}
|
|
370
|
+ for (let w in obj) {
|
|
371
|
+ union_package[w] = obj[w][1]
|
|
372
|
+ exclude_union_package[w] = obj[w][2]
|
|
373
|
+ }
|
|
374
|
+ ad_outer.union_position_package = union_package
|
|
375
|
+ ad_outer.exclude_union_position_package = exclude_union_package
|
|
376
|
+ }
|
|
377
|
+ }
|
|
378
|
+ }
|
|
379
|
+ //添加创建广告任务
|
|
380
|
+ submitLoading.value = true
|
|
381
|
+ let params = {
|
|
382
|
+ campaign_list: JSON.stringify(campaign_list),
|
|
383
|
+ ad_common: JSON.stringify(ad_common),
|
|
384
|
+ ad_outer: JSON.stringify(ad_outer),
|
|
385
|
+ comtype: dialogInfo.comtype,
|
|
386
|
+ }
|
|
387
|
+ if(dialogInfo.comtype == 2) {
|
|
388
|
+ params['dotime'] = dialogInfo.dotime
|
|
389
|
+ }
|
|
390
|
+ adsCreate(params).then((res:any) => {
|
|
391
|
+ submitLoading.value = false
|
|
392
|
+ if(res.task_id && dialogInfo.comtype == 1){
|
|
393
|
+ LoadingMaskRef.value?.switchShow(true)
|
|
394
|
+ adTaskEvent(res.task_id)
|
|
395
|
+ }else{
|
|
396
|
+ goAdTask()
|
|
397
|
+ }
|
|
398
|
+ }).catch((err) => {
|
|
399
|
+ console.log(err,'提交失败')
|
|
400
|
+ submitLoading.value = false
|
|
401
|
+ })
|
|
402
|
+}
|
|
403
|
+
|
|
404
|
+/**广告任务执行记录 */
|
|
405
|
+const adTaskEvent = (task_id) => {
|
|
406
|
+ taskRecord({task_id}).then((res:any)=>{
|
|
407
|
+ if(res.status == 1 || res.status == 0) {
|
|
408
|
+ timer = setTimeout(()=>{
|
|
409
|
+ adTaskEvent(task_id)
|
|
410
|
+ },1000)
|
|
411
|
+ }else{
|
|
412
|
+ LoadingMaskRef.value?.switchShow(false)
|
|
413
|
+ }
|
|
414
|
+ if(res.status == 2) {
|
|
415
|
+ ElMessage.success('提交成功!')
|
|
416
|
+ router.push({ path: '/gdtList' })
|
|
417
|
+ }
|
|
418
|
+ }).catch(()=>{
|
|
419
|
+ LoadingMaskRef.value?.switchShow(false)
|
|
420
|
+ })
|
|
421
|
+}
|
|
422
|
+
|
|
423
|
+/**后台执行 */
|
|
424
|
+const loadingMaskConfirm = () => {
|
|
425
|
+ clearTimeout(timer)
|
|
426
|
+ LoadingMaskRef.value?.switchShow(false)
|
|
427
|
+ goAdTask()
|
|
428
|
+}
|
|
429
|
+
|
|
430
|
+/**去任务列表 */
|
|
431
|
+const goAdTask = () => {
|
|
432
|
+ router.push({ path: '/adTask' })
|
|
433
|
+}
|
|
434
|
+
|
|
435
|
+/**点击账号切换 */
|
|
436
|
+const accItemEvent = (id: number) => {
|
|
437
|
+ pageInfo.accId = id
|
|
438
|
+ getPlanAdNum()
|
|
439
|
+}
|
|
440
|
+
|
|
441
|
+/**获取帐号下广告及计划 */
|
|
442
|
+const getPlanAdNum = () => {
|
|
443
|
+ let list = _.cloneDeep(pageInfo.campaign_list.filter((v) => {
|
|
444
|
+ return v.id == pageInfo.accId
|
|
445
|
+ }))
|
|
446
|
+ if (list.length > 0) {
|
|
447
|
+ let tableList: any[] = []
|
|
448
|
+ list[0].chooseList.forEach((item, index) => {
|
|
449
|
+ for (let i = 0; i < item.ad_list.length; i++) {
|
|
450
|
+ let item_v = item.ad_list[i]
|
|
451
|
+ let obj = _.cloneDeep(item_v)
|
|
452
|
+ if (i == 0) {
|
|
453
|
+ obj = Object.assign(obj, { main_info: _.cloneDeep(item), main_index: index, ad_index: i })
|
|
454
|
+ } else {
|
|
455
|
+ obj = Object.assign(obj, { main_index: index, ad_index: i })
|
|
456
|
+ }
|
|
457
|
+ tableList.push(obj)
|
|
458
|
+ }
|
|
459
|
+ })
|
|
460
|
+ pageInfo.accPlanAd.planNum = list[0].chooseList.length;
|
|
461
|
+ pageInfo.accPlanAd.adNum = tableList.length;
|
|
462
|
+ pageInfo.tableList = tableList
|
|
463
|
+ } else {
|
|
464
|
+ pageInfo.accPlanAd.adNum = 0
|
|
465
|
+ pageInfo.accPlanAd.planNum = 0
|
|
466
|
+ pageInfo.tableList = []
|
|
467
|
+ }
|
|
468
|
+}
|
|
469
|
+/**删除广告 */
|
|
470
|
+const deleTextEvent = (item, index) => {
|
|
471
|
+ let list = pageInfo.campaign_list.filter((v) => {
|
|
472
|
+ return v.id == pageInfo.accId
|
|
473
|
+ })
|
|
474
|
+ if (list.length > 0) {
|
|
475
|
+ list[0].chooseList[item.main_index].ad_list.splice(item.ad_index, 1)
|
|
476
|
+ pageInfo.num_total.adNum -= 1
|
|
477
|
+ if (list[0].chooseList[item.main_index].ad_list.length == 0) {
|
|
478
|
+ list[0].chooseList.splice(item.main_index, 1)
|
|
479
|
+ pageInfo.num_total.planNum -= 1
|
|
480
|
+ }
|
|
481
|
+ if (list[0].chooseList.length == 0) {
|
|
482
|
+ pageInfo.campaign_list = pageInfo.campaign_list.filter((v) => {
|
|
483
|
+ return v.id != pageInfo.accId
|
|
484
|
+ })
|
|
485
|
+ pageInfo.accList = pageInfo.accList.filter((v) => {
|
|
486
|
+ return v.id != pageInfo.accId
|
|
487
|
+ })
|
|
488
|
+ if (pageInfo.campaign_list.length > 0) {
|
|
489
|
+ pageInfo.accId = pageInfo.campaign_list[0].id
|
|
490
|
+ }
|
|
491
|
+ }
|
|
492
|
+ } else {
|
|
493
|
+ ElMessage.warning('删除失败!')
|
|
494
|
+ }
|
|
495
|
+ getPlanAdNum()
|
|
496
|
+}
|
|
497
|
+const objectSpanMethod = ({
|
|
498
|
+ row,
|
|
499
|
+ column,
|
|
500
|
+ rowIndex,
|
|
501
|
+ columnIndex,
|
|
502
|
+}) => {
|
|
503
|
+ if (columnIndex === 0) {
|
|
504
|
+ if (row.main_info?.ad_list && row.main_info?.ad_list.length > 0) {
|
|
505
|
+ return {
|
|
506
|
+ rowspan: row.main_info.ad_list.length,
|
|
507
|
+ colspan: 1,
|
|
508
|
+ }
|
|
509
|
+ } else {
|
|
510
|
+ return {
|
|
511
|
+ rowspan: 0,
|
|
512
|
+ colspan: 0,
|
|
513
|
+ }
|
|
514
|
+ }
|
|
515
|
+ }
|
|
516
|
+}
|
|
517
|
+const selectionChangeEvent = (val: any) => {
|
|
518
|
+ pageInfo.chooseList = val
|
|
519
|
+}
|
|
520
|
+
|
|
521
|
+//表头样式
|
|
522
|
+const tableHeaderStyle = ({ row, column, rowIndex, columnIndex }: never) => {
|
|
523
|
+ return {
|
|
524
|
+ backgroundColor: '#fff',
|
|
525
|
+ color: '#161E46',
|
|
526
|
+ padding: '15px 0',
|
|
527
|
+ fontSize: '14px'
|
|
528
|
+ }
|
|
529
|
+}
|
|
530
|
+
|
|
531
|
+watch(() => props.infoObj.updateKey, () => {
|
|
532
|
+ nextTick(async () => {
|
|
533
|
+ //账号
|
|
534
|
+ pageInfo.accList = _.cloneDeep(props.infoObj.accVal)
|
|
535
|
+ if (!pageInfo.accList || pageInfo.accList.length == 0) return;
|
|
536
|
+ //广告计划
|
|
537
|
+ pageInfo.campaign_list = _.cloneDeep(props.infoObj.campaign_list)
|
|
538
|
+ //计划数等
|
|
539
|
+ pageInfo.num_total = _.cloneDeep(props.infoObj.num_total)
|
|
540
|
+ //推广目标
|
|
541
|
+ pageInfo.target = _.cloneDeep(props.infoObj.target)
|
|
542
|
+ //广告基本信息
|
|
543
|
+ pageInfo.basicInfoData = _.cloneDeep(props.infoObj.basicInfoData)
|
|
544
|
+ //规则配置
|
|
545
|
+ pageInfo.RuleConfigObj = _.cloneDeep(props.infoObj.RuleConfigObj)
|
|
546
|
+ accItemEvent(pageInfo.accList[0].id)
|
|
547
|
+ })
|
|
548
|
+}, { immediate: true, deep: true })
|
|
549
|
+
|
|
550
|
+</script>
|
|
551
|
+<style lang="scss" scoped>
|
|
552
|
+@import "src/assets/style/batchGdt.scss";
|
|
553
|
+
|
|
554
|
+.ellipsis {
|
|
555
|
+ display: -webkit-box;
|
|
556
|
+ -webkit-line-clamp: 2;
|
|
557
|
+ -webkit-box-orient: vertical;
|
|
558
|
+ overflow: hidden;
|
|
559
|
+ text-overflow: ellipsis;
|
|
560
|
+}
|
|
561
|
+
|
|
562
|
+.areaBox {
|
|
563
|
+ background-color: #ffffff;
|
|
564
|
+ min-height: 400px;
|
|
565
|
+}
|
|
566
|
+
|
|
567
|
+.areaCon {
|
|
568
|
+ background-color: #FBFBFB !important;
|
|
569
|
+
|
|
570
|
+ .accItem {
|
|
571
|
+ width: 237px;
|
|
572
|
+ height: 50px;
|
|
573
|
+ background: #f2f2f2;
|
|
574
|
+ border-top-left-radius: 5px;
|
|
575
|
+ border-top-right-radius: 5px;
|
|
576
|
+ font-size: 14px;
|
|
577
|
+ display: flex;
|
|
578
|
+ align-items: center;
|
|
579
|
+ justify-content: center;
|
|
580
|
+ cursor: pointer;
|
|
581
|
+ border: 1px solid #E2E2E2;
|
|
582
|
+ color: #161E46;
|
|
583
|
+ margin-right: 5px;
|
|
584
|
+ border-bottom: none;
|
|
585
|
+
|
|
586
|
+ &.active {
|
|
587
|
+ border: 1px solid #3173FF;
|
|
588
|
+ color: #3173FF;
|
|
589
|
+ background: rgba(155, 187, 255, 0.52);
|
|
590
|
+ border-bottom: none;
|
|
591
|
+ }
|
|
592
|
+ }
|
|
593
|
+
|
|
594
|
+ .chooseBox {
|
|
595
|
+ background-color: #fff;
|
|
596
|
+ padding: 10px;
|
|
597
|
+ }
|
|
598
|
+}
|
|
599
|
+
|
|
600
|
+.cellDiv {
|
|
601
|
+ color: #161E46;
|
|
602
|
+
|
|
603
|
+ .el-icon {
|
|
604
|
+ margin-left: 4px;
|
|
605
|
+ }
|
|
606
|
+}
|
|
607
|
+
|
|
608
|
+.empty-block {
|
|
609
|
+ display: flex;
|
|
610
|
+ flex-direction: column;
|
|
611
|
+ align-items: center;
|
|
612
|
+ justify-content: center;
|
|
613
|
+ padding-top: 70px;
|
|
614
|
+
|
|
615
|
+ .empty-title {
|
|
616
|
+ margin: 0;
|
|
617
|
+ font-size: 48px;
|
|
618
|
+ line-height: 67px;
|
|
619
|
+ color: #e0e3e7;
|
|
620
|
+ }
|
|
621
|
+
|
|
622
|
+ .empty-description {
|
|
623
|
+ margin-top: 25px;
|
|
624
|
+ font-size: 14px;
|
|
625
|
+ font-weight: 500;
|
|
626
|
+ line-height: 20px;
|
|
627
|
+ color: #808695;
|
|
628
|
+ }
|
|
629
|
+}
|
|
630
|
+</style>
|