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
dfd32a5e
Commit
dfd32a5e
authored
Sep 24, 2025
by
hzl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 处理修改
parent
0a740254
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
120 additions
and
50 deletions
+120
-50
CampaignTaskManage.vue
src/views/campaignTask/CampaignTaskManage.vue
+73
-4
CampaignTemplateManage.vue
src/views/campaignTemplate/CampaignTemplateManage.vue
+47
-46
No files found.
src/views/campaignTask/CampaignTaskManage.vue
View file @
dfd32a5e
...
...
@@ -60,6 +60,20 @@
</
template
>
</el-table-column>
<el-table-column
prop=
"campaignNameList"
label=
"计划名称"
width=
"200"
>
<
template
slot-scope=
"scope"
>
<div
v-if=
"scope.row.campaignNameList"
class=
"campaign-names"
>
<div
v-for=
"(name, index) in scope.row.campaignNameList.split(',')"
:key=
"index"
class=
"campaign-name-item"
>
{{
name
.
trim
()
}}
</div>
</div>
<span
v-else
>
-
</span>
</
template
>
</el-table-column>
<el-table-column
prop=
"startTime"
label=
"开始时间"
width=
"180"
>
<
template
slot-scope=
"scope"
>
{{
scope
.
row
.
startTime
?
moment
(
scope
.
row
.
startTime
).
format
(
'YYYY-MM-DD HH:mm:ss'
)
:
''
}}
...
...
@@ -1282,6 +1296,18 @@ export default {
if
(
this
.
form
.
platform
===
2
)
{
// 修改字段名
taskData
.
tiktok_json
=
JSON
.
stringify
(
this
.
form
.
tiktok_json
);
// 添加计划名称列表字段
if
(
this
.
form
.
tiktok_json
.
campaignIdList
&&
this
.
form
.
tiktok_json
.
campaignIdList
.
length
>
0
)
{
// 根据选中的计划ID找到对应的计划名称
const
selectedCampaignNames
=
this
.
form
.
tiktok_json
.
campaignIdList
.
map
(
campaignId
=>
{
const
campaign
=
this
.
campaignOptions
.
find
(
item
=>
item
.
campaignId
===
campaignId
);
return
campaign
?
campaign
.
campaignName
:
campaignId
;
});
taskData
.
campaignNameList
=
selectedCampaignNames
.
join
(
','
);
}
else
{
taskData
.
campaignNameList
=
''
;
}
}
// 将应用列表数据转换为接口所需格式
...
...
@@ -1579,13 +1605,30 @@ export default {
return
;
}
// 只有在不保留设备机型的情况下才清空(用户主动切换账户时)
if
(
!
preserveDeviceModels
)
{
this
.
form
.
tiktok_json
.
deviceModels
=
[];
}
// 保存当前选中的设备机型
const
currentDeviceModels
=
[...
this
.
form
.
tiktok_json
.
deviceModels
];
await
this
.
fetchCampaignList
(
advertiserId
);
await
this
.
fetchDeviceModelList
(
advertiserId
);
// 如果之前有选中的设备机型,且新账户的设备机型列表中包含这些机型,则保持选中状态
if
(
currentDeviceModels
.
length
>
0
)
{
this
.
$nextTick
(()
=>
{
const
availableDeviceModels
=
this
.
deviceModelOptions
.
map
(
item
=>
item
.
device_model_id
);
const
validDeviceModels
=
currentDeviceModels
.
filter
(
modelId
=>
availableDeviceModels
.
includes
(
modelId
)
);
if
(
validDeviceModels
.
length
>
0
)
{
this
.
form
.
tiktok_json
.
deviceModels
=
validDeviceModels
;
console
.
log
(
'保持设备机型选择:'
,
validDeviceModels
);
}
else
{
// 如果之前的设备机型在新账户中不可用,则清空
this
.
form
.
tiktok_json
.
deviceModels
=
[];
console
.
log
(
'设备机型在新账户中不可用,已清空'
);
}
});
}
},
// 修改搜索处理方法
...
...
@@ -2396,4 +2439,30 @@ export default {
width
:
100%
;
}
}
/* 计划名称换行显示样式 */
.campaign-names
{
max-height
:
80px
;
overflow-y
:
auto
;
}
.campaign-name-item
{
padding
:
2px
4px
;
margin
:
1px
0
;
background-color
:
#f0f9ff
;
border
:
1px
solid
#bae6fd
;
border-radius
:
3px
;
font-size
:
12px
;
color
:
#0369a1
;
white-space
:
nowrap
;
overflow
:
hidden
;
text-overflow
:
ellipsis
;
transition
:
all
0
.2s
ease
;
}
.campaign-name-item
:hover
{
background-color
:
#e0f2fe
;
border-color
:
#7dd3fc
;
transform
:
translateX
(
2px
);
}
</
style
>
src/views/campaignTemplate/CampaignTemplateManage.vue
View file @
dfd32a5e
...
...
@@ -499,7 +499,7 @@ export default {
// 初始化tiktok_json为对象而不是null
tiktok_json
:
{
optimizationGoal
:
'VALUE'
,
optimizationEvent
:
''
,
optimizationEvent
:
'
AD_REVENUE_VALUE
'
,
deepBidType
:
'VO_MIN_ROAS'
,
// deepCpaBid: 0,
roasBid
:
0
,
...
...
@@ -930,7 +930,7 @@ export default {
// 初始化为对象而不是null
tiktok_json
:
{
optimizationGoal
:
'VALUE'
,
optimizationEvent
:
''
,
optimizationEvent
:
'
AD_REVENUE_VALUE
'
,
deepBidType
:
'VO_MIN_ROAS'
,
// deepCpaBid: 0,
roasBid
:
0
,
...
...
@@ -1004,7 +1004,7 @@ export default {
// 处理tiktok_json字段
let
tiktokJsonData
=
{
optimizationGoal
:
'VALUE'
,
optimizationEvent
:
''
,
optimizationEvent
:
'
AD_REVENUE_VALUE
'
,
deepBidType
:
'VO_MIN_ROAS'
,
// deepCpaBid: 0,
roasBid
:
0
,
...
...
@@ -1230,27 +1230,46 @@ export default {
}
},
// 处理广告主变化
async
handleAdvertiserChange
(
advertiserId
)
{
if
(
!
advertiserId
)
{
this
.
campaignOptions
=
[];
this
.
tiktokCampaignIdList
=
[];
this
.
deviceModelOptions
=
[];
this
.
tiktokDeviceModels
=
[];
return
;
}
// 切换账户时清空之前选择的设备机型
this
.
tiktokDeviceModels
=
[];
// 处理广告主变化
async
handleAdvertiserChange
(
advertiserId
)
{
if
(
!
advertiserId
)
{
this
.
campaignOptions
=
[];
this
.
tiktokCampaignIdList
=
[];
this
.
deviceModelOptions
=
[];
this
.
tiktokDeviceModels
=
[];
return
;
}
await
this
.
fetchCampaignList
(
advertiserId
);
await
this
.
fetchDeviceModelList
(
advertiserId
);
// 如果是新增模板,在获取设备机型列表后设置默认值
if
(
!
this
.
form
.
id
)
{
this
.
setDefaultDeviceModels
();
}
},
// 保存当前选中的设备机型
const
currentDeviceModels
=
[...
this
.
tiktokDeviceModels
];
await
this
.
fetchCampaignList
(
advertiserId
);
await
this
.
fetchDeviceModelList
(
advertiserId
);
// 如果之前有选中的设备机型,且新账户的设备机型列表中包含这些机型,则保持选中状态
if
(
currentDeviceModels
.
length
>
0
)
{
this
.
$nextTick
(()
=>
{
const
availableDeviceModels
=
this
.
deviceModelOptions
.
map
(
item
=>
item
.
device_model_id
);
const
validDeviceModels
=
currentDeviceModels
.
filter
(
modelId
=>
availableDeviceModels
.
includes
(
modelId
)
);
if
(
validDeviceModels
.
length
>
0
)
{
this
.
tiktokDeviceModels
=
validDeviceModels
;
console
.
log
(
'保持设备机型选择:'
,
validDeviceModels
);
}
else
{
// 如果之前的设备机型在新账户中不可用,则设置默认值
this
.
setDefaultDeviceModels
();
console
.
log
(
'设备机型在新账户中不可用,已设置默认值'
);
}
});
}
else
{
// 如果是新增模板且没有之前的设备机型选择,设置默认值
if
(
!
this
.
form
.
id
)
{
this
.
setDefaultDeviceModels
();
}
}
},
// 获取计划列表
async
fetchCampaignList
(
advertiserId
)
{
...
...
@@ -1307,29 +1326,11 @@ export default {
// 设置默认设备机型
setDefaultDeviceModels
()
{
// 默认选中的设备机型ID列表
const
defaultDeviceModelIds
=
[
'298'
,
// Discovery
'177'
,
// Google
'203'
,
// ITEL
'145'
,
// Motorola
'172'
,
// Nokia
'181'
,
// RealMe
'109'
,
// Samsung
'114'
,
// TECNO
'125'
,
// Zen Admire Unity
'130'
// ZTE
];
// 检查哪些默认机型在当前可选项中存在
const
availableDefaultIds
=
defaultDeviceModelIds
.
filter
(
id
=>
this
.
deviceModelOptions
.
some
(
device
=>
device
.
device_model_id
===
id
)
);
// 设置默认选中的设备机型
if
(
availableDefaultIds
.
length
>
0
)
{
this
.
tiktokDeviceModels
=
availableDefaultIds
;
console
.
log
(
'设置默认设备机型:'
,
availableDefaultIds
);
// 默认全选所有可用的安卓设备机型
if
(
this
.
deviceModelOptions
.
length
>
0
)
{
const
allDeviceModelIds
=
this
.
deviceModelOptions
.
map
(
device
=>
device
.
device_model_id
);
this
.
tiktokDeviceModels
=
allDeviceModelIds
;
console
.
log
(
'设置默认全选设备机型:'
,
allDeviceModelIds
);
}
},
}
...
...
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