perf: 添加任务默认选中自己,如果不选则添加无负责人任务

This commit is contained in:
kuaifan 2022-03-08 00:29:10 +08:00
parent 5afed4b85e
commit 4ff32511b9
3 changed files with 6 additions and 10 deletions

View File

@ -799,7 +799,7 @@ export default {
onAddTask(data) {
this.$refs.addTask.defaultPriority();
this.$refs.addTask.setData($A.isJson(data) ? data : {
'owner': this.userId,
'owner': [this.userId],
'column_id': data,
});
this.addTaskShow = true;

View File

@ -328,7 +328,7 @@ export default {
}
Store.set('addTask', {
times: [start, end],
owner: this.userId,
owner: [this.userId],
beforeClose: () => {
guide.clearGuideElement();
}

View File

@ -176,7 +176,7 @@ export default {
cascader: [],
name: "",
content: "",
owner: 0,
owner: [],
add_assist: 1,
project_id: 0,
column_id: 0,
@ -247,11 +247,7 @@ export default {
},
showAddAssist() {
const {owner} = this.addData;
if ($A.isArray(owner) && owner.includes(this.userId)) {
return false;
}
return owner != this.userId;
return !this.addData.owner.includes(this.userId);
}
},
watch: {
@ -376,8 +372,8 @@ export default {
if (this.subName.trim() !== '') {
this.addData.subtasks.push({
name: this.subName.trim(),
owner: [this.userId],
times: [],
owner: this.userId
});
this.subName = '';
}
@ -489,7 +485,7 @@ export default {
cascader: [],
name: "",
content: "",
owner: 0,
owner: [],
add_assist: 1,
column_id: 0,
times: [],