Merge remote-tracking branch 'origin/master'

This commit is contained in:
wenyann 2021-03-25 10:32:32 +08:00
commit 66708eca81
1 changed files with 10 additions and 3 deletions

View File

@ -313,10 +313,17 @@ export default {
this.$post("/test/case/review/projects", {reviewId: this.reviewId}, res => {
let data = res.data;
if (data) {
this.currentProject = data[0];
this.projects = data;
this.projectId = data[0].id;
this.projectName = data[0].name;
const index = data.findIndex(d => d.id === this.$store.state.projectId);
if (index !== -1) {
this.projectId = data[index].id;
this.projectName = data[index].name;
this.currentProject = data[index];
} else {
this.projectId = data[0].id;
this.projectName = data[0].name;
this.currentProject = data[0];
}
}
})
}