perf: 重复添加任务的情况

This commit is contained in:
kuaifan 2024-11-22 23:35:10 +08:00
parent 65b8e2270e
commit fb24c63e7f
2 changed files with 8 additions and 1 deletions

View File

@ -104,6 +104,8 @@ export default {
},
data() {
return {
loadIng: 0,
addData: {
name: "",
owner: 0,
@ -205,11 +207,13 @@ export default {
$A.messageWarning("请输入任务描述");
return;
}
if (this.loadIng > 0) {
return;
}
this.loadIng++;
let type = this.parentId > 0 ? 'taskAddSub' : 'taskAdd';
this.$store.dispatch(type, this.getData()).then(({msg}) => {
$A.messageSuccess(msg);
this.loadIng--;
this.active = false;
this.addData = {
name: "",
@ -226,6 +230,7 @@ export default {
}
}).catch(({msg}) => {
$A.modalError(msg);
}).finally(() => {
this.loadIng--;
});
},

View File

@ -2136,6 +2136,7 @@ export default {
dispatch("call", {
url: 'project/task/add',
data: post,
spinner: 600,
method: 'post',
}).then(result => {
if (result.data.is_visible === 1) {
@ -2160,6 +2161,7 @@ export default {
dispatch("call", {
url: 'project/task/addsub',
data: data,
spinner: 600,
}).then(result => {
dispatch("addTaskSuccess", result.data)
resolve(result)