From 40e8e473985cc08108f44de6a7ad525fb92282b7 Mon Sep 17 00:00:00 2001 From: kuaifan Date: Mon, 20 Dec 2021 18:52:24 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=BB=BB=E5=8A=A1=E5=90=8E?= =?UTF-8?q?=E7=BB=A7=E7=BB=AD=E6=B7=BB=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pages/manage/components/ProjectList.vue | 7 ++-- .../js/pages/manage/components/TaskAdd.vue | 32 +++++++++++++------ .../pages/manage/components/TaskAddSimple.vue | 2 ++ 3 files changed, 28 insertions(+), 13 deletions(-) diff --git a/resources/assets/js/pages/manage/components/ProjectList.vue b/resources/assets/js/pages/manage/components/ProjectList.vue index f1528105c..9cd75557f 100644 --- a/resources/assets/js/pages/manage/components/ProjectList.vue +++ b/resources/assets/js/pages/manage/components/ProjectList.vue @@ -297,6 +297,7 @@
+
@@ -638,14 +639,14 @@ export default { }); }, - onAddTask() { + onAddTask(again) { this.addLoad++; this.$refs.add.onAdd((success) => { this.addLoad--; - if (success) { + if (success && again !== true) { this.addShow = false; } - }) + }, again) }, addTopShow(id, show) { diff --git a/resources/assets/js/pages/manage/components/TaskAdd.vue b/resources/assets/js/pages/manage/components/TaskAdd.vue index eb349bc03..58421b270 100644 --- a/resources/assets/js/pages/manage/components/TaskAdd.vue +++ b/resources/assets/js/pages/manage/components/TaskAdd.vue @@ -125,6 +125,8 @@ export default { data() { return { addData: { + name: "", + content: "", owner: 0, column_id: 0, times: [], @@ -283,7 +285,7 @@ export default { setData(data) { this.addData = Object.assign({}, this.addData, data); }, - onAdd(callback) { + onAdd(callback, again) { if (!this.addData.name) { $A.messageError("任务描述不能为空"); callback(false) @@ -293,15 +295,25 @@ export default { project_id: this.projectId })).then(({msg}) => { $A.messageSuccess(msg); - this.addData = { - owner: 0, - column_id: 0, - times: [], - subtasks: [], - p_level: 0, - p_name: '', - p_color: '', - }; + if (again === true) { + this.addData = Object.assign({}, this.addData, { + name: "", + content: "", + subtasks: [], + }); + } else { + this.addData = { + name: "", + content: "", + owner: 0, + column_id: 0, + times: [], + subtasks: [], + p_level: 0, + p_name: '', + p_color: '', + }; + } callback(true) }).catch(({msg}) => { $A.modalError(msg); diff --git a/resources/assets/js/pages/manage/components/TaskAddSimple.vue b/resources/assets/js/pages/manage/components/TaskAddSimple.vue index 2b21a1c58..da54bc9b7 100644 --- a/resources/assets/js/pages/manage/components/TaskAddSimple.vue +++ b/resources/assets/js/pages/manage/components/TaskAddSimple.vue @@ -103,6 +103,7 @@ export default { data() { return { addData: { + name: "", owner: 0, column_id: 0, times: [], @@ -206,6 +207,7 @@ export default { this.loadIng--; this.active = false; this.addData = { + name: "", owner: 0, column_id: 0, times: [],