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;
},
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;
}
//

View File

@ -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;

View File

@ -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>