fix 多个tag下不同项目下用例保存

This commit is contained in:
chenjianxing 2020-05-22 10:28:17 +08:00
parent 8574b1467f
commit 0ace484dd0
4 changed files with 18 additions and 5 deletions

View File

@ -17,6 +17,7 @@
:draggable="true"
:select-node.sync="selectNode"
@refreshTable="refreshTable"
:current-project="currentProject"
ref="nodeTree"/>
</ms-aside-container>
@ -39,6 +40,7 @@
:read-only="testCaseReadOnly"
:tree-nodes="treeNodes"
:select-node="selectNode"
:current-project="currentProject"
ref="testCaseEditDialog">
</test-case-edit>

View File

@ -250,6 +250,9 @@
},
selectNode: {
type: Object
},
currentProject: {
type: Object
}
},
mounted() {
@ -330,9 +333,11 @@
param.nodePath = item.path;
}
});
if(localStorage.getItem(CURRENT_PROJECT)) {
param.projectId = JSON.parse(localStorage.getItem(CURRENT_PROJECT)).id;
if (this.currentProject) {
param.projectId = this.currentProject.id;
}
param.name = param.name.trim();
if (param.name == '') {
this.$warning(this.$t('test_track.case.input_name'));

View File

@ -57,6 +57,9 @@
props: {
treeNodes: {
type: Array
},
currentProject: {
type: Object
}
},
methods: {
@ -106,8 +109,8 @@
}
param.name = this.form.name.trim();
param.label = this.form.name;
if (localStorage.getItem(CURRENT_PROJECT)) {
param.projectId = JSON.parse(localStorage.getItem(CURRENT_PROJECT)).id;
if (this.currentProject) {
param.projectId = this.currentProject.id;
}
return url;
},

View File

@ -49,7 +49,7 @@
</span>
</template>
</el-tree>
<node-edit ref="nodeEdit" :tree-nodes="treeNodes" @refresh="refreshNode" />
<node-edit ref="nodeEdit" :current-project="currentProject" :tree-nodes="treeNodes" @refresh="refreshNode" />
</div>
</template>
@ -83,6 +83,9 @@ export default {
draggable: {
type: Boolean,
default: true
},
currentProject: {
type: Object
}
},
watch: {