no message

This commit is contained in:
kuaifan 2021-06-12 21:52:13 +08:00
parent 153fe1b2fb
commit cacba4f9a6
2 changed files with 21 additions and 12 deletions

View File

@ -821,9 +821,8 @@ export default {
Object.keys(updata).forEach(key => this.$set(task, key, updata[key]));
this.$store.dispatch("taskUpdate", Object.assign(updata, {
task_id: task.id,
})).then(({data}) => {
})).then(() => {
this.$set(task, 'loading', false);
Object.keys(data).forEach(key => this.$set(task, key, data[key]));
}).catch(({msg}) => {
this.$set(task, 'loading', false);
$A.modalError(msg);

View File

@ -374,6 +374,24 @@ export default {
}
},
/**
* 更新任务信息
* @param state
* @param data
*/
taskData({state}, data) {
state.projectDetail.project_column.some(({project_task}) => {
let index = project_task.findIndex(({id}) => id === data.id);
if (index > -1) {
project_task.splice(index, 1, Object.assign(project_task[index], data))
return true;
}
});
if (data.id == state.projectOpenTask.id) {
state.projectOpenTask = Object.assign({}, state.projectOpenTask, data);
}
},
/**
* 获取任务信息
* @param state
@ -389,16 +407,7 @@ export default {
task_id,
},
}).then(result => {
state.projectDetail.project_column.some(({project_task}) => {
let index = project_task.findIndex(({id}) => id === task_id);
if (index > -1) {
project_task.splice(index, 1, Object.assign(project_task[index], result.data))
return true;
}
});
if (task_id == state.projectOpenTask.id) {
state.projectOpenTask = Object.assign({}, state.projectOpenTask, result.data);
}
dispatch("taskData", result.data);
resolve(result)
}).catch(result => {
reject(result)
@ -549,6 +558,7 @@ export default {
if (typeof updata.complete_at !== "undefined") {
dispatch('projectOne', result.data.project_id);
}
dispatch("taskData", result.data);
resolve(result)
}).catch(result => {
dispatch('taskOne', data.id);