feat(接口定义): 测试数据显示控制

This commit is contained in:
fit2-zhao 2021-09-09 09:41:18 +08:00 committed by fit2-zhao
parent 6bca2c8617
commit a148886e06
5 changed files with 10 additions and 5 deletions

View File

@ -135,7 +135,6 @@
import MsApiRequestForm from "../request/http/ApiHttpRequestForm"; import MsApiRequestForm from "../request/http/ApiHttpRequestForm";
import MsResponseText from "../response/ResponseText"; import MsResponseText from "../response/ResponseText";
import {WORKSPACE_ID} from '../../../../../../common/js/constants';
import {API_STATUS, REQ_METHOD} from "../../model/JsonData"; import {API_STATUS, REQ_METHOD} from "../../model/JsonData";
import {KeyValue} from "../../model/ApiTestModel"; import {KeyValue} from "../../model/ApiTestModel";
import MsInputTag from "@/business/components/api/automation/scenario/MsInputTag"; import MsInputTag from "@/business/components/api/automation/scenario/MsInputTag";

View File

@ -36,7 +36,7 @@
<div v-loading="loading"> <div v-loading="loading">
<p class="tip">{{ $t('api_test.definition.request.req_param') }} </p> <p class="tip">{{ $t('api_test.definition.request.req_param') }} </p>
<!-- HTTP 请求参数 --> <!-- HTTP 请求参数 -->
<ms-api-request-form :isShowEnable="true" :headers="request.headers" :request="request" :response="responseData"/> <ms-api-request-form :isShowEnable="true" :definition-test="true" :headers="request.headers" :request="request" :response="responseData"/>
<!-- HTTP 请求返回数据 --> <!-- HTTP 请求返回数据 -->
<p class="tip">{{ $t('api_test.definition.request.res_param') }} </p> <p class="tip">{{ $t('api_test.definition.request.res_param') }} </p>

View File

@ -67,7 +67,7 @@
<el-tab-pane :label="$t('api_test.definition.request.other_config')" name="advancedConfig"> <el-tab-pane :label="$t('api_test.definition.request.other_config')" name="advancedConfig">
<ms-api-advanced-config :is-read-only="isReadOnly" :request="request"/> <ms-api-advanced-config :is-read-only="isReadOnly" :request="request"/>
</el-tab-pane> </el-tab-pane>
<el-tab-pane name="create" v-if="hasPermission('PROJECT_API_DEFINITION:READ+CREATE_API') && hasLicense()"> <el-tab-pane name="create" v-if="hasPermission('PROJECT_API_DEFINITION:READ+CREATE_API') && hasLicense() && definitionTest">
<template v-slot:label> <template v-slot:label>
<el-button size="mini" type="primary" @click.stop @click="generate">{{$t('commons.generate_test_data')}}</el-button> <el-button size="mini" type="primary" @click.stop @click="generate">{{$t('commons.generate_test_data')}}</el-button>
</template> </template>
@ -118,6 +118,12 @@
method: String, method: String,
request: {}, request: {},
response: {}, response: {},
definitionTest:{
type:Boolean,
default() {
return false;
}
},
showScript: { showScript: {
type: Boolean, type: Boolean,
default: true, default: true,

View File

@ -48,7 +48,7 @@
<div v-loading="loading"> <div v-loading="loading">
<p class="tip">{{ $t('api_test.definition.request.req_param') }} </p> <p class="tip">{{ $t('api_test.definition.request.req_param') }} </p>
<!-- HTTP 请求参数 --> <!-- HTTP 请求参数 -->
<ms-api-request-form :isShowEnable="true" :headers="api.request.headers" :request="api.request"/> <ms-api-request-form :isShowEnable="true" :definition-test="true" :headers="api.request.headers" :request="api.request"/>
<!--返回结果--> <!--返回结果-->
<!-- HTTP 请求返回数据 --> <!-- HTTP 请求返回数据 -->
<p class="tip">{{ $t('api_test.definition.request.res_param') }} </p> <p class="tip">{{ $t('api_test.definition.request.res_param') }} </p>