fix: 清空子任务的时间报错闪现的问题

This commit is contained in:
kuaifan 2022-03-04 19:43:54 +08:00
parent 95a3aa7290
commit 152aa0f92b

View File

@ -1484,7 +1484,7 @@ export default {
*/ */
taskUpdate({state, dispatch}, data) { taskUpdate({state, dispatch}, data) {
return new Promise(function (resolve, reject) { return new Promise(function (resolve, reject) {
dispatch("taskBeforeUpdate", data).then(post => { dispatch("taskBeforeUpdate", data).then(({confirm, post}) => {
dispatch("taskLoadStart", post.task_id) dispatch("taskLoadStart", post.task_id)
dispatch("call", { dispatch("call", {
url: 'project/task/update', url: 'project/task/update',
@ -1498,7 +1498,7 @@ export default {
console.warn(e); console.warn(e);
dispatch("taskLoadEnd", post.task_id) dispatch("taskLoadEnd", post.task_id)
dispatch("getTaskOne", post.task_id).catch(() => {}) dispatch("getTaskOne", post.task_id).catch(() => {})
reject(e) setTimeout(() => { reject(e) }, confirm === true ? 301 : 0)
}); });
}).catch(reject) }).catch(reject)
}); });
@ -1585,14 +1585,20 @@ export default {
} }
// //
if (content === null) { if (content === null) {
resolve(post); resolve({
confirm: false,
post
});
return return
} }
$A.modalConfirm({ $A.modalConfirm({
title, title,
content, content,
onOk: () => { onOk: () => {
resolve(post); resolve({
confirm: true,
post
});
}, },
onCancel: () => { onCancel: () => {
reject({msg: false}) reject({msg: false})