refactor: 关联页面项目默认为当前项目
This commit is contained in:
parent
04bf8111f5
commit
cd8c7a9124
|
@ -310,8 +310,6 @@ export default {
|
|||
}
|
||||
item.passRate=item.passRate+'%'
|
||||
})
|
||||
console.log(this.tableData)
|
||||
|
||||
});
|
||||
},
|
||||
copyData(status) {
|
||||
|
|
|
@ -34,6 +34,7 @@
|
|||
import MsDialogFooter from '../../../../../common/components/MsDialogFooter'
|
||||
import SelectMenu from "../../../../common/SelectMenu";
|
||||
import RelevanceDialog from "./RelevanceDialog";
|
||||
import {getCurrentProjectID} from "@/common/js/utils";
|
||||
|
||||
export default {
|
||||
name: "TestCaseRelevanceBase",
|
||||
|
@ -93,10 +94,17 @@
|
|||
this.result = this.$get("/project/listAll", res => {
|
||||
let data = res.data;
|
||||
if (data) {
|
||||
const index = data.findIndex(d => d.id === getCurrentProjectID());
|
||||
this.projects = data;
|
||||
this.projectId = data[0].id;
|
||||
this.projectName = data[0].name;
|
||||
this.changeProject(data[0]);
|
||||
if (index !== -1) {
|
||||
this.projectId = data[index].id;
|
||||
this.projectName = data[index].name;
|
||||
this.changeProject(data[index]);
|
||||
} else {
|
||||
this.projectId = data[0].id;
|
||||
this.projectName = data[0].name;
|
||||
this.changeProject(data[0]);
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue