perf: 重复添加任务列表的情况

This commit is contained in:
kuaifan 2024-11-22 23:31:02 +08:00
parent bfb2db8a3f
commit 65b8e2270e

View File

@ -518,6 +518,7 @@ export default {
searchText: '', searchText: '',
addColumnShow: false, addColumnShow: false,
addColumnLoad: false,
addColumnName: '', addColumnName: '',
sortData: [], sortData: [],
@ -1047,21 +1048,25 @@ export default {
addColumnSubmit() { addColumnSubmit() {
let name = this.addColumnName.trim(); let name = this.addColumnName.trim();
if (name === '') { if (name === '' || this.addColumnLoad) {
return; return;
} }
this.addColumnLoad = true
this.$store.dispatch("call", { this.$store.dispatch("call", {
url: 'project/column/add', url: 'project/column/add',
data: { data: {
project_id: this.projectId, project_id: this.projectId,
name: name, name: name,
}, },
spinner: 600,
}).then(({data, msg}) => { }).then(({data, msg}) => {
$A.messageSuccess(msg); $A.messageSuccess(msg);
this.addColumnName = ''; this.addColumnName = '';
this.$store.dispatch("saveColumn", data); this.$store.dispatch("saveColumn", data);
}).catch(({msg}) => { }).catch(({msg}) => {
$A.modalError(msg); $A.modalError(msg);
}).finally(() => {
this.addColumnLoad = false;
}); });
}, },