Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in / Register
Toggle navigation
Z
zxn-adputin
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lijin
zxn-adputin
Commits
3e10460b
Commit
3e10460b
authored
Apr 20, 2025
by
lijin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
modified
parent
3a040af1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
98 deletions
+37
-98
CampaignTaskManage.vue
src/views/campaignTask/CampaignTaskManage.vue
+37
-98
No files found.
src/views/campaignTask/CampaignTaskManage.vue
View file @
3e10460b
...
@@ -894,63 +894,31 @@ export default {
...
@@ -894,63 +894,31 @@ export default {
try
{
try
{
let
taskData
=
{}
let
taskData
=
{}
if
(
this
.
form
.
templateType
===
1
)
{
// 使用现有模板
// 检查是否修改了模板配置
const
templateModified
=
this
.
isTemplateModified
()
if
(
templateModified
)
{
// 创建一个修改后的临时模板
const
modifiedTemplate
=
{
name
:
this
.
selectedTemplate
.
name
+
' (修改版)'
,
campaign_type
:
this
.
form
.
campaign_type
,
appStore
:
this
.
form
.
appStore
,
daily_budget
:
this
.
form
.
daily_budget
,
bidding_type
:
this
.
form
.
bidding_type
,
target_roas
:
this
.
form
.
target_roas
,
app_groups
:
this
.
form
.
app_groups
,
location_groups
:
this
.
form
.
location_groups
,
material_groups
:
this
.
form
.
material_groups
,
title_groups
:
this
.
form
.
title_groups
,
description_groups
:
this
.
form
.
description_groups
,
is_temp
:
1
,
// 标记为临时模板
original_template_id
:
this
.
form
.
campaignTemplateId
// 记录原始模板ID
}
taskData
=
{
id
:
this
.
form
.
id
,
tempTemplate
:
modifiedTemplate
,
useModifiedTemplate
:
true
}
}
else
{
// 没有修改模板,直接使用原模板
taskData
=
{
taskData
=
{
id
:
this
.
form
.
id
,
id
:
this
.
form
.
id
,
campaignTemplateId
:
this
.
form
.
campaignTemplateId
}
}
}
else
{
// 使用临时模板,创建临时模板并使用
const
templateData
=
{
name
:
this
.
form
.
tempTemplateName
,
campaign_type
:
this
.
form
.
campaign_type
,
campaign_type
:
this
.
form
.
campaign_type
,
appS
tore
:
this
.
form
.
appStore
,
app_s
tore
:
this
.
form
.
appStore
,
daily_budget
:
this
.
form
.
daily_budget
,
daily_budget
:
this
.
form
.
daily_budget
,
bidding_type
:
this
.
form
.
bidding_type
,
bidding_type
:
this
.
form
.
bidding_type
,
target_roas
:
this
.
form
.
target_roas
,
target_roas
:
this
.
form
.
target_roas
,
app_groups
:
this
.
form
.
app_groups
,
location_groups
:
this
.
form
.
location_groups
,
material_groups
:
this
.
form
.
material_groups
,
title_groups
:
this
.
form
.
title_groups
,
description_groups
:
this
.
form
.
description_groups
,
is_temp
:
1
// 标记为临时模板
}
}
taskData
=
{
// 将应用列表数据转换为接口所需格式
id
:
this
.
form
.
id
,
taskData
.
apps
=
this
.
appListData
.
map
(
app
=>
({
tempTemplate
:
templateData
pkg
:
app
.
appId
,
}
campaignCount
:
app
.
campaignCount
||
1
}
}));
// 将地域组数据转换为接口所需格式
taskData
.
locationGroups
=
this
.
selectedLocationGroups
.
map
(
group
=>
({
locationGroupId
:
group
.
id
,
campaignCount
:
group
.
campaignCount
||
1
}));
// 标题组、描述组、素材组保持数组格式
taskData
.
titleGroups
=
this
.
form
.
title_groups
;
taskData
.
descriptionGroups
=
this
.
form
.
description_groups
;
taskData
.
materialGroups
=
this
.
form
.
material_groups
;
let
response
let
response
if
(
this
.
isEdit
)
{
if
(
this
.
isEdit
)
{
...
@@ -958,13 +926,14 @@ export default {
...
@@ -958,13 +926,14 @@ export default {
}
else
{
}
else
{
response
=
await
createCampaignTask
(
taskData
)
response
=
await
createCampaignTask
(
taskData
)
}
}
console
.
log
(
'提交结果:'
,
response
)
if
(
response
.
data
&&
response
.
data
.
code
===
200
)
{
if
(
response
.
status
===
200
)
{
this
.
$message
.
success
(
this
.
isEdit
?
'更新成功'
:
'创建成功'
)
this
.
$message
.
success
(
this
.
isEdit
?
'更新成功'
:
'创建成功'
)
this
.
dialogVisible
=
false
this
.
dialogVisible
=
false
this
.
fetchData
()
this
.
fetchData
()
}
else
{
}
else
{
this
.
$message
.
error
(
response
.
data
.
message
||
'操作失败'
)
this
.
$message
.
error
(
response
.
msg
||
'操作失败'
)
}
}
}
catch
(
error
)
{
}
catch
(
error
)
{
console
.
error
(
'提交失败:'
,
error
)
console
.
error
(
'提交失败:'
,
error
)
...
@@ -976,44 +945,7 @@ export default {
...
@@ -976,44 +945,7 @@ export default {
})
})
},
},
// 检查模板是否被修改
isTemplateModified
()
{
if
(
!
this
.
selectedTemplate
)
return
false
const
template
=
this
.
selectedTemplate
// 比较各个字段值是否有变化
if
(
template
.
campaign_type
!==
this
.
form
.
campaign_type
)
return
true
if
(
template
.
appStore
!==
this
.
form
.
appStore
)
return
true
if
(
template
.
daily_budget
!==
this
.
form
.
daily_budget
)
return
true
if
(
template
.
bidding_type
!==
this
.
form
.
bidding_type
)
return
true
if
(
template
.
target_roas
!==
this
.
form
.
target_roas
)
return
true
// 比较数组是否有变化
const
compareArrays
=
(
arr1
,
arr2
)
=>
{
if
(
!
arr1
&&
!
arr2
)
return
true
if
(
!
arr1
||
!
arr2
)
return
false
if
(
arr1
.
length
!==
arr2
.
length
)
return
false
// 排序后比较各元素
const
sorted1
=
[...
arr1
].
sort
()
const
sorted2
=
[...
arr2
].
sort
()
for
(
let
i
=
0
;
i
<
sorted1
.
length
;
i
++
)
{
if
(
sorted1
[
i
]
!==
sorted2
[
i
])
return
false
}
return
true
}
if
(
!
compareArrays
(
template
.
app_groups
,
this
.
form
.
app_groups
))
return
true
if
(
!
compareArrays
(
template
.
location_groups
,
this
.
form
.
location_groups
))
return
true
if
(
!
compareArrays
(
template
.
material_groups
,
this
.
form
.
material_groups
))
return
true
if
(
!
compareArrays
(
template
.
title_groups
,
this
.
form
.
title_groups
))
return
true
if
(
!
compareArrays
(
template
.
description_groups
,
this
.
form
.
description_groups
))
return
true
return
false
},
showErrorReason
()
{
showErrorReason
()
{
this
.
errorReasonVisible
=
true
;
this
.
errorReasonVisible
=
true
;
...
@@ -1393,6 +1325,8 @@ export default {
...
@@ -1393,6 +1325,8 @@ export default {
async
fetchAppsForSelector
()
{
async
fetchAppsForSelector
()
{
try
{
try
{
this
.
appsLoading
=
true
;
// 显示加载状态
const
params
=
{
const
params
=
{
platformId
:
5
,
platformId
:
5
,
menuCode
:
"game.Overview,android"
,
menuCode
:
"game.Overview,android"
,
...
@@ -1400,10 +1334,15 @@ export default {
...
@@ -1400,10 +1334,15 @@ export default {
const
response
=
await
getSelectApps
(
params
);
const
response
=
await
getSelectApps
(
params
);
if
(
response
.
status
===
200
)
{
if
(
response
.
status
===
200
)
{
this
.
selectApps
=
response
.
result
.
data
||
[];
this
.
selectApps
=
response
.
result
.
data
||
[];
}
else
{
console
.
error
(
"获取应用列表失败:"
,
response
);
this
.
$message
.
error
(
"获取应用列表失败"
);
}
}
}
catch
(
error
)
{
}
catch
(
error
)
{
console
.
error
(
"获取应用列表失败:"
,
error
);
console
.
error
(
"获取应用列表失败:"
,
error
);
this
.
$message
.
error
(
"获取应用列表失败"
);
this
.
$message
.
error
(
"获取应用列表失败"
);
}
finally
{
this
.
appsLoading
=
false
;
// 隐藏加载状态
}
}
},
},
...
@@ -1439,7 +1378,7 @@ export default {
...
@@ -1439,7 +1378,7 @@ export default {
}
}
// 检查是否已经存在
// 检查是否已经存在
const
exists
=
this
.
appListData
.
some
(
item
=>
item
.
appId
===
appInfo
.
pkg
||
item
.
id
===
appInfo
.
id
);
const
exists
=
this
.
appListData
.
some
(
item
=>
item
.
appId
===
appInfo
.
value
||
item
.
id
===
appInfo
.
id
);
if
(
exists
)
{
if
(
exists
)
{
this
.
$message
.
warning
(
'该应用已经在列表中'
);
this
.
$message
.
warning
(
'该应用已经在列表中'
);
return
;
return
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment