fix(接口自动化): 修复引用步骤执行结果内容运行复制

This commit is contained in:
fit2-zhao 2021-03-24 19:27:11 +08:00
parent c3937b1c44
commit 4c3e69cdf1
2 changed files with 59 additions and 44 deletions

View File

@ -37,14 +37,19 @@
</div> </div>
<!--最大化不显示具体内容--> <!--最大化不显示具体内容-->
<div class="header" v-if="!isMax"> <div class="header" v-if="!isMax">
<fieldset :disabled="data.disabled" class="ms-fieldset">
<el-collapse-transition> <el-collapse-transition>
<div v-if="data.active && showCollapse" :draggable="draggable"> <div v-if="data.active && showCollapse" :draggable="draggable">
<el-divider></el-divider> <el-divider></el-divider>
<fieldset :disabled="data.disabled" class="ms-fieldset">
<!--四种协议请求内容-->
<slot name="request"></slot>
<!--其他模版内容比如断言提取等-->
<slot></slot> <slot></slot>
</fieldset>
<!--四种协议执行结果内容-->
<slot name="result"></slot>
</div> </div>
</el-collapse-transition> </el-collapse-transition>
</fieldset>
</div> </div>
</el-card> </el-card>

View File

@ -27,20 +27,32 @@
</el-tooltip> </el-tooltip>
</template> </template>
<!--请求内容-->
<template v-slot:request>
<customize-req-info :is-customize-req="isCustomizeReq" :request="request"/> <customize-req-info :is-customize-req="isCustomizeReq" :request="request"/>
<p class="tip">{{ $t('api_test.definition.request.req_param') }} </p> <p class="tip">{{ $t('api_test.definition.request.req_param') }} </p>
<ms-api-request-form :isShowEnable="true" :referenced="true" :headers="request.headers " :request="request" <ms-api-request-form v-if="request.protocol==='HTTP' || request.type==='HTTPSamplerProxy'"
v-if="request.protocol==='HTTP' || request.type==='HTTPSamplerProxy'"/> :isShowEnable="true"
<esb-definition v-xpack :request="request" :showScript="false" v-if="this.showXpackCompnent&&request.esbDataStruct!=null" ref="esbDefinition"/> :referenced="true"
<ms-tcp-basis-parameters :request="request" v-if="(request.protocol==='TCP'|| request.type==='TCPSampler')&&request.esbDataStruct==null " :showScript="false"/> :headers="request.headers "
:request="request"/>
<ms-sql-basis-parameters :request="request" v-if="request.protocol==='SQL'|| request.type==='JDBCSampler'" <esb-definition v-if="showXpackCompnent&&request.esbDataStruct!=null"
v-xpack
:request="request"
:showScript="false"
ref="esbDefinition"/>
<ms-tcp-basis-parameters v-if="(request.protocol==='TCP'|| request.type==='TCPSampler')&&request.esbDataStruct==null "
:request="request"
:showScript="false"/> :showScript="false"/>
<ms-dubbo-basis-parameters :request="request" <ms-sql-basis-parameters v-if="request.protocol==='SQL'|| request.type==='JDBCSampler'"
v-if="request.protocol==='DUBBO' || request.protocol==='dubbo://'|| request.type==='DubboSampler'" :request="request"
:showScript="false"/> :showScript="false"/>
<ms-dubbo-basis-parameters v-if="request.protocol==='DUBBO' || request.protocol==='dubbo://'|| request.type==='DubboSampler'"
:request="request"
:showScript="false"/>
</template>
<!-- 执行结果内容 -->
<template v-slot:result>
<p class="tip">{{ $t('api_test.definition.request.res_param') }} </p> <p class="tip">{{ $t('api_test.definition.request.res_param') }} </p>
<div v-if="request.result"> <div v-if="request.result">
<el-tabs v-model="request.activeName" closable class="ms-tabs"> <el-tabs v-model="request.activeName" closable class="ms-tabs">
@ -58,17 +70,15 @@
<div v-else> <div v-else>
<api-response-component :currentProtocol="request.protocol" :result="request.requestResult"/> <api-response-component :currentProtocol="request.protocol" :result="request.requestResult"/>
</div> </div>
<!-- 保存操作 --> <!-- 保存操作 -->
<el-button type="primary" size="small" class="ms-btn-flot" @click="saveTestCase(item)" <el-button type="primary" size="small" class="ms-btn-flot" @click="saveTestCase(item)" v-if="!request.referenced">
v-if="!request.referenced">
{{ $t('commons.save') }} {{ $t('commons.save') }}
</el-button> </el-button>
</template>
</api-base-component> </api-base-component>
<ms-run :debug="true" :reportId="reportId" :run-data="runData" :env-map="envMap" <ms-run :debug="true" :reportId="reportId" :run-data="runData" :env-map="envMap"
@runRefresh="runRefresh" ref="runTest"/> @runRefresh="runRefresh" ref="runTest"/>
</div> </div>
</template> </template>