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
ec521995
Commit
ec521995
authored
Jul 08, 2025
by
huangzhenglong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 增加loading效果防止重复提交
parent
1e2e1de6
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
3 deletions
+11
-3
CampaignTaskManage.vue
src/views/campaignTask/CampaignTaskManage.vue
+11
-3
No files found.
src/views/campaignTask/CampaignTaskManage.vue
View file @
ec521995
...
@@ -79,8 +79,8 @@
...
@@ -79,8 +79,8 @@
<
template
slot-scope=
"scope"
>
<
template
slot-scope=
"scope"
>
<el-tag
<el-tag
:type=
"getStatusType(scope.row.status)"
:type=
"getStatusType(scope.row.status)"
:class=
"
{'clickable-tag': scope.row.status === 4}"
:class=
"
{'clickable-tag': scope.row.status ===
3 || scope.row.status ===
4}"
@click="
scope.row.status === 4
&&
showErrorMessage(scope.row)">
@click="
(scope.row.status === 3 || scope.row.status === 4)
&&
showErrorMessage(scope.row)">
{{
getStatusText
(
scope
.
row
.
status
)
}}
{{
getStatusText
(
scope
.
row
.
status
)
}}
</el-tag>
</el-tag>
</
template
>
</
template
>
...
@@ -109,6 +109,7 @@
...
@@ -109,6 +109,7 @@
icon=
"el-icon-video-play"
icon=
"el-icon-video-play"
circle
circle
title=
"开始"
title=
"开始"
:loading=
"startLoading"
@
click=
"handleStart(scope.row)"
></el-button>
@
click=
"handleStart(scope.row)"
></el-button>
<el-button
<el-button
v-else
v-else
...
@@ -564,6 +565,7 @@ export default {
...
@@ -564,6 +565,7 @@ export default {
const
start
=
end
.
clone
().
subtract
(
7
,
'day'
)
const
start
=
end
.
clone
().
subtract
(
7
,
'day'
)
return
{
return
{
loading
:
false
,
loading
:
false
,
startLoading
:
false
,
// 新增:任务启动loading状态
condition
:
{
condition
:
{
templateId
:
null
,
templateId
:
null
,
status
:
null
,
status
:
null
,
...
@@ -862,6 +864,10 @@ export default {
...
@@ -862,6 +864,10 @@ export default {
},
},
async
handleStart
(
row
)
{
async
handleStart
(
row
)
{
if
(
this
.
startLoading
)
{
return
;
}
this
.
startLoading
=
true
;
try
{
try
{
const
response
=
await
axios
.
post
(
process
.
env
.
PUTIN_API
+
`/campaign-tasks/start?campaignTaskId=
${
row
.
id
}
`
)
const
response
=
await
axios
.
post
(
process
.
env
.
PUTIN_API
+
`/campaign-tasks/start?campaignTaskId=
${
row
.
id
}
`
)
if
(
response
.
status
==
200
)
{
if
(
response
.
status
==
200
)
{
...
@@ -876,6 +882,8 @@ export default {
...
@@ -876,6 +882,8 @@ export default {
const
errorMessage
=
error
.
response
&&
error
.
response
.
data
&&
error
.
response
.
data
.
message
?
const
errorMessage
=
error
.
response
&&
error
.
response
.
data
&&
error
.
response
.
data
.
message
?
error
.
response
.
data
.
message
:
error
.
message
error
.
response
.
data
.
message
:
error
.
message
this
.
$message
.
error
(
'任务开始失败:'
+
errorMessage
)
this
.
$message
.
error
(
'任务开始失败:'
+
errorMessage
)
}
finally
{
this
.
startLoading
=
false
;
}
}
},
},
...
...
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