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) { onAddTask(data) {
this.$refs.addTask.defaultPriority(); this.$refs.addTask.defaultPriority();
this.$refs.addTask.setData($A.isJson(data) ? data : { this.$refs.addTask.setData($A.isJson(data) ? data : {
'owner': this.userId, 'owner': [this.userId],
'column_id': data, 'column_id': data,
}); });
this.addTaskShow = true; this.addTaskShow = true;

View File

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

View File

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