fix(接口测试): 修复场景步骤操作权限控制错误问题

--bug=1021457 --user=赵勇 [BUG]GitHub #21035 场景中复制的场景/循环控制器/事物控制器/条件控制器下面中引用的接口case无法删除 https://www.tapd.cn/55049933/s/1321965
This commit is contained in:
fit2-zhao 2023-01-03 11:32:39 +08:00 committed by fit2-zhao
parent fd1a73f51f
commit c5547e5228
3 changed files with 7 additions and 11 deletions

View File

@ -267,14 +267,14 @@ export default {
return (
!this.innerStep ||
(this.showBtn &&
(!this.data.disabled || this.data.root || this.data.isCopy) &&
(!this.data.disabled || this.data.root || this.data.isCopy || this.data.showExtend) &&
this.showVersion &&
this.stepFilter.get('ALlSamplerStep').indexOf(this.data.type) === -1)
);
}
return (
this.showBtn &&
(!this.data.disabled || this.data.root || this.isDeleted || this.data.isCopy) &&
(!this.data.disabled || this.data.root || this.isDeleted || this.data.isCopy || this.data.showExtend) &&
this.showVersion &&
this.stepFilter.get('ALlSamplerStep').indexOf(this.data.type) === -1
);

View File

@ -281,6 +281,8 @@ export default {
if (this.request.id && this.request.referenced === 'REF') {
this.request.disabled = true;
this.request.root = this.node.parent.parent ? false : true;
this.request.showExtend =
this.node.parent && this.node.parent.data && this.node.parent.data.disabled ? false : true;
}
this.isShowNum = this.request.num ? true : false;
if (this.request.protocol === 'HTTP') {
@ -332,15 +334,7 @@ export default {
return {};
},
isCompReadOnly() {
if (this.request) {
if (this.request.disabled) {
return this.request.disabled;
} else {
return false;
}
} else {
return false;
}
return this.request.disabled;
},
displayTitle() {
if (this.isApiImport) {

View File

@ -156,6 +156,8 @@ export default {
if (this.scenario.id && this.scenario.referenced === 'REF' && !this.scenario.loaded && this.scenario.hashTree) {
this.scenario.root = this.node.parent.parent ? false : true;
this.scenario.disabled = true;
this.scenario.showExtend =
this.node.parent && this.node.parent.data && this.node.parent.data.disabled ? false : true;
this.recursive(this.scenario.hashTree, this.scenario.projectId, true);
}
if (this.scenario.id && this.scenario.referenced === 'Copy' && !this.scenario.isCopy && !this.scenario.disabled) {