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

View File

@ -250,6 +250,9 @@
}, },
selectNode: { selectNode: {
type: Object type: Object
},
currentProject: {
type: Object
} }
}, },
mounted() { mounted() {
@ -330,9 +333,11 @@
param.nodePath = item.path; 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(); param.name = param.name.trim();
if (param.name == '') { if (param.name == '') {
this.$warning(this.$t('test_track.case.input_name')); this.$warning(this.$t('test_track.case.input_name'));

View File

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

View File

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