no message

This commit is contained in:
kuaifan 2021-06-15 00:45:36 +08:00
parent 3f69a3e6dd
commit 7b91a53a71
5 changed files with 23 additions and 20 deletions

View File

@ -162,6 +162,7 @@ export default {
mounted() {
this.$store.dispatch("getUserInfo");
this.$store.dispatch("getTaskPriority");
},
deactivated() {

View File

@ -293,7 +293,7 @@
maxWidth: '640px'
}"
:mask-closable="false">
<TaskAdd v-model="addData"/>
<TaskAdd ref="add" v-model="addData"/>
<div slot="footer">
<Button type="default" @click="addShow=false">{{$L('取消')}}</Button>
<Button type="primary" :loading="taskLoad > 0" @click="onAddTask">{{$L('添加')}}</Button>
@ -619,6 +619,7 @@ export default {
this.$set(this.addData, 'column_id', column_id);
this.$set(this.addData, 'project_id', this.projectDetail.id);
}
this.$refs.add.defaultPriority();
this.addShow = true;
},

View File

@ -159,13 +159,6 @@ export default {
},
}
},
mounted() {
this.$store.dispatch('getTaskPriority').then(() => {
if (!this.value.p_name && this.taskPriority.length > 0) {
this.choosePriority(this.taskPriority[0])
}
})
},
computed: {
...mapState(['userId', 'projectDetail', 'taskPriority']),
},
@ -259,6 +252,15 @@ export default {
this.$set(this.value, 'p_level', item.priority)
this.$set(this.value, 'p_name', item.name)
this.$set(this.value, 'p_color', item.color)
},
defaultPriority() {
if (this.taskPriority.length === 0) {
return;
}
if (this.value.p_name) {
return;
}
this.choosePriority(this.taskPriority[0]);
}
}
}

View File

@ -105,18 +105,8 @@ export default {
openAdd() {
this.active = true;
this.defaultPriority();
this.$nextTick(() => {
if (this.taskPriority.length === 0) {
this.$store.dispatch('getTaskPriority').then(() => {
if (!this.addData.p_name && this.taskPriority.length > 0) {
this.choosePriority(this.taskPriority[0])
}
});
} else {
if (!this.addData.p_name && this.taskPriority.length > 0) {
this.choosePriority(this.taskPriority[0])
}
}
this.$refs.input.focus();
});
},
@ -178,6 +168,16 @@ export default {
this.$set(this.addData, 'p_name', item.name)
this.$set(this.addData, 'p_color', item.color)
this.$refs.input.focus()
},
defaultPriority() {
if (this.taskPriority.length === 0) {
return;
}
if (this.addData.p_name) {
return;
}
this.choosePriority(this.taskPriority[0]);
}
}
}

View File

@ -444,7 +444,6 @@ export default {
},
mounted() {
this.$store.dispatch('getTaskPriority');
this.nowInterval = setInterval(() => {
this.nowTime = Math.round(new Date().getTime() / 1000);
}, 1000);