fix(接口测试): 修复自定义脚本导入api时不展示没有case接口的问题

--bug=1010932 --user=宋天阳
【接口测试】github#11239,接口定义不创建CASE,在场景中前后置脚本添加从API定义导入关联时不显示没有CASE的接口
https://www.tapd.cn/55049933/s/1115387
This commit is contained in:
song-tianyang 2022-03-09 14:34:24 +08:00 committed by xiaomeinvG
parent 3dbc32bc21
commit ab1c3f7b7b
4 changed files with 51 additions and 5 deletions

View File

@ -25,7 +25,7 @@
ref="apitable">
<template v-slot:header>
<ms-environment-select :project-id="projectId" v-if="isTestPlan" :is-read-only="isReadOnly"
<ms-environment-select :project-id="projectId" v-if="isTestPlan || isScript" :is-read-only="isReadOnly"
@setEnvironment="setEnvironment" ref="msEnvironmentSelect"/>
</template>
@ -80,6 +80,12 @@ export default {
type: Boolean,
default: false,
},
isScript: {
type: Boolean,
default() {
return false;
}
},
isApiListEnable: {
type: Boolean,
default: false,

View File

@ -8,7 +8,7 @@
<slot name="version"></slot>
</template>
<ms-environment-select :project-id="projectId" v-if="isTestPlan" :is-read-only="isReadOnly"
<ms-environment-select :project-id="projectId" v-if="isTestPlan || isScript" :is-read-only="isReadOnly"
@setEnvironment="setEnvironment" ref="msEnvironmentSelect"/>
<el-input :placeholder="$t('commons.search_by_name_or_id')" @blur="initTable"
@ -174,6 +174,12 @@ export default {
type: Boolean,
default: false,
},
isScript: {
type: Boolean,
default() {
return false;
}
},
isReadOnly: {
type: Boolean,
default: false

View File

@ -4,6 +4,7 @@
@setProject="setProject"
@save="save"
:plan-id="planId"
:dialog-title="dialogTitle"
ref="baseRelevance">
<template v-slot:aside>
@ -24,7 +25,8 @@
:select-node-ids="selectNodeIds"
:is-api-list-enable="isApiListEnable"
:project-id="projectId"
:is-test-plan="true"
:is-test-plan="isTestPlan"
:is-script="isScript"
:plan-id="planId"
@isApiListEnableChange="isApiListEnableChange"
ref="apiList"/>
@ -35,7 +37,8 @@
:select-node-ids="selectNodeIds"
:is-api-list-enable="isApiListEnable"
:project-id="projectId"
:is-test-plan="true"
:is-test-plan="isTestPlan"
:is-script="isScript"
:plan-id="planId"
@isApiListEnableChange="isApiListEnableChange"
ref="apiCaseList"/>
@ -68,6 +71,7 @@ export default {
currentModule: null,
selectNodeIds: [],
moduleOptions: {},
dialogTitle:this.$t('test_track.plan_view.relevance_test_case'),
trashEnable: false,
isApiListEnable: true,
condition: {},
@ -79,12 +83,42 @@ export default {
props: {
planId: {
type: String
},
isTestPlan: {
type: Boolean,
default() {
return true;
}
},
isScript: {
type: Boolean,
default() {
return false;
}
}
},
created() {
if(this.isScript){
if(this.isApiListEnable){
this.dialogTitle = this.$t('permission.project_api_definition.import_api');
}else {
this.dialogTitle = this.$t('permission.project_track_case.import');
}
}
},
watch: {
planId() {
this.condition.planId = this.planId;
},
isApiListEnable(){
if(this.isScript){
if(this.isApiListEnable){
this.dialogTitle = this.$t('permission.project_api_definition.import_api');
}else {
this.dialogTitle = this.$t('permission.project_track_case.import');
}
}
}
},
methods: {
open() {

View File

@ -24,7 +24,7 @@
</div>
<custom-function-relate ref="customFunctionRelate" @addCustomFuncScript="handleCodeTemplate"/>
<!--接口列表-->
<api-func-relevance @save="apiSave" @close="apiClose" ref="apiFuncRelevance"/>
<api-func-relevance @save="apiSave" :is-test-plan="false" :is-script="true" @close="apiClose" ref="apiFuncRelevance"/>
</div>
</template>