fix(测试跟踪): 用例评审跨项目复制用例,模块和责任人显示有误

--bug=1024030 --user=陈建星 【测试跟踪】功能用例库内跨项目复制模块信息和责任人有误 https://www.tapd.cn/55049933/s/1348015
This commit is contained in:
chenjianxing 2023-03-10 16:13:21 +08:00 committed by jianxing
parent 854a19f1ee
commit 0418a5b31c
3 changed files with 36 additions and 12 deletions

View File

@ -635,7 +635,10 @@ export default {
return this.isAdd || this.editableState; return this.isAdd || this.editableState;
}, },
isCopy() { isCopy() {
return this.editType == 'copy'; return this.editType === 'copy' || this.isPublicCopy;
},
isPublicCopy() {
return this.editType === 'publicCopy';
}, },
showPublic() { showPublic() {
return this.isPublic && this.isXpack; return this.isPublic && this.isXpack;
@ -838,7 +841,7 @@ export default {
}, },
copyPublicCase() { copyPublicCase() {
// 使使 projectId // 使使 projectId
openCaseEdit({caseId: this.caseId, type: 'copy', projectId: getCurrentProjectID()}, this); openCaseEdit({caseId: this.caseId, type: 'publicCopy', projectId: getCurrentProjectID()}, this);
}, },
closePublicCase() { closePublicCase() {
this.$emit("close"); this.$emit("close");
@ -998,9 +1001,6 @@ export default {
document.title = this.$t('test_track.case.create_case'); document.title = this.$t('test_track.case.create_case');
let user = JSON.parse(localStorage.getItem(TokenKey)); let user = JSON.parse(localStorage.getItem(TokenKey));
this.form.priority = "P3";
this.form.type = "functional";
this.form.method = "manual";
this.form.maintainer = user.id; this.form.maintainer = user.id;
this.form.tags = []; this.form.tags = [];
this.form.versionId = this.initLatestVersionId; this.form.versionId = this.initLatestVersionId;
@ -1127,6 +1127,12 @@ export default {
} }
this.casePublic = tmp.casePublic; this.casePublic = tmp.casePublic;
if (this.isPublicCopy) {
// copy
let user = JSON.parse(localStorage.getItem(TokenKey));
this.form.maintainer = user.id;
}
// //
this.customFieldForm = parseCustomField( this.customFieldForm = parseCustomField(
this.form, this.form,
@ -1140,7 +1146,7 @@ export default {
this.reloadForm(); this.reloadForm();
}, },
resetSystemField() { resetSystemField() {
if (this.operationType === "add") { if (!this.caseId) {
return; return;
} }
// //

View File

@ -496,21 +496,37 @@ export default {
// //
this.form.nodeId = this.createNodeId; this.form.nodeId = this.createNodeId;
let node = this.findTreeNode(treeNodes); let node = this.findTreeNode(treeNodes);
this.form.nodePath = node ? node.path : ''; if (node) {
this.form.nodePath = node.path;
} else {
//
this.setUnplannedModule(treeNodes);
}
} else { } else {
// ID // ID
this.form.nodeId = treeNodes[0].id; this.setUnplannedModule(treeNodes);
this.form.nodePath = treeNodes[0].path;
} }
} }
} else { } else {
if (this.form.nodeId) { if (this.form.nodeId) {
// nodePath // nodePath
let node = this.findTreeNode(treeNodes); let node = this.findTreeNode(treeNodes);
this.form.nodePath = node ? node.path : ''; if (node) {
this.form.nodePath = node.path;
} else {
//
this.setUnplannedModule(treeNodes);
}
} else {
this.setUnplannedModule(treeNodes);
} }
} }
}, },
setUnplannedModule(treeNodes) {
// ID
this.form.nodeId = treeNodes[0].id;
this.form.nodePath = treeNodes[0].path;
},
getNodeTrees() { getNodeTrees() {
if (this.publicEnable || !this.projectId) { if (this.publicEnable || !this.projectId) {
return; return;

View File

@ -1,5 +1,5 @@
<template> <template>
<ms-node-tree class="node-tree" <ms-node-tree class="public-node-tree"
v-loading="loading" v-loading="loading"
local-suffix="test_case" local-suffix="test_case"
default-label="未规划用例" default-label="未规划用例"
@ -74,5 +74,7 @@ export default {
</script> </script>
<style scoped> <style scoped>
.public-node-tree :deep(.node-tree) {
height: calc(100vh - 205px);
}
</style> </style>