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;
|
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;
|
||||||
}
|
}
|
||||||
// 用例等级等字段以表中对应字段为准,后端复杂操作直接改表中对应字段即可
|
// 用例等级等字段以表中对应字段为准,后端复杂操作直接改表中对应字段即可
|
||||||
|
|
|
@ -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;
|
||||||
|
|
|
@ -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>
|
||||||
|
|
Loading…
Reference in New Issue