Skip to content

Commit

Permalink
添加任务后继续添加
Browse files Browse the repository at this point in the history
  • Loading branch information
kuaifan committed Dec 20, 2021
1 parent 6faf7e7 commit 40e8e47
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 13 deletions.
7 changes: 4 additions & 3 deletions resources/assets/js/pages/manage/components/ProjectList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,7 @@
<div slot="footer">
<Button type="default" @click="addShow=false">{{$L('取消')}}</Button>
<Button type="primary" :loading="addLoad > 0" @click="onAddTask">{{$L('添加')}}</Button>
<Button type="primary" :loading="addLoad > 0" @click="onAddTask(true)">{{$L('添加并继续')}}</Button>
</div>
</Modal>

Expand Down Expand Up @@ -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) {
Expand Down
32 changes: 22 additions & 10 deletions resources/assets/js/pages/manage/components/TaskAdd.vue
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,8 @@ export default {
data() {
return {
addData: {
name: "",
content: "",
owner: 0,
column_id: 0,
times: [],
Expand Down Expand Up @@ -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)
Expand All @@ -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);
Expand Down
2 changes: 2 additions & 0 deletions resources/assets/js/pages/manage/components/TaskAddSimple.vue
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ export default {
data() {
return {
addData: {
name: "",
owner: 0,
column_id: 0,
times: [],
Expand Down Expand Up @@ -206,6 +207,7 @@ export default {
this.loadIng--;
this.active = false;
this.addData = {
name: "",
owner: 0,
column_id: 0,
times: [],
Expand Down

0 comments on commit 40e8e47

Please sign in to comment.