no message
This commit is contained in:
parent
153fe1b2fb
commit
cacba4f9a6
@ -821,9 +821,8 @@ export default {
|
|||||||
Object.keys(updata).forEach(key => this.$set(task, key, updata[key]));
|
Object.keys(updata).forEach(key => this.$set(task, key, updata[key]));
|
||||||
this.$store.dispatch("taskUpdate", Object.assign(updata, {
|
this.$store.dispatch("taskUpdate", Object.assign(updata, {
|
||||||
task_id: task.id,
|
task_id: task.id,
|
||||||
})).then(({data}) => {
|
})).then(() => {
|
||||||
this.$set(task, 'loading', false);
|
this.$set(task, 'loading', false);
|
||||||
Object.keys(data).forEach(key => this.$set(task, key, data[key]));
|
|
||||||
}).catch(({msg}) => {
|
}).catch(({msg}) => {
|
||||||
this.$set(task, 'loading', false);
|
this.$set(task, 'loading', false);
|
||||||
$A.modalError(msg);
|
$A.modalError(msg);
|
||||||
|
30
resources/assets/js/store/actions.js
vendored
30
resources/assets/js/store/actions.js
vendored
@ -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
|
* @param state
|
||||||
@ -389,16 +407,7 @@ export default {
|
|||||||
task_id,
|
task_id,
|
||||||
},
|
},
|
||||||
}).then(result => {
|
}).then(result => {
|
||||||
state.projectDetail.project_column.some(({project_task}) => {
|
dispatch("taskData", result.data);
|
||||||
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);
|
|
||||||
}
|
|
||||||
resolve(result)
|
resolve(result)
|
||||||
}).catch(result => {
|
}).catch(result => {
|
||||||
reject(result)
|
reject(result)
|
||||||
@ -549,6 +558,7 @@ export default {
|
|||||||
if (typeof updata.complete_at !== "undefined") {
|
if (typeof updata.complete_at !== "undefined") {
|
||||||
dispatch('projectOne', result.data.project_id);
|
dispatch('projectOne', result.data.project_id);
|
||||||
}
|
}
|
||||||
|
dispatch("taskData", result.data);
|
||||||
resolve(result)
|
resolve(result)
|
||||||
}).catch(result => {
|
}).catch(result => {
|
||||||
dispatch('taskOne', data.id);
|
dispatch('taskOne', data.id);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user