|
@@ -82,118 +82,181 @@ export const strategyGroupsEvent = ({
|
82
|
82
|
id: info.id
|
83
|
83
|
}).then(async (res: any) => {
|
84
|
84
|
loading.close()
|
85
|
|
- if (res.rule_conf && isObject(JSON.parse(res.rule_conf))) {//规则配置
|
86
|
|
- pageInfo.RuleConfigObj = JSON.parse(res.rule_conf)
|
87
|
|
- }
|
88
|
|
- if (res.ad_base && isObject(JSON.parse(res.ad_base))) {//广告基本信息
|
89
|
|
- basicInfoData.fillBack = JSON.parse(res.ad_base)
|
90
|
|
- getAdPresetsInfo('strategyGroups', basicInfoData.fillBack)
|
91
|
|
- }
|
92
|
|
- if (res?.account_ids && accValue.value) {//媒体账户
|
|
85
|
+ strategyGroupsConfig(res)
|
|
86
|
+ }).catch((err) => {
|
|
87
|
+ console.log(err)
|
|
88
|
+ pageInfo.groupsConfig = {}
|
|
89
|
+ ElMessage.error('策略组配置失败!')
|
|
90
|
+ loading.close()
|
|
91
|
+ })
|
|
92
|
+ }
|
|
93
|
+
|
|
94
|
+ /**策略组回调配置 */
|
|
95
|
+ const strategyGroupsConfig = async (res, adsDetailRes?) => {
|
|
96
|
+ if (res.rule_conf && isObject(JSON.parse(res.rule_conf))) {//规则配置
|
|
97
|
+ pageInfo.RuleConfigObj = JSON.parse(res.rule_conf)
|
|
98
|
+ }
|
|
99
|
+ if (res.ad_base && isObject(JSON.parse(res.ad_base))) {//广告基本信息
|
|
100
|
+ basicInfoData.fillBack = JSON.parse(res.ad_base)
|
|
101
|
+ getAdPresetsInfo('strategyGroups', basicInfoData.fillBack)
|
|
102
|
+ }
|
|
103
|
+ if (res?.account_ids && accValue.value) {//媒体账户
|
|
104
|
+ if(adsDetailRes){//广告复制
|
|
105
|
+ accValue.value = [adsDetailRes.account_id]
|
|
106
|
+ }else{
|
93
|
107
|
accValue.value = res?.account_ids.split(',')
|
94
|
|
- pageInfo.accIdsList = res?.account_ids?.split(',')?.map((v) => {
|
95
|
|
- return { 'name': v, 'id': v }
|
96
|
|
- })
|
97
|
|
- pageInfo.accIdsList_copy_last = _.cloneDeep(pageInfo.accIdsList)
|
98
|
108
|
}
|
99
|
|
- if (res?.promoted_object_type && targetRef.value) {//推广目标
|
100
|
|
- pageInfo.targetValue = res?.promoted_object_type
|
101
|
|
- targetRef.value.value = pageInfo.targetValue;
|
102
|
|
- }
|
103
|
|
- if (res?.creative_base) {//创意基本信息
|
104
|
|
- let creative_base = JSON.parse(res?.creative_base)
|
105
|
|
- for (let key in originalityBasicInfoData) {
|
106
|
|
- originalityBasicInfoData[key] = creative_base[key]
|
107
|
|
- }
|
108
|
|
- updateHaveContent({ id: 5, chooseNum: 1})
|
109
|
|
- } else {
|
110
|
|
- clearOriginalityInfo()
|
111
|
|
- }
|
112
|
|
- if (res?.targetings_info) {//定向包
|
113
|
|
- pageInfo.directObj = JSON.parse(res?.targetings_info)
|
114
|
|
- if (DirectPacketExhibitionRef.value && DirectPacketExhibitionRef.value[0]) {
|
115
|
|
- DirectPacketExhibitionRef.value[0].feedbackEvent(pageInfo.directObj)
|
116
|
|
- }
|
117
|
|
- } else {
|
118
|
|
- if (DirectPacketExhibitionRef.value && DirectPacketExhibitionRef.value[0]) {
|
119
|
|
- DirectPacketExhibitionRef.value[0]?.clearDirectContent()
|
120
|
|
- }
|
|
109
|
+ pageInfo.accIdsList = accValue.value?.map((v) => {
|
|
110
|
+ return { 'name': v, 'id': v }
|
|
111
|
+ })
|
|
112
|
+ pageInfo.accIdsList_copy_last = _.cloneDeep(pageInfo.accIdsList)
|
|
113
|
+ }
|
|
114
|
+ if (res?.promoted_object_type && targetRef.value) {//推广目标
|
|
115
|
+ pageInfo.targetValue = res?.promoted_object_type
|
|
116
|
+ targetRef.value.value = pageInfo.targetValue;
|
|
117
|
+ }
|
|
118
|
+ if (res?.creative_base) {//创意基本信息
|
|
119
|
+ let creative_base = JSON.parse(res?.creative_base)
|
|
120
|
+ creative_base.params = creative_base.params.filter((v)=>{
|
|
121
|
+ return accValue.value.includes(v.account_id)
|
|
122
|
+ })
|
|
123
|
+ for (let key in originalityBasicInfoData) {
|
|
124
|
+ originalityBasicInfoData[key] = creative_base[key]
|
121
|
125
|
}
|
122
|
|
- if (res?.creative_info) {//创意素材
|
123
|
|
- let creative_info = JSON.parse(res?.creative_info)
|
124
|
|
- for (let key in cMaterial) {
|
125
|
|
- cMaterial[key] = creative_info[key]
|
126
|
|
- }
|
127
|
|
- } else {
|
128
|
|
- CreativeMaterial_clear()
|
|
126
|
+ updateHaveContent({ id: 5, chooseNum: 1})
|
|
127
|
+ } else {
|
|
128
|
+ clearOriginalityInfo()
|
|
129
|
+ }
|
|
130
|
+ if (res?.targetings_info) {//定向包
|
|
131
|
+ pageInfo.directObj = JSON.parse(res?.targetings_info)
|
|
132
|
+ pageInfo.directObj.chooseList = pageInfo.directObj.chooseList.filter((v)=>{
|
|
133
|
+ return accValue.value.includes(v.id)
|
|
134
|
+ })
|
|
135
|
+ if (DirectPacketExhibitionRef.value && DirectPacketExhibitionRef.value[0]) {
|
|
136
|
+ DirectPacketExhibitionRef.value[0].feedbackEvent(pageInfo.directObj)
|
129
|
137
|
}
|
130
|
|
- if (res?.paperwork) {//文案
|
131
|
|
- pageInfo.copywriterInfoData = JSON.parse(res?.paperwork)
|
132
|
|
- if (CopywriterRef.value && CopywriterRef.value[0]) {
|
133
|
|
- CopywriterRef.value[0].feedbackEvent(_.cloneDeep(pageInfo.copywriterInfoData))
|
134
|
|
- }
|
135
|
|
- } else {//清空文案
|
136
|
|
- updateHaveContent({
|
137
|
|
- id: 7,
|
138
|
|
- chooseNum: 0,
|
139
|
|
- minusFlag: false,
|
140
|
|
- clearFlag: true
|
141
|
|
- })
|
142
|
|
- if (CopywriterRef.value) {
|
143
|
|
- CopywriterRef.value[0]?.clearEvent()
|
144
|
|
- }
|
|
138
|
+ } else {
|
|
139
|
+ if (DirectPacketExhibitionRef.value && DirectPacketExhibitionRef.value[0]) {
|
|
140
|
+ DirectPacketExhibitionRef.value[0]?.clearDirectContent()
|
145
|
141
|
}
|
146
|
|
- await computeCount()
|
147
|
|
- if (res?.landing_page) {//落地页
|
148
|
|
- pageInfo.copyLandPageInfoData = JSON.parse(res?.landing_page)
|
149
|
|
- if (LandPageRef.value && LandPageRef.value[0]) {
|
150
|
|
- LandPageRef.value[0].feedbackEvent(_.cloneDeep(pageInfo.copyLandPageInfoData))
|
151
|
|
- }
|
152
|
|
- } else {//清空落地页
|
153
|
|
- if (LandPageRef.value) {
|
154
|
|
- LandPageRef.value[0]?.clearEvent()
|
155
|
|
- }
|
156
|
|
- updateHaveContent({
|
157
|
|
- id: 8,
|
158
|
|
- chooseNum: 0,
|
159
|
|
- minusFlag: false,
|
160
|
|
- clearFlag: true
|
161
|
|
- })
|
|
142
|
+ }
|
|
143
|
+ if (res?.creative_info) {//创意素材
|
|
144
|
+ let creative_info = JSON.parse(res?.creative_info)
|
|
145
|
+ creative_info.resResult = creative_info.resResult.filter((v)=>{
|
|
146
|
+ return accValue.value.includes(v.account_id)
|
|
147
|
+ })
|
|
148
|
+ creative_info.list?.forEach((item)=>{
|
|
149
|
+ item.list?.forEach((item1) => {
|
|
150
|
+ item1.resResult = item1.resResult?.filter((v)=>{
|
|
151
|
+ return accValue.value.includes(v.account_id)
|
|
152
|
+ })
|
|
153
|
+ });
|
|
154
|
+ })
|
|
155
|
+ creative_info.list_copy?.forEach((item)=>{
|
|
156
|
+ item.list?.forEach((item1) => {
|
|
157
|
+ item1.resResult = item1.resResult?.filter((v)=>{
|
|
158
|
+ return accValue.value.includes(v.account_id)
|
|
159
|
+ })
|
|
160
|
+ });
|
|
161
|
+ })
|
|
162
|
+ for (let key in cMaterial) {
|
|
163
|
+ cMaterial[key] = creative_info[key]
|
162
|
164
|
}
|
163
|
|
- if (res?.user_action_sets) {//精准匹配归因
|
164
|
|
- basicInfoData.outerConfig.attributionOuter = JSON.parse(res?.user_action_sets)
|
165
|
|
- } else {
|
166
|
|
- basicInfoData.outerConfig.attributionOuter.value = {}
|
167
|
|
- basicInfoData.outerConfig.attributionOuter.other = {}
|
168
|
|
- basicInfoData.outerConfig.attributionOuter.isComplete = false
|
|
165
|
+ } else {
|
|
166
|
+ CreativeMaterial_clear()
|
|
167
|
+ }
|
|
168
|
+ if (res?.paperwork) {//文案
|
|
169
|
+ pageInfo.copywriterInfoData = JSON.parse(res?.paperwork)
|
|
170
|
+
|
|
171
|
+ if (CopywriterRef.value && CopywriterRef.value[0]) {
|
|
172
|
+ CopywriterRef.value[0].feedbackEvent(_.cloneDeep(pageInfo.copywriterInfoData))
|
169
|
173
|
}
|
170
|
|
- if (res?.union_position) {//优量汇
|
171
|
|
- basicInfoData.outerConfig.unionPosition = JSON.parse(res?.union_position)
|
172
|
|
- } else {
|
173
|
|
- basicInfoData.outerConfig.unionPosition.value = {}
|
174
|
|
- basicInfoData.outerConfig.unionPosition.other = {}
|
175
|
|
- basicInfoData.outerConfig.unionPosition.isComplete = false
|
|
174
|
+ } else {//清空文案
|
|
175
|
+ updateHaveContent({
|
|
176
|
+ id: 7,
|
|
177
|
+ chooseNum: 0,
|
|
178
|
+ minusFlag: false,
|
|
179
|
+ clearFlag: true
|
|
180
|
+ })
|
|
181
|
+ if (CopywriterRef.value) {
|
|
182
|
+ CopywriterRef.value[0]?.clearEvent()
|
176
|
183
|
}
|
177
|
|
- if (res?.start_audience) {//一方助攻人群包
|
178
|
|
- basicInfoData.outerConfig.targetingPartyData = JSON.parse(res?.start_audience)
|
179
|
|
- } else {
|
180
|
|
- basicInfoData.outerConfig.targetingPartyData.value = {}
|
181
|
|
- basicInfoData.outerConfig.targetingPartyData.other = {}
|
182
|
|
- basicInfoData.outerConfig.targetingPartyData.isComplete = false
|
|
184
|
+ }
|
|
185
|
+ await computeCount()
|
|
186
|
+ if (res?.landing_page) {//落地页
|
|
187
|
+ let landPageInfo = JSON.parse(res?.landing_page)
|
|
188
|
+ let landData = _.cloneDeep(landPageInfo.data)
|
|
189
|
+ landPageInfo.data = {}
|
|
190
|
+ accValue.value.forEach((item) => {
|
|
191
|
+ landPageInfo.data[item] = landData[item]
|
|
192
|
+ });
|
|
193
|
+ pageInfo.copyLandPageInfoData = landPageInfo
|
|
194
|
+ if (LandPageRef.value && LandPageRef.value[0]) {
|
|
195
|
+ LandPageRef.value[0].feedbackEvent(_.cloneDeep(pageInfo.copyLandPageInfoData))
|
183
|
196
|
}
|
184
|
|
- if (res?.wechat_channels) {//视频号
|
185
|
|
- basicInfoData.outerConfig.weChatVideoAccount = JSON.parse(res?.wechat_channels)
|
186
|
|
- } else {
|
187
|
|
- basicInfoData.outerConfig.weChatVideoAccount.value = {}
|
188
|
|
- basicInfoData.outerConfig.weChatVideoAccount.other = {}
|
189
|
|
- basicInfoData.outerConfig.weChatVideoAccount.isComplete = false
|
|
197
|
+ } else {//清空落地页
|
|
198
|
+ if (LandPageRef.value) {
|
|
199
|
+ LandPageRef.value[0]?.clearEvent()
|
190
|
200
|
}
|
191
|
|
- }).catch((err) => {
|
192
|
|
- console.log(err)
|
193
|
|
- pageInfo.groupsConfig = {}
|
194
|
|
- ElMessage.error('策略组配置失败!')
|
195
|
|
- loading.close()
|
196
|
|
- })
|
|
201
|
+ updateHaveContent({
|
|
202
|
+ id: 8,
|
|
203
|
+ chooseNum: 0,
|
|
204
|
+ minusFlag: false,
|
|
205
|
+ clearFlag: true
|
|
206
|
+ })
|
|
207
|
+ }
|
|
208
|
+ if (res?.user_action_sets) {//精准匹配归因
|
|
209
|
+ let user_action_sets = JSON.parse(res?.user_action_sets)
|
|
210
|
+ let user_action_value = _.cloneDeep(user_action_sets.value)
|
|
211
|
+ user_action_sets.value = {}
|
|
212
|
+ accValue.value.forEach((item) => {
|
|
213
|
+ user_action_sets.value[item] = user_action_value[item]
|
|
214
|
+ });
|
|
215
|
+ basicInfoData.outerConfig.attributionOuter = user_action_sets;
|
|
216
|
+ } else {
|
|
217
|
+ basicInfoData.outerConfig.attributionOuter.value = {}
|
|
218
|
+ basicInfoData.outerConfig.attributionOuter.other = {}
|
|
219
|
+ basicInfoData.outerConfig.attributionOuter.isComplete = false
|
|
220
|
+ }
|
|
221
|
+ if (res?.union_position) {//优量汇
|
|
222
|
+ let union_position = JSON.parse(res?.union_position)
|
|
223
|
+ let union_position_value = _.cloneDeep(union_position.value)
|
|
224
|
+ union_position.value = {}
|
|
225
|
+ accValue.value.forEach((item) => {
|
|
226
|
+ union_position.value[item] = union_position_value[item]
|
|
227
|
+ });
|
|
228
|
+ basicInfoData.outerConfig.unionPosition = union_position
|
|
229
|
+ } else {
|
|
230
|
+ basicInfoData.outerConfig.unionPosition.value = {}
|
|
231
|
+ basicInfoData.outerConfig.unionPosition.other = {}
|
|
232
|
+ basicInfoData.outerConfig.unionPosition.isComplete = false
|
|
233
|
+ }
|
|
234
|
+ if (res?.start_audience) {//一方助攻人群包
|
|
235
|
+ let start_audience = JSON.parse(res?.start_audience)
|
|
236
|
+ let start_audience_value = _.cloneDeep(start_audience.value)
|
|
237
|
+ start_audience.value = {}
|
|
238
|
+ accValue.value.forEach((item) => {
|
|
239
|
+ start_audience.value[item] = start_audience_value[item]
|
|
240
|
+ });
|
|
241
|
+ basicInfoData.outerConfig.targetingPartyData = start_audience
|
|
242
|
+ } else {
|
|
243
|
+ basicInfoData.outerConfig.targetingPartyData.value = {}
|
|
244
|
+ basicInfoData.outerConfig.targetingPartyData.other = {}
|
|
245
|
+ basicInfoData.outerConfig.targetingPartyData.isComplete = false
|
|
246
|
+ }
|
|
247
|
+ if (res?.wechat_channels) {//视频号
|
|
248
|
+ let wechat_channels = JSON.parse(res?.wechat_channels)
|
|
249
|
+ let wechat_channels_value = _.cloneDeep(wechat_channels.value)
|
|
250
|
+ wechat_channels.value = {}
|
|
251
|
+ accValue.value.forEach((item) => {
|
|
252
|
+ wechat_channels.value[item] = wechat_channels_value[item]
|
|
253
|
+ });
|
|
254
|
+ basicInfoData.outerConfig.weChatVideoAccount = wechat_channels
|
|
255
|
+ } else {
|
|
256
|
+ basicInfoData.outerConfig.weChatVideoAccount.value = {}
|
|
257
|
+ basicInfoData.outerConfig.weChatVideoAccount.other = {}
|
|
258
|
+ basicInfoData.outerConfig.weChatVideoAccount.isComplete = false
|
|
259
|
+ }
|
197
|
260
|
}
|
198
|
261
|
return {
|
199
|
262
|
StrategyGroupsDialogRef,
|
|
@@ -201,6 +264,7 @@ export const strategyGroupsEvent = ({
|
201
|
264
|
openStrategyGroups,
|
202
|
265
|
openSaveStrategyGroups,
|
203
|
266
|
closeSeletedGroup,
|
204
|
|
- strategyGroupsUse
|
|
267
|
+ strategyGroupsUse,
|
|
268
|
+ strategyGroupsConfig
|
205
|
269
|
}
|
206
|
270
|
}
|