refactor: 请求参数修改

This commit is contained in:
Captain.B 2020-08-11 14:28:20 +08:00
parent f316d99141
commit 468eea3b50
1 changed files with 19 additions and 22 deletions

View File

@ -43,15 +43,13 @@
<el-tabs v-model="activeName"> <el-tabs v-model="activeName">
<el-tab-pane :label="$t('api_test.request.parameters')" name="parameters"> <el-tab-pane :label="$t('api_test.request.parameters')" name="parameters">
<ms-api-key-value :is-read-only="isReadOnly" :items="request.parameters" <ms-api-body v-if="isNotGet" :is-read-only="isReadOnly" :body="request.body"/>
<ms-api-key-value v-else :is-read-only="isReadOnly" :items="request.parameters"
:description="$t('api_test.request.parameters_desc')"/> :description="$t('api_test.request.parameters_desc')"/>
</el-tab-pane> </el-tab-pane>
<el-tab-pane :label="$t('api_test.request.headers')" name="headers"> <el-tab-pane :label="$t('api_test.request.headers')" name="headers">
<ms-api-key-value :is-read-only="isReadOnly" :suggestions="headerSuggestions" :items="request.headers"/> <ms-api-key-value :is-read-only="isReadOnly" :suggestions="headerSuggestions" :items="request.headers"/>
</el-tab-pane> </el-tab-pane>
<el-tab-pane :label="$t('api_test.request.body')" name="body" v-if="isNotGet">
<ms-api-body :is-read-only="isReadOnly" :body="request.body"/>
</el-tab-pane>
<el-tab-pane :label="$t('api_test.request.assertions.label')" name="assertions"> <el-tab-pane :label="$t('api_test.request.assertions.label')" name="assertions">
<ms-api-assertions :is-read-only="isReadOnly" :assertions="request.assertions"/> <ms-api-assertions :is-read-only="isReadOnly" :assertions="request.assertions"/>
</el-tab-pane> </el-tab-pane>
@ -63,25 +61,24 @@
</template> </template>
<script> <script>
import MsApiKeyValue from "../ApiKeyValue"; import MsApiKeyValue from "../ApiKeyValue";
import MsApiBody from "../ApiBody"; import MsApiBody from "../ApiBody";
import MsApiAssertions from "../assertion/ApiAssertions"; import MsApiAssertions from "../assertion/ApiAssertions";
import {KeyValue} from "../../model/ScenarioModel"; import {HttpRequest, KeyValue} from "../../model/ScenarioModel";
import MsApiExtract from "../extract/ApiExtract"; import MsApiExtract from "../extract/ApiExtract";
import ApiRequestMethodSelect from "../collapse/ApiRequestMethodSelect"; import ApiRequestMethodSelect from "../collapse/ApiRequestMethodSelect";
import {REQUEST_HEADERS} from "@/common/js/constants"; import {REQUEST_HEADERS} from "@/common/js/constants";
import {HttpRequest} from "../../model/ScenarioModel";
export default { export default {
name: "MsApiHttpRequestForm", name: "MsApiHttpRequestForm",
components: {ApiRequestMethodSelect, MsApiExtract, MsApiAssertions, MsApiBody, MsApiKeyValue}, components: {ApiRequestMethodSelect, MsApiExtract, MsApiAssertions, MsApiBody, MsApiKeyValue},
props: { props: {
request: HttpRequest, request: HttpRequest,
isReadOnly: { isReadOnly: {
type: Boolean, type: Boolean,
default: false default: false
} }
}, },
data() { data() {
let validateURL = (rule, value, callback) => { let validateURL = (rule, value, callback) => {