mirror of
https://github.com/kuaifan/dootask.git
synced 2025-12-13 12:02:51 +00:00
perf: 重复添加任务的情况
This commit is contained in:
parent
65b8e2270e
commit
fb24c63e7f
@ -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--;
|
||||
});
|
||||
},
|
||||
|
||||
2
resources/assets/js/store/actions.js
vendored
2
resources/assets/js/store/actions.js
vendored
@ -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)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user