fix:修改任务频繁点击增加多条问题

This commit is contained in:
wyx
2022-12-20 15:35:04 +08:00
parent febf4774ee
commit 4442ca956d
7 changed files with 146 additions and 3 deletions

View File

@@ -317,6 +317,7 @@ export default {
textV2: "",
radioV1: "",
time: "",
isClick: false
});
const closeDrawer = () => {
ctx.emit("update:addactiveVisible", false);
@@ -464,6 +465,13 @@ export default {
return message.warning("请输入活动地址");
}
if(state.isClick){
message.destroy();
message.error('请勿频繁点击')
return
}
state.isClick = true;
let obj = {
activityAddress: state.inputV3, //活动地址
activityDuration: state.inputV2, //活动时长
@@ -489,10 +497,12 @@ export default {
ctx.emit("changeData", false);
message.destroy();
message.success("更新成功");
state.isClick = false;
})
.catch(() => {
message.destroy();
message.error("更新失败");
state.isClick = false;
});
} else {
//新建活动信息
@@ -504,10 +514,12 @@ export default {
closeDrawer();
await updateTask(res);
ctx.emit("changeData", false);
state.isClick = false;
})
.catch(() => {
message.destroy();
message.error("创建失败");
state.isClick = false;
});
}
};