fix(测试跟踪): 用例评审跨项目复制用例,模块和责任人显示有误
--bug=1024030 --user=陈建星 【测试跟踪】功能用例库内跨项目复制模块信息和责任人有误 https://www.tapd.cn/55049933/s/1348015
This commit is contained in:
parent
854a19f1ee
commit
0418a5b31c
|
@ -635,7 +635,10 @@ export default {
|
|||
return this.isAdd || this.editableState;
|
||||
},
|
||||
isCopy() {
|
||||
return this.editType == 'copy';
|
||||
return this.editType === 'copy' || this.isPublicCopy;
|
||||
},
|
||||
isPublicCopy() {
|
||||
return this.editType === 'publicCopy';
|
||||
},
|
||||
showPublic() {
|
||||
return this.isPublic && this.isXpack;
|
||||
|
@ -838,7 +841,7 @@ export default {
|
|||
},
|
||||
copyPublicCase() {
|
||||
// 这里复制使用当前项目,不使用 projectId ,可能没有权限
|
||||
openCaseEdit({caseId: this.caseId, type: 'copy', projectId: getCurrentProjectID()}, this);
|
||||
openCaseEdit({caseId: this.caseId, type: 'publicCopy', projectId: getCurrentProjectID()}, this);
|
||||
},
|
||||
closePublicCase() {
|
||||
this.$emit("close");
|
||||
|
@ -998,9 +1001,6 @@ export default {
|
|||
document.title = this.$t('test_track.case.create_case');
|
||||
|
||||
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.tags = [];
|
||||
this.form.versionId = this.initLatestVersionId;
|
||||
|
@ -1127,6 +1127,12 @@ export default {
|
|||
}
|
||||
this.casePublic = tmp.casePublic;
|
||||
|
||||
if (this.isPublicCopy) {
|
||||
// 如果是 copy 用例库的用例,责任人设置成当前用户
|
||||
let user = JSON.parse(localStorage.getItem(TokenKey));
|
||||
this.form.maintainer = user.id;
|
||||
}
|
||||
|
||||
//设置自定义熟悉默认值
|
||||
this.customFieldForm = parseCustomField(
|
||||
this.form,
|
||||
|
@ -1140,7 +1146,7 @@ export default {
|
|||
this.reloadForm();
|
||||
},
|
||||
resetSystemField() {
|
||||
if (this.operationType === "add") {
|
||||
if (!this.caseId) {
|
||||
return;
|
||||
}
|
||||
// 用例等级等字段以表中对应字段为准,后端复杂操作直接改表中对应字段即可
|
||||
|
|
|
@ -496,21 +496,37 @@ export default {
|
|||
// 创建时设置选中的模块
|
||||
this.form.nodeId = this.createNodeId;
|
||||
let node = this.findTreeNode(treeNodes);
|
||||
this.form.nodePath = node ? node.path : '';
|
||||
if (node) {
|
||||
this.form.nodePath = node.path;
|
||||
} else {
|
||||
// 如果模块已删除,设置为未规划模块
|
||||
this.setUnplannedModule(treeNodes);
|
||||
}
|
||||
} else {
|
||||
// 创建不带模块ID,设置成为规划模块
|
||||
this.form.nodeId = treeNodes[0].id;
|
||||
this.form.nodePath = treeNodes[0].path;
|
||||
this.setUnplannedModule(treeNodes);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (this.form.nodeId) {
|
||||
// 编辑重新设置下 nodePath
|
||||
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() {
|
||||
if (this.publicEnable || !this.projectId) {
|
||||
return;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<template>
|
||||
<ms-node-tree class="node-tree"
|
||||
<ms-node-tree class="public-node-tree"
|
||||
v-loading="loading"
|
||||
local-suffix="test_case"
|
||||
default-label="未规划用例"
|
||||
|
@ -74,5 +74,7 @@ export default {
|
|||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
.public-node-tree :deep(.node-tree) {
|
||||
height: calc(100vh - 205px);
|
||||
}
|
||||
</style>
|
||||
|
|
Loading…
Reference in New Issue