diff --git a/frontend/src/business/components/track/case/components/TestCaseEdit.vue b/frontend/src/business/components/track/case/components/TestCaseEdit.vue index aea39df948..9d0d1d0dce 100644 --- a/frontend/src/business/components/track/case/components/TestCaseEdit.vue +++ b/frontend/src/business/components/track/case/components/TestCaseEdit.vue @@ -416,8 +416,12 @@ export default { }); }, 1000); if(this.selectNode && this.selectNode.data && !this.form.id){ - this.form.module = this.selectNode.data.id; - this.form.nodePath = this.selectNode.data.path; + this.form.module = this.selectNode.data.id; + 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: { @@ -441,6 +445,10 @@ export default { this.form.module = this.currentTestCaseInfo.nodeId; 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: { setModule(id,data) {