mirror of
https://github.com/kuaifan/dootask.git
synced 2025-12-14 21:02:49 +00:00
feat: 任务创建窗口自动选择上次添加的项目
This commit is contained in:
parent
bbf7277abc
commit
abd87f3584
@ -212,7 +212,10 @@ export default {
|
|||||||
this.$nextTick(this.$refs.input.focus)
|
this.$nextTick(this.$refs.input.focus)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
'addData.column_id' () {
|
'addData.project_id'(id) {
|
||||||
|
this.$store.state.method.setStorage("cacheAddTaskProjectId", id);
|
||||||
|
},
|
||||||
|
'addData.column_id'(id) {
|
||||||
const {project_id, column_id} = this.addData;
|
const {project_id, column_id} = this.addData;
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
if (project_id && column_id) {
|
if (project_id && column_id) {
|
||||||
@ -221,6 +224,7 @@ export default {
|
|||||||
this.$set(this.addData, 'cascader', []);
|
this.$set(this.addData, 'cascader', []);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
this.$store.state.method.setStorage("cacheAddTaskColumnId", id);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
@ -305,15 +309,21 @@ export default {
|
|||||||
this.addData.column_id = column.id;
|
this.addData.column_id = column.id;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
let project = this.projects.find(({id}) => id == this.projectId) || this.projects.find(({id}) => id > 0);
|
let cacheAddTaskProjectId = this.$store.state.method.getStorageInt("cacheAddTaskProjectId");
|
||||||
|
let cacheAddTaskColumnId = this.$store.state.method.getStorageInt("cacheAddTaskColumnId");
|
||||||
|
let project = this.projects.find(({id}) => id == this.projectId)
|
||||||
|
|| this.projects.find(({id}) => id == cacheAddTaskProjectId)
|
||||||
|
|| this.projects.find(({id}) => id > 0);
|
||||||
if (project) {
|
if (project) {
|
||||||
let column = this.columns.find(({project_id}) => project_id == project.id);
|
let column = this.columns.find(({project_id, id}) => project_id == project.id && id == cacheAddTaskColumnId)
|
||||||
|
|| this.columns.find(({project_id}) => project_id == project.id);
|
||||||
if (column) {
|
if (column) {
|
||||||
this.addData.project_id = column.project_id;
|
this.addData.project_id = column.project_id;
|
||||||
this.addData.column_id = column.id;
|
this.addData.column_id = column.id;
|
||||||
} else {
|
} else {
|
||||||
this.$store.dispatch("getColumns", project.id).then((data) => {
|
this.$store.dispatch("getColumns", project.id).then(() => {
|
||||||
column = data.find(({id}) => id > 0);
|
column = this.columns.find(({project_id, id}) => project_id == project.id && id == cacheAddTaskColumnId)
|
||||||
|
|| this.columns.find(({project_id}) => project_id == project.id);
|
||||||
if (column) {
|
if (column) {
|
||||||
this.addData.project_id = column.project_id;
|
this.addData.project_id = column.project_id;
|
||||||
this.addData.column_id = column.id;
|
this.addData.column_id = column.id;
|
||||||
|
|||||||
5
resources/assets/sass/pages/common.scss
vendored
5
resources/assets/sass/pages/common.scss
vendored
@ -177,6 +177,11 @@ body {
|
|||||||
.adaption {
|
.adaption {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
.ivu-btn {
|
||||||
|
height: 38px;
|
||||||
|
line-height: 36px;
|
||||||
|
min-width: auto;
|
||||||
|
}
|
||||||
.ivu-btn,
|
.ivu-btn,
|
||||||
.ivu-btn-group,
|
.ivu-btn-group,
|
||||||
.ivu-poptip {
|
.ivu-poptip {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user