fix(测试跟踪): 修复创建用例默认没有选择模块问题

This commit is contained in:
fit2-zhao 2021-04-01 19:11:50 +08:00 committed by fit2-zhao
parent b101be03a0
commit c201ec94ab
1 changed files with 10 additions and 2 deletions

View File

@ -419,6 +419,10 @@ export default {
this.form.module = this.selectNode.data.id; this.form.module = this.selectNode.data.id;
this.form.nodePath = this.selectNode.data.path; this.form.nodePath = this.selectNode.data.path;
} }
if((!this.form.module || this.form.module==="default-module" || this.form.module ==="root") && this.treeNodes.length > 0){
this.form.module = this.treeNodes[0].id;
this.form.nodePath = this.treeNodes[0].path;
}
}, },
// watch: { // watch: {
// treeNodes() { // treeNodes() {
@ -441,6 +445,10 @@ export default {
this.form.module = this.currentTestCaseInfo.nodeId; this.form.module = this.currentTestCaseInfo.nodeId;
this.form.nodePath = this.currentTestCaseInfo.nodePath; this.form.nodePath = this.currentTestCaseInfo.nodePath;
} }
if((!this.form.module || this.form.module==="default-module" || this.form.module ==="root") && this.treeNodes.length > 0){
this.form.module = this.treeNodes[0].id;
this.form.nodePath = this.treeNodes[0].path;
}
}, },
methods: { methods: {
setModule(id,data) { setModule(id,data) {